From f8237696c312af68fe7b50dd72f7b5eee394ebcb Mon Sep 17 00:00:00 2001 From: paddatrapper Date: Thu, 8 Feb 2024 16:48:36 +0000 Subject: [PATCH] chore(deps): update openapitools/openapi-generator-cli docker tag to v7.3.0 (#50) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> libretime/client@7bd4ab63fd3d8fe37282acb126ed5b21f218bd0a --- javascript-client/.openapi-generator/VERSION | 2 +- javascript-client/README.md | 5 +- javascript-client/api/celery-tasks-api.ts | 64 +- javascript-client/api/files-api.ts | 74 +- .../api/imported-podcasts-api.ts | 64 +- javascript-client/api/info-api.ts | 14 +- javascript-client/api/libraries-api.ts | 64 +- javascript-client/api/listener-counts-api.ts | 64 +- javascript-client/api/live-logs-api.ts | 64 +- javascript-client/api/login-attempts-api.ts | 64 +- javascript-client/api/mount-names-api.ts | 64 +- .../api/playlist-contents-api.ts | 64 +- javascript-client/api/playlists-api.ts | 64 +- javascript-client/api/playout-history-api.ts | 64 +- .../api/playout-history-metadata-api.ts | 64 +- .../playout-history-template-fields-api.ts | 64 +- .../api/playout-history-templates-api.ts | 64 +- javascript-client/api/podcast-episodes-api.ts | 64 +- javascript-client/api/podcasts-api.ts | 64 +- javascript-client/api/preferences-api.ts | 64 +- javascript-client/api/schedule-api.ts | 64 +- javascript-client/api/schema-api.ts | 14 +- .../api/service-registers-api.ts | 64 +- javascript-client/api/show-days-api.ts | 64 +- javascript-client/api/show-hosts-api.ts | 64 +- javascript-client/api/show-instances-api.ts | 64 +- .../api/show-rebroadcasts-api.ts | 64 +- javascript-client/api/shows-api.ts | 64 +- .../api/smart-block-contents-api.ts | 64 +- .../api/smart-block-criteria-api.ts | 64 +- javascript-client/api/smart-blocks-api.ts | 64 +- javascript-client/api/station-podcasts-api.ts | 64 +- javascript-client/api/stream-api.ts | 24 +- .../api/third-party-track-references-api.ts | 64 +- javascript-client/api/timestamps-api.ts | 64 +- javascript-client/api/user-tokens-api.ts | 64 +- javascript-client/api/users-api.ts | 64 +- javascript-client/api/version-api.ts | 14 +- .../api/webstream-metadata-api.ts | 64 +- javascript-client/api/webstreams-api.ts | 64 +- javascript-client/base.ts | 20 +- javascript-client/common.ts | 2 +- javascript-client/configuration.ts | 9 + php-client/.openapi-generator/FILES | 1 - php-client/.openapi-generator/VERSION | 2 +- php-client/lib/Api/CeleryTasksApi.php | 168 +- php-client/lib/Api/FilesApi.php | 200 +- php-client/lib/Api/ImportedPodcastsApi.php | 168 +- php-client/lib/Api/InfoApi.php | 36 +- php-client/lib/Api/LibrariesApi.php | 168 +- php-client/lib/Api/ListenerCountsApi.php | 168 +- php-client/lib/Api/LiveLogsApi.php | 168 +- php-client/lib/Api/LoginAttemptsApi.php | 168 +- php-client/lib/Api/MountNamesApi.php | 168 +- php-client/lib/Api/PlaylistContentsApi.php | 168 +- php-client/lib/Api/PlaylistsApi.php | 168 +- php-client/lib/Api/PlayoutHistoryApi.php | 168 +- .../lib/Api/PlayoutHistoryMetadataApi.php | 168 +- .../Api/PlayoutHistoryTemplateFieldsApi.php | 168 +- .../lib/Api/PlayoutHistoryTemplatesApi.php | 168 +- php-client/lib/Api/PodcastEpisodesApi.php | 168 +- php-client/lib/Api/PodcastsApi.php | 168 +- php-client/lib/Api/PreferencesApi.php | 168 +- php-client/lib/Api/ScheduleApi.php | 168 +- php-client/lib/Api/SchemaApi.php | 36 +- php-client/lib/Api/ServiceRegistersApi.php | 168 +- php-client/lib/Api/ShowDaysApi.php | 168 +- php-client/lib/Api/ShowHostsApi.php | 168 +- php-client/lib/Api/ShowInstancesApi.php | 168 +- php-client/lib/Api/ShowRebroadcastsApi.php | 168 +- php-client/lib/Api/ShowsApi.php | 168 +- php-client/lib/Api/SmartBlockContentsApi.php | 168 +- php-client/lib/Api/SmartBlockCriteriaApi.php | 168 +- php-client/lib/Api/SmartBlocksApi.php | 168 +- php-client/lib/Api/StationPodcastsApi.php | 168 +- php-client/lib/Api/StreamApi.php | 68 +- .../lib/Api/ThirdPartyTrackReferencesApi.php | 168 +- php-client/lib/Api/TimestampsApi.php | 168 +- php-client/lib/Api/UserTokensApi.php | 168 +- php-client/lib/Api/UsersApi.php | 168 +- php-client/lib/Api/VersionApi.php | 36 +- php-client/lib/Api/WebstreamMetadataApi.php | 168 +- php-client/lib/Api/WebstreamsApi.php | 168 +- php-client/lib/ApiException.php | 2 +- php-client/lib/Configuration.php | 12 +- php-client/lib/HeaderSelector.php | 2 +- php-client/lib/Model/BlankEnum.php | 2 +- php-client/lib/Model/CeleryTask.php | 12 +- php-client/lib/Model/File.php | 130 +- php-client/lib/Model/FileImportStatusEnum.php | 2 +- php-client/lib/Model/ImportedPodcast.php | 10 +- php-client/lib/Model/Info.php | 2 +- php-client/lib/Model/Library.php | 12 +- php-client/lib/Model/ListenerCount.php | 8 +- php-client/lib/Model/LiveLog.php | 8 +- php-client/lib/Model/LoginAttempt.php | 4 +- php-client/lib/Model/ModelInterface.php | 2 +- php-client/lib/Model/MountName.php | 4 +- php-client/lib/Model/NullEnum.php | 2 +- php-client/lib/Model/PatchedCeleryTask.php | 12 +- php-client/lib/Model/PatchedFile.php | 130 +- .../lib/Model/PatchedImportedPodcast.php | 10 +- php-client/lib/Model/PatchedLibrary.php | 12 +- php-client/lib/Model/PatchedListenerCount.php | 8 +- php-client/lib/Model/PatchedLiveLog.php | 8 +- php-client/lib/Model/PatchedLoginAttempt.php | 4 +- php-client/lib/Model/PatchedMountName.php | 4 +- php-client/lib/Model/PatchedPlaylist.php | 14 +- .../lib/Model/PatchedPlaylistContent.php | 26 +- .../lib/Model/PatchedPlayoutHistory.php | 10 +- .../Model/PatchedPlayoutHistoryMetadata.php | 8 +- .../Model/PatchedPlayoutHistoryTemplate.php | 6 +- .../PatchedPlayoutHistoryTemplateField.php | 14 +- php-client/lib/Model/PatchedPodcast.php | 30 +- .../lib/Model/PatchedPodcastEpisode.php | 16 +- php-client/lib/Model/PatchedPreference.php | 8 +- php-client/lib/Model/PatchedSchedule.php | 30 +- .../lib/Model/PatchedServiceRegister.php | 4 +- php-client/lib/Model/PatchedShow.php | 28 +- php-client/lib/Model/PatchedShowDays.php | 22 +- php-client/lib/Model/PatchedShowHost.php | 6 +- php-client/lib/Model/PatchedShowInstance.php | 28 +- .../lib/Model/PatchedShowRebroadcast.php | 8 +- php-client/lib/Model/PatchedSmartBlock.php | 16 +- .../lib/Model/PatchedSmartBlockContent.php | 20 +- .../lib/Model/PatchedSmartBlockCriteria.php | 14 +- .../lib/Model/PatchedSmartBlockKind.php | 2 +- .../lib/Model/PatchedStationPodcast.php | 4 +- .../Model/PatchedThirdPartyTrackReference.php | 12 +- php-client/lib/Model/PatchedTimestamp.php | 4 +- php-client/lib/Model/PatchedUser.php | 24 +- php-client/lib/Model/PatchedUserToken.php | 10 +- php-client/lib/Model/PatchedWebstream.php | 20 +- .../lib/Model/PatchedWebstreamMetadata.php | 8 +- php-client/lib/Model/Playlist.php | 14 +- php-client/lib/Model/PlaylistContent.php | 26 +- .../lib/Model/PlaylistContentKindEnum.php | 2 +- php-client/lib/Model/PlayoutHistory.php | 10 +- .../lib/Model/PlayoutHistoryMetadata.php | 8 +- .../lib/Model/PlayoutHistoryTemplate.php | 6 +- .../lib/Model/PlayoutHistoryTemplateField.php | 14 +- php-client/lib/Model/Podcast.php | 30 +- php-client/lib/Model/PodcastEpisode.php | 16 +- php-client/lib/Model/PositionStatusEnum.php | 2 +- php-client/lib/Model/Preference.php | 8 +- php-client/lib/Model/RecordEnabledEnum.php | 2 +- php-client/lib/Model/RepeatKindEnum.php | 2 +- php-client/lib/Model/RoleEnum.php | 2 +- php-client/lib/Model/Schedule.php | 30 +- php-client/lib/Model/ServiceRegister.php | 4 +- php-client/lib/Model/Show.php | 28 +- php-client/lib/Model/ShowDays.php | 22 +- php-client/lib/Model/ShowHost.php | 6 +- php-client/lib/Model/ShowInstance.php | 28 +- php-client/lib/Model/ShowRebroadcast.php | 8 +- php-client/lib/Model/SmartBlock.php | 16 +- php-client/lib/Model/SmartBlockContent.php | 20 +- php-client/lib/Model/SmartBlockCriteria.php | 14 +- php-client/lib/Model/SmartBlockKindEnum.php | 2 +- php-client/lib/Model/StationPodcast.php | 4 +- php-client/lib/Model/StreamPreferences.php | 6 +- php-client/lib/Model/StreamState.php | 10 +- .../lib/Model/ThirdPartyTrackReference.php | 12 +- php-client/lib/Model/Timestamp.php | 4 +- php-client/lib/Model/User.php | 24 +- php-client/lib/Model/UserToken.php | 10 +- php-client/lib/Model/Version.php | 2 +- php-client/lib/Model/Webstream.php | 20 +- php-client/lib/Model/WebstreamMetadata.php | 8 +- php-client/lib/Model/WeekDayEnum.php | 2 +- php-client/lib/ObjectSerializer.php | 2 +- python-client/.openapi-generator/FILES | 1 - python-client/.openapi-generator/VERSION | 2 +- python-client/README.md | 1 - python-client/docs/BlankEnum.md | 1 + python-client/docs/CeleryTask.md | 1 + python-client/docs/CeleryTasksApi.md | 30 +- python-client/docs/File.md | 1 + python-client/docs/FileImportStatusEnum.md | 1 + python-client/docs/FilesApi.md | 35 +- python-client/docs/ImportedPodcast.md | 1 + python-client/docs/ImportedPodcastsApi.md | 30 +- python-client/docs/Info.md | 1 + python-client/docs/InfoApi.md | 5 +- python-client/docs/LibrariesApi.md | 30 +- python-client/docs/Library.md | 1 + python-client/docs/ListenerCount.md | 1 + python-client/docs/ListenerCountsApi.md | 30 +- python-client/docs/LiveLog.md | 1 + python-client/docs/LiveLogsApi.md | 30 +- python-client/docs/LoginAttempt.md | 1 + python-client/docs/LoginAttemptsApi.md | 30 +- python-client/docs/MountName.md | 1 + python-client/docs/MountNamesApi.md | 30 +- python-client/docs/NullEnum.md | 1 + python-client/docs/PatchedCeleryTask.md | 1 + python-client/docs/PatchedFile.md | 1 + python-client/docs/PatchedImportedPodcast.md | 1 + python-client/docs/PatchedLibrary.md | 1 + python-client/docs/PatchedListenerCount.md | 1 + python-client/docs/PatchedLiveLog.md | 1 + python-client/docs/PatchedLoginAttempt.md | 1 + python-client/docs/PatchedMountName.md | 1 + python-client/docs/PatchedPlaylist.md | 1 + python-client/docs/PatchedPlaylistContent.md | 1 + python-client/docs/PatchedPlayoutHistory.md | 1 + .../docs/PatchedPlayoutHistoryMetadata.md | 1 + .../docs/PatchedPlayoutHistoryTemplate.md | 1 + .../PatchedPlayoutHistoryTemplateField.md | 1 + python-client/docs/PatchedPodcast.md | 1 + python-client/docs/PatchedPodcastEpisode.md | 1 + python-client/docs/PatchedPreference.md | 1 + python-client/docs/PatchedSchedule.md | 1 + python-client/docs/PatchedServiceRegister.md | 1 + python-client/docs/PatchedShow.md | 1 + python-client/docs/PatchedShowDays.md | 1 + python-client/docs/PatchedShowHost.md | 1 + python-client/docs/PatchedShowInstance.md | 1 + python-client/docs/PatchedShowRebroadcast.md | 1 + python-client/docs/PatchedSmartBlock.md | 1 + .../docs/PatchedSmartBlockContent.md | 1 + .../docs/PatchedSmartBlockCriteria.md | 1 + python-client/docs/PatchedSmartBlockKind.md | 1 + python-client/docs/PatchedStationPodcast.md | 1 + .../docs/PatchedThirdPartyTrackReference.md | 1 + python-client/docs/PatchedTimestamp.md | 1 + python-client/docs/PatchedUser.md | 1 + python-client/docs/PatchedUserToken.md | 1 + python-client/docs/PatchedWebstream.md | 1 + .../docs/PatchedWebstreamMetadata.md | 1 + python-client/docs/Playlist.md | 1 + python-client/docs/PlaylistContent.md | 1 + python-client/docs/PlaylistContentKindEnum.md | 1 + python-client/docs/PlaylistContentsApi.md | 30 +- python-client/docs/PlaylistsApi.md | 30 +- python-client/docs/PlayoutHistory.md | 1 + python-client/docs/PlayoutHistoryApi.md | 30 +- python-client/docs/PlayoutHistoryMetadata.md | 1 + .../docs/PlayoutHistoryMetadataApi.md | 30 +- python-client/docs/PlayoutHistoryTemplate.md | 1 + .../docs/PlayoutHistoryTemplateField.md | 1 + .../docs/PlayoutHistoryTemplateFieldsApi.md | 30 +- .../docs/PlayoutHistoryTemplatesApi.md | 30 +- python-client/docs/Podcast.md | 1 + python-client/docs/PodcastEpisode.md | 1 + python-client/docs/PodcastEpisodesApi.md | 30 +- python-client/docs/PodcastsApi.md | 30 +- python-client/docs/PositionStatusEnum.md | 1 + python-client/docs/Preference.md | 1 + python-client/docs/PreferencesApi.md | 30 +- python-client/docs/RecordEnabledEnum.md | 1 + python-client/docs/RepeatKindEnum.md | 1 + python-client/docs/RoleEnum.md | 1 + python-client/docs/Schedule.md | 1 + python-client/docs/ScheduleApi.md | 30 +- python-client/docs/SchemaApi.md | 5 +- python-client/docs/ServiceRegister.md | 1 + python-client/docs/ServiceRegistersApi.md | 30 +- python-client/docs/Show.md | 1 + python-client/docs/ShowDays.md | 1 + python-client/docs/ShowDaysApi.md | 30 +- python-client/docs/ShowHost.md | 1 + python-client/docs/ShowHostsApi.md | 30 +- python-client/docs/ShowInstance.md | 1 + python-client/docs/ShowInstancesApi.md | 30 +- python-client/docs/ShowRebroadcast.md | 1 + python-client/docs/ShowRebroadcastsApi.md | 30 +- python-client/docs/ShowsApi.md | 30 +- python-client/docs/SmartBlock.md | 1 + python-client/docs/SmartBlockContent.md | 1 + python-client/docs/SmartBlockContentsApi.md | 30 +- python-client/docs/SmartBlockCriteria.md | 1 + python-client/docs/SmartBlockCriteriaApi.md | 30 +- python-client/docs/SmartBlockKindEnum.md | 1 + python-client/docs/SmartBlocksApi.md | 30 +- python-client/docs/StationPodcast.md | 1 + python-client/docs/StationPodcastsApi.md | 30 +- python-client/docs/StreamApi.md | 10 +- python-client/docs/StreamPreferences.md | 1 + python-client/docs/StreamState.md | 1 + .../docs/ThirdPartyTrackReference.md | 1 + .../docs/ThirdPartyTrackReferencesApi.md | 30 +- python-client/docs/Timestamp.md | 1 + python-client/docs/TimestampsApi.md | 30 +- python-client/docs/User.md | 1 + python-client/docs/UserToken.md | 1 + python-client/docs/UserTokensApi.md | 30 +- python-client/docs/UsersApi.md | 30 +- python-client/docs/Version.md | 1 + python-client/docs/VersionApi.md | 5 +- python-client/docs/Webstream.md | 1 + python-client/docs/WebstreamMetadata.md | 1 + python-client/docs/WebstreamMetadataApi.md | 30 +- python-client/docs/WebstreamsApi.md | 30 +- python-client/docs/WeekDayEnum.md | 1 + .../libretime_client/api/celery_tasks_api.py | 1968 +++++++++----- .../libretime_client/api/files_api.py | 2282 +++++++++++------ .../api/imported_podcasts_api.py | 1968 +++++++++----- .../libretime_client/api/info_api.py | 318 ++- .../libretime_client/api/libraries_api.py | 1968 +++++++++----- .../api/listener_counts_api.py | 1968 +++++++++----- .../libretime_client/api/live_logs_api.py | 1968 +++++++++----- .../api/login_attempts_api.py | 1968 +++++++++----- .../libretime_client/api/mount_names_api.py | 1968 +++++++++----- .../api/playlist_contents_api.py | 1968 +++++++++----- .../libretime_client/api/playlists_api.py | 1968 +++++++++----- .../api/playout_history_api.py | 1968 +++++++++----- .../api/playout_history_metadata_api.py | 1968 +++++++++----- .../playout_history_template_fields_api.py | 1968 +++++++++----- .../api/playout_history_templates_api.py | 1968 +++++++++----- .../api/podcast_episodes_api.py | 1968 +++++++++----- .../libretime_client/api/podcasts_api.py | 1968 +++++++++----- .../libretime_client/api/preferences_api.py | 1968 +++++++++----- .../libretime_client/api/schedule_api.py | 2130 ++++++++++----- .../libretime_client/api/schema_api.py | 362 ++- .../api/service_registers_api.py | 1968 +++++++++----- .../libretime_client/api/show_days_api.py | 1968 +++++++++----- .../libretime_client/api/show_hosts_api.py | 1968 +++++++++----- .../api/show_instances_api.py | 1968 +++++++++----- .../api/show_rebroadcasts_api.py | 1968 +++++++++----- .../libretime_client/api/shows_api.py | 1968 +++++++++----- .../api/smart_block_contents_api.py | 1968 +++++++++----- .../api/smart_block_criteria_api.py | 1968 +++++++++----- .../libretime_client/api/smart_blocks_api.py | 1968 +++++++++----- .../api/station_podcasts_api.py | 1968 +++++++++----- .../libretime_client/api/stream_api.py | 621 +++-- .../api/third_party_track_references_api.py | 1968 +++++++++----- .../libretime_client/api/timestamps_api.py | 1968 +++++++++----- .../libretime_client/api/user_tokens_api.py | 1968 +++++++++----- .../libretime_client/api/users_api.py | 1968 +++++++++----- .../libretime_client/api/version_api.py | 318 ++- .../api/webstream_metadata_api.py | 1968 +++++++++----- .../libretime_client/api/webstreams_api.py | 1968 +++++++++----- python-client/libretime_client/api_client.py | 536 ++-- .../libretime_client/api_response.py | 28 +- .../libretime_client/configuration.py | 6 +- python-client/libretime_client/exceptions.py | 83 +- .../libretime_client/models/blank_enum.py | 13 +- .../libretime_client/models/celery_task.py | 77 +- python-client/libretime_client/models/file.py | 395 +-- .../models/file_import_status_enum.py | 13 +- .../models/imported_podcast.py | 70 +- python-client/libretime_client/models/info.py | 61 +- .../libretime_client/models/library.py | 76 +- .../libretime_client/models/listener_count.py | 68 +- .../libretime_client/models/live_log.py | 69 +- .../libretime_client/models/login_attempt.py | 65 +- .../libretime_client/models/mount_name.py | 64 +- .../libretime_client/models/null_enum.py | 13 +- .../models/patched_celery_task.py | 73 +- .../libretime_client/models/patched_file.py | 393 +-- .../models/patched_imported_podcast.py | 60 +- .../models/patched_library.py | 74 +- .../models/patched_listener_count.py | 62 +- .../models/patched_live_log.py | 65 +- .../models/patched_login_attempt.py | 65 +- .../models/patched_mount_name.py | 62 +- .../models/patched_playlist.py | 83 +- .../models/patched_playlist_content.py | 102 +- .../models/patched_playout_history.py | 68 +- .../patched_playout_history_metadata.py | 64 +- .../patched_playout_history_template.py | 64 +- .../patched_playout_history_template_field.py | 68 +- .../models/patched_podcast.py | 134 +- .../models/patched_podcast_episode.py | 69 +- .../models/patched_preference.py | 74 +- .../models/patched_schedule.py | 93 +- .../models/patched_service_register.py | 61 +- .../libretime_client/models/patched_show.py | 105 +- .../models/patched_show_days.py | 79 +- .../models/patched_show_host.py | 57 +- .../models/patched_show_instance.py | 91 +- .../models/patched_show_rebroadcast.py | 62 +- .../models/patched_smart_block.py | 89 +- .../models/patched_smart_block_content.py | 94 +- .../models/patched_smart_block_criteria.py | 78 +- .../models/patched_smart_block_kind.py | 42 +- .../models/patched_station_podcast.py | 57 +- .../patched_third_party_track_reference.py | 81 +- .../models/patched_timestamp.py | 56 +- .../libretime_client/models/patched_user.py | 103 +- .../models/patched_user_token.py | 63 +- .../models/patched_webstream.py | 79 +- .../models/patched_webstream_metadata.py | 61 +- .../libretime_client/models/playlist.py | 85 +- .../models/playlist_content.py | 108 +- .../models/playlist_content_kind_enum.py | 13 +- .../models/playout_history.py | 74 +- .../models/playout_history_metadata.py | 68 +- .../models/playout_history_template.py | 66 +- .../models/playout_history_template_field.py | 76 +- .../libretime_client/models/podcast.py | 136 +- .../models/podcast_episode.py | 77 +- .../models/position_status_enum.py | 13 +- .../libretime_client/models/preference.py | 78 +- .../models/record_enabled_enum.py | 13 +- .../models/repeat_kind_enum.py | 13 +- .../libretime_client/models/role_enum.py | 13 +- .../libretime_client/models/schedule.py | 105 +- .../models/service_register.py | 61 +- python-client/libretime_client/models/show.py | 117 +- .../libretime_client/models/show_days.py | 89 +- .../libretime_client/models/show_host.py | 65 +- .../libretime_client/models/show_instance.py | 105 +- .../models/show_rebroadcast.py | 68 +- .../libretime_client/models/smart_block.py | 91 +- .../models/smart_block_content.py | 98 +- .../models/smart_block_criteria.py | 84 +- .../models/smart_block_kind_enum.py | 13 +- .../models/station_podcast.py | 63 +- .../models/stream_preferences.py | 71 +- .../libretime_client/models/stream_state.py | 83 +- .../models/third_party_track_reference.py | 83 +- .../libretime_client/models/timestamp.py | 62 +- python-client/libretime_client/models/user.py | 107 +- .../libretime_client/models/user_token.py | 71 +- .../libretime_client/models/version.py | 61 +- .../libretime_client/models/webstream.py | 87 +- .../models/webstream_metadata.py | 67 +- .../libretime_client/models/week_day_enum.py | 13 +- python-client/libretime_client/rest.py | 292 +-- python-client/pyproject.toml | 45 +- python-client/requirements.txt | 4 +- python-client/setup.py | 4 +- python-client/test-requirements.txt | 2 + 425 files changed, 59454 insertions(+), 27533 deletions(-) diff --git a/javascript-client/.openapi-generator/VERSION b/javascript-client/.openapi-generator/VERSION index 73a86b19..8b23b8d4 100644 --- a/javascript-client/.openapi-generator/VERSION +++ b/javascript-client/.openapi-generator/VERSION @@ -1 +1 @@ -7.0.1 \ No newline at end of file +7.3.0 \ No newline at end of file diff --git a/javascript-client/README.md b/javascript-client/README.md index 86e066d0..15266998 100644 --- a/javascript-client/README.md +++ b/javascript-client/README.md @@ -15,7 +15,7 @@ Module system * CommonJS * ES6 module system -It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) +It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)) ### Building @@ -27,7 +27,7 @@ npm run build ### Publishing -First build the package then run ```npm publish``` +First build the package then run `npm publish` ### Consuming @@ -43,3 +43,4 @@ _unPublished (not recommended):_ ``` npm install PATH_TO_GENERATED_PACKAGE --save +``` diff --git a/javascript-client/api/celery-tasks-api.ts b/javascript-client/api/celery-tasks-api.ts index 82241200..18a796bb 100644 --- a/javascript-client/api/celery-tasks-api.ts +++ b/javascript-client/api/celery-tasks-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { CeleryTask } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const CeleryTasksApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - celeryTasksCreate: async (celeryTask: CeleryTask, options: AxiosRequestConfig = {}): Promise => { + celeryTasksCreate: async (celeryTask: CeleryTask, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'celeryTask' is not null or undefined assertParamExists('celeryTasksCreate', 'celeryTask', celeryTask) const localVarPath = `/api/v2/celery-tasks`; @@ -78,7 +78,7 @@ export const CeleryTasksApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - celeryTasksDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + celeryTasksDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('celeryTasksDestroy', 'id', id) const localVarPath = `/api/v2/celery-tasks/{id}` @@ -116,7 +116,7 @@ export const CeleryTasksApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - celeryTasksList: async (options: AxiosRequestConfig = {}): Promise => { + celeryTasksList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/celery-tasks`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const CeleryTasksApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - celeryTasksPartialUpdate: async (id: number, patchedCeleryTask?: PatchedCeleryTask, options: AxiosRequestConfig = {}): Promise => { + celeryTasksPartialUpdate: async (id: number, patchedCeleryTask?: PatchedCeleryTask, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('celeryTasksPartialUpdate', 'id', id) const localVarPath = `/api/v2/celery-tasks/{id}` @@ -195,7 +195,7 @@ export const CeleryTasksApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - celeryTasksRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + celeryTasksRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('celeryTasksRetrieve', 'id', id) const localVarPath = `/api/v2/celery-tasks/{id}` @@ -235,7 +235,7 @@ export const CeleryTasksApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - celeryTasksUpdate: async (id: number, celeryTask: CeleryTask, options: AxiosRequestConfig = {}): Promise => { + celeryTasksUpdate: async (id: number, celeryTask: CeleryTask, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('celeryTasksUpdate', 'id', id) // verify required parameter 'celeryTask' is not null or undefined @@ -289,9 +289,11 @@ export const CeleryTasksApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async celeryTasksCreate(celeryTask: CeleryTask, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async celeryTasksCreate(celeryTask: CeleryTask, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.celeryTasksCreate(celeryTask, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CeleryTasksApi.celeryTasksCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const CeleryTasksApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async celeryTasksDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async celeryTasksDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.celeryTasksDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CeleryTasksApi.celeryTasksDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async celeryTasksList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async celeryTasksList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.celeryTasksList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CeleryTasksApi.celeryTasksList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const CeleryTasksApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async celeryTasksPartialUpdate(id: number, patchedCeleryTask?: PatchedCeleryTask, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async celeryTasksPartialUpdate(id: number, patchedCeleryTask?: PatchedCeleryTask, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.celeryTasksPartialUpdate(id, patchedCeleryTask, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CeleryTasksApi.celeryTasksPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const CeleryTasksApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async celeryTasksRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async celeryTasksRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.celeryTasksRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CeleryTasksApi.celeryTasksRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const CeleryTasksApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async celeryTasksUpdate(id: number, celeryTask: CeleryTask, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async celeryTasksUpdate(id: number, celeryTask: CeleryTask, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.celeryTasksUpdate(id, celeryTask, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CeleryTasksApi.celeryTasksUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class CeleryTasksApi extends BaseAPI { * @throws {RequiredError} * @memberof CeleryTasksApi */ - public celeryTasksCreate(celeryTask: CeleryTask, options?: AxiosRequestConfig) { + public celeryTasksCreate(celeryTask: CeleryTask, options?: RawAxiosRequestConfig) { return CeleryTasksApiFp(this.configuration).celeryTasksCreate(celeryTask, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class CeleryTasksApi extends BaseAPI { * @throws {RequiredError} * @memberof CeleryTasksApi */ - public celeryTasksDestroy(id: number, options?: AxiosRequestConfig) { + public celeryTasksDestroy(id: number, options?: RawAxiosRequestConfig) { return CeleryTasksApiFp(this.configuration).celeryTasksDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class CeleryTasksApi extends BaseAPI { * @throws {RequiredError} * @memberof CeleryTasksApi */ - public celeryTasksList(options?: AxiosRequestConfig) { + public celeryTasksList(options?: RawAxiosRequestConfig) { return CeleryTasksApiFp(this.configuration).celeryTasksList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class CeleryTasksApi extends BaseAPI { * @throws {RequiredError} * @memberof CeleryTasksApi */ - public celeryTasksPartialUpdate(id: number, patchedCeleryTask?: PatchedCeleryTask, options?: AxiosRequestConfig) { + public celeryTasksPartialUpdate(id: number, patchedCeleryTask?: PatchedCeleryTask, options?: RawAxiosRequestConfig) { return CeleryTasksApiFp(this.configuration).celeryTasksPartialUpdate(id, patchedCeleryTask, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class CeleryTasksApi extends BaseAPI { * @throws {RequiredError} * @memberof CeleryTasksApi */ - public celeryTasksRetrieve(id: number, options?: AxiosRequestConfig) { + public celeryTasksRetrieve(id: number, options?: RawAxiosRequestConfig) { return CeleryTasksApiFp(this.configuration).celeryTasksRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class CeleryTasksApi extends BaseAPI { * @throws {RequiredError} * @memberof CeleryTasksApi */ - public celeryTasksUpdate(id: number, celeryTask: CeleryTask, options?: AxiosRequestConfig) { + public celeryTasksUpdate(id: number, celeryTask: CeleryTask, options?: RawAxiosRequestConfig) { return CeleryTasksApiFp(this.configuration).celeryTasksUpdate(id, celeryTask, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/files-api.ts b/javascript-client/api/files-api.ts index 46cd3b2d..21ffadd0 100644 --- a/javascript-client/api/files-api.ts +++ b/javascript-client/api/files-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { ModelFile } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const FilesApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - filesCreate: async (modelFile: ModelFile, options: AxiosRequestConfig = {}): Promise => { + filesCreate: async (modelFile: ModelFile, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'modelFile' is not null or undefined assertParamExists('filesCreate', 'modelFile', modelFile) const localVarPath = `/api/v2/files`; @@ -78,7 +78,7 @@ export const FilesApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - filesDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + filesDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('filesDestroy', 'id', id) const localVarPath = `/api/v2/files/{id}` @@ -117,7 +117,7 @@ export const FilesApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - filesDownloadRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + filesDownloadRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('filesDownloadRetrieve', 'id', id) const localVarPath = `/api/v2/files/{id}/download` @@ -155,7 +155,7 @@ export const FilesApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - filesList: async (options: AxiosRequestConfig = {}): Promise => { + filesList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/files`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -192,7 +192,7 @@ export const FilesApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - filesPartialUpdate: async (id: number, patchedFile?: PatchedFile, options: AxiosRequestConfig = {}): Promise => { + filesPartialUpdate: async (id: number, patchedFile?: PatchedFile, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('filesPartialUpdate', 'id', id) const localVarPath = `/api/v2/files/{id}` @@ -234,7 +234,7 @@ export const FilesApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - filesRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + filesRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('filesRetrieve', 'id', id) const localVarPath = `/api/v2/files/{id}` @@ -274,7 +274,7 @@ export const FilesApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - filesUpdate: async (id: number, modelFile: ModelFile, options: AxiosRequestConfig = {}): Promise => { + filesUpdate: async (id: number, modelFile: ModelFile, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('filesUpdate', 'id', id) // verify required parameter 'modelFile' is not null or undefined @@ -328,9 +328,11 @@ export const FilesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async filesCreate(modelFile: ModelFile, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async filesCreate(modelFile: ModelFile, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.filesCreate(modelFile, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['FilesApi.filesCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -338,9 +340,11 @@ export const FilesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async filesDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async filesDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.filesDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['FilesApi.filesDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -348,18 +352,22 @@ export const FilesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async filesDownloadRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async filesDownloadRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.filesDownloadRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['FilesApi.filesDownloadRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async filesList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async filesList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.filesList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['FilesApi.filesList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -368,9 +376,11 @@ export const FilesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async filesPartialUpdate(id: number, patchedFile?: PatchedFile, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async filesPartialUpdate(id: number, patchedFile?: PatchedFile, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.filesPartialUpdate(id, patchedFile, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['FilesApi.filesPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -378,9 +388,11 @@ export const FilesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async filesRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async filesRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.filesRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['FilesApi.filesRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -389,9 +401,11 @@ export const FilesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async filesUpdate(id: number, modelFile: ModelFile, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async filesUpdate(id: number, modelFile: ModelFile, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.filesUpdate(id, modelFile, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['FilesApi.filesUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -484,7 +498,7 @@ export class FilesApi extends BaseAPI { * @throws {RequiredError} * @memberof FilesApi */ - public filesCreate(modelFile: ModelFile, options?: AxiosRequestConfig) { + public filesCreate(modelFile: ModelFile, options?: RawAxiosRequestConfig) { return FilesApiFp(this.configuration).filesCreate(modelFile, options).then((request) => request(this.axios, this.basePath)); } @@ -495,7 +509,7 @@ export class FilesApi extends BaseAPI { * @throws {RequiredError} * @memberof FilesApi */ - public filesDestroy(id: number, options?: AxiosRequestConfig) { + public filesDestroy(id: number, options?: RawAxiosRequestConfig) { return FilesApiFp(this.configuration).filesDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -506,7 +520,7 @@ export class FilesApi extends BaseAPI { * @throws {RequiredError} * @memberof FilesApi */ - public filesDownloadRetrieve(id: number, options?: AxiosRequestConfig) { + public filesDownloadRetrieve(id: number, options?: RawAxiosRequestConfig) { return FilesApiFp(this.configuration).filesDownloadRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -516,7 +530,7 @@ export class FilesApi extends BaseAPI { * @throws {RequiredError} * @memberof FilesApi */ - public filesList(options?: AxiosRequestConfig) { + public filesList(options?: RawAxiosRequestConfig) { return FilesApiFp(this.configuration).filesList(options).then((request) => request(this.axios, this.basePath)); } @@ -528,7 +542,7 @@ export class FilesApi extends BaseAPI { * @throws {RequiredError} * @memberof FilesApi */ - public filesPartialUpdate(id: number, patchedFile?: PatchedFile, options?: AxiosRequestConfig) { + public filesPartialUpdate(id: number, patchedFile?: PatchedFile, options?: RawAxiosRequestConfig) { return FilesApiFp(this.configuration).filesPartialUpdate(id, patchedFile, options).then((request) => request(this.axios, this.basePath)); } @@ -539,7 +553,7 @@ export class FilesApi extends BaseAPI { * @throws {RequiredError} * @memberof FilesApi */ - public filesRetrieve(id: number, options?: AxiosRequestConfig) { + public filesRetrieve(id: number, options?: RawAxiosRequestConfig) { return FilesApiFp(this.configuration).filesRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -551,7 +565,7 @@ export class FilesApi extends BaseAPI { * @throws {RequiredError} * @memberof FilesApi */ - public filesUpdate(id: number, modelFile: ModelFile, options?: AxiosRequestConfig) { + public filesUpdate(id: number, modelFile: ModelFile, options?: RawAxiosRequestConfig) { return FilesApiFp(this.configuration).filesUpdate(id, modelFile, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/imported-podcasts-api.ts b/javascript-client/api/imported-podcasts-api.ts index 8bf53b1b..e9d5f490 100644 --- a/javascript-client/api/imported-podcasts-api.ts +++ b/javascript-client/api/imported-podcasts-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { ImportedPodcast } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const ImportedPodcastsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - importedPodcastsCreate: async (importedPodcast: ImportedPodcast, options: AxiosRequestConfig = {}): Promise => { + importedPodcastsCreate: async (importedPodcast: ImportedPodcast, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'importedPodcast' is not null or undefined assertParamExists('importedPodcastsCreate', 'importedPodcast', importedPodcast) const localVarPath = `/api/v2/imported-podcasts`; @@ -78,7 +78,7 @@ export const ImportedPodcastsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - importedPodcastsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + importedPodcastsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('importedPodcastsDestroy', 'id', id) const localVarPath = `/api/v2/imported-podcasts/{id}` @@ -116,7 +116,7 @@ export const ImportedPodcastsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - importedPodcastsList: async (options: AxiosRequestConfig = {}): Promise => { + importedPodcastsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/imported-podcasts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const ImportedPodcastsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - importedPodcastsPartialUpdate: async (id: number, patchedImportedPodcast?: PatchedImportedPodcast, options: AxiosRequestConfig = {}): Promise => { + importedPodcastsPartialUpdate: async (id: number, patchedImportedPodcast?: PatchedImportedPodcast, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('importedPodcastsPartialUpdate', 'id', id) const localVarPath = `/api/v2/imported-podcasts/{id}` @@ -195,7 +195,7 @@ export const ImportedPodcastsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - importedPodcastsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + importedPodcastsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('importedPodcastsRetrieve', 'id', id) const localVarPath = `/api/v2/imported-podcasts/{id}` @@ -235,7 +235,7 @@ export const ImportedPodcastsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - importedPodcastsUpdate: async (id: number, importedPodcast: ImportedPodcast, options: AxiosRequestConfig = {}): Promise => { + importedPodcastsUpdate: async (id: number, importedPodcast: ImportedPodcast, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('importedPodcastsUpdate', 'id', id) // verify required parameter 'importedPodcast' is not null or undefined @@ -289,9 +289,11 @@ export const ImportedPodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async importedPodcastsCreate(importedPodcast: ImportedPodcast, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async importedPodcastsCreate(importedPodcast: ImportedPodcast, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.importedPodcastsCreate(importedPodcast, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ImportedPodcastsApi.importedPodcastsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const ImportedPodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async importedPodcastsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async importedPodcastsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.importedPodcastsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ImportedPodcastsApi.importedPodcastsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async importedPodcastsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async importedPodcastsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.importedPodcastsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ImportedPodcastsApi.importedPodcastsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const ImportedPodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async importedPodcastsPartialUpdate(id: number, patchedImportedPodcast?: PatchedImportedPodcast, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async importedPodcastsPartialUpdate(id: number, patchedImportedPodcast?: PatchedImportedPodcast, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.importedPodcastsPartialUpdate(id, patchedImportedPodcast, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ImportedPodcastsApi.importedPodcastsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const ImportedPodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async importedPodcastsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async importedPodcastsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.importedPodcastsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ImportedPodcastsApi.importedPodcastsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const ImportedPodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async importedPodcastsUpdate(id: number, importedPodcast: ImportedPodcast, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async importedPodcastsUpdate(id: number, importedPodcast: ImportedPodcast, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.importedPodcastsUpdate(id, importedPodcast, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ImportedPodcastsApi.importedPodcastsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class ImportedPodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof ImportedPodcastsApi */ - public importedPodcastsCreate(importedPodcast: ImportedPodcast, options?: AxiosRequestConfig) { + public importedPodcastsCreate(importedPodcast: ImportedPodcast, options?: RawAxiosRequestConfig) { return ImportedPodcastsApiFp(this.configuration).importedPodcastsCreate(importedPodcast, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class ImportedPodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof ImportedPodcastsApi */ - public importedPodcastsDestroy(id: number, options?: AxiosRequestConfig) { + public importedPodcastsDestroy(id: number, options?: RawAxiosRequestConfig) { return ImportedPodcastsApiFp(this.configuration).importedPodcastsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class ImportedPodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof ImportedPodcastsApi */ - public importedPodcastsList(options?: AxiosRequestConfig) { + public importedPodcastsList(options?: RawAxiosRequestConfig) { return ImportedPodcastsApiFp(this.configuration).importedPodcastsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class ImportedPodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof ImportedPodcastsApi */ - public importedPodcastsPartialUpdate(id: number, patchedImportedPodcast?: PatchedImportedPodcast, options?: AxiosRequestConfig) { + public importedPodcastsPartialUpdate(id: number, patchedImportedPodcast?: PatchedImportedPodcast, options?: RawAxiosRequestConfig) { return ImportedPodcastsApiFp(this.configuration).importedPodcastsPartialUpdate(id, patchedImportedPodcast, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class ImportedPodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof ImportedPodcastsApi */ - public importedPodcastsRetrieve(id: number, options?: AxiosRequestConfig) { + public importedPodcastsRetrieve(id: number, options?: RawAxiosRequestConfig) { return ImportedPodcastsApiFp(this.configuration).importedPodcastsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class ImportedPodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof ImportedPodcastsApi */ - public importedPodcastsUpdate(id: number, importedPodcast: ImportedPodcast, options?: AxiosRequestConfig) { + public importedPodcastsUpdate(id: number, importedPodcast: ImportedPodcast, options?: RawAxiosRequestConfig) { return ImportedPodcastsApiFp(this.configuration).importedPodcastsUpdate(id, importedPodcast, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/info-api.ts b/javascript-client/api/info-api.ts index 51bcbf39..b906bf50 100644 --- a/javascript-client/api/info-api.ts +++ b/javascript-client/api/info-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { Info } from '../model'; /** @@ -34,7 +34,7 @@ export const InfoApiAxiosParamCreator = function (configuration?: Configuration) * @param {*} [options] Override http request option. * @throws {RequiredError} */ - infoRetrieve: async (options: AxiosRequestConfig = {}): Promise => { + infoRetrieve: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/info`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -79,9 +79,11 @@ export const InfoApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async infoRetrieve(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async infoRetrieve(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.infoRetrieve(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['InfoApi.infoRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -117,7 +119,7 @@ export class InfoApi extends BaseAPI { * @throws {RequiredError} * @memberof InfoApi */ - public infoRetrieve(options?: AxiosRequestConfig) { + public infoRetrieve(options?: RawAxiosRequestConfig) { return InfoApiFp(this.configuration).infoRetrieve(options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/libraries-api.ts b/javascript-client/api/libraries-api.ts index 62c73719..6e477eea 100644 --- a/javascript-client/api/libraries-api.ts +++ b/javascript-client/api/libraries-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { Library } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const LibrariesApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - librariesCreate: async (library: Library, options: AxiosRequestConfig = {}): Promise => { + librariesCreate: async (library: Library, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'library' is not null or undefined assertParamExists('librariesCreate', 'library', library) const localVarPath = `/api/v2/libraries`; @@ -78,7 +78,7 @@ export const LibrariesApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - librariesDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + librariesDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('librariesDestroy', 'id', id) const localVarPath = `/api/v2/libraries/{id}` @@ -116,7 +116,7 @@ export const LibrariesApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - librariesList: async (options: AxiosRequestConfig = {}): Promise => { + librariesList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/libraries`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const LibrariesApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - librariesPartialUpdate: async (id: number, patchedLibrary?: PatchedLibrary, options: AxiosRequestConfig = {}): Promise => { + librariesPartialUpdate: async (id: number, patchedLibrary?: PatchedLibrary, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('librariesPartialUpdate', 'id', id) const localVarPath = `/api/v2/libraries/{id}` @@ -195,7 +195,7 @@ export const LibrariesApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - librariesRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + librariesRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('librariesRetrieve', 'id', id) const localVarPath = `/api/v2/libraries/{id}` @@ -235,7 +235,7 @@ export const LibrariesApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - librariesUpdate: async (id: number, library: Library, options: AxiosRequestConfig = {}): Promise => { + librariesUpdate: async (id: number, library: Library, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('librariesUpdate', 'id', id) // verify required parameter 'library' is not null or undefined @@ -289,9 +289,11 @@ export const LibrariesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async librariesCreate(library: Library, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async librariesCreate(library: Library, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.librariesCreate(library, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LibrariesApi.librariesCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const LibrariesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async librariesDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async librariesDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.librariesDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LibrariesApi.librariesDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async librariesList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async librariesList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.librariesList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LibrariesApi.librariesList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const LibrariesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async librariesPartialUpdate(id: number, patchedLibrary?: PatchedLibrary, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async librariesPartialUpdate(id: number, patchedLibrary?: PatchedLibrary, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.librariesPartialUpdate(id, patchedLibrary, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LibrariesApi.librariesPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const LibrariesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async librariesRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async librariesRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.librariesRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LibrariesApi.librariesRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const LibrariesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async librariesUpdate(id: number, library: Library, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async librariesUpdate(id: number, library: Library, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.librariesUpdate(id, library, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LibrariesApi.librariesUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class LibrariesApi extends BaseAPI { * @throws {RequiredError} * @memberof LibrariesApi */ - public librariesCreate(library: Library, options?: AxiosRequestConfig) { + public librariesCreate(library: Library, options?: RawAxiosRequestConfig) { return LibrariesApiFp(this.configuration).librariesCreate(library, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class LibrariesApi extends BaseAPI { * @throws {RequiredError} * @memberof LibrariesApi */ - public librariesDestroy(id: number, options?: AxiosRequestConfig) { + public librariesDestroy(id: number, options?: RawAxiosRequestConfig) { return LibrariesApiFp(this.configuration).librariesDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class LibrariesApi extends BaseAPI { * @throws {RequiredError} * @memberof LibrariesApi */ - public librariesList(options?: AxiosRequestConfig) { + public librariesList(options?: RawAxiosRequestConfig) { return LibrariesApiFp(this.configuration).librariesList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class LibrariesApi extends BaseAPI { * @throws {RequiredError} * @memberof LibrariesApi */ - public librariesPartialUpdate(id: number, patchedLibrary?: PatchedLibrary, options?: AxiosRequestConfig) { + public librariesPartialUpdate(id: number, patchedLibrary?: PatchedLibrary, options?: RawAxiosRequestConfig) { return LibrariesApiFp(this.configuration).librariesPartialUpdate(id, patchedLibrary, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class LibrariesApi extends BaseAPI { * @throws {RequiredError} * @memberof LibrariesApi */ - public librariesRetrieve(id: number, options?: AxiosRequestConfig) { + public librariesRetrieve(id: number, options?: RawAxiosRequestConfig) { return LibrariesApiFp(this.configuration).librariesRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class LibrariesApi extends BaseAPI { * @throws {RequiredError} * @memberof LibrariesApi */ - public librariesUpdate(id: number, library: Library, options?: AxiosRequestConfig) { + public librariesUpdate(id: number, library: Library, options?: RawAxiosRequestConfig) { return LibrariesApiFp(this.configuration).librariesUpdate(id, library, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/listener-counts-api.ts b/javascript-client/api/listener-counts-api.ts index 50267254..f80b2a05 100644 --- a/javascript-client/api/listener-counts-api.ts +++ b/javascript-client/api/listener-counts-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { ListenerCount } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const ListenerCountsApiAxiosParamCreator = function (configuration?: Conf * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listenerCountsCreate: async (listenerCount: ListenerCount, options: AxiosRequestConfig = {}): Promise => { + listenerCountsCreate: async (listenerCount: ListenerCount, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'listenerCount' is not null or undefined assertParamExists('listenerCountsCreate', 'listenerCount', listenerCount) const localVarPath = `/api/v2/listener-counts`; @@ -78,7 +78,7 @@ export const ListenerCountsApiAxiosParamCreator = function (configuration?: Conf * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listenerCountsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + listenerCountsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('listenerCountsDestroy', 'id', id) const localVarPath = `/api/v2/listener-counts/{id}` @@ -116,7 +116,7 @@ export const ListenerCountsApiAxiosParamCreator = function (configuration?: Conf * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listenerCountsList: async (options: AxiosRequestConfig = {}): Promise => { + listenerCountsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/listener-counts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const ListenerCountsApiAxiosParamCreator = function (configuration?: Conf * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listenerCountsPartialUpdate: async (id: number, patchedListenerCount?: PatchedListenerCount, options: AxiosRequestConfig = {}): Promise => { + listenerCountsPartialUpdate: async (id: number, patchedListenerCount?: PatchedListenerCount, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('listenerCountsPartialUpdate', 'id', id) const localVarPath = `/api/v2/listener-counts/{id}` @@ -195,7 +195,7 @@ export const ListenerCountsApiAxiosParamCreator = function (configuration?: Conf * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listenerCountsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + listenerCountsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('listenerCountsRetrieve', 'id', id) const localVarPath = `/api/v2/listener-counts/{id}` @@ -235,7 +235,7 @@ export const ListenerCountsApiAxiosParamCreator = function (configuration?: Conf * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listenerCountsUpdate: async (id: number, listenerCount: ListenerCount, options: AxiosRequestConfig = {}): Promise => { + listenerCountsUpdate: async (id: number, listenerCount: ListenerCount, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('listenerCountsUpdate', 'id', id) // verify required parameter 'listenerCount' is not null or undefined @@ -289,9 +289,11 @@ export const ListenerCountsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listenerCountsCreate(listenerCount: ListenerCount, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async listenerCountsCreate(listenerCount: ListenerCount, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listenerCountsCreate(listenerCount, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ListenerCountsApi.listenerCountsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const ListenerCountsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listenerCountsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async listenerCountsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listenerCountsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ListenerCountsApi.listenerCountsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listenerCountsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async listenerCountsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.listenerCountsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ListenerCountsApi.listenerCountsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const ListenerCountsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listenerCountsPartialUpdate(id: number, patchedListenerCount?: PatchedListenerCount, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async listenerCountsPartialUpdate(id: number, patchedListenerCount?: PatchedListenerCount, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listenerCountsPartialUpdate(id, patchedListenerCount, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ListenerCountsApi.listenerCountsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const ListenerCountsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listenerCountsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async listenerCountsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listenerCountsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ListenerCountsApi.listenerCountsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const ListenerCountsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listenerCountsUpdate(id: number, listenerCount: ListenerCount, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async listenerCountsUpdate(id: number, listenerCount: ListenerCount, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listenerCountsUpdate(id, listenerCount, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ListenerCountsApi.listenerCountsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class ListenerCountsApi extends BaseAPI { * @throws {RequiredError} * @memberof ListenerCountsApi */ - public listenerCountsCreate(listenerCount: ListenerCount, options?: AxiosRequestConfig) { + public listenerCountsCreate(listenerCount: ListenerCount, options?: RawAxiosRequestConfig) { return ListenerCountsApiFp(this.configuration).listenerCountsCreate(listenerCount, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class ListenerCountsApi extends BaseAPI { * @throws {RequiredError} * @memberof ListenerCountsApi */ - public listenerCountsDestroy(id: number, options?: AxiosRequestConfig) { + public listenerCountsDestroy(id: number, options?: RawAxiosRequestConfig) { return ListenerCountsApiFp(this.configuration).listenerCountsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class ListenerCountsApi extends BaseAPI { * @throws {RequiredError} * @memberof ListenerCountsApi */ - public listenerCountsList(options?: AxiosRequestConfig) { + public listenerCountsList(options?: RawAxiosRequestConfig) { return ListenerCountsApiFp(this.configuration).listenerCountsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class ListenerCountsApi extends BaseAPI { * @throws {RequiredError} * @memberof ListenerCountsApi */ - public listenerCountsPartialUpdate(id: number, patchedListenerCount?: PatchedListenerCount, options?: AxiosRequestConfig) { + public listenerCountsPartialUpdate(id: number, patchedListenerCount?: PatchedListenerCount, options?: RawAxiosRequestConfig) { return ListenerCountsApiFp(this.configuration).listenerCountsPartialUpdate(id, patchedListenerCount, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class ListenerCountsApi extends BaseAPI { * @throws {RequiredError} * @memberof ListenerCountsApi */ - public listenerCountsRetrieve(id: number, options?: AxiosRequestConfig) { + public listenerCountsRetrieve(id: number, options?: RawAxiosRequestConfig) { return ListenerCountsApiFp(this.configuration).listenerCountsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class ListenerCountsApi extends BaseAPI { * @throws {RequiredError} * @memberof ListenerCountsApi */ - public listenerCountsUpdate(id: number, listenerCount: ListenerCount, options?: AxiosRequestConfig) { + public listenerCountsUpdate(id: number, listenerCount: ListenerCount, options?: RawAxiosRequestConfig) { return ListenerCountsApiFp(this.configuration).listenerCountsUpdate(id, listenerCount, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/live-logs-api.ts b/javascript-client/api/live-logs-api.ts index 14521078..12e8ed50 100644 --- a/javascript-client/api/live-logs-api.ts +++ b/javascript-client/api/live-logs-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { LiveLog } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const LiveLogsApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - liveLogsCreate: async (liveLog: LiveLog, options: AxiosRequestConfig = {}): Promise => { + liveLogsCreate: async (liveLog: LiveLog, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'liveLog' is not null or undefined assertParamExists('liveLogsCreate', 'liveLog', liveLog) const localVarPath = `/api/v2/live-logs`; @@ -78,7 +78,7 @@ export const LiveLogsApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - liveLogsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + liveLogsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('liveLogsDestroy', 'id', id) const localVarPath = `/api/v2/live-logs/{id}` @@ -116,7 +116,7 @@ export const LiveLogsApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - liveLogsList: async (options: AxiosRequestConfig = {}): Promise => { + liveLogsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/live-logs`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const LiveLogsApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - liveLogsPartialUpdate: async (id: number, patchedLiveLog?: PatchedLiveLog, options: AxiosRequestConfig = {}): Promise => { + liveLogsPartialUpdate: async (id: number, patchedLiveLog?: PatchedLiveLog, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('liveLogsPartialUpdate', 'id', id) const localVarPath = `/api/v2/live-logs/{id}` @@ -195,7 +195,7 @@ export const LiveLogsApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - liveLogsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + liveLogsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('liveLogsRetrieve', 'id', id) const localVarPath = `/api/v2/live-logs/{id}` @@ -235,7 +235,7 @@ export const LiveLogsApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - liveLogsUpdate: async (id: number, liveLog: LiveLog, options: AxiosRequestConfig = {}): Promise => { + liveLogsUpdate: async (id: number, liveLog: LiveLog, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('liveLogsUpdate', 'id', id) // verify required parameter 'liveLog' is not null or undefined @@ -289,9 +289,11 @@ export const LiveLogsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async liveLogsCreate(liveLog: LiveLog, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async liveLogsCreate(liveLog: LiveLog, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.liveLogsCreate(liveLog, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LiveLogsApi.liveLogsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const LiveLogsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async liveLogsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async liveLogsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.liveLogsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LiveLogsApi.liveLogsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async liveLogsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async liveLogsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.liveLogsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LiveLogsApi.liveLogsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const LiveLogsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async liveLogsPartialUpdate(id: number, patchedLiveLog?: PatchedLiveLog, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async liveLogsPartialUpdate(id: number, patchedLiveLog?: PatchedLiveLog, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.liveLogsPartialUpdate(id, patchedLiveLog, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LiveLogsApi.liveLogsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const LiveLogsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async liveLogsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async liveLogsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.liveLogsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LiveLogsApi.liveLogsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const LiveLogsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async liveLogsUpdate(id: number, liveLog: LiveLog, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async liveLogsUpdate(id: number, liveLog: LiveLog, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.liveLogsUpdate(id, liveLog, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LiveLogsApi.liveLogsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class LiveLogsApi extends BaseAPI { * @throws {RequiredError} * @memberof LiveLogsApi */ - public liveLogsCreate(liveLog: LiveLog, options?: AxiosRequestConfig) { + public liveLogsCreate(liveLog: LiveLog, options?: RawAxiosRequestConfig) { return LiveLogsApiFp(this.configuration).liveLogsCreate(liveLog, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class LiveLogsApi extends BaseAPI { * @throws {RequiredError} * @memberof LiveLogsApi */ - public liveLogsDestroy(id: number, options?: AxiosRequestConfig) { + public liveLogsDestroy(id: number, options?: RawAxiosRequestConfig) { return LiveLogsApiFp(this.configuration).liveLogsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class LiveLogsApi extends BaseAPI { * @throws {RequiredError} * @memberof LiveLogsApi */ - public liveLogsList(options?: AxiosRequestConfig) { + public liveLogsList(options?: RawAxiosRequestConfig) { return LiveLogsApiFp(this.configuration).liveLogsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class LiveLogsApi extends BaseAPI { * @throws {RequiredError} * @memberof LiveLogsApi */ - public liveLogsPartialUpdate(id: number, patchedLiveLog?: PatchedLiveLog, options?: AxiosRequestConfig) { + public liveLogsPartialUpdate(id: number, patchedLiveLog?: PatchedLiveLog, options?: RawAxiosRequestConfig) { return LiveLogsApiFp(this.configuration).liveLogsPartialUpdate(id, patchedLiveLog, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class LiveLogsApi extends BaseAPI { * @throws {RequiredError} * @memberof LiveLogsApi */ - public liveLogsRetrieve(id: number, options?: AxiosRequestConfig) { + public liveLogsRetrieve(id: number, options?: RawAxiosRequestConfig) { return LiveLogsApiFp(this.configuration).liveLogsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class LiveLogsApi extends BaseAPI { * @throws {RequiredError} * @memberof LiveLogsApi */ - public liveLogsUpdate(id: number, liveLog: LiveLog, options?: AxiosRequestConfig) { + public liveLogsUpdate(id: number, liveLog: LiveLog, options?: RawAxiosRequestConfig) { return LiveLogsApiFp(this.configuration).liveLogsUpdate(id, liveLog, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/login-attempts-api.ts b/javascript-client/api/login-attempts-api.ts index 6905f7b8..08b1f13c 100644 --- a/javascript-client/api/login-attempts-api.ts +++ b/javascript-client/api/login-attempts-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { LoginAttempt } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const LoginAttemptsApiAxiosParamCreator = function (configuration?: Confi * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginAttemptsCreate: async (loginAttempt: LoginAttempt, options: AxiosRequestConfig = {}): Promise => { + loginAttemptsCreate: async (loginAttempt: LoginAttempt, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'loginAttempt' is not null or undefined assertParamExists('loginAttemptsCreate', 'loginAttempt', loginAttempt) const localVarPath = `/api/v2/login-attempts`; @@ -78,7 +78,7 @@ export const LoginAttemptsApiAxiosParamCreator = function (configuration?: Confi * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginAttemptsDestroy: async (ip: string, options: AxiosRequestConfig = {}): Promise => { + loginAttemptsDestroy: async (ip: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'ip' is not null or undefined assertParamExists('loginAttemptsDestroy', 'ip', ip) const localVarPath = `/api/v2/login-attempts/{ip}` @@ -116,7 +116,7 @@ export const LoginAttemptsApiAxiosParamCreator = function (configuration?: Confi * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginAttemptsList: async (options: AxiosRequestConfig = {}): Promise => { + loginAttemptsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/login-attempts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const LoginAttemptsApiAxiosParamCreator = function (configuration?: Confi * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginAttemptsPartialUpdate: async (ip: string, patchedLoginAttempt?: PatchedLoginAttempt, options: AxiosRequestConfig = {}): Promise => { + loginAttemptsPartialUpdate: async (ip: string, patchedLoginAttempt?: PatchedLoginAttempt, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'ip' is not null or undefined assertParamExists('loginAttemptsPartialUpdate', 'ip', ip) const localVarPath = `/api/v2/login-attempts/{ip}` @@ -195,7 +195,7 @@ export const LoginAttemptsApiAxiosParamCreator = function (configuration?: Confi * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginAttemptsRetrieve: async (ip: string, options: AxiosRequestConfig = {}): Promise => { + loginAttemptsRetrieve: async (ip: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'ip' is not null or undefined assertParamExists('loginAttemptsRetrieve', 'ip', ip) const localVarPath = `/api/v2/login-attempts/{ip}` @@ -235,7 +235,7 @@ export const LoginAttemptsApiAxiosParamCreator = function (configuration?: Confi * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginAttemptsUpdate: async (ip: string, loginAttempt: LoginAttempt, options: AxiosRequestConfig = {}): Promise => { + loginAttemptsUpdate: async (ip: string, loginAttempt: LoginAttempt, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'ip' is not null or undefined assertParamExists('loginAttemptsUpdate', 'ip', ip) // verify required parameter 'loginAttempt' is not null or undefined @@ -289,9 +289,11 @@ export const LoginAttemptsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async loginAttemptsCreate(loginAttempt: LoginAttempt, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async loginAttemptsCreate(loginAttempt: LoginAttempt, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.loginAttemptsCreate(loginAttempt, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LoginAttemptsApi.loginAttemptsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const LoginAttemptsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async loginAttemptsDestroy(ip: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async loginAttemptsDestroy(ip: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.loginAttemptsDestroy(ip, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LoginAttemptsApi.loginAttemptsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async loginAttemptsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async loginAttemptsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.loginAttemptsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LoginAttemptsApi.loginAttemptsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const LoginAttemptsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async loginAttemptsPartialUpdate(ip: string, patchedLoginAttempt?: PatchedLoginAttempt, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async loginAttemptsPartialUpdate(ip: string, patchedLoginAttempt?: PatchedLoginAttempt, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.loginAttemptsPartialUpdate(ip, patchedLoginAttempt, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LoginAttemptsApi.loginAttemptsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const LoginAttemptsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async loginAttemptsRetrieve(ip: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async loginAttemptsRetrieve(ip: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.loginAttemptsRetrieve(ip, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LoginAttemptsApi.loginAttemptsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const LoginAttemptsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async loginAttemptsUpdate(ip: string, loginAttempt: LoginAttempt, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async loginAttemptsUpdate(ip: string, loginAttempt: LoginAttempt, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.loginAttemptsUpdate(ip, loginAttempt, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LoginAttemptsApi.loginAttemptsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class LoginAttemptsApi extends BaseAPI { * @throws {RequiredError} * @memberof LoginAttemptsApi */ - public loginAttemptsCreate(loginAttempt: LoginAttempt, options?: AxiosRequestConfig) { + public loginAttemptsCreate(loginAttempt: LoginAttempt, options?: RawAxiosRequestConfig) { return LoginAttemptsApiFp(this.configuration).loginAttemptsCreate(loginAttempt, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class LoginAttemptsApi extends BaseAPI { * @throws {RequiredError} * @memberof LoginAttemptsApi */ - public loginAttemptsDestroy(ip: string, options?: AxiosRequestConfig) { + public loginAttemptsDestroy(ip: string, options?: RawAxiosRequestConfig) { return LoginAttemptsApiFp(this.configuration).loginAttemptsDestroy(ip, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class LoginAttemptsApi extends BaseAPI { * @throws {RequiredError} * @memberof LoginAttemptsApi */ - public loginAttemptsList(options?: AxiosRequestConfig) { + public loginAttemptsList(options?: RawAxiosRequestConfig) { return LoginAttemptsApiFp(this.configuration).loginAttemptsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class LoginAttemptsApi extends BaseAPI { * @throws {RequiredError} * @memberof LoginAttemptsApi */ - public loginAttemptsPartialUpdate(ip: string, patchedLoginAttempt?: PatchedLoginAttempt, options?: AxiosRequestConfig) { + public loginAttemptsPartialUpdate(ip: string, patchedLoginAttempt?: PatchedLoginAttempt, options?: RawAxiosRequestConfig) { return LoginAttemptsApiFp(this.configuration).loginAttemptsPartialUpdate(ip, patchedLoginAttempt, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class LoginAttemptsApi extends BaseAPI { * @throws {RequiredError} * @memberof LoginAttemptsApi */ - public loginAttemptsRetrieve(ip: string, options?: AxiosRequestConfig) { + public loginAttemptsRetrieve(ip: string, options?: RawAxiosRequestConfig) { return LoginAttemptsApiFp(this.configuration).loginAttemptsRetrieve(ip, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class LoginAttemptsApi extends BaseAPI { * @throws {RequiredError} * @memberof LoginAttemptsApi */ - public loginAttemptsUpdate(ip: string, loginAttempt: LoginAttempt, options?: AxiosRequestConfig) { + public loginAttemptsUpdate(ip: string, loginAttempt: LoginAttempt, options?: RawAxiosRequestConfig) { return LoginAttemptsApiFp(this.configuration).loginAttemptsUpdate(ip, loginAttempt, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/mount-names-api.ts b/javascript-client/api/mount-names-api.ts index 95529da2..82eb5fa2 100644 --- a/javascript-client/api/mount-names-api.ts +++ b/javascript-client/api/mount-names-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { MountName } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const MountNamesApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - mountNamesCreate: async (mountName: MountName, options: AxiosRequestConfig = {}): Promise => { + mountNamesCreate: async (mountName: MountName, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'mountName' is not null or undefined assertParamExists('mountNamesCreate', 'mountName', mountName) const localVarPath = `/api/v2/mount-names`; @@ -78,7 +78,7 @@ export const MountNamesApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - mountNamesDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + mountNamesDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('mountNamesDestroy', 'id', id) const localVarPath = `/api/v2/mount-names/{id}` @@ -116,7 +116,7 @@ export const MountNamesApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - mountNamesList: async (options: AxiosRequestConfig = {}): Promise => { + mountNamesList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/mount-names`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const MountNamesApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - mountNamesPartialUpdate: async (id: number, patchedMountName?: PatchedMountName, options: AxiosRequestConfig = {}): Promise => { + mountNamesPartialUpdate: async (id: number, patchedMountName?: PatchedMountName, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('mountNamesPartialUpdate', 'id', id) const localVarPath = `/api/v2/mount-names/{id}` @@ -195,7 +195,7 @@ export const MountNamesApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - mountNamesRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + mountNamesRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('mountNamesRetrieve', 'id', id) const localVarPath = `/api/v2/mount-names/{id}` @@ -235,7 +235,7 @@ export const MountNamesApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - mountNamesUpdate: async (id: number, mountName: MountName, options: AxiosRequestConfig = {}): Promise => { + mountNamesUpdate: async (id: number, mountName: MountName, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('mountNamesUpdate', 'id', id) // verify required parameter 'mountName' is not null or undefined @@ -289,9 +289,11 @@ export const MountNamesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async mountNamesCreate(mountName: MountName, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async mountNamesCreate(mountName: MountName, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.mountNamesCreate(mountName, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['MountNamesApi.mountNamesCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const MountNamesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async mountNamesDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async mountNamesDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.mountNamesDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['MountNamesApi.mountNamesDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async mountNamesList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async mountNamesList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.mountNamesList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['MountNamesApi.mountNamesList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const MountNamesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async mountNamesPartialUpdate(id: number, patchedMountName?: PatchedMountName, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async mountNamesPartialUpdate(id: number, patchedMountName?: PatchedMountName, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.mountNamesPartialUpdate(id, patchedMountName, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['MountNamesApi.mountNamesPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const MountNamesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async mountNamesRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async mountNamesRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.mountNamesRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['MountNamesApi.mountNamesRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const MountNamesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async mountNamesUpdate(id: number, mountName: MountName, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async mountNamesUpdate(id: number, mountName: MountName, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.mountNamesUpdate(id, mountName, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['MountNamesApi.mountNamesUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class MountNamesApi extends BaseAPI { * @throws {RequiredError} * @memberof MountNamesApi */ - public mountNamesCreate(mountName: MountName, options?: AxiosRequestConfig) { + public mountNamesCreate(mountName: MountName, options?: RawAxiosRequestConfig) { return MountNamesApiFp(this.configuration).mountNamesCreate(mountName, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class MountNamesApi extends BaseAPI { * @throws {RequiredError} * @memberof MountNamesApi */ - public mountNamesDestroy(id: number, options?: AxiosRequestConfig) { + public mountNamesDestroy(id: number, options?: RawAxiosRequestConfig) { return MountNamesApiFp(this.configuration).mountNamesDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class MountNamesApi extends BaseAPI { * @throws {RequiredError} * @memberof MountNamesApi */ - public mountNamesList(options?: AxiosRequestConfig) { + public mountNamesList(options?: RawAxiosRequestConfig) { return MountNamesApiFp(this.configuration).mountNamesList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class MountNamesApi extends BaseAPI { * @throws {RequiredError} * @memberof MountNamesApi */ - public mountNamesPartialUpdate(id: number, patchedMountName?: PatchedMountName, options?: AxiosRequestConfig) { + public mountNamesPartialUpdate(id: number, patchedMountName?: PatchedMountName, options?: RawAxiosRequestConfig) { return MountNamesApiFp(this.configuration).mountNamesPartialUpdate(id, patchedMountName, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class MountNamesApi extends BaseAPI { * @throws {RequiredError} * @memberof MountNamesApi */ - public mountNamesRetrieve(id: number, options?: AxiosRequestConfig) { + public mountNamesRetrieve(id: number, options?: RawAxiosRequestConfig) { return MountNamesApiFp(this.configuration).mountNamesRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class MountNamesApi extends BaseAPI { * @throws {RequiredError} * @memberof MountNamesApi */ - public mountNamesUpdate(id: number, mountName: MountName, options?: AxiosRequestConfig) { + public mountNamesUpdate(id: number, mountName: MountName, options?: RawAxiosRequestConfig) { return MountNamesApiFp(this.configuration).mountNamesUpdate(id, mountName, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/playlist-contents-api.ts b/javascript-client/api/playlist-contents-api.ts index 66e448a5..eff32123 100644 --- a/javascript-client/api/playlist-contents-api.ts +++ b/javascript-client/api/playlist-contents-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedPlaylistContent } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const PlaylistContentsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playlistContentsCreate: async (playlistContent: PlaylistContent, options: AxiosRequestConfig = {}): Promise => { + playlistContentsCreate: async (playlistContent: PlaylistContent, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'playlistContent' is not null or undefined assertParamExists('playlistContentsCreate', 'playlistContent', playlistContent) const localVarPath = `/api/v2/playlist-contents`; @@ -78,7 +78,7 @@ export const PlaylistContentsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playlistContentsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + playlistContentsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playlistContentsDestroy', 'id', id) const localVarPath = `/api/v2/playlist-contents/{id}` @@ -116,7 +116,7 @@ export const PlaylistContentsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playlistContentsList: async (options: AxiosRequestConfig = {}): Promise => { + playlistContentsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/playlist-contents`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const PlaylistContentsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playlistContentsPartialUpdate: async (id: number, patchedPlaylistContent?: PatchedPlaylistContent, options: AxiosRequestConfig = {}): Promise => { + playlistContentsPartialUpdate: async (id: number, patchedPlaylistContent?: PatchedPlaylistContent, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playlistContentsPartialUpdate', 'id', id) const localVarPath = `/api/v2/playlist-contents/{id}` @@ -195,7 +195,7 @@ export const PlaylistContentsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playlistContentsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + playlistContentsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playlistContentsRetrieve', 'id', id) const localVarPath = `/api/v2/playlist-contents/{id}` @@ -235,7 +235,7 @@ export const PlaylistContentsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playlistContentsUpdate: async (id: number, playlistContent: PlaylistContent, options: AxiosRequestConfig = {}): Promise => { + playlistContentsUpdate: async (id: number, playlistContent: PlaylistContent, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playlistContentsUpdate', 'id', id) // verify required parameter 'playlistContent' is not null or undefined @@ -289,9 +289,11 @@ export const PlaylistContentsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playlistContentsCreate(playlistContent: PlaylistContent, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playlistContentsCreate(playlistContent: PlaylistContent, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playlistContentsCreate(playlistContent, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlaylistContentsApi.playlistContentsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const PlaylistContentsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playlistContentsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playlistContentsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playlistContentsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlaylistContentsApi.playlistContentsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playlistContentsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async playlistContentsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.playlistContentsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlaylistContentsApi.playlistContentsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const PlaylistContentsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playlistContentsPartialUpdate(id: number, patchedPlaylistContent?: PatchedPlaylistContent, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playlistContentsPartialUpdate(id: number, patchedPlaylistContent?: PatchedPlaylistContent, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playlistContentsPartialUpdate(id, patchedPlaylistContent, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlaylistContentsApi.playlistContentsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const PlaylistContentsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playlistContentsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playlistContentsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playlistContentsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlaylistContentsApi.playlistContentsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const PlaylistContentsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playlistContentsUpdate(id: number, playlistContent: PlaylistContent, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playlistContentsUpdate(id: number, playlistContent: PlaylistContent, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playlistContentsUpdate(id, playlistContent, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlaylistContentsApi.playlistContentsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class PlaylistContentsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlaylistContentsApi */ - public playlistContentsCreate(playlistContent: PlaylistContent, options?: AxiosRequestConfig) { + public playlistContentsCreate(playlistContent: PlaylistContent, options?: RawAxiosRequestConfig) { return PlaylistContentsApiFp(this.configuration).playlistContentsCreate(playlistContent, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class PlaylistContentsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlaylistContentsApi */ - public playlistContentsDestroy(id: number, options?: AxiosRequestConfig) { + public playlistContentsDestroy(id: number, options?: RawAxiosRequestConfig) { return PlaylistContentsApiFp(this.configuration).playlistContentsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class PlaylistContentsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlaylistContentsApi */ - public playlistContentsList(options?: AxiosRequestConfig) { + public playlistContentsList(options?: RawAxiosRequestConfig) { return PlaylistContentsApiFp(this.configuration).playlistContentsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class PlaylistContentsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlaylistContentsApi */ - public playlistContentsPartialUpdate(id: number, patchedPlaylistContent?: PatchedPlaylistContent, options?: AxiosRequestConfig) { + public playlistContentsPartialUpdate(id: number, patchedPlaylistContent?: PatchedPlaylistContent, options?: RawAxiosRequestConfig) { return PlaylistContentsApiFp(this.configuration).playlistContentsPartialUpdate(id, patchedPlaylistContent, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class PlaylistContentsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlaylistContentsApi */ - public playlistContentsRetrieve(id: number, options?: AxiosRequestConfig) { + public playlistContentsRetrieve(id: number, options?: RawAxiosRequestConfig) { return PlaylistContentsApiFp(this.configuration).playlistContentsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class PlaylistContentsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlaylistContentsApi */ - public playlistContentsUpdate(id: number, playlistContent: PlaylistContent, options?: AxiosRequestConfig) { + public playlistContentsUpdate(id: number, playlistContent: PlaylistContent, options?: RawAxiosRequestConfig) { return PlaylistContentsApiFp(this.configuration).playlistContentsUpdate(id, playlistContent, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/playlists-api.ts b/javascript-client/api/playlists-api.ts index 440cddf5..e3e51fe6 100644 --- a/javascript-client/api/playlists-api.ts +++ b/javascript-client/api/playlists-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedPlaylist } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const PlaylistsApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playlistsCreate: async (playlist: Playlist, options: AxiosRequestConfig = {}): Promise => { + playlistsCreate: async (playlist: Playlist, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'playlist' is not null or undefined assertParamExists('playlistsCreate', 'playlist', playlist) const localVarPath = `/api/v2/playlists`; @@ -78,7 +78,7 @@ export const PlaylistsApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playlistsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + playlistsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playlistsDestroy', 'id', id) const localVarPath = `/api/v2/playlists/{id}` @@ -116,7 +116,7 @@ export const PlaylistsApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playlistsList: async (options: AxiosRequestConfig = {}): Promise => { + playlistsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/playlists`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const PlaylistsApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playlistsPartialUpdate: async (id: number, patchedPlaylist?: PatchedPlaylist, options: AxiosRequestConfig = {}): Promise => { + playlistsPartialUpdate: async (id: number, patchedPlaylist?: PatchedPlaylist, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playlistsPartialUpdate', 'id', id) const localVarPath = `/api/v2/playlists/{id}` @@ -195,7 +195,7 @@ export const PlaylistsApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playlistsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + playlistsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playlistsRetrieve', 'id', id) const localVarPath = `/api/v2/playlists/{id}` @@ -235,7 +235,7 @@ export const PlaylistsApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playlistsUpdate: async (id: number, playlist: Playlist, options: AxiosRequestConfig = {}): Promise => { + playlistsUpdate: async (id: number, playlist: Playlist, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playlistsUpdate', 'id', id) // verify required parameter 'playlist' is not null or undefined @@ -289,9 +289,11 @@ export const PlaylistsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playlistsCreate(playlist: Playlist, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playlistsCreate(playlist: Playlist, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playlistsCreate(playlist, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlaylistsApi.playlistsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const PlaylistsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playlistsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playlistsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playlistsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlaylistsApi.playlistsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playlistsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async playlistsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.playlistsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlaylistsApi.playlistsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const PlaylistsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playlistsPartialUpdate(id: number, patchedPlaylist?: PatchedPlaylist, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playlistsPartialUpdate(id: number, patchedPlaylist?: PatchedPlaylist, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playlistsPartialUpdate(id, patchedPlaylist, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlaylistsApi.playlistsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const PlaylistsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playlistsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playlistsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playlistsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlaylistsApi.playlistsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const PlaylistsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playlistsUpdate(id: number, playlist: Playlist, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playlistsUpdate(id: number, playlist: Playlist, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playlistsUpdate(id, playlist, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlaylistsApi.playlistsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class PlaylistsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlaylistsApi */ - public playlistsCreate(playlist: Playlist, options?: AxiosRequestConfig) { + public playlistsCreate(playlist: Playlist, options?: RawAxiosRequestConfig) { return PlaylistsApiFp(this.configuration).playlistsCreate(playlist, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class PlaylistsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlaylistsApi */ - public playlistsDestroy(id: number, options?: AxiosRequestConfig) { + public playlistsDestroy(id: number, options?: RawAxiosRequestConfig) { return PlaylistsApiFp(this.configuration).playlistsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class PlaylistsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlaylistsApi */ - public playlistsList(options?: AxiosRequestConfig) { + public playlistsList(options?: RawAxiosRequestConfig) { return PlaylistsApiFp(this.configuration).playlistsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class PlaylistsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlaylistsApi */ - public playlistsPartialUpdate(id: number, patchedPlaylist?: PatchedPlaylist, options?: AxiosRequestConfig) { + public playlistsPartialUpdate(id: number, patchedPlaylist?: PatchedPlaylist, options?: RawAxiosRequestConfig) { return PlaylistsApiFp(this.configuration).playlistsPartialUpdate(id, patchedPlaylist, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class PlaylistsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlaylistsApi */ - public playlistsRetrieve(id: number, options?: AxiosRequestConfig) { + public playlistsRetrieve(id: number, options?: RawAxiosRequestConfig) { return PlaylistsApiFp(this.configuration).playlistsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class PlaylistsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlaylistsApi */ - public playlistsUpdate(id: number, playlist: Playlist, options?: AxiosRequestConfig) { + public playlistsUpdate(id: number, playlist: Playlist, options?: RawAxiosRequestConfig) { return PlaylistsApiFp(this.configuration).playlistsUpdate(id, playlist, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/playout-history-api.ts b/javascript-client/api/playout-history-api.ts index d24630e8..4000013b 100644 --- a/javascript-client/api/playout-history-api.ts +++ b/javascript-client/api/playout-history-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedPlayoutHistory } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const PlayoutHistoryApiAxiosParamCreator = function (configuration?: Conf * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryCreate: async (playoutHistory: PlayoutHistory, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryCreate: async (playoutHistory: PlayoutHistory, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'playoutHistory' is not null or undefined assertParamExists('playoutHistoryCreate', 'playoutHistory', playoutHistory) const localVarPath = `/api/v2/playout-history`; @@ -78,7 +78,7 @@ export const PlayoutHistoryApiAxiosParamCreator = function (configuration?: Conf * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryDestroy', 'id', id) const localVarPath = `/api/v2/playout-history/{id}` @@ -116,7 +116,7 @@ export const PlayoutHistoryApiAxiosParamCreator = function (configuration?: Conf * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryList: async (options: AxiosRequestConfig = {}): Promise => { + playoutHistoryList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/playout-history`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const PlayoutHistoryApiAxiosParamCreator = function (configuration?: Conf * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryPartialUpdate: async (id: number, patchedPlayoutHistory?: PatchedPlayoutHistory, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryPartialUpdate: async (id: number, patchedPlayoutHistory?: PatchedPlayoutHistory, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryPartialUpdate', 'id', id) const localVarPath = `/api/v2/playout-history/{id}` @@ -195,7 +195,7 @@ export const PlayoutHistoryApiAxiosParamCreator = function (configuration?: Conf * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryRetrieve', 'id', id) const localVarPath = `/api/v2/playout-history/{id}` @@ -235,7 +235,7 @@ export const PlayoutHistoryApiAxiosParamCreator = function (configuration?: Conf * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryUpdate: async (id: number, playoutHistory: PlayoutHistory, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryUpdate: async (id: number, playoutHistory: PlayoutHistory, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryUpdate', 'id', id) // verify required parameter 'playoutHistory' is not null or undefined @@ -289,9 +289,11 @@ export const PlayoutHistoryApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryCreate(playoutHistory: PlayoutHistory, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryCreate(playoutHistory: PlayoutHistory, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryCreate(playoutHistory, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryApi.playoutHistoryCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const PlayoutHistoryApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryApi.playoutHistoryDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async playoutHistoryList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryApi.playoutHistoryList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const PlayoutHistoryApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryPartialUpdate(id: number, patchedPlayoutHistory?: PatchedPlayoutHistory, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryPartialUpdate(id: number, patchedPlayoutHistory?: PatchedPlayoutHistory, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryPartialUpdate(id, patchedPlayoutHistory, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryApi.playoutHistoryPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const PlayoutHistoryApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryApi.playoutHistoryRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const PlayoutHistoryApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryUpdate(id: number, playoutHistory: PlayoutHistory, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryUpdate(id: number, playoutHistory: PlayoutHistory, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryUpdate(id, playoutHistory, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryApi.playoutHistoryUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class PlayoutHistoryApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryApi */ - public playoutHistoryCreate(playoutHistory: PlayoutHistory, options?: AxiosRequestConfig) { + public playoutHistoryCreate(playoutHistory: PlayoutHistory, options?: RawAxiosRequestConfig) { return PlayoutHistoryApiFp(this.configuration).playoutHistoryCreate(playoutHistory, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class PlayoutHistoryApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryApi */ - public playoutHistoryDestroy(id: number, options?: AxiosRequestConfig) { + public playoutHistoryDestroy(id: number, options?: RawAxiosRequestConfig) { return PlayoutHistoryApiFp(this.configuration).playoutHistoryDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class PlayoutHistoryApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryApi */ - public playoutHistoryList(options?: AxiosRequestConfig) { + public playoutHistoryList(options?: RawAxiosRequestConfig) { return PlayoutHistoryApiFp(this.configuration).playoutHistoryList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class PlayoutHistoryApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryApi */ - public playoutHistoryPartialUpdate(id: number, patchedPlayoutHistory?: PatchedPlayoutHistory, options?: AxiosRequestConfig) { + public playoutHistoryPartialUpdate(id: number, patchedPlayoutHistory?: PatchedPlayoutHistory, options?: RawAxiosRequestConfig) { return PlayoutHistoryApiFp(this.configuration).playoutHistoryPartialUpdate(id, patchedPlayoutHistory, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class PlayoutHistoryApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryApi */ - public playoutHistoryRetrieve(id: number, options?: AxiosRequestConfig) { + public playoutHistoryRetrieve(id: number, options?: RawAxiosRequestConfig) { return PlayoutHistoryApiFp(this.configuration).playoutHistoryRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class PlayoutHistoryApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryApi */ - public playoutHistoryUpdate(id: number, playoutHistory: PlayoutHistory, options?: AxiosRequestConfig) { + public playoutHistoryUpdate(id: number, playoutHistory: PlayoutHistory, options?: RawAxiosRequestConfig) { return PlayoutHistoryApiFp(this.configuration).playoutHistoryUpdate(id, playoutHistory, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/playout-history-metadata-api.ts b/javascript-client/api/playout-history-metadata-api.ts index d2b96186..fba20f5e 100644 --- a/javascript-client/api/playout-history-metadata-api.ts +++ b/javascript-client/api/playout-history-metadata-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedPlayoutHistoryMetadata } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const PlayoutHistoryMetadataApiAxiosParamCreator = function (configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryMetadataCreate: async (playoutHistoryMetadata: PlayoutHistoryMetadata, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryMetadataCreate: async (playoutHistoryMetadata: PlayoutHistoryMetadata, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'playoutHistoryMetadata' is not null or undefined assertParamExists('playoutHistoryMetadataCreate', 'playoutHistoryMetadata', playoutHistoryMetadata) const localVarPath = `/api/v2/playout-history-metadata`; @@ -78,7 +78,7 @@ export const PlayoutHistoryMetadataApiAxiosParamCreator = function (configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryMetadataDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryMetadataDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryMetadataDestroy', 'id', id) const localVarPath = `/api/v2/playout-history-metadata/{id}` @@ -116,7 +116,7 @@ export const PlayoutHistoryMetadataApiAxiosParamCreator = function (configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryMetadataList: async (options: AxiosRequestConfig = {}): Promise => { + playoutHistoryMetadataList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/playout-history-metadata`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const PlayoutHistoryMetadataApiAxiosParamCreator = function (configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryMetadataPartialUpdate: async (id: number, patchedPlayoutHistoryMetadata?: PatchedPlayoutHistoryMetadata, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryMetadataPartialUpdate: async (id: number, patchedPlayoutHistoryMetadata?: PatchedPlayoutHistoryMetadata, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryMetadataPartialUpdate', 'id', id) const localVarPath = `/api/v2/playout-history-metadata/{id}` @@ -195,7 +195,7 @@ export const PlayoutHistoryMetadataApiAxiosParamCreator = function (configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryMetadataRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryMetadataRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryMetadataRetrieve', 'id', id) const localVarPath = `/api/v2/playout-history-metadata/{id}` @@ -235,7 +235,7 @@ export const PlayoutHistoryMetadataApiAxiosParamCreator = function (configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryMetadataUpdate: async (id: number, playoutHistoryMetadata: PlayoutHistoryMetadata, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryMetadataUpdate: async (id: number, playoutHistoryMetadata: PlayoutHistoryMetadata, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryMetadataUpdate', 'id', id) // verify required parameter 'playoutHistoryMetadata' is not null or undefined @@ -289,9 +289,11 @@ export const PlayoutHistoryMetadataApiFp = function(configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryMetadataCreate(playoutHistoryMetadata: PlayoutHistoryMetadata, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryMetadataCreate(playoutHistoryMetadata: PlayoutHistoryMetadata, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryMetadataCreate(playoutHistoryMetadata, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryMetadataApi.playoutHistoryMetadataCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const PlayoutHistoryMetadataApiFp = function(configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryMetadataDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryMetadataDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryMetadataDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryMetadataApi.playoutHistoryMetadataDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryMetadataList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async playoutHistoryMetadataList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryMetadataList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryMetadataApi.playoutHistoryMetadataList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const PlayoutHistoryMetadataApiFp = function(configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryMetadataPartialUpdate(id: number, patchedPlayoutHistoryMetadata?: PatchedPlayoutHistoryMetadata, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryMetadataPartialUpdate(id: number, patchedPlayoutHistoryMetadata?: PatchedPlayoutHistoryMetadata, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryMetadataPartialUpdate(id, patchedPlayoutHistoryMetadata, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryMetadataApi.playoutHistoryMetadataPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const PlayoutHistoryMetadataApiFp = function(configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryMetadataRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryMetadataRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryMetadataRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryMetadataApi.playoutHistoryMetadataRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const PlayoutHistoryMetadataApiFp = function(configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryMetadataUpdate(id: number, playoutHistoryMetadata: PlayoutHistoryMetadata, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryMetadataUpdate(id: number, playoutHistoryMetadata: PlayoutHistoryMetadata, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryMetadataUpdate(id, playoutHistoryMetadata, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryMetadataApi.playoutHistoryMetadataUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class PlayoutHistoryMetadataApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryMetadataApi */ - public playoutHistoryMetadataCreate(playoutHistoryMetadata: PlayoutHistoryMetadata, options?: AxiosRequestConfig) { + public playoutHistoryMetadataCreate(playoutHistoryMetadata: PlayoutHistoryMetadata, options?: RawAxiosRequestConfig) { return PlayoutHistoryMetadataApiFp(this.configuration).playoutHistoryMetadataCreate(playoutHistoryMetadata, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class PlayoutHistoryMetadataApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryMetadataApi */ - public playoutHistoryMetadataDestroy(id: number, options?: AxiosRequestConfig) { + public playoutHistoryMetadataDestroy(id: number, options?: RawAxiosRequestConfig) { return PlayoutHistoryMetadataApiFp(this.configuration).playoutHistoryMetadataDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class PlayoutHistoryMetadataApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryMetadataApi */ - public playoutHistoryMetadataList(options?: AxiosRequestConfig) { + public playoutHistoryMetadataList(options?: RawAxiosRequestConfig) { return PlayoutHistoryMetadataApiFp(this.configuration).playoutHistoryMetadataList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class PlayoutHistoryMetadataApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryMetadataApi */ - public playoutHistoryMetadataPartialUpdate(id: number, patchedPlayoutHistoryMetadata?: PatchedPlayoutHistoryMetadata, options?: AxiosRequestConfig) { + public playoutHistoryMetadataPartialUpdate(id: number, patchedPlayoutHistoryMetadata?: PatchedPlayoutHistoryMetadata, options?: RawAxiosRequestConfig) { return PlayoutHistoryMetadataApiFp(this.configuration).playoutHistoryMetadataPartialUpdate(id, patchedPlayoutHistoryMetadata, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class PlayoutHistoryMetadataApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryMetadataApi */ - public playoutHistoryMetadataRetrieve(id: number, options?: AxiosRequestConfig) { + public playoutHistoryMetadataRetrieve(id: number, options?: RawAxiosRequestConfig) { return PlayoutHistoryMetadataApiFp(this.configuration).playoutHistoryMetadataRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class PlayoutHistoryMetadataApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryMetadataApi */ - public playoutHistoryMetadataUpdate(id: number, playoutHistoryMetadata: PlayoutHistoryMetadata, options?: AxiosRequestConfig) { + public playoutHistoryMetadataUpdate(id: number, playoutHistoryMetadata: PlayoutHistoryMetadata, options?: RawAxiosRequestConfig) { return PlayoutHistoryMetadataApiFp(this.configuration).playoutHistoryMetadataUpdate(id, playoutHistoryMetadata, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/playout-history-template-fields-api.ts b/javascript-client/api/playout-history-template-fields-api.ts index c3e21cde..e689f420 100644 --- a/javascript-client/api/playout-history-template-fields-api.ts +++ b/javascript-client/api/playout-history-template-fields-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedPlayoutHistoryTemplateField } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const PlayoutHistoryTemplateFieldsApiAxiosParamCreator = function (config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryTemplateFieldsCreate: async (playoutHistoryTemplateField: PlayoutHistoryTemplateField, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryTemplateFieldsCreate: async (playoutHistoryTemplateField: PlayoutHistoryTemplateField, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'playoutHistoryTemplateField' is not null or undefined assertParamExists('playoutHistoryTemplateFieldsCreate', 'playoutHistoryTemplateField', playoutHistoryTemplateField) const localVarPath = `/api/v2/playout-history-template-fields`; @@ -78,7 +78,7 @@ export const PlayoutHistoryTemplateFieldsApiAxiosParamCreator = function (config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryTemplateFieldsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryTemplateFieldsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryTemplateFieldsDestroy', 'id', id) const localVarPath = `/api/v2/playout-history-template-fields/{id}` @@ -116,7 +116,7 @@ export const PlayoutHistoryTemplateFieldsApiAxiosParamCreator = function (config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryTemplateFieldsList: async (options: AxiosRequestConfig = {}): Promise => { + playoutHistoryTemplateFieldsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/playout-history-template-fields`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const PlayoutHistoryTemplateFieldsApiAxiosParamCreator = function (config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryTemplateFieldsPartialUpdate: async (id: number, patchedPlayoutHistoryTemplateField?: PatchedPlayoutHistoryTemplateField, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryTemplateFieldsPartialUpdate: async (id: number, patchedPlayoutHistoryTemplateField?: PatchedPlayoutHistoryTemplateField, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryTemplateFieldsPartialUpdate', 'id', id) const localVarPath = `/api/v2/playout-history-template-fields/{id}` @@ -195,7 +195,7 @@ export const PlayoutHistoryTemplateFieldsApiAxiosParamCreator = function (config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryTemplateFieldsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryTemplateFieldsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryTemplateFieldsRetrieve', 'id', id) const localVarPath = `/api/v2/playout-history-template-fields/{id}` @@ -235,7 +235,7 @@ export const PlayoutHistoryTemplateFieldsApiAxiosParamCreator = function (config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryTemplateFieldsUpdate: async (id: number, playoutHistoryTemplateField: PlayoutHistoryTemplateField, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryTemplateFieldsUpdate: async (id: number, playoutHistoryTemplateField: PlayoutHistoryTemplateField, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryTemplateFieldsUpdate', 'id', id) // verify required parameter 'playoutHistoryTemplateField' is not null or undefined @@ -289,9 +289,11 @@ export const PlayoutHistoryTemplateFieldsApiFp = function(configuration?: Config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryTemplateFieldsCreate(playoutHistoryTemplateField: PlayoutHistoryTemplateField, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryTemplateFieldsCreate(playoutHistoryTemplateField: PlayoutHistoryTemplateField, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryTemplateFieldsCreate(playoutHistoryTemplateField, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryTemplateFieldsApi.playoutHistoryTemplateFieldsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const PlayoutHistoryTemplateFieldsApiFp = function(configuration?: Config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryTemplateFieldsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryTemplateFieldsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryTemplateFieldsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryTemplateFieldsApi.playoutHistoryTemplateFieldsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryTemplateFieldsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async playoutHistoryTemplateFieldsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryTemplateFieldsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryTemplateFieldsApi.playoutHistoryTemplateFieldsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const PlayoutHistoryTemplateFieldsApiFp = function(configuration?: Config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryTemplateFieldsPartialUpdate(id: number, patchedPlayoutHistoryTemplateField?: PatchedPlayoutHistoryTemplateField, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryTemplateFieldsPartialUpdate(id: number, patchedPlayoutHistoryTemplateField?: PatchedPlayoutHistoryTemplateField, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryTemplateFieldsPartialUpdate(id, patchedPlayoutHistoryTemplateField, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryTemplateFieldsApi.playoutHistoryTemplateFieldsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const PlayoutHistoryTemplateFieldsApiFp = function(configuration?: Config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryTemplateFieldsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryTemplateFieldsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryTemplateFieldsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryTemplateFieldsApi.playoutHistoryTemplateFieldsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const PlayoutHistoryTemplateFieldsApiFp = function(configuration?: Config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryTemplateFieldsUpdate(id: number, playoutHistoryTemplateField: PlayoutHistoryTemplateField, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryTemplateFieldsUpdate(id: number, playoutHistoryTemplateField: PlayoutHistoryTemplateField, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryTemplateFieldsUpdate(id, playoutHistoryTemplateField, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryTemplateFieldsApi.playoutHistoryTemplateFieldsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class PlayoutHistoryTemplateFieldsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryTemplateFieldsApi */ - public playoutHistoryTemplateFieldsCreate(playoutHistoryTemplateField: PlayoutHistoryTemplateField, options?: AxiosRequestConfig) { + public playoutHistoryTemplateFieldsCreate(playoutHistoryTemplateField: PlayoutHistoryTemplateField, options?: RawAxiosRequestConfig) { return PlayoutHistoryTemplateFieldsApiFp(this.configuration).playoutHistoryTemplateFieldsCreate(playoutHistoryTemplateField, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class PlayoutHistoryTemplateFieldsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryTemplateFieldsApi */ - public playoutHistoryTemplateFieldsDestroy(id: number, options?: AxiosRequestConfig) { + public playoutHistoryTemplateFieldsDestroy(id: number, options?: RawAxiosRequestConfig) { return PlayoutHistoryTemplateFieldsApiFp(this.configuration).playoutHistoryTemplateFieldsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class PlayoutHistoryTemplateFieldsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryTemplateFieldsApi */ - public playoutHistoryTemplateFieldsList(options?: AxiosRequestConfig) { + public playoutHistoryTemplateFieldsList(options?: RawAxiosRequestConfig) { return PlayoutHistoryTemplateFieldsApiFp(this.configuration).playoutHistoryTemplateFieldsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class PlayoutHistoryTemplateFieldsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryTemplateFieldsApi */ - public playoutHistoryTemplateFieldsPartialUpdate(id: number, patchedPlayoutHistoryTemplateField?: PatchedPlayoutHistoryTemplateField, options?: AxiosRequestConfig) { + public playoutHistoryTemplateFieldsPartialUpdate(id: number, patchedPlayoutHistoryTemplateField?: PatchedPlayoutHistoryTemplateField, options?: RawAxiosRequestConfig) { return PlayoutHistoryTemplateFieldsApiFp(this.configuration).playoutHistoryTemplateFieldsPartialUpdate(id, patchedPlayoutHistoryTemplateField, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class PlayoutHistoryTemplateFieldsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryTemplateFieldsApi */ - public playoutHistoryTemplateFieldsRetrieve(id: number, options?: AxiosRequestConfig) { + public playoutHistoryTemplateFieldsRetrieve(id: number, options?: RawAxiosRequestConfig) { return PlayoutHistoryTemplateFieldsApiFp(this.configuration).playoutHistoryTemplateFieldsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class PlayoutHistoryTemplateFieldsApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryTemplateFieldsApi */ - public playoutHistoryTemplateFieldsUpdate(id: number, playoutHistoryTemplateField: PlayoutHistoryTemplateField, options?: AxiosRequestConfig) { + public playoutHistoryTemplateFieldsUpdate(id: number, playoutHistoryTemplateField: PlayoutHistoryTemplateField, options?: RawAxiosRequestConfig) { return PlayoutHistoryTemplateFieldsApiFp(this.configuration).playoutHistoryTemplateFieldsUpdate(id, playoutHistoryTemplateField, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/playout-history-templates-api.ts b/javascript-client/api/playout-history-templates-api.ts index 50d5351b..06e7997d 100644 --- a/javascript-client/api/playout-history-templates-api.ts +++ b/javascript-client/api/playout-history-templates-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedPlayoutHistoryTemplate } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const PlayoutHistoryTemplatesApiAxiosParamCreator = function (configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryTemplatesCreate: async (playoutHistoryTemplate: PlayoutHistoryTemplate, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryTemplatesCreate: async (playoutHistoryTemplate: PlayoutHistoryTemplate, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'playoutHistoryTemplate' is not null or undefined assertParamExists('playoutHistoryTemplatesCreate', 'playoutHistoryTemplate', playoutHistoryTemplate) const localVarPath = `/api/v2/playout-history-templates`; @@ -78,7 +78,7 @@ export const PlayoutHistoryTemplatesApiAxiosParamCreator = function (configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryTemplatesDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryTemplatesDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryTemplatesDestroy', 'id', id) const localVarPath = `/api/v2/playout-history-templates/{id}` @@ -116,7 +116,7 @@ export const PlayoutHistoryTemplatesApiAxiosParamCreator = function (configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryTemplatesList: async (options: AxiosRequestConfig = {}): Promise => { + playoutHistoryTemplatesList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/playout-history-templates`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const PlayoutHistoryTemplatesApiAxiosParamCreator = function (configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryTemplatesPartialUpdate: async (id: number, patchedPlayoutHistoryTemplate?: PatchedPlayoutHistoryTemplate, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryTemplatesPartialUpdate: async (id: number, patchedPlayoutHistoryTemplate?: PatchedPlayoutHistoryTemplate, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryTemplatesPartialUpdate', 'id', id) const localVarPath = `/api/v2/playout-history-templates/{id}` @@ -195,7 +195,7 @@ export const PlayoutHistoryTemplatesApiAxiosParamCreator = function (configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryTemplatesRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryTemplatesRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryTemplatesRetrieve', 'id', id) const localVarPath = `/api/v2/playout-history-templates/{id}` @@ -235,7 +235,7 @@ export const PlayoutHistoryTemplatesApiAxiosParamCreator = function (configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - playoutHistoryTemplatesUpdate: async (id: number, playoutHistoryTemplate: PlayoutHistoryTemplate, options: AxiosRequestConfig = {}): Promise => { + playoutHistoryTemplatesUpdate: async (id: number, playoutHistoryTemplate: PlayoutHistoryTemplate, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('playoutHistoryTemplatesUpdate', 'id', id) // verify required parameter 'playoutHistoryTemplate' is not null or undefined @@ -289,9 +289,11 @@ export const PlayoutHistoryTemplatesApiFp = function(configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryTemplatesCreate(playoutHistoryTemplate: PlayoutHistoryTemplate, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryTemplatesCreate(playoutHistoryTemplate: PlayoutHistoryTemplate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryTemplatesCreate(playoutHistoryTemplate, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryTemplatesApi.playoutHistoryTemplatesCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const PlayoutHistoryTemplatesApiFp = function(configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryTemplatesDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryTemplatesDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryTemplatesDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryTemplatesApi.playoutHistoryTemplatesDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryTemplatesList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async playoutHistoryTemplatesList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryTemplatesList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryTemplatesApi.playoutHistoryTemplatesList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const PlayoutHistoryTemplatesApiFp = function(configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryTemplatesPartialUpdate(id: number, patchedPlayoutHistoryTemplate?: PatchedPlayoutHistoryTemplate, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryTemplatesPartialUpdate(id: number, patchedPlayoutHistoryTemplate?: PatchedPlayoutHistoryTemplate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryTemplatesPartialUpdate(id, patchedPlayoutHistoryTemplate, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryTemplatesApi.playoutHistoryTemplatesPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const PlayoutHistoryTemplatesApiFp = function(configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryTemplatesRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryTemplatesRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryTemplatesRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryTemplatesApi.playoutHistoryTemplatesRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const PlayoutHistoryTemplatesApiFp = function(configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async playoutHistoryTemplatesUpdate(id: number, playoutHistoryTemplate: PlayoutHistoryTemplate, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async playoutHistoryTemplatesUpdate(id: number, playoutHistoryTemplate: PlayoutHistoryTemplate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.playoutHistoryTemplatesUpdate(id, playoutHistoryTemplate, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PlayoutHistoryTemplatesApi.playoutHistoryTemplatesUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class PlayoutHistoryTemplatesApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryTemplatesApi */ - public playoutHistoryTemplatesCreate(playoutHistoryTemplate: PlayoutHistoryTemplate, options?: AxiosRequestConfig) { + public playoutHistoryTemplatesCreate(playoutHistoryTemplate: PlayoutHistoryTemplate, options?: RawAxiosRequestConfig) { return PlayoutHistoryTemplatesApiFp(this.configuration).playoutHistoryTemplatesCreate(playoutHistoryTemplate, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class PlayoutHistoryTemplatesApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryTemplatesApi */ - public playoutHistoryTemplatesDestroy(id: number, options?: AxiosRequestConfig) { + public playoutHistoryTemplatesDestroy(id: number, options?: RawAxiosRequestConfig) { return PlayoutHistoryTemplatesApiFp(this.configuration).playoutHistoryTemplatesDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class PlayoutHistoryTemplatesApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryTemplatesApi */ - public playoutHistoryTemplatesList(options?: AxiosRequestConfig) { + public playoutHistoryTemplatesList(options?: RawAxiosRequestConfig) { return PlayoutHistoryTemplatesApiFp(this.configuration).playoutHistoryTemplatesList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class PlayoutHistoryTemplatesApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryTemplatesApi */ - public playoutHistoryTemplatesPartialUpdate(id: number, patchedPlayoutHistoryTemplate?: PatchedPlayoutHistoryTemplate, options?: AxiosRequestConfig) { + public playoutHistoryTemplatesPartialUpdate(id: number, patchedPlayoutHistoryTemplate?: PatchedPlayoutHistoryTemplate, options?: RawAxiosRequestConfig) { return PlayoutHistoryTemplatesApiFp(this.configuration).playoutHistoryTemplatesPartialUpdate(id, patchedPlayoutHistoryTemplate, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class PlayoutHistoryTemplatesApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryTemplatesApi */ - public playoutHistoryTemplatesRetrieve(id: number, options?: AxiosRequestConfig) { + public playoutHistoryTemplatesRetrieve(id: number, options?: RawAxiosRequestConfig) { return PlayoutHistoryTemplatesApiFp(this.configuration).playoutHistoryTemplatesRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class PlayoutHistoryTemplatesApi extends BaseAPI { * @throws {RequiredError} * @memberof PlayoutHistoryTemplatesApi */ - public playoutHistoryTemplatesUpdate(id: number, playoutHistoryTemplate: PlayoutHistoryTemplate, options?: AxiosRequestConfig) { + public playoutHistoryTemplatesUpdate(id: number, playoutHistoryTemplate: PlayoutHistoryTemplate, options?: RawAxiosRequestConfig) { return PlayoutHistoryTemplatesApiFp(this.configuration).playoutHistoryTemplatesUpdate(id, playoutHistoryTemplate, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/podcast-episodes-api.ts b/javascript-client/api/podcast-episodes-api.ts index b8b47d4c..69e809eb 100644 --- a/javascript-client/api/podcast-episodes-api.ts +++ b/javascript-client/api/podcast-episodes-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedPodcastEpisode } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const PodcastEpisodesApiAxiosParamCreator = function (configuration?: Con * @param {*} [options] Override http request option. * @throws {RequiredError} */ - podcastEpisodesCreate: async (podcastEpisode: PodcastEpisode, options: AxiosRequestConfig = {}): Promise => { + podcastEpisodesCreate: async (podcastEpisode: PodcastEpisode, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'podcastEpisode' is not null or undefined assertParamExists('podcastEpisodesCreate', 'podcastEpisode', podcastEpisode) const localVarPath = `/api/v2/podcast-episodes`; @@ -78,7 +78,7 @@ export const PodcastEpisodesApiAxiosParamCreator = function (configuration?: Con * @param {*} [options] Override http request option. * @throws {RequiredError} */ - podcastEpisodesDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + podcastEpisodesDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('podcastEpisodesDestroy', 'id', id) const localVarPath = `/api/v2/podcast-episodes/{id}` @@ -116,7 +116,7 @@ export const PodcastEpisodesApiAxiosParamCreator = function (configuration?: Con * @param {*} [options] Override http request option. * @throws {RequiredError} */ - podcastEpisodesList: async (options: AxiosRequestConfig = {}): Promise => { + podcastEpisodesList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/podcast-episodes`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const PodcastEpisodesApiAxiosParamCreator = function (configuration?: Con * @param {*} [options] Override http request option. * @throws {RequiredError} */ - podcastEpisodesPartialUpdate: async (id: number, patchedPodcastEpisode?: PatchedPodcastEpisode, options: AxiosRequestConfig = {}): Promise => { + podcastEpisodesPartialUpdate: async (id: number, patchedPodcastEpisode?: PatchedPodcastEpisode, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('podcastEpisodesPartialUpdate', 'id', id) const localVarPath = `/api/v2/podcast-episodes/{id}` @@ -195,7 +195,7 @@ export const PodcastEpisodesApiAxiosParamCreator = function (configuration?: Con * @param {*} [options] Override http request option. * @throws {RequiredError} */ - podcastEpisodesRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + podcastEpisodesRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('podcastEpisodesRetrieve', 'id', id) const localVarPath = `/api/v2/podcast-episodes/{id}` @@ -235,7 +235,7 @@ export const PodcastEpisodesApiAxiosParamCreator = function (configuration?: Con * @param {*} [options] Override http request option. * @throws {RequiredError} */ - podcastEpisodesUpdate: async (id: number, podcastEpisode: PodcastEpisode, options: AxiosRequestConfig = {}): Promise => { + podcastEpisodesUpdate: async (id: number, podcastEpisode: PodcastEpisode, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('podcastEpisodesUpdate', 'id', id) // verify required parameter 'podcastEpisode' is not null or undefined @@ -289,9 +289,11 @@ export const PodcastEpisodesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async podcastEpisodesCreate(podcastEpisode: PodcastEpisode, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async podcastEpisodesCreate(podcastEpisode: PodcastEpisode, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.podcastEpisodesCreate(podcastEpisode, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PodcastEpisodesApi.podcastEpisodesCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const PodcastEpisodesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async podcastEpisodesDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async podcastEpisodesDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.podcastEpisodesDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PodcastEpisodesApi.podcastEpisodesDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async podcastEpisodesList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async podcastEpisodesList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.podcastEpisodesList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PodcastEpisodesApi.podcastEpisodesList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const PodcastEpisodesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async podcastEpisodesPartialUpdate(id: number, patchedPodcastEpisode?: PatchedPodcastEpisode, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async podcastEpisodesPartialUpdate(id: number, patchedPodcastEpisode?: PatchedPodcastEpisode, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.podcastEpisodesPartialUpdate(id, patchedPodcastEpisode, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PodcastEpisodesApi.podcastEpisodesPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const PodcastEpisodesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async podcastEpisodesRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async podcastEpisodesRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.podcastEpisodesRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PodcastEpisodesApi.podcastEpisodesRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const PodcastEpisodesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async podcastEpisodesUpdate(id: number, podcastEpisode: PodcastEpisode, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async podcastEpisodesUpdate(id: number, podcastEpisode: PodcastEpisode, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.podcastEpisodesUpdate(id, podcastEpisode, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PodcastEpisodesApi.podcastEpisodesUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class PodcastEpisodesApi extends BaseAPI { * @throws {RequiredError} * @memberof PodcastEpisodesApi */ - public podcastEpisodesCreate(podcastEpisode: PodcastEpisode, options?: AxiosRequestConfig) { + public podcastEpisodesCreate(podcastEpisode: PodcastEpisode, options?: RawAxiosRequestConfig) { return PodcastEpisodesApiFp(this.configuration).podcastEpisodesCreate(podcastEpisode, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class PodcastEpisodesApi extends BaseAPI { * @throws {RequiredError} * @memberof PodcastEpisodesApi */ - public podcastEpisodesDestroy(id: number, options?: AxiosRequestConfig) { + public podcastEpisodesDestroy(id: number, options?: RawAxiosRequestConfig) { return PodcastEpisodesApiFp(this.configuration).podcastEpisodesDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class PodcastEpisodesApi extends BaseAPI { * @throws {RequiredError} * @memberof PodcastEpisodesApi */ - public podcastEpisodesList(options?: AxiosRequestConfig) { + public podcastEpisodesList(options?: RawAxiosRequestConfig) { return PodcastEpisodesApiFp(this.configuration).podcastEpisodesList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class PodcastEpisodesApi extends BaseAPI { * @throws {RequiredError} * @memberof PodcastEpisodesApi */ - public podcastEpisodesPartialUpdate(id: number, patchedPodcastEpisode?: PatchedPodcastEpisode, options?: AxiosRequestConfig) { + public podcastEpisodesPartialUpdate(id: number, patchedPodcastEpisode?: PatchedPodcastEpisode, options?: RawAxiosRequestConfig) { return PodcastEpisodesApiFp(this.configuration).podcastEpisodesPartialUpdate(id, patchedPodcastEpisode, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class PodcastEpisodesApi extends BaseAPI { * @throws {RequiredError} * @memberof PodcastEpisodesApi */ - public podcastEpisodesRetrieve(id: number, options?: AxiosRequestConfig) { + public podcastEpisodesRetrieve(id: number, options?: RawAxiosRequestConfig) { return PodcastEpisodesApiFp(this.configuration).podcastEpisodesRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class PodcastEpisodesApi extends BaseAPI { * @throws {RequiredError} * @memberof PodcastEpisodesApi */ - public podcastEpisodesUpdate(id: number, podcastEpisode: PodcastEpisode, options?: AxiosRequestConfig) { + public podcastEpisodesUpdate(id: number, podcastEpisode: PodcastEpisode, options?: RawAxiosRequestConfig) { return PodcastEpisodesApiFp(this.configuration).podcastEpisodesUpdate(id, podcastEpisode, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/podcasts-api.ts b/javascript-client/api/podcasts-api.ts index ca8886be..2b4a8cf3 100644 --- a/javascript-client/api/podcasts-api.ts +++ b/javascript-client/api/podcasts-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedPodcast } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const PodcastsApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - podcastsCreate: async (podcast: Podcast, options: AxiosRequestConfig = {}): Promise => { + podcastsCreate: async (podcast: Podcast, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'podcast' is not null or undefined assertParamExists('podcastsCreate', 'podcast', podcast) const localVarPath = `/api/v2/podcasts`; @@ -78,7 +78,7 @@ export const PodcastsApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - podcastsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + podcastsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('podcastsDestroy', 'id', id) const localVarPath = `/api/v2/podcasts/{id}` @@ -116,7 +116,7 @@ export const PodcastsApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - podcastsList: async (options: AxiosRequestConfig = {}): Promise => { + podcastsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/podcasts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const PodcastsApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - podcastsPartialUpdate: async (id: number, patchedPodcast?: PatchedPodcast, options: AxiosRequestConfig = {}): Promise => { + podcastsPartialUpdate: async (id: number, patchedPodcast?: PatchedPodcast, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('podcastsPartialUpdate', 'id', id) const localVarPath = `/api/v2/podcasts/{id}` @@ -195,7 +195,7 @@ export const PodcastsApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - podcastsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + podcastsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('podcastsRetrieve', 'id', id) const localVarPath = `/api/v2/podcasts/{id}` @@ -235,7 +235,7 @@ export const PodcastsApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - podcastsUpdate: async (id: number, podcast: Podcast, options: AxiosRequestConfig = {}): Promise => { + podcastsUpdate: async (id: number, podcast: Podcast, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('podcastsUpdate', 'id', id) // verify required parameter 'podcast' is not null or undefined @@ -289,9 +289,11 @@ export const PodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async podcastsCreate(podcast: Podcast, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async podcastsCreate(podcast: Podcast, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.podcastsCreate(podcast, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PodcastsApi.podcastsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const PodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async podcastsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async podcastsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.podcastsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PodcastsApi.podcastsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async podcastsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async podcastsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.podcastsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PodcastsApi.podcastsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const PodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async podcastsPartialUpdate(id: number, patchedPodcast?: PatchedPodcast, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async podcastsPartialUpdate(id: number, patchedPodcast?: PatchedPodcast, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.podcastsPartialUpdate(id, patchedPodcast, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PodcastsApi.podcastsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const PodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async podcastsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async podcastsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.podcastsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PodcastsApi.podcastsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const PodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async podcastsUpdate(id: number, podcast: Podcast, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async podcastsUpdate(id: number, podcast: Podcast, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.podcastsUpdate(id, podcast, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PodcastsApi.podcastsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class PodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof PodcastsApi */ - public podcastsCreate(podcast: Podcast, options?: AxiosRequestConfig) { + public podcastsCreate(podcast: Podcast, options?: RawAxiosRequestConfig) { return PodcastsApiFp(this.configuration).podcastsCreate(podcast, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class PodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof PodcastsApi */ - public podcastsDestroy(id: number, options?: AxiosRequestConfig) { + public podcastsDestroy(id: number, options?: RawAxiosRequestConfig) { return PodcastsApiFp(this.configuration).podcastsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class PodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof PodcastsApi */ - public podcastsList(options?: AxiosRequestConfig) { + public podcastsList(options?: RawAxiosRequestConfig) { return PodcastsApiFp(this.configuration).podcastsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class PodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof PodcastsApi */ - public podcastsPartialUpdate(id: number, patchedPodcast?: PatchedPodcast, options?: AxiosRequestConfig) { + public podcastsPartialUpdate(id: number, patchedPodcast?: PatchedPodcast, options?: RawAxiosRequestConfig) { return PodcastsApiFp(this.configuration).podcastsPartialUpdate(id, patchedPodcast, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class PodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof PodcastsApi */ - public podcastsRetrieve(id: number, options?: AxiosRequestConfig) { + public podcastsRetrieve(id: number, options?: RawAxiosRequestConfig) { return PodcastsApiFp(this.configuration).podcastsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class PodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof PodcastsApi */ - public podcastsUpdate(id: number, podcast: Podcast, options?: AxiosRequestConfig) { + public podcastsUpdate(id: number, podcast: Podcast, options?: RawAxiosRequestConfig) { return PodcastsApiFp(this.configuration).podcastsUpdate(id, podcast, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/preferences-api.ts b/javascript-client/api/preferences-api.ts index 653c495a..9cdb4348 100644 --- a/javascript-client/api/preferences-api.ts +++ b/javascript-client/api/preferences-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedPreference } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const PreferencesApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - preferencesCreate: async (preference: Preference, options: AxiosRequestConfig = {}): Promise => { + preferencesCreate: async (preference: Preference, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'preference' is not null or undefined assertParamExists('preferencesCreate', 'preference', preference) const localVarPath = `/api/v2/preferences`; @@ -78,7 +78,7 @@ export const PreferencesApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - preferencesDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + preferencesDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('preferencesDestroy', 'id', id) const localVarPath = `/api/v2/preferences/{id}` @@ -116,7 +116,7 @@ export const PreferencesApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - preferencesList: async (options: AxiosRequestConfig = {}): Promise => { + preferencesList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/preferences`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const PreferencesApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - preferencesPartialUpdate: async (id: number, patchedPreference?: PatchedPreference, options: AxiosRequestConfig = {}): Promise => { + preferencesPartialUpdate: async (id: number, patchedPreference?: PatchedPreference, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('preferencesPartialUpdate', 'id', id) const localVarPath = `/api/v2/preferences/{id}` @@ -195,7 +195,7 @@ export const PreferencesApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - preferencesRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + preferencesRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('preferencesRetrieve', 'id', id) const localVarPath = `/api/v2/preferences/{id}` @@ -235,7 +235,7 @@ export const PreferencesApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - preferencesUpdate: async (id: number, preference: Preference, options: AxiosRequestConfig = {}): Promise => { + preferencesUpdate: async (id: number, preference: Preference, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('preferencesUpdate', 'id', id) // verify required parameter 'preference' is not null or undefined @@ -289,9 +289,11 @@ export const PreferencesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async preferencesCreate(preference: Preference, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async preferencesCreate(preference: Preference, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.preferencesCreate(preference, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreferencesApi.preferencesCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const PreferencesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async preferencesDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async preferencesDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.preferencesDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreferencesApi.preferencesDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async preferencesList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async preferencesList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.preferencesList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreferencesApi.preferencesList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const PreferencesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async preferencesPartialUpdate(id: number, patchedPreference?: PatchedPreference, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async preferencesPartialUpdate(id: number, patchedPreference?: PatchedPreference, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.preferencesPartialUpdate(id, patchedPreference, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreferencesApi.preferencesPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const PreferencesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async preferencesRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async preferencesRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.preferencesRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreferencesApi.preferencesRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const PreferencesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async preferencesUpdate(id: number, preference: Preference, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async preferencesUpdate(id: number, preference: Preference, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.preferencesUpdate(id, preference, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreferencesApi.preferencesUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class PreferencesApi extends BaseAPI { * @throws {RequiredError} * @memberof PreferencesApi */ - public preferencesCreate(preference: Preference, options?: AxiosRequestConfig) { + public preferencesCreate(preference: Preference, options?: RawAxiosRequestConfig) { return PreferencesApiFp(this.configuration).preferencesCreate(preference, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class PreferencesApi extends BaseAPI { * @throws {RequiredError} * @memberof PreferencesApi */ - public preferencesDestroy(id: number, options?: AxiosRequestConfig) { + public preferencesDestroy(id: number, options?: RawAxiosRequestConfig) { return PreferencesApiFp(this.configuration).preferencesDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class PreferencesApi extends BaseAPI { * @throws {RequiredError} * @memberof PreferencesApi */ - public preferencesList(options?: AxiosRequestConfig) { + public preferencesList(options?: RawAxiosRequestConfig) { return PreferencesApiFp(this.configuration).preferencesList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class PreferencesApi extends BaseAPI { * @throws {RequiredError} * @memberof PreferencesApi */ - public preferencesPartialUpdate(id: number, patchedPreference?: PatchedPreference, options?: AxiosRequestConfig) { + public preferencesPartialUpdate(id: number, patchedPreference?: PatchedPreference, options?: RawAxiosRequestConfig) { return PreferencesApiFp(this.configuration).preferencesPartialUpdate(id, patchedPreference, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class PreferencesApi extends BaseAPI { * @throws {RequiredError} * @memberof PreferencesApi */ - public preferencesRetrieve(id: number, options?: AxiosRequestConfig) { + public preferencesRetrieve(id: number, options?: RawAxiosRequestConfig) { return PreferencesApiFp(this.configuration).preferencesRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class PreferencesApi extends BaseAPI { * @throws {RequiredError} * @memberof PreferencesApi */ - public preferencesUpdate(id: number, preference: Preference, options?: AxiosRequestConfig) { + public preferencesUpdate(id: number, preference: Preference, options?: RawAxiosRequestConfig) { return PreferencesApiFp(this.configuration).preferencesUpdate(id, preference, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/schedule-api.ts b/javascript-client/api/schedule-api.ts index 4e148c43..aedcf6be 100644 --- a/javascript-client/api/schedule-api.ts +++ b/javascript-client/api/schedule-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedSchedule } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const ScheduleApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - scheduleCreate: async (schedule: Schedule, options: AxiosRequestConfig = {}): Promise => { + scheduleCreate: async (schedule: Schedule, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'schedule' is not null or undefined assertParamExists('scheduleCreate', 'schedule', schedule) const localVarPath = `/api/v2/schedule`; @@ -78,7 +78,7 @@ export const ScheduleApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - scheduleDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + scheduleDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('scheduleDestroy', 'id', id) const localVarPath = `/api/v2/schedule/{id}` @@ -123,7 +123,7 @@ export const ScheduleApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - scheduleList: async (broadcasted?: number, endsAfter?: string, endsBefore?: string, overbooked?: boolean, positionStatus?: number, startsAfter?: string, startsBefore?: string, options: AxiosRequestConfig = {}): Promise => { + scheduleList: async (broadcasted?: number, endsAfter?: string, endsBefore?: string, overbooked?: boolean, positionStatus?: number, startsAfter?: string, startsBefore?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/schedule`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -196,7 +196,7 @@ export const ScheduleApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - schedulePartialUpdate: async (id: number, patchedSchedule?: PatchedSchedule, options: AxiosRequestConfig = {}): Promise => { + schedulePartialUpdate: async (id: number, patchedSchedule?: PatchedSchedule, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('schedulePartialUpdate', 'id', id) const localVarPath = `/api/v2/schedule/{id}` @@ -238,7 +238,7 @@ export const ScheduleApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - scheduleRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + scheduleRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('scheduleRetrieve', 'id', id) const localVarPath = `/api/v2/schedule/{id}` @@ -278,7 +278,7 @@ export const ScheduleApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - scheduleUpdate: async (id: number, schedule: Schedule, options: AxiosRequestConfig = {}): Promise => { + scheduleUpdate: async (id: number, schedule: Schedule, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('scheduleUpdate', 'id', id) // verify required parameter 'schedule' is not null or undefined @@ -332,9 +332,11 @@ export const ScheduleApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async scheduleCreate(schedule: Schedule, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async scheduleCreate(schedule: Schedule, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.scheduleCreate(schedule, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScheduleApi.scheduleCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -342,9 +344,11 @@ export const ScheduleApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async scheduleDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async scheduleDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.scheduleDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScheduleApi.scheduleDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -358,9 +362,11 @@ export const ScheduleApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async scheduleList(broadcasted?: number, endsAfter?: string, endsBefore?: string, overbooked?: boolean, positionStatus?: number, startsAfter?: string, startsBefore?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async scheduleList(broadcasted?: number, endsAfter?: string, endsBefore?: string, overbooked?: boolean, positionStatus?: number, startsAfter?: string, startsBefore?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.scheduleList(broadcasted, endsAfter, endsBefore, overbooked, positionStatus, startsAfter, startsBefore, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScheduleApi.scheduleList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -369,9 +375,11 @@ export const ScheduleApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async schedulePartialUpdate(id: number, patchedSchedule?: PatchedSchedule, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async schedulePartialUpdate(id: number, patchedSchedule?: PatchedSchedule, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.schedulePartialUpdate(id, patchedSchedule, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScheduleApi.schedulePartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -379,9 +387,11 @@ export const ScheduleApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async scheduleRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async scheduleRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.scheduleRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScheduleApi.scheduleRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -390,9 +400,11 @@ export const ScheduleApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async scheduleUpdate(id: number, schedule: Schedule, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async scheduleUpdate(id: number, schedule: Schedule, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.scheduleUpdate(id, schedule, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScheduleApi.scheduleUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -483,7 +495,7 @@ export class ScheduleApi extends BaseAPI { * @throws {RequiredError} * @memberof ScheduleApi */ - public scheduleCreate(schedule: Schedule, options?: AxiosRequestConfig) { + public scheduleCreate(schedule: Schedule, options?: RawAxiosRequestConfig) { return ScheduleApiFp(this.configuration).scheduleCreate(schedule, options).then((request) => request(this.axios, this.basePath)); } @@ -494,7 +506,7 @@ export class ScheduleApi extends BaseAPI { * @throws {RequiredError} * @memberof ScheduleApi */ - public scheduleDestroy(id: number, options?: AxiosRequestConfig) { + public scheduleDestroy(id: number, options?: RawAxiosRequestConfig) { return ScheduleApiFp(this.configuration).scheduleDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -511,7 +523,7 @@ export class ScheduleApi extends BaseAPI { * @throws {RequiredError} * @memberof ScheduleApi */ - public scheduleList(broadcasted?: number, endsAfter?: string, endsBefore?: string, overbooked?: boolean, positionStatus?: number, startsAfter?: string, startsBefore?: string, options?: AxiosRequestConfig) { + public scheduleList(broadcasted?: number, endsAfter?: string, endsBefore?: string, overbooked?: boolean, positionStatus?: number, startsAfter?: string, startsBefore?: string, options?: RawAxiosRequestConfig) { return ScheduleApiFp(this.configuration).scheduleList(broadcasted, endsAfter, endsBefore, overbooked, positionStatus, startsAfter, startsBefore, options).then((request) => request(this.axios, this.basePath)); } @@ -523,7 +535,7 @@ export class ScheduleApi extends BaseAPI { * @throws {RequiredError} * @memberof ScheduleApi */ - public schedulePartialUpdate(id: number, patchedSchedule?: PatchedSchedule, options?: AxiosRequestConfig) { + public schedulePartialUpdate(id: number, patchedSchedule?: PatchedSchedule, options?: RawAxiosRequestConfig) { return ScheduleApiFp(this.configuration).schedulePartialUpdate(id, patchedSchedule, options).then((request) => request(this.axios, this.basePath)); } @@ -534,7 +546,7 @@ export class ScheduleApi extends BaseAPI { * @throws {RequiredError} * @memberof ScheduleApi */ - public scheduleRetrieve(id: number, options?: AxiosRequestConfig) { + public scheduleRetrieve(id: number, options?: RawAxiosRequestConfig) { return ScheduleApiFp(this.configuration).scheduleRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -546,7 +558,7 @@ export class ScheduleApi extends BaseAPI { * @throws {RequiredError} * @memberof ScheduleApi */ - public scheduleUpdate(id: number, schedule: Schedule, options?: AxiosRequestConfig) { + public scheduleUpdate(id: number, schedule: Schedule, options?: RawAxiosRequestConfig) { return ScheduleApiFp(this.configuration).scheduleUpdate(id, schedule, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/schema-api.ts b/javascript-client/api/schema-api.ts index 59dbeef5..7878deb5 100644 --- a/javascript-client/api/schema-api.ts +++ b/javascript-client/api/schema-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; /** * SchemaApi - axios parameter creator * @export @@ -34,7 +34,7 @@ export const SchemaApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - schemaRetrieve: async (format?: SchemaRetrieveFormatEnum, lang?: SchemaRetrieveLangEnum, options: AxiosRequestConfig = {}): Promise => { + schemaRetrieve: async (format?: SchemaRetrieveFormatEnum, lang?: SchemaRetrieveLangEnum, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/schema`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -89,9 +89,11 @@ export const SchemaApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async schemaRetrieve(format?: SchemaRetrieveFormatEnum, lang?: SchemaRetrieveLangEnum, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: any; }>> { + async schemaRetrieve(format?: SchemaRetrieveFormatEnum, lang?: SchemaRetrieveLangEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: any; }>> { const localVarAxiosArgs = await localVarAxiosParamCreator.schemaRetrieve(format, lang, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SchemaApi.schemaRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -131,7 +133,7 @@ export class SchemaApi extends BaseAPI { * @throws {RequiredError} * @memberof SchemaApi */ - public schemaRetrieve(format?: SchemaRetrieveFormatEnum, lang?: SchemaRetrieveLangEnum, options?: AxiosRequestConfig) { + public schemaRetrieve(format?: SchemaRetrieveFormatEnum, lang?: SchemaRetrieveLangEnum, options?: RawAxiosRequestConfig) { return SchemaApiFp(this.configuration).schemaRetrieve(format, lang, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/service-registers-api.ts b/javascript-client/api/service-registers-api.ts index a24f6c73..bfc95ea0 100644 --- a/javascript-client/api/service-registers-api.ts +++ b/javascript-client/api/service-registers-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedServiceRegister } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const ServiceRegistersApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - serviceRegistersCreate: async (serviceRegister: ServiceRegister, options: AxiosRequestConfig = {}): Promise => { + serviceRegistersCreate: async (serviceRegister: ServiceRegister, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'serviceRegister' is not null or undefined assertParamExists('serviceRegistersCreate', 'serviceRegister', serviceRegister) const localVarPath = `/api/v2/service-registers`; @@ -78,7 +78,7 @@ export const ServiceRegistersApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - serviceRegistersDestroy: async (name: string, options: AxiosRequestConfig = {}): Promise => { + serviceRegistersDestroy: async (name: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'name' is not null or undefined assertParamExists('serviceRegistersDestroy', 'name', name) const localVarPath = `/api/v2/service-registers/{name}` @@ -116,7 +116,7 @@ export const ServiceRegistersApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - serviceRegistersList: async (options: AxiosRequestConfig = {}): Promise => { + serviceRegistersList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/service-registers`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const ServiceRegistersApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - serviceRegistersPartialUpdate: async (name: string, patchedServiceRegister?: PatchedServiceRegister, options: AxiosRequestConfig = {}): Promise => { + serviceRegistersPartialUpdate: async (name: string, patchedServiceRegister?: PatchedServiceRegister, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'name' is not null or undefined assertParamExists('serviceRegistersPartialUpdate', 'name', name) const localVarPath = `/api/v2/service-registers/{name}` @@ -195,7 +195,7 @@ export const ServiceRegistersApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - serviceRegistersRetrieve: async (name: string, options: AxiosRequestConfig = {}): Promise => { + serviceRegistersRetrieve: async (name: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'name' is not null or undefined assertParamExists('serviceRegistersRetrieve', 'name', name) const localVarPath = `/api/v2/service-registers/{name}` @@ -235,7 +235,7 @@ export const ServiceRegistersApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - serviceRegistersUpdate: async (name: string, serviceRegister: ServiceRegister, options: AxiosRequestConfig = {}): Promise => { + serviceRegistersUpdate: async (name: string, serviceRegister: ServiceRegister, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'name' is not null or undefined assertParamExists('serviceRegistersUpdate', 'name', name) // verify required parameter 'serviceRegister' is not null or undefined @@ -289,9 +289,11 @@ export const ServiceRegistersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async serviceRegistersCreate(serviceRegister: ServiceRegister, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async serviceRegistersCreate(serviceRegister: ServiceRegister, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.serviceRegistersCreate(serviceRegister, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ServiceRegistersApi.serviceRegistersCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const ServiceRegistersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async serviceRegistersDestroy(name: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async serviceRegistersDestroy(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.serviceRegistersDestroy(name, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ServiceRegistersApi.serviceRegistersDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async serviceRegistersList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async serviceRegistersList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.serviceRegistersList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ServiceRegistersApi.serviceRegistersList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const ServiceRegistersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async serviceRegistersPartialUpdate(name: string, patchedServiceRegister?: PatchedServiceRegister, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async serviceRegistersPartialUpdate(name: string, patchedServiceRegister?: PatchedServiceRegister, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.serviceRegistersPartialUpdate(name, patchedServiceRegister, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ServiceRegistersApi.serviceRegistersPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const ServiceRegistersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async serviceRegistersRetrieve(name: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async serviceRegistersRetrieve(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.serviceRegistersRetrieve(name, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ServiceRegistersApi.serviceRegistersRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const ServiceRegistersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async serviceRegistersUpdate(name: string, serviceRegister: ServiceRegister, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async serviceRegistersUpdate(name: string, serviceRegister: ServiceRegister, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.serviceRegistersUpdate(name, serviceRegister, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ServiceRegistersApi.serviceRegistersUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class ServiceRegistersApi extends BaseAPI { * @throws {RequiredError} * @memberof ServiceRegistersApi */ - public serviceRegistersCreate(serviceRegister: ServiceRegister, options?: AxiosRequestConfig) { + public serviceRegistersCreate(serviceRegister: ServiceRegister, options?: RawAxiosRequestConfig) { return ServiceRegistersApiFp(this.configuration).serviceRegistersCreate(serviceRegister, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class ServiceRegistersApi extends BaseAPI { * @throws {RequiredError} * @memberof ServiceRegistersApi */ - public serviceRegistersDestroy(name: string, options?: AxiosRequestConfig) { + public serviceRegistersDestroy(name: string, options?: RawAxiosRequestConfig) { return ServiceRegistersApiFp(this.configuration).serviceRegistersDestroy(name, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class ServiceRegistersApi extends BaseAPI { * @throws {RequiredError} * @memberof ServiceRegistersApi */ - public serviceRegistersList(options?: AxiosRequestConfig) { + public serviceRegistersList(options?: RawAxiosRequestConfig) { return ServiceRegistersApiFp(this.configuration).serviceRegistersList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class ServiceRegistersApi extends BaseAPI { * @throws {RequiredError} * @memberof ServiceRegistersApi */ - public serviceRegistersPartialUpdate(name: string, patchedServiceRegister?: PatchedServiceRegister, options?: AxiosRequestConfig) { + public serviceRegistersPartialUpdate(name: string, patchedServiceRegister?: PatchedServiceRegister, options?: RawAxiosRequestConfig) { return ServiceRegistersApiFp(this.configuration).serviceRegistersPartialUpdate(name, patchedServiceRegister, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class ServiceRegistersApi extends BaseAPI { * @throws {RequiredError} * @memberof ServiceRegistersApi */ - public serviceRegistersRetrieve(name: string, options?: AxiosRequestConfig) { + public serviceRegistersRetrieve(name: string, options?: RawAxiosRequestConfig) { return ServiceRegistersApiFp(this.configuration).serviceRegistersRetrieve(name, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class ServiceRegistersApi extends BaseAPI { * @throws {RequiredError} * @memberof ServiceRegistersApi */ - public serviceRegistersUpdate(name: string, serviceRegister: ServiceRegister, options?: AxiosRequestConfig) { + public serviceRegistersUpdate(name: string, serviceRegister: ServiceRegister, options?: RawAxiosRequestConfig) { return ServiceRegistersApiFp(this.configuration).serviceRegistersUpdate(name, serviceRegister, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/show-days-api.ts b/javascript-client/api/show-days-api.ts index c0f30f66..ccce454c 100644 --- a/javascript-client/api/show-days-api.ts +++ b/javascript-client/api/show-days-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedShowDays } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const ShowDaysApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showDaysCreate: async (showDays: ShowDays, options: AxiosRequestConfig = {}): Promise => { + showDaysCreate: async (showDays: ShowDays, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'showDays' is not null or undefined assertParamExists('showDaysCreate', 'showDays', showDays) const localVarPath = `/api/v2/show-days`; @@ -78,7 +78,7 @@ export const ShowDaysApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showDaysDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + showDaysDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showDaysDestroy', 'id', id) const localVarPath = `/api/v2/show-days/{id}` @@ -116,7 +116,7 @@ export const ShowDaysApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showDaysList: async (options: AxiosRequestConfig = {}): Promise => { + showDaysList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/show-days`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const ShowDaysApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showDaysPartialUpdate: async (id: number, patchedShowDays?: PatchedShowDays, options: AxiosRequestConfig = {}): Promise => { + showDaysPartialUpdate: async (id: number, patchedShowDays?: PatchedShowDays, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showDaysPartialUpdate', 'id', id) const localVarPath = `/api/v2/show-days/{id}` @@ -195,7 +195,7 @@ export const ShowDaysApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showDaysRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + showDaysRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showDaysRetrieve', 'id', id) const localVarPath = `/api/v2/show-days/{id}` @@ -235,7 +235,7 @@ export const ShowDaysApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showDaysUpdate: async (id: number, showDays: ShowDays, options: AxiosRequestConfig = {}): Promise => { + showDaysUpdate: async (id: number, showDays: ShowDays, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showDaysUpdate', 'id', id) // verify required parameter 'showDays' is not null or undefined @@ -289,9 +289,11 @@ export const ShowDaysApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showDaysCreate(showDays: ShowDays, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showDaysCreate(showDays: ShowDays, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showDaysCreate(showDays, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowDaysApi.showDaysCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const ShowDaysApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showDaysDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showDaysDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showDaysDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowDaysApi.showDaysDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showDaysList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async showDaysList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.showDaysList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowDaysApi.showDaysList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const ShowDaysApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showDaysPartialUpdate(id: number, patchedShowDays?: PatchedShowDays, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showDaysPartialUpdate(id: number, patchedShowDays?: PatchedShowDays, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showDaysPartialUpdate(id, patchedShowDays, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowDaysApi.showDaysPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const ShowDaysApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showDaysRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showDaysRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showDaysRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowDaysApi.showDaysRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const ShowDaysApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showDaysUpdate(id: number, showDays: ShowDays, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showDaysUpdate(id: number, showDays: ShowDays, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showDaysUpdate(id, showDays, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowDaysApi.showDaysUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class ShowDaysApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowDaysApi */ - public showDaysCreate(showDays: ShowDays, options?: AxiosRequestConfig) { + public showDaysCreate(showDays: ShowDays, options?: RawAxiosRequestConfig) { return ShowDaysApiFp(this.configuration).showDaysCreate(showDays, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class ShowDaysApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowDaysApi */ - public showDaysDestroy(id: number, options?: AxiosRequestConfig) { + public showDaysDestroy(id: number, options?: RawAxiosRequestConfig) { return ShowDaysApiFp(this.configuration).showDaysDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class ShowDaysApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowDaysApi */ - public showDaysList(options?: AxiosRequestConfig) { + public showDaysList(options?: RawAxiosRequestConfig) { return ShowDaysApiFp(this.configuration).showDaysList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class ShowDaysApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowDaysApi */ - public showDaysPartialUpdate(id: number, patchedShowDays?: PatchedShowDays, options?: AxiosRequestConfig) { + public showDaysPartialUpdate(id: number, patchedShowDays?: PatchedShowDays, options?: RawAxiosRequestConfig) { return ShowDaysApiFp(this.configuration).showDaysPartialUpdate(id, patchedShowDays, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class ShowDaysApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowDaysApi */ - public showDaysRetrieve(id: number, options?: AxiosRequestConfig) { + public showDaysRetrieve(id: number, options?: RawAxiosRequestConfig) { return ShowDaysApiFp(this.configuration).showDaysRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class ShowDaysApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowDaysApi */ - public showDaysUpdate(id: number, showDays: ShowDays, options?: AxiosRequestConfig) { + public showDaysUpdate(id: number, showDays: ShowDays, options?: RawAxiosRequestConfig) { return ShowDaysApiFp(this.configuration).showDaysUpdate(id, showDays, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/show-hosts-api.ts b/javascript-client/api/show-hosts-api.ts index 57a4ef75..9f7a1fa7 100644 --- a/javascript-client/api/show-hosts-api.ts +++ b/javascript-client/api/show-hosts-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedShowHost } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const ShowHostsApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showHostsCreate: async (showHost: ShowHost, options: AxiosRequestConfig = {}): Promise => { + showHostsCreate: async (showHost: ShowHost, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'showHost' is not null or undefined assertParamExists('showHostsCreate', 'showHost', showHost) const localVarPath = `/api/v2/show-hosts`; @@ -78,7 +78,7 @@ export const ShowHostsApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showHostsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + showHostsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showHostsDestroy', 'id', id) const localVarPath = `/api/v2/show-hosts/{id}` @@ -116,7 +116,7 @@ export const ShowHostsApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showHostsList: async (options: AxiosRequestConfig = {}): Promise => { + showHostsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/show-hosts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const ShowHostsApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showHostsPartialUpdate: async (id: number, patchedShowHost?: PatchedShowHost, options: AxiosRequestConfig = {}): Promise => { + showHostsPartialUpdate: async (id: number, patchedShowHost?: PatchedShowHost, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showHostsPartialUpdate', 'id', id) const localVarPath = `/api/v2/show-hosts/{id}` @@ -195,7 +195,7 @@ export const ShowHostsApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showHostsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + showHostsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showHostsRetrieve', 'id', id) const localVarPath = `/api/v2/show-hosts/{id}` @@ -235,7 +235,7 @@ export const ShowHostsApiAxiosParamCreator = function (configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showHostsUpdate: async (id: number, showHost: ShowHost, options: AxiosRequestConfig = {}): Promise => { + showHostsUpdate: async (id: number, showHost: ShowHost, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showHostsUpdate', 'id', id) // verify required parameter 'showHost' is not null or undefined @@ -289,9 +289,11 @@ export const ShowHostsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showHostsCreate(showHost: ShowHost, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showHostsCreate(showHost: ShowHost, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showHostsCreate(showHost, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowHostsApi.showHostsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const ShowHostsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showHostsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showHostsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showHostsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowHostsApi.showHostsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showHostsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async showHostsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.showHostsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowHostsApi.showHostsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const ShowHostsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showHostsPartialUpdate(id: number, patchedShowHost?: PatchedShowHost, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showHostsPartialUpdate(id: number, patchedShowHost?: PatchedShowHost, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showHostsPartialUpdate(id, patchedShowHost, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowHostsApi.showHostsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const ShowHostsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showHostsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showHostsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showHostsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowHostsApi.showHostsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const ShowHostsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showHostsUpdate(id: number, showHost: ShowHost, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showHostsUpdate(id: number, showHost: ShowHost, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showHostsUpdate(id, showHost, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowHostsApi.showHostsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class ShowHostsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowHostsApi */ - public showHostsCreate(showHost: ShowHost, options?: AxiosRequestConfig) { + public showHostsCreate(showHost: ShowHost, options?: RawAxiosRequestConfig) { return ShowHostsApiFp(this.configuration).showHostsCreate(showHost, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class ShowHostsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowHostsApi */ - public showHostsDestroy(id: number, options?: AxiosRequestConfig) { + public showHostsDestroy(id: number, options?: RawAxiosRequestConfig) { return ShowHostsApiFp(this.configuration).showHostsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class ShowHostsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowHostsApi */ - public showHostsList(options?: AxiosRequestConfig) { + public showHostsList(options?: RawAxiosRequestConfig) { return ShowHostsApiFp(this.configuration).showHostsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class ShowHostsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowHostsApi */ - public showHostsPartialUpdate(id: number, patchedShowHost?: PatchedShowHost, options?: AxiosRequestConfig) { + public showHostsPartialUpdate(id: number, patchedShowHost?: PatchedShowHost, options?: RawAxiosRequestConfig) { return ShowHostsApiFp(this.configuration).showHostsPartialUpdate(id, patchedShowHost, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class ShowHostsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowHostsApi */ - public showHostsRetrieve(id: number, options?: AxiosRequestConfig) { + public showHostsRetrieve(id: number, options?: RawAxiosRequestConfig) { return ShowHostsApiFp(this.configuration).showHostsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class ShowHostsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowHostsApi */ - public showHostsUpdate(id: number, showHost: ShowHost, options?: AxiosRequestConfig) { + public showHostsUpdate(id: number, showHost: ShowHost, options?: RawAxiosRequestConfig) { return ShowHostsApiFp(this.configuration).showHostsUpdate(id, showHost, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/show-instances-api.ts b/javascript-client/api/show-instances-api.ts index 7cee41ab..7946843d 100644 --- a/javascript-client/api/show-instances-api.ts +++ b/javascript-client/api/show-instances-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedShowInstance } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const ShowInstancesApiAxiosParamCreator = function (configuration?: Confi * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showInstancesCreate: async (showInstance: ShowInstance, options: AxiosRequestConfig = {}): Promise => { + showInstancesCreate: async (showInstance: ShowInstance, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'showInstance' is not null or undefined assertParamExists('showInstancesCreate', 'showInstance', showInstance) const localVarPath = `/api/v2/show-instances`; @@ -78,7 +78,7 @@ export const ShowInstancesApiAxiosParamCreator = function (configuration?: Confi * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showInstancesDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + showInstancesDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showInstancesDestroy', 'id', id) const localVarPath = `/api/v2/show-instances/{id}` @@ -116,7 +116,7 @@ export const ShowInstancesApiAxiosParamCreator = function (configuration?: Confi * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showInstancesList: async (options: AxiosRequestConfig = {}): Promise => { + showInstancesList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/show-instances`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const ShowInstancesApiAxiosParamCreator = function (configuration?: Confi * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showInstancesPartialUpdate: async (id: number, patchedShowInstance?: PatchedShowInstance, options: AxiosRequestConfig = {}): Promise => { + showInstancesPartialUpdate: async (id: number, patchedShowInstance?: PatchedShowInstance, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showInstancesPartialUpdate', 'id', id) const localVarPath = `/api/v2/show-instances/{id}` @@ -195,7 +195,7 @@ export const ShowInstancesApiAxiosParamCreator = function (configuration?: Confi * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showInstancesRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + showInstancesRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showInstancesRetrieve', 'id', id) const localVarPath = `/api/v2/show-instances/{id}` @@ -235,7 +235,7 @@ export const ShowInstancesApiAxiosParamCreator = function (configuration?: Confi * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showInstancesUpdate: async (id: number, showInstance: ShowInstance, options: AxiosRequestConfig = {}): Promise => { + showInstancesUpdate: async (id: number, showInstance: ShowInstance, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showInstancesUpdate', 'id', id) // verify required parameter 'showInstance' is not null or undefined @@ -289,9 +289,11 @@ export const ShowInstancesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showInstancesCreate(showInstance: ShowInstance, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showInstancesCreate(showInstance: ShowInstance, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showInstancesCreate(showInstance, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowInstancesApi.showInstancesCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const ShowInstancesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showInstancesDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showInstancesDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showInstancesDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowInstancesApi.showInstancesDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showInstancesList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async showInstancesList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.showInstancesList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowInstancesApi.showInstancesList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const ShowInstancesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showInstancesPartialUpdate(id: number, patchedShowInstance?: PatchedShowInstance, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showInstancesPartialUpdate(id: number, patchedShowInstance?: PatchedShowInstance, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showInstancesPartialUpdate(id, patchedShowInstance, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowInstancesApi.showInstancesPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const ShowInstancesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showInstancesRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showInstancesRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showInstancesRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowInstancesApi.showInstancesRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const ShowInstancesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showInstancesUpdate(id: number, showInstance: ShowInstance, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showInstancesUpdate(id: number, showInstance: ShowInstance, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showInstancesUpdate(id, showInstance, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowInstancesApi.showInstancesUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class ShowInstancesApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowInstancesApi */ - public showInstancesCreate(showInstance: ShowInstance, options?: AxiosRequestConfig) { + public showInstancesCreate(showInstance: ShowInstance, options?: RawAxiosRequestConfig) { return ShowInstancesApiFp(this.configuration).showInstancesCreate(showInstance, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class ShowInstancesApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowInstancesApi */ - public showInstancesDestroy(id: number, options?: AxiosRequestConfig) { + public showInstancesDestroy(id: number, options?: RawAxiosRequestConfig) { return ShowInstancesApiFp(this.configuration).showInstancesDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class ShowInstancesApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowInstancesApi */ - public showInstancesList(options?: AxiosRequestConfig) { + public showInstancesList(options?: RawAxiosRequestConfig) { return ShowInstancesApiFp(this.configuration).showInstancesList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class ShowInstancesApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowInstancesApi */ - public showInstancesPartialUpdate(id: number, patchedShowInstance?: PatchedShowInstance, options?: AxiosRequestConfig) { + public showInstancesPartialUpdate(id: number, patchedShowInstance?: PatchedShowInstance, options?: RawAxiosRequestConfig) { return ShowInstancesApiFp(this.configuration).showInstancesPartialUpdate(id, patchedShowInstance, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class ShowInstancesApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowInstancesApi */ - public showInstancesRetrieve(id: number, options?: AxiosRequestConfig) { + public showInstancesRetrieve(id: number, options?: RawAxiosRequestConfig) { return ShowInstancesApiFp(this.configuration).showInstancesRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class ShowInstancesApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowInstancesApi */ - public showInstancesUpdate(id: number, showInstance: ShowInstance, options?: AxiosRequestConfig) { + public showInstancesUpdate(id: number, showInstance: ShowInstance, options?: RawAxiosRequestConfig) { return ShowInstancesApiFp(this.configuration).showInstancesUpdate(id, showInstance, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/show-rebroadcasts-api.ts b/javascript-client/api/show-rebroadcasts-api.ts index ac4ba1ad..d1e5db9d 100644 --- a/javascript-client/api/show-rebroadcasts-api.ts +++ b/javascript-client/api/show-rebroadcasts-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedShowRebroadcast } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const ShowRebroadcastsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showRebroadcastsCreate: async (showRebroadcast: ShowRebroadcast, options: AxiosRequestConfig = {}): Promise => { + showRebroadcastsCreate: async (showRebroadcast: ShowRebroadcast, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'showRebroadcast' is not null or undefined assertParamExists('showRebroadcastsCreate', 'showRebroadcast', showRebroadcast) const localVarPath = `/api/v2/show-rebroadcasts`; @@ -78,7 +78,7 @@ export const ShowRebroadcastsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showRebroadcastsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + showRebroadcastsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showRebroadcastsDestroy', 'id', id) const localVarPath = `/api/v2/show-rebroadcasts/{id}` @@ -116,7 +116,7 @@ export const ShowRebroadcastsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showRebroadcastsList: async (options: AxiosRequestConfig = {}): Promise => { + showRebroadcastsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/show-rebroadcasts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const ShowRebroadcastsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showRebroadcastsPartialUpdate: async (id: number, patchedShowRebroadcast?: PatchedShowRebroadcast, options: AxiosRequestConfig = {}): Promise => { + showRebroadcastsPartialUpdate: async (id: number, patchedShowRebroadcast?: PatchedShowRebroadcast, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showRebroadcastsPartialUpdate', 'id', id) const localVarPath = `/api/v2/show-rebroadcasts/{id}` @@ -195,7 +195,7 @@ export const ShowRebroadcastsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showRebroadcastsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + showRebroadcastsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showRebroadcastsRetrieve', 'id', id) const localVarPath = `/api/v2/show-rebroadcasts/{id}` @@ -235,7 +235,7 @@ export const ShowRebroadcastsApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showRebroadcastsUpdate: async (id: number, showRebroadcast: ShowRebroadcast, options: AxiosRequestConfig = {}): Promise => { + showRebroadcastsUpdate: async (id: number, showRebroadcast: ShowRebroadcast, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showRebroadcastsUpdate', 'id', id) // verify required parameter 'showRebroadcast' is not null or undefined @@ -289,9 +289,11 @@ export const ShowRebroadcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showRebroadcastsCreate(showRebroadcast: ShowRebroadcast, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showRebroadcastsCreate(showRebroadcast: ShowRebroadcast, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showRebroadcastsCreate(showRebroadcast, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowRebroadcastsApi.showRebroadcastsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const ShowRebroadcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showRebroadcastsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showRebroadcastsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showRebroadcastsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowRebroadcastsApi.showRebroadcastsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showRebroadcastsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async showRebroadcastsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.showRebroadcastsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowRebroadcastsApi.showRebroadcastsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const ShowRebroadcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showRebroadcastsPartialUpdate(id: number, patchedShowRebroadcast?: PatchedShowRebroadcast, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showRebroadcastsPartialUpdate(id: number, patchedShowRebroadcast?: PatchedShowRebroadcast, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showRebroadcastsPartialUpdate(id, patchedShowRebroadcast, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowRebroadcastsApi.showRebroadcastsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const ShowRebroadcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showRebroadcastsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showRebroadcastsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showRebroadcastsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowRebroadcastsApi.showRebroadcastsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const ShowRebroadcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showRebroadcastsUpdate(id: number, showRebroadcast: ShowRebroadcast, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showRebroadcastsUpdate(id: number, showRebroadcast: ShowRebroadcast, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showRebroadcastsUpdate(id, showRebroadcast, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowRebroadcastsApi.showRebroadcastsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class ShowRebroadcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowRebroadcastsApi */ - public showRebroadcastsCreate(showRebroadcast: ShowRebroadcast, options?: AxiosRequestConfig) { + public showRebroadcastsCreate(showRebroadcast: ShowRebroadcast, options?: RawAxiosRequestConfig) { return ShowRebroadcastsApiFp(this.configuration).showRebroadcastsCreate(showRebroadcast, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class ShowRebroadcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowRebroadcastsApi */ - public showRebroadcastsDestroy(id: number, options?: AxiosRequestConfig) { + public showRebroadcastsDestroy(id: number, options?: RawAxiosRequestConfig) { return ShowRebroadcastsApiFp(this.configuration).showRebroadcastsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class ShowRebroadcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowRebroadcastsApi */ - public showRebroadcastsList(options?: AxiosRequestConfig) { + public showRebroadcastsList(options?: RawAxiosRequestConfig) { return ShowRebroadcastsApiFp(this.configuration).showRebroadcastsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class ShowRebroadcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowRebroadcastsApi */ - public showRebroadcastsPartialUpdate(id: number, patchedShowRebroadcast?: PatchedShowRebroadcast, options?: AxiosRequestConfig) { + public showRebroadcastsPartialUpdate(id: number, patchedShowRebroadcast?: PatchedShowRebroadcast, options?: RawAxiosRequestConfig) { return ShowRebroadcastsApiFp(this.configuration).showRebroadcastsPartialUpdate(id, patchedShowRebroadcast, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class ShowRebroadcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowRebroadcastsApi */ - public showRebroadcastsRetrieve(id: number, options?: AxiosRequestConfig) { + public showRebroadcastsRetrieve(id: number, options?: RawAxiosRequestConfig) { return ShowRebroadcastsApiFp(this.configuration).showRebroadcastsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class ShowRebroadcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowRebroadcastsApi */ - public showRebroadcastsUpdate(id: number, showRebroadcast: ShowRebroadcast, options?: AxiosRequestConfig) { + public showRebroadcastsUpdate(id: number, showRebroadcast: ShowRebroadcast, options?: RawAxiosRequestConfig) { return ShowRebroadcastsApiFp(this.configuration).showRebroadcastsUpdate(id, showRebroadcast, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/shows-api.ts b/javascript-client/api/shows-api.ts index a93b73b8..8bfc0743 100644 --- a/javascript-client/api/shows-api.ts +++ b/javascript-client/api/shows-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedShow } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const ShowsApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showsCreate: async (show: Show, options: AxiosRequestConfig = {}): Promise => { + showsCreate: async (show: Show, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'show' is not null or undefined assertParamExists('showsCreate', 'show', show) const localVarPath = `/api/v2/shows`; @@ -78,7 +78,7 @@ export const ShowsApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + showsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showsDestroy', 'id', id) const localVarPath = `/api/v2/shows/{id}` @@ -116,7 +116,7 @@ export const ShowsApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showsList: async (options: AxiosRequestConfig = {}): Promise => { + showsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/shows`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const ShowsApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showsPartialUpdate: async (id: number, patchedShow?: PatchedShow, options: AxiosRequestConfig = {}): Promise => { + showsPartialUpdate: async (id: number, patchedShow?: PatchedShow, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showsPartialUpdate', 'id', id) const localVarPath = `/api/v2/shows/{id}` @@ -195,7 +195,7 @@ export const ShowsApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + showsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showsRetrieve', 'id', id) const localVarPath = `/api/v2/shows/{id}` @@ -235,7 +235,7 @@ export const ShowsApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - showsUpdate: async (id: number, show: Show, options: AxiosRequestConfig = {}): Promise => { + showsUpdate: async (id: number, show: Show, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('showsUpdate', 'id', id) // verify required parameter 'show' is not null or undefined @@ -289,9 +289,11 @@ export const ShowsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showsCreate(show: Show, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showsCreate(show: Show, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showsCreate(show, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowsApi.showsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const ShowsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowsApi.showsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async showsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.showsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowsApi.showsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const ShowsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showsPartialUpdate(id: number, patchedShow?: PatchedShow, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showsPartialUpdate(id: number, patchedShow?: PatchedShow, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showsPartialUpdate(id, patchedShow, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowsApi.showsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const ShowsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowsApi.showsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const ShowsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async showsUpdate(id: number, show: Show, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async showsUpdate(id: number, show: Show, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.showsUpdate(id, show, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ShowsApi.showsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class ShowsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowsApi */ - public showsCreate(show: Show, options?: AxiosRequestConfig) { + public showsCreate(show: Show, options?: RawAxiosRequestConfig) { return ShowsApiFp(this.configuration).showsCreate(show, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class ShowsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowsApi */ - public showsDestroy(id: number, options?: AxiosRequestConfig) { + public showsDestroy(id: number, options?: RawAxiosRequestConfig) { return ShowsApiFp(this.configuration).showsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class ShowsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowsApi */ - public showsList(options?: AxiosRequestConfig) { + public showsList(options?: RawAxiosRequestConfig) { return ShowsApiFp(this.configuration).showsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class ShowsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowsApi */ - public showsPartialUpdate(id: number, patchedShow?: PatchedShow, options?: AxiosRequestConfig) { + public showsPartialUpdate(id: number, patchedShow?: PatchedShow, options?: RawAxiosRequestConfig) { return ShowsApiFp(this.configuration).showsPartialUpdate(id, patchedShow, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class ShowsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowsApi */ - public showsRetrieve(id: number, options?: AxiosRequestConfig) { + public showsRetrieve(id: number, options?: RawAxiosRequestConfig) { return ShowsApiFp(this.configuration).showsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class ShowsApi extends BaseAPI { * @throws {RequiredError} * @memberof ShowsApi */ - public showsUpdate(id: number, show: Show, options?: AxiosRequestConfig) { + public showsUpdate(id: number, show: Show, options?: RawAxiosRequestConfig) { return ShowsApiFp(this.configuration).showsUpdate(id, show, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/smart-block-contents-api.ts b/javascript-client/api/smart-block-contents-api.ts index 258f8c40..dd2decb0 100644 --- a/javascript-client/api/smart-block-contents-api.ts +++ b/javascript-client/api/smart-block-contents-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedSmartBlockContent } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const SmartBlockContentsApiAxiosParamCreator = function (configuration?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlockContentsCreate: async (smartBlockContent: SmartBlockContent, options: AxiosRequestConfig = {}): Promise => { + smartBlockContentsCreate: async (smartBlockContent: SmartBlockContent, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'smartBlockContent' is not null or undefined assertParamExists('smartBlockContentsCreate', 'smartBlockContent', smartBlockContent) const localVarPath = `/api/v2/smart-block-contents`; @@ -78,7 +78,7 @@ export const SmartBlockContentsApiAxiosParamCreator = function (configuration?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlockContentsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + smartBlockContentsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('smartBlockContentsDestroy', 'id', id) const localVarPath = `/api/v2/smart-block-contents/{id}` @@ -116,7 +116,7 @@ export const SmartBlockContentsApiAxiosParamCreator = function (configuration?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlockContentsList: async (options: AxiosRequestConfig = {}): Promise => { + smartBlockContentsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/smart-block-contents`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const SmartBlockContentsApiAxiosParamCreator = function (configuration?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlockContentsPartialUpdate: async (id: number, patchedSmartBlockContent?: PatchedSmartBlockContent, options: AxiosRequestConfig = {}): Promise => { + smartBlockContentsPartialUpdate: async (id: number, patchedSmartBlockContent?: PatchedSmartBlockContent, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('smartBlockContentsPartialUpdate', 'id', id) const localVarPath = `/api/v2/smart-block-contents/{id}` @@ -195,7 +195,7 @@ export const SmartBlockContentsApiAxiosParamCreator = function (configuration?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlockContentsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + smartBlockContentsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('smartBlockContentsRetrieve', 'id', id) const localVarPath = `/api/v2/smart-block-contents/{id}` @@ -235,7 +235,7 @@ export const SmartBlockContentsApiAxiosParamCreator = function (configuration?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlockContentsUpdate: async (id: number, smartBlockContent: SmartBlockContent, options: AxiosRequestConfig = {}): Promise => { + smartBlockContentsUpdate: async (id: number, smartBlockContent: SmartBlockContent, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('smartBlockContentsUpdate', 'id', id) // verify required parameter 'smartBlockContent' is not null or undefined @@ -289,9 +289,11 @@ export const SmartBlockContentsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlockContentsCreate(smartBlockContent: SmartBlockContent, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlockContentsCreate(smartBlockContent: SmartBlockContent, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlockContentsCreate(smartBlockContent, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlockContentsApi.smartBlockContentsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const SmartBlockContentsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlockContentsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlockContentsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlockContentsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlockContentsApi.smartBlockContentsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlockContentsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async smartBlockContentsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlockContentsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlockContentsApi.smartBlockContentsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const SmartBlockContentsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlockContentsPartialUpdate(id: number, patchedSmartBlockContent?: PatchedSmartBlockContent, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlockContentsPartialUpdate(id: number, patchedSmartBlockContent?: PatchedSmartBlockContent, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlockContentsPartialUpdate(id, patchedSmartBlockContent, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlockContentsApi.smartBlockContentsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const SmartBlockContentsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlockContentsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlockContentsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlockContentsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlockContentsApi.smartBlockContentsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const SmartBlockContentsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlockContentsUpdate(id: number, smartBlockContent: SmartBlockContent, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlockContentsUpdate(id: number, smartBlockContent: SmartBlockContent, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlockContentsUpdate(id, smartBlockContent, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlockContentsApi.smartBlockContentsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class SmartBlockContentsApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlockContentsApi */ - public smartBlockContentsCreate(smartBlockContent: SmartBlockContent, options?: AxiosRequestConfig) { + public smartBlockContentsCreate(smartBlockContent: SmartBlockContent, options?: RawAxiosRequestConfig) { return SmartBlockContentsApiFp(this.configuration).smartBlockContentsCreate(smartBlockContent, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class SmartBlockContentsApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlockContentsApi */ - public smartBlockContentsDestroy(id: number, options?: AxiosRequestConfig) { + public smartBlockContentsDestroy(id: number, options?: RawAxiosRequestConfig) { return SmartBlockContentsApiFp(this.configuration).smartBlockContentsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class SmartBlockContentsApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlockContentsApi */ - public smartBlockContentsList(options?: AxiosRequestConfig) { + public smartBlockContentsList(options?: RawAxiosRequestConfig) { return SmartBlockContentsApiFp(this.configuration).smartBlockContentsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class SmartBlockContentsApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlockContentsApi */ - public smartBlockContentsPartialUpdate(id: number, patchedSmartBlockContent?: PatchedSmartBlockContent, options?: AxiosRequestConfig) { + public smartBlockContentsPartialUpdate(id: number, patchedSmartBlockContent?: PatchedSmartBlockContent, options?: RawAxiosRequestConfig) { return SmartBlockContentsApiFp(this.configuration).smartBlockContentsPartialUpdate(id, patchedSmartBlockContent, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class SmartBlockContentsApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlockContentsApi */ - public smartBlockContentsRetrieve(id: number, options?: AxiosRequestConfig) { + public smartBlockContentsRetrieve(id: number, options?: RawAxiosRequestConfig) { return SmartBlockContentsApiFp(this.configuration).smartBlockContentsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class SmartBlockContentsApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlockContentsApi */ - public smartBlockContentsUpdate(id: number, smartBlockContent: SmartBlockContent, options?: AxiosRequestConfig) { + public smartBlockContentsUpdate(id: number, smartBlockContent: SmartBlockContent, options?: RawAxiosRequestConfig) { return SmartBlockContentsApiFp(this.configuration).smartBlockContentsUpdate(id, smartBlockContent, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/smart-block-criteria-api.ts b/javascript-client/api/smart-block-criteria-api.ts index a3b3659a..2ab7380a 100644 --- a/javascript-client/api/smart-block-criteria-api.ts +++ b/javascript-client/api/smart-block-criteria-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedSmartBlockCriteria } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const SmartBlockCriteriaApiAxiosParamCreator = function (configuration?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlockCriteriaCreate: async (smartBlockCriteria: SmartBlockCriteria, options: AxiosRequestConfig = {}): Promise => { + smartBlockCriteriaCreate: async (smartBlockCriteria: SmartBlockCriteria, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'smartBlockCriteria' is not null or undefined assertParamExists('smartBlockCriteriaCreate', 'smartBlockCriteria', smartBlockCriteria) const localVarPath = `/api/v2/smart-block-criteria`; @@ -78,7 +78,7 @@ export const SmartBlockCriteriaApiAxiosParamCreator = function (configuration?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlockCriteriaDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + smartBlockCriteriaDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('smartBlockCriteriaDestroy', 'id', id) const localVarPath = `/api/v2/smart-block-criteria/{id}` @@ -116,7 +116,7 @@ export const SmartBlockCriteriaApiAxiosParamCreator = function (configuration?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlockCriteriaList: async (options: AxiosRequestConfig = {}): Promise => { + smartBlockCriteriaList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/smart-block-criteria`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const SmartBlockCriteriaApiAxiosParamCreator = function (configuration?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlockCriteriaPartialUpdate: async (id: number, patchedSmartBlockCriteria?: PatchedSmartBlockCriteria, options: AxiosRequestConfig = {}): Promise => { + smartBlockCriteriaPartialUpdate: async (id: number, patchedSmartBlockCriteria?: PatchedSmartBlockCriteria, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('smartBlockCriteriaPartialUpdate', 'id', id) const localVarPath = `/api/v2/smart-block-criteria/{id}` @@ -195,7 +195,7 @@ export const SmartBlockCriteriaApiAxiosParamCreator = function (configuration?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlockCriteriaRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + smartBlockCriteriaRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('smartBlockCriteriaRetrieve', 'id', id) const localVarPath = `/api/v2/smart-block-criteria/{id}` @@ -235,7 +235,7 @@ export const SmartBlockCriteriaApiAxiosParamCreator = function (configuration?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlockCriteriaUpdate: async (id: number, smartBlockCriteria: SmartBlockCriteria, options: AxiosRequestConfig = {}): Promise => { + smartBlockCriteriaUpdate: async (id: number, smartBlockCriteria: SmartBlockCriteria, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('smartBlockCriteriaUpdate', 'id', id) // verify required parameter 'smartBlockCriteria' is not null or undefined @@ -289,9 +289,11 @@ export const SmartBlockCriteriaApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlockCriteriaCreate(smartBlockCriteria: SmartBlockCriteria, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlockCriteriaCreate(smartBlockCriteria: SmartBlockCriteria, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlockCriteriaCreate(smartBlockCriteria, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlockCriteriaApi.smartBlockCriteriaCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const SmartBlockCriteriaApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlockCriteriaDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlockCriteriaDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlockCriteriaDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlockCriteriaApi.smartBlockCriteriaDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlockCriteriaList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async smartBlockCriteriaList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlockCriteriaList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlockCriteriaApi.smartBlockCriteriaList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const SmartBlockCriteriaApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlockCriteriaPartialUpdate(id: number, patchedSmartBlockCriteria?: PatchedSmartBlockCriteria, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlockCriteriaPartialUpdate(id: number, patchedSmartBlockCriteria?: PatchedSmartBlockCriteria, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlockCriteriaPartialUpdate(id, patchedSmartBlockCriteria, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlockCriteriaApi.smartBlockCriteriaPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const SmartBlockCriteriaApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlockCriteriaRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlockCriteriaRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlockCriteriaRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlockCriteriaApi.smartBlockCriteriaRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const SmartBlockCriteriaApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlockCriteriaUpdate(id: number, smartBlockCriteria: SmartBlockCriteria, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlockCriteriaUpdate(id: number, smartBlockCriteria: SmartBlockCriteria, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlockCriteriaUpdate(id, smartBlockCriteria, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlockCriteriaApi.smartBlockCriteriaUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class SmartBlockCriteriaApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlockCriteriaApi */ - public smartBlockCriteriaCreate(smartBlockCriteria: SmartBlockCriteria, options?: AxiosRequestConfig) { + public smartBlockCriteriaCreate(smartBlockCriteria: SmartBlockCriteria, options?: RawAxiosRequestConfig) { return SmartBlockCriteriaApiFp(this.configuration).smartBlockCriteriaCreate(smartBlockCriteria, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class SmartBlockCriteriaApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlockCriteriaApi */ - public smartBlockCriteriaDestroy(id: number, options?: AxiosRequestConfig) { + public smartBlockCriteriaDestroy(id: number, options?: RawAxiosRequestConfig) { return SmartBlockCriteriaApiFp(this.configuration).smartBlockCriteriaDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class SmartBlockCriteriaApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlockCriteriaApi */ - public smartBlockCriteriaList(options?: AxiosRequestConfig) { + public smartBlockCriteriaList(options?: RawAxiosRequestConfig) { return SmartBlockCriteriaApiFp(this.configuration).smartBlockCriteriaList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class SmartBlockCriteriaApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlockCriteriaApi */ - public smartBlockCriteriaPartialUpdate(id: number, patchedSmartBlockCriteria?: PatchedSmartBlockCriteria, options?: AxiosRequestConfig) { + public smartBlockCriteriaPartialUpdate(id: number, patchedSmartBlockCriteria?: PatchedSmartBlockCriteria, options?: RawAxiosRequestConfig) { return SmartBlockCriteriaApiFp(this.configuration).smartBlockCriteriaPartialUpdate(id, patchedSmartBlockCriteria, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class SmartBlockCriteriaApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlockCriteriaApi */ - public smartBlockCriteriaRetrieve(id: number, options?: AxiosRequestConfig) { + public smartBlockCriteriaRetrieve(id: number, options?: RawAxiosRequestConfig) { return SmartBlockCriteriaApiFp(this.configuration).smartBlockCriteriaRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class SmartBlockCriteriaApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlockCriteriaApi */ - public smartBlockCriteriaUpdate(id: number, smartBlockCriteria: SmartBlockCriteria, options?: AxiosRequestConfig) { + public smartBlockCriteriaUpdate(id: number, smartBlockCriteria: SmartBlockCriteria, options?: RawAxiosRequestConfig) { return SmartBlockCriteriaApiFp(this.configuration).smartBlockCriteriaUpdate(id, smartBlockCriteria, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/smart-blocks-api.ts b/javascript-client/api/smart-blocks-api.ts index e8a1d8d4..9bbb5cf6 100644 --- a/javascript-client/api/smart-blocks-api.ts +++ b/javascript-client/api/smart-blocks-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedSmartBlock } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const SmartBlocksApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlocksCreate: async (smartBlock: SmartBlock, options: AxiosRequestConfig = {}): Promise => { + smartBlocksCreate: async (smartBlock: SmartBlock, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'smartBlock' is not null or undefined assertParamExists('smartBlocksCreate', 'smartBlock', smartBlock) const localVarPath = `/api/v2/smart-blocks`; @@ -78,7 +78,7 @@ export const SmartBlocksApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlocksDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + smartBlocksDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('smartBlocksDestroy', 'id', id) const localVarPath = `/api/v2/smart-blocks/{id}` @@ -116,7 +116,7 @@ export const SmartBlocksApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlocksList: async (options: AxiosRequestConfig = {}): Promise => { + smartBlocksList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/smart-blocks`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const SmartBlocksApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlocksPartialUpdate: async (id: number, patchedSmartBlock?: PatchedSmartBlock, options: AxiosRequestConfig = {}): Promise => { + smartBlocksPartialUpdate: async (id: number, patchedSmartBlock?: PatchedSmartBlock, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('smartBlocksPartialUpdate', 'id', id) const localVarPath = `/api/v2/smart-blocks/{id}` @@ -195,7 +195,7 @@ export const SmartBlocksApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlocksRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + smartBlocksRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('smartBlocksRetrieve', 'id', id) const localVarPath = `/api/v2/smart-blocks/{id}` @@ -235,7 +235,7 @@ export const SmartBlocksApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - smartBlocksUpdate: async (id: number, smartBlock: SmartBlock, options: AxiosRequestConfig = {}): Promise => { + smartBlocksUpdate: async (id: number, smartBlock: SmartBlock, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('smartBlocksUpdate', 'id', id) // verify required parameter 'smartBlock' is not null or undefined @@ -289,9 +289,11 @@ export const SmartBlocksApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlocksCreate(smartBlock: SmartBlock, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlocksCreate(smartBlock: SmartBlock, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlocksCreate(smartBlock, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlocksApi.smartBlocksCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const SmartBlocksApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlocksDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlocksDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlocksDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlocksApi.smartBlocksDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlocksList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async smartBlocksList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlocksList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlocksApi.smartBlocksList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const SmartBlocksApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlocksPartialUpdate(id: number, patchedSmartBlock?: PatchedSmartBlock, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlocksPartialUpdate(id: number, patchedSmartBlock?: PatchedSmartBlock, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlocksPartialUpdate(id, patchedSmartBlock, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlocksApi.smartBlocksPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const SmartBlocksApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlocksRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlocksRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlocksRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlocksApi.smartBlocksRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const SmartBlocksApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async smartBlocksUpdate(id: number, smartBlock: SmartBlock, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async smartBlocksUpdate(id: number, smartBlock: SmartBlock, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.smartBlocksUpdate(id, smartBlock, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['SmartBlocksApi.smartBlocksUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class SmartBlocksApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlocksApi */ - public smartBlocksCreate(smartBlock: SmartBlock, options?: AxiosRequestConfig) { + public smartBlocksCreate(smartBlock: SmartBlock, options?: RawAxiosRequestConfig) { return SmartBlocksApiFp(this.configuration).smartBlocksCreate(smartBlock, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class SmartBlocksApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlocksApi */ - public smartBlocksDestroy(id: number, options?: AxiosRequestConfig) { + public smartBlocksDestroy(id: number, options?: RawAxiosRequestConfig) { return SmartBlocksApiFp(this.configuration).smartBlocksDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class SmartBlocksApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlocksApi */ - public smartBlocksList(options?: AxiosRequestConfig) { + public smartBlocksList(options?: RawAxiosRequestConfig) { return SmartBlocksApiFp(this.configuration).smartBlocksList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class SmartBlocksApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlocksApi */ - public smartBlocksPartialUpdate(id: number, patchedSmartBlock?: PatchedSmartBlock, options?: AxiosRequestConfig) { + public smartBlocksPartialUpdate(id: number, patchedSmartBlock?: PatchedSmartBlock, options?: RawAxiosRequestConfig) { return SmartBlocksApiFp(this.configuration).smartBlocksPartialUpdate(id, patchedSmartBlock, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class SmartBlocksApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlocksApi */ - public smartBlocksRetrieve(id: number, options?: AxiosRequestConfig) { + public smartBlocksRetrieve(id: number, options?: RawAxiosRequestConfig) { return SmartBlocksApiFp(this.configuration).smartBlocksRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class SmartBlocksApi extends BaseAPI { * @throws {RequiredError} * @memberof SmartBlocksApi */ - public smartBlocksUpdate(id: number, smartBlock: SmartBlock, options?: AxiosRequestConfig) { + public smartBlocksUpdate(id: number, smartBlock: SmartBlock, options?: RawAxiosRequestConfig) { return SmartBlocksApiFp(this.configuration).smartBlocksUpdate(id, smartBlock, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/station-podcasts-api.ts b/javascript-client/api/station-podcasts-api.ts index 329f9c69..0aae7753 100644 --- a/javascript-client/api/station-podcasts-api.ts +++ b/javascript-client/api/station-podcasts-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedStationPodcast } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const StationPodcastsApiAxiosParamCreator = function (configuration?: Con * @param {*} [options] Override http request option. * @throws {RequiredError} */ - stationPodcastsCreate: async (stationPodcast: StationPodcast, options: AxiosRequestConfig = {}): Promise => { + stationPodcastsCreate: async (stationPodcast: StationPodcast, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'stationPodcast' is not null or undefined assertParamExists('stationPodcastsCreate', 'stationPodcast', stationPodcast) const localVarPath = `/api/v2/station-podcasts`; @@ -78,7 +78,7 @@ export const StationPodcastsApiAxiosParamCreator = function (configuration?: Con * @param {*} [options] Override http request option. * @throws {RequiredError} */ - stationPodcastsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + stationPodcastsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('stationPodcastsDestroy', 'id', id) const localVarPath = `/api/v2/station-podcasts/{id}` @@ -116,7 +116,7 @@ export const StationPodcastsApiAxiosParamCreator = function (configuration?: Con * @param {*} [options] Override http request option. * @throws {RequiredError} */ - stationPodcastsList: async (options: AxiosRequestConfig = {}): Promise => { + stationPodcastsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/station-podcasts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const StationPodcastsApiAxiosParamCreator = function (configuration?: Con * @param {*} [options] Override http request option. * @throws {RequiredError} */ - stationPodcastsPartialUpdate: async (id: number, patchedStationPodcast?: PatchedStationPodcast, options: AxiosRequestConfig = {}): Promise => { + stationPodcastsPartialUpdate: async (id: number, patchedStationPodcast?: PatchedStationPodcast, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('stationPodcastsPartialUpdate', 'id', id) const localVarPath = `/api/v2/station-podcasts/{id}` @@ -195,7 +195,7 @@ export const StationPodcastsApiAxiosParamCreator = function (configuration?: Con * @param {*} [options] Override http request option. * @throws {RequiredError} */ - stationPodcastsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + stationPodcastsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('stationPodcastsRetrieve', 'id', id) const localVarPath = `/api/v2/station-podcasts/{id}` @@ -235,7 +235,7 @@ export const StationPodcastsApiAxiosParamCreator = function (configuration?: Con * @param {*} [options] Override http request option. * @throws {RequiredError} */ - stationPodcastsUpdate: async (id: number, stationPodcast: StationPodcast, options: AxiosRequestConfig = {}): Promise => { + stationPodcastsUpdate: async (id: number, stationPodcast: StationPodcast, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('stationPodcastsUpdate', 'id', id) // verify required parameter 'stationPodcast' is not null or undefined @@ -289,9 +289,11 @@ export const StationPodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async stationPodcastsCreate(stationPodcast: StationPodcast, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async stationPodcastsCreate(stationPodcast: StationPodcast, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.stationPodcastsCreate(stationPodcast, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['StationPodcastsApi.stationPodcastsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const StationPodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async stationPodcastsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async stationPodcastsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.stationPodcastsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['StationPodcastsApi.stationPodcastsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async stationPodcastsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async stationPodcastsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.stationPodcastsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['StationPodcastsApi.stationPodcastsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const StationPodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async stationPodcastsPartialUpdate(id: number, patchedStationPodcast?: PatchedStationPodcast, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async stationPodcastsPartialUpdate(id: number, patchedStationPodcast?: PatchedStationPodcast, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.stationPodcastsPartialUpdate(id, patchedStationPodcast, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['StationPodcastsApi.stationPodcastsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const StationPodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async stationPodcastsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async stationPodcastsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.stationPodcastsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['StationPodcastsApi.stationPodcastsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const StationPodcastsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async stationPodcastsUpdate(id: number, stationPodcast: StationPodcast, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async stationPodcastsUpdate(id: number, stationPodcast: StationPodcast, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.stationPodcastsUpdate(id, stationPodcast, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['StationPodcastsApi.stationPodcastsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class StationPodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof StationPodcastsApi */ - public stationPodcastsCreate(stationPodcast: StationPodcast, options?: AxiosRequestConfig) { + public stationPodcastsCreate(stationPodcast: StationPodcast, options?: RawAxiosRequestConfig) { return StationPodcastsApiFp(this.configuration).stationPodcastsCreate(stationPodcast, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class StationPodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof StationPodcastsApi */ - public stationPodcastsDestroy(id: number, options?: AxiosRequestConfig) { + public stationPodcastsDestroy(id: number, options?: RawAxiosRequestConfig) { return StationPodcastsApiFp(this.configuration).stationPodcastsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class StationPodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof StationPodcastsApi */ - public stationPodcastsList(options?: AxiosRequestConfig) { + public stationPodcastsList(options?: RawAxiosRequestConfig) { return StationPodcastsApiFp(this.configuration).stationPodcastsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class StationPodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof StationPodcastsApi */ - public stationPodcastsPartialUpdate(id: number, patchedStationPodcast?: PatchedStationPodcast, options?: AxiosRequestConfig) { + public stationPodcastsPartialUpdate(id: number, patchedStationPodcast?: PatchedStationPodcast, options?: RawAxiosRequestConfig) { return StationPodcastsApiFp(this.configuration).stationPodcastsPartialUpdate(id, patchedStationPodcast, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class StationPodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof StationPodcastsApi */ - public stationPodcastsRetrieve(id: number, options?: AxiosRequestConfig) { + public stationPodcastsRetrieve(id: number, options?: RawAxiosRequestConfig) { return StationPodcastsApiFp(this.configuration).stationPodcastsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class StationPodcastsApi extends BaseAPI { * @throws {RequiredError} * @memberof StationPodcastsApi */ - public stationPodcastsUpdate(id: number, stationPodcast: StationPodcast, options?: AxiosRequestConfig) { + public stationPodcastsUpdate(id: number, stationPodcast: StationPodcast, options?: RawAxiosRequestConfig) { return StationPodcastsApiFp(this.configuration).stationPodcastsUpdate(id, stationPodcast, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/stream-api.ts b/javascript-client/api/stream-api.ts index 01a588e8..376380b1 100644 --- a/javascript-client/api/stream-api.ts +++ b/javascript-client/api/stream-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { StreamPreferences } from '../model'; // @ts-ignore @@ -36,7 +36,7 @@ export const StreamApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - streamPreferencesRetrieve: async (options: AxiosRequestConfig = {}): Promise => { + streamPreferencesRetrieve: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/stream/preferences`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -71,7 +71,7 @@ export const StreamApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - streamStateRetrieve: async (options: AxiosRequestConfig = {}): Promise => { + streamStateRetrieve: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/stream/state`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -116,18 +116,22 @@ export const StreamApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async streamPreferencesRetrieve(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async streamPreferencesRetrieve(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.streamPreferencesRetrieve(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['StreamApi.streamPreferencesRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async streamStateRetrieve(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async streamStateRetrieve(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.streamStateRetrieve(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['StreamApi.streamStateRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -171,7 +175,7 @@ export class StreamApi extends BaseAPI { * @throws {RequiredError} * @memberof StreamApi */ - public streamPreferencesRetrieve(options?: AxiosRequestConfig) { + public streamPreferencesRetrieve(options?: RawAxiosRequestConfig) { return StreamApiFp(this.configuration).streamPreferencesRetrieve(options).then((request) => request(this.axios, this.basePath)); } @@ -181,7 +185,7 @@ export class StreamApi extends BaseAPI { * @throws {RequiredError} * @memberof StreamApi */ - public streamStateRetrieve(options?: AxiosRequestConfig) { + public streamStateRetrieve(options?: RawAxiosRequestConfig) { return StreamApiFp(this.configuration).streamStateRetrieve(options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/third-party-track-references-api.ts b/javascript-client/api/third-party-track-references-api.ts index 9e0a44b2..2cab99e5 100644 --- a/javascript-client/api/third-party-track-references-api.ts +++ b/javascript-client/api/third-party-track-references-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedThirdPartyTrackReference } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const ThirdPartyTrackReferencesApiAxiosParamCreator = function (configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - thirdPartyTrackReferencesCreate: async (thirdPartyTrackReference: ThirdPartyTrackReference, options: AxiosRequestConfig = {}): Promise => { + thirdPartyTrackReferencesCreate: async (thirdPartyTrackReference: ThirdPartyTrackReference, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'thirdPartyTrackReference' is not null or undefined assertParamExists('thirdPartyTrackReferencesCreate', 'thirdPartyTrackReference', thirdPartyTrackReference) const localVarPath = `/api/v2/third-party-track-references`; @@ -78,7 +78,7 @@ export const ThirdPartyTrackReferencesApiAxiosParamCreator = function (configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - thirdPartyTrackReferencesDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + thirdPartyTrackReferencesDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('thirdPartyTrackReferencesDestroy', 'id', id) const localVarPath = `/api/v2/third-party-track-references/{id}` @@ -116,7 +116,7 @@ export const ThirdPartyTrackReferencesApiAxiosParamCreator = function (configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - thirdPartyTrackReferencesList: async (options: AxiosRequestConfig = {}): Promise => { + thirdPartyTrackReferencesList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/third-party-track-references`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const ThirdPartyTrackReferencesApiAxiosParamCreator = function (configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - thirdPartyTrackReferencesPartialUpdate: async (id: number, patchedThirdPartyTrackReference?: PatchedThirdPartyTrackReference, options: AxiosRequestConfig = {}): Promise => { + thirdPartyTrackReferencesPartialUpdate: async (id: number, patchedThirdPartyTrackReference?: PatchedThirdPartyTrackReference, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('thirdPartyTrackReferencesPartialUpdate', 'id', id) const localVarPath = `/api/v2/third-party-track-references/{id}` @@ -195,7 +195,7 @@ export const ThirdPartyTrackReferencesApiAxiosParamCreator = function (configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - thirdPartyTrackReferencesRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + thirdPartyTrackReferencesRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('thirdPartyTrackReferencesRetrieve', 'id', id) const localVarPath = `/api/v2/third-party-track-references/{id}` @@ -235,7 +235,7 @@ export const ThirdPartyTrackReferencesApiAxiosParamCreator = function (configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - thirdPartyTrackReferencesUpdate: async (id: number, thirdPartyTrackReference: ThirdPartyTrackReference, options: AxiosRequestConfig = {}): Promise => { + thirdPartyTrackReferencesUpdate: async (id: number, thirdPartyTrackReference: ThirdPartyTrackReference, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('thirdPartyTrackReferencesUpdate', 'id', id) // verify required parameter 'thirdPartyTrackReference' is not null or undefined @@ -289,9 +289,11 @@ export const ThirdPartyTrackReferencesApiFp = function(configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async thirdPartyTrackReferencesCreate(thirdPartyTrackReference: ThirdPartyTrackReference, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async thirdPartyTrackReferencesCreate(thirdPartyTrackReference: ThirdPartyTrackReference, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.thirdPartyTrackReferencesCreate(thirdPartyTrackReference, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ThirdPartyTrackReferencesApi.thirdPartyTrackReferencesCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const ThirdPartyTrackReferencesApiFp = function(configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async thirdPartyTrackReferencesDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async thirdPartyTrackReferencesDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.thirdPartyTrackReferencesDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ThirdPartyTrackReferencesApi.thirdPartyTrackReferencesDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async thirdPartyTrackReferencesList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async thirdPartyTrackReferencesList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.thirdPartyTrackReferencesList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ThirdPartyTrackReferencesApi.thirdPartyTrackReferencesList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const ThirdPartyTrackReferencesApiFp = function(configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async thirdPartyTrackReferencesPartialUpdate(id: number, patchedThirdPartyTrackReference?: PatchedThirdPartyTrackReference, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async thirdPartyTrackReferencesPartialUpdate(id: number, patchedThirdPartyTrackReference?: PatchedThirdPartyTrackReference, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.thirdPartyTrackReferencesPartialUpdate(id, patchedThirdPartyTrackReference, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ThirdPartyTrackReferencesApi.thirdPartyTrackReferencesPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const ThirdPartyTrackReferencesApiFp = function(configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async thirdPartyTrackReferencesRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async thirdPartyTrackReferencesRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.thirdPartyTrackReferencesRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ThirdPartyTrackReferencesApi.thirdPartyTrackReferencesRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const ThirdPartyTrackReferencesApiFp = function(configuration?: Configura * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async thirdPartyTrackReferencesUpdate(id: number, thirdPartyTrackReference: ThirdPartyTrackReference, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async thirdPartyTrackReferencesUpdate(id: number, thirdPartyTrackReference: ThirdPartyTrackReference, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.thirdPartyTrackReferencesUpdate(id, thirdPartyTrackReference, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ThirdPartyTrackReferencesApi.thirdPartyTrackReferencesUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class ThirdPartyTrackReferencesApi extends BaseAPI { * @throws {RequiredError} * @memberof ThirdPartyTrackReferencesApi */ - public thirdPartyTrackReferencesCreate(thirdPartyTrackReference: ThirdPartyTrackReference, options?: AxiosRequestConfig) { + public thirdPartyTrackReferencesCreate(thirdPartyTrackReference: ThirdPartyTrackReference, options?: RawAxiosRequestConfig) { return ThirdPartyTrackReferencesApiFp(this.configuration).thirdPartyTrackReferencesCreate(thirdPartyTrackReference, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class ThirdPartyTrackReferencesApi extends BaseAPI { * @throws {RequiredError} * @memberof ThirdPartyTrackReferencesApi */ - public thirdPartyTrackReferencesDestroy(id: number, options?: AxiosRequestConfig) { + public thirdPartyTrackReferencesDestroy(id: number, options?: RawAxiosRequestConfig) { return ThirdPartyTrackReferencesApiFp(this.configuration).thirdPartyTrackReferencesDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class ThirdPartyTrackReferencesApi extends BaseAPI { * @throws {RequiredError} * @memberof ThirdPartyTrackReferencesApi */ - public thirdPartyTrackReferencesList(options?: AxiosRequestConfig) { + public thirdPartyTrackReferencesList(options?: RawAxiosRequestConfig) { return ThirdPartyTrackReferencesApiFp(this.configuration).thirdPartyTrackReferencesList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class ThirdPartyTrackReferencesApi extends BaseAPI { * @throws {RequiredError} * @memberof ThirdPartyTrackReferencesApi */ - public thirdPartyTrackReferencesPartialUpdate(id: number, patchedThirdPartyTrackReference?: PatchedThirdPartyTrackReference, options?: AxiosRequestConfig) { + public thirdPartyTrackReferencesPartialUpdate(id: number, patchedThirdPartyTrackReference?: PatchedThirdPartyTrackReference, options?: RawAxiosRequestConfig) { return ThirdPartyTrackReferencesApiFp(this.configuration).thirdPartyTrackReferencesPartialUpdate(id, patchedThirdPartyTrackReference, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class ThirdPartyTrackReferencesApi extends BaseAPI { * @throws {RequiredError} * @memberof ThirdPartyTrackReferencesApi */ - public thirdPartyTrackReferencesRetrieve(id: number, options?: AxiosRequestConfig) { + public thirdPartyTrackReferencesRetrieve(id: number, options?: RawAxiosRequestConfig) { return ThirdPartyTrackReferencesApiFp(this.configuration).thirdPartyTrackReferencesRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class ThirdPartyTrackReferencesApi extends BaseAPI { * @throws {RequiredError} * @memberof ThirdPartyTrackReferencesApi */ - public thirdPartyTrackReferencesUpdate(id: number, thirdPartyTrackReference: ThirdPartyTrackReference, options?: AxiosRequestConfig) { + public thirdPartyTrackReferencesUpdate(id: number, thirdPartyTrackReference: ThirdPartyTrackReference, options?: RawAxiosRequestConfig) { return ThirdPartyTrackReferencesApiFp(this.configuration).thirdPartyTrackReferencesUpdate(id, thirdPartyTrackReference, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/timestamps-api.ts b/javascript-client/api/timestamps-api.ts index fe55d8af..5a8eede9 100644 --- a/javascript-client/api/timestamps-api.ts +++ b/javascript-client/api/timestamps-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedTimestamp } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const TimestampsApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - timestampsCreate: async (timestamp: Timestamp, options: AxiosRequestConfig = {}): Promise => { + timestampsCreate: async (timestamp: Timestamp, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'timestamp' is not null or undefined assertParamExists('timestampsCreate', 'timestamp', timestamp) const localVarPath = `/api/v2/timestamps`; @@ -78,7 +78,7 @@ export const TimestampsApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - timestampsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + timestampsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('timestampsDestroy', 'id', id) const localVarPath = `/api/v2/timestamps/{id}` @@ -116,7 +116,7 @@ export const TimestampsApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - timestampsList: async (options: AxiosRequestConfig = {}): Promise => { + timestampsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/timestamps`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const TimestampsApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - timestampsPartialUpdate: async (id: number, patchedTimestamp?: PatchedTimestamp, options: AxiosRequestConfig = {}): Promise => { + timestampsPartialUpdate: async (id: number, patchedTimestamp?: PatchedTimestamp, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('timestampsPartialUpdate', 'id', id) const localVarPath = `/api/v2/timestamps/{id}` @@ -195,7 +195,7 @@ export const TimestampsApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - timestampsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + timestampsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('timestampsRetrieve', 'id', id) const localVarPath = `/api/v2/timestamps/{id}` @@ -235,7 +235,7 @@ export const TimestampsApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - timestampsUpdate: async (id: number, timestamp: Timestamp, options: AxiosRequestConfig = {}): Promise => { + timestampsUpdate: async (id: number, timestamp: Timestamp, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('timestampsUpdate', 'id', id) // verify required parameter 'timestamp' is not null or undefined @@ -289,9 +289,11 @@ export const TimestampsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async timestampsCreate(timestamp: Timestamp, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async timestampsCreate(timestamp: Timestamp, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.timestampsCreate(timestamp, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TimestampsApi.timestampsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const TimestampsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async timestampsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async timestampsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.timestampsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TimestampsApi.timestampsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async timestampsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async timestampsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.timestampsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TimestampsApi.timestampsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const TimestampsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async timestampsPartialUpdate(id: number, patchedTimestamp?: PatchedTimestamp, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async timestampsPartialUpdate(id: number, patchedTimestamp?: PatchedTimestamp, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.timestampsPartialUpdate(id, patchedTimestamp, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TimestampsApi.timestampsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const TimestampsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async timestampsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async timestampsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.timestampsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TimestampsApi.timestampsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const TimestampsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async timestampsUpdate(id: number, timestamp: Timestamp, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async timestampsUpdate(id: number, timestamp: Timestamp, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.timestampsUpdate(id, timestamp, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TimestampsApi.timestampsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class TimestampsApi extends BaseAPI { * @throws {RequiredError} * @memberof TimestampsApi */ - public timestampsCreate(timestamp: Timestamp, options?: AxiosRequestConfig) { + public timestampsCreate(timestamp: Timestamp, options?: RawAxiosRequestConfig) { return TimestampsApiFp(this.configuration).timestampsCreate(timestamp, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class TimestampsApi extends BaseAPI { * @throws {RequiredError} * @memberof TimestampsApi */ - public timestampsDestroy(id: number, options?: AxiosRequestConfig) { + public timestampsDestroy(id: number, options?: RawAxiosRequestConfig) { return TimestampsApiFp(this.configuration).timestampsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class TimestampsApi extends BaseAPI { * @throws {RequiredError} * @memberof TimestampsApi */ - public timestampsList(options?: AxiosRequestConfig) { + public timestampsList(options?: RawAxiosRequestConfig) { return TimestampsApiFp(this.configuration).timestampsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class TimestampsApi extends BaseAPI { * @throws {RequiredError} * @memberof TimestampsApi */ - public timestampsPartialUpdate(id: number, patchedTimestamp?: PatchedTimestamp, options?: AxiosRequestConfig) { + public timestampsPartialUpdate(id: number, patchedTimestamp?: PatchedTimestamp, options?: RawAxiosRequestConfig) { return TimestampsApiFp(this.configuration).timestampsPartialUpdate(id, patchedTimestamp, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class TimestampsApi extends BaseAPI { * @throws {RequiredError} * @memberof TimestampsApi */ - public timestampsRetrieve(id: number, options?: AxiosRequestConfig) { + public timestampsRetrieve(id: number, options?: RawAxiosRequestConfig) { return TimestampsApiFp(this.configuration).timestampsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class TimestampsApi extends BaseAPI { * @throws {RequiredError} * @memberof TimestampsApi */ - public timestampsUpdate(id: number, timestamp: Timestamp, options?: AxiosRequestConfig) { + public timestampsUpdate(id: number, timestamp: Timestamp, options?: RawAxiosRequestConfig) { return TimestampsApiFp(this.configuration).timestampsUpdate(id, timestamp, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/user-tokens-api.ts b/javascript-client/api/user-tokens-api.ts index 9b43e52e..839b0312 100644 --- a/javascript-client/api/user-tokens-api.ts +++ b/javascript-client/api/user-tokens-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedUserToken } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const UserTokensApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - userTokensCreate: async (userToken: UserToken, options: AxiosRequestConfig = {}): Promise => { + userTokensCreate: async (userToken: UserToken, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'userToken' is not null or undefined assertParamExists('userTokensCreate', 'userToken', userToken) const localVarPath = `/api/v2/user-tokens`; @@ -78,7 +78,7 @@ export const UserTokensApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - userTokensDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + userTokensDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('userTokensDestroy', 'id', id) const localVarPath = `/api/v2/user-tokens/{id}` @@ -116,7 +116,7 @@ export const UserTokensApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - userTokensList: async (options: AxiosRequestConfig = {}): Promise => { + userTokensList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/user-tokens`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const UserTokensApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - userTokensPartialUpdate: async (id: number, patchedUserToken?: PatchedUserToken, options: AxiosRequestConfig = {}): Promise => { + userTokensPartialUpdate: async (id: number, patchedUserToken?: PatchedUserToken, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('userTokensPartialUpdate', 'id', id) const localVarPath = `/api/v2/user-tokens/{id}` @@ -195,7 +195,7 @@ export const UserTokensApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - userTokensRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + userTokensRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('userTokensRetrieve', 'id', id) const localVarPath = `/api/v2/user-tokens/{id}` @@ -235,7 +235,7 @@ export const UserTokensApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - userTokensUpdate: async (id: number, userToken: UserToken, options: AxiosRequestConfig = {}): Promise => { + userTokensUpdate: async (id: number, userToken: UserToken, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('userTokensUpdate', 'id', id) // verify required parameter 'userToken' is not null or undefined @@ -289,9 +289,11 @@ export const UserTokensApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async userTokensCreate(userToken: UserToken, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async userTokensCreate(userToken: UserToken, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.userTokensCreate(userToken, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UserTokensApi.userTokensCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const UserTokensApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async userTokensDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async userTokensDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.userTokensDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UserTokensApi.userTokensDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async userTokensList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async userTokensList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.userTokensList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UserTokensApi.userTokensList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const UserTokensApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async userTokensPartialUpdate(id: number, patchedUserToken?: PatchedUserToken, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async userTokensPartialUpdate(id: number, patchedUserToken?: PatchedUserToken, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.userTokensPartialUpdate(id, patchedUserToken, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UserTokensApi.userTokensPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const UserTokensApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async userTokensRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async userTokensRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.userTokensRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UserTokensApi.userTokensRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const UserTokensApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async userTokensUpdate(id: number, userToken: UserToken, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async userTokensUpdate(id: number, userToken: UserToken, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.userTokensUpdate(id, userToken, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UserTokensApi.userTokensUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class UserTokensApi extends BaseAPI { * @throws {RequiredError} * @memberof UserTokensApi */ - public userTokensCreate(userToken: UserToken, options?: AxiosRequestConfig) { + public userTokensCreate(userToken: UserToken, options?: RawAxiosRequestConfig) { return UserTokensApiFp(this.configuration).userTokensCreate(userToken, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class UserTokensApi extends BaseAPI { * @throws {RequiredError} * @memberof UserTokensApi */ - public userTokensDestroy(id: number, options?: AxiosRequestConfig) { + public userTokensDestroy(id: number, options?: RawAxiosRequestConfig) { return UserTokensApiFp(this.configuration).userTokensDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class UserTokensApi extends BaseAPI { * @throws {RequiredError} * @memberof UserTokensApi */ - public userTokensList(options?: AxiosRequestConfig) { + public userTokensList(options?: RawAxiosRequestConfig) { return UserTokensApiFp(this.configuration).userTokensList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class UserTokensApi extends BaseAPI { * @throws {RequiredError} * @memberof UserTokensApi */ - public userTokensPartialUpdate(id: number, patchedUserToken?: PatchedUserToken, options?: AxiosRequestConfig) { + public userTokensPartialUpdate(id: number, patchedUserToken?: PatchedUserToken, options?: RawAxiosRequestConfig) { return UserTokensApiFp(this.configuration).userTokensPartialUpdate(id, patchedUserToken, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class UserTokensApi extends BaseAPI { * @throws {RequiredError} * @memberof UserTokensApi */ - public userTokensRetrieve(id: number, options?: AxiosRequestConfig) { + public userTokensRetrieve(id: number, options?: RawAxiosRequestConfig) { return UserTokensApiFp(this.configuration).userTokensRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class UserTokensApi extends BaseAPI { * @throws {RequiredError} * @memberof UserTokensApi */ - public userTokensUpdate(id: number, userToken: UserToken, options?: AxiosRequestConfig) { + public userTokensUpdate(id: number, userToken: UserToken, options?: RawAxiosRequestConfig) { return UserTokensApiFp(this.configuration).userTokensUpdate(id, userToken, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/users-api.ts b/javascript-client/api/users-api.ts index 51bf1a4c..a0846a77 100644 --- a/javascript-client/api/users-api.ts +++ b/javascript-client/api/users-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedUser } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - usersCreate: async (user: User, options: AxiosRequestConfig = {}): Promise => { + usersCreate: async (user: User, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'user' is not null or undefined assertParamExists('usersCreate', 'user', user) const localVarPath = `/api/v2/users`; @@ -78,7 +78,7 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - usersDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + usersDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('usersDestroy', 'id', id) const localVarPath = `/api/v2/users/{id}` @@ -116,7 +116,7 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - usersList: async (options: AxiosRequestConfig = {}): Promise => { + usersList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/users`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - usersPartialUpdate: async (id: number, patchedUser?: PatchedUser, options: AxiosRequestConfig = {}): Promise => { + usersPartialUpdate: async (id: number, patchedUser?: PatchedUser, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('usersPartialUpdate', 'id', id) const localVarPath = `/api/v2/users/{id}` @@ -195,7 +195,7 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - usersRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + usersRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('usersRetrieve', 'id', id) const localVarPath = `/api/v2/users/{id}` @@ -235,7 +235,7 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - usersUpdate: async (id: number, user: User, options: AxiosRequestConfig = {}): Promise => { + usersUpdate: async (id: number, user: User, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('usersUpdate', 'id', id) // verify required parameter 'user' is not null or undefined @@ -289,9 +289,11 @@ export const UsersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async usersCreate(user: User, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async usersCreate(user: User, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.usersCreate(user, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UsersApi.usersCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const UsersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async usersDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async usersDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.usersDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UsersApi.usersDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async usersList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async usersList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.usersList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UsersApi.usersList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const UsersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async usersPartialUpdate(id: number, patchedUser?: PatchedUser, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async usersPartialUpdate(id: number, patchedUser?: PatchedUser, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.usersPartialUpdate(id, patchedUser, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UsersApi.usersPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const UsersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async usersRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async usersRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.usersRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UsersApi.usersRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const UsersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async usersUpdate(id: number, user: User, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async usersUpdate(id: number, user: User, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.usersUpdate(id, user, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UsersApi.usersUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class UsersApi extends BaseAPI { * @throws {RequiredError} * @memberof UsersApi */ - public usersCreate(user: User, options?: AxiosRequestConfig) { + public usersCreate(user: User, options?: RawAxiosRequestConfig) { return UsersApiFp(this.configuration).usersCreate(user, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class UsersApi extends BaseAPI { * @throws {RequiredError} * @memberof UsersApi */ - public usersDestroy(id: number, options?: AxiosRequestConfig) { + public usersDestroy(id: number, options?: RawAxiosRequestConfig) { return UsersApiFp(this.configuration).usersDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class UsersApi extends BaseAPI { * @throws {RequiredError} * @memberof UsersApi */ - public usersList(options?: AxiosRequestConfig) { + public usersList(options?: RawAxiosRequestConfig) { return UsersApiFp(this.configuration).usersList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class UsersApi extends BaseAPI { * @throws {RequiredError} * @memberof UsersApi */ - public usersPartialUpdate(id: number, patchedUser?: PatchedUser, options?: AxiosRequestConfig) { + public usersPartialUpdate(id: number, patchedUser?: PatchedUser, options?: RawAxiosRequestConfig) { return UsersApiFp(this.configuration).usersPartialUpdate(id, patchedUser, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class UsersApi extends BaseAPI { * @throws {RequiredError} * @memberof UsersApi */ - public usersRetrieve(id: number, options?: AxiosRequestConfig) { + public usersRetrieve(id: number, options?: RawAxiosRequestConfig) { return UsersApiFp(this.configuration).usersRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class UsersApi extends BaseAPI { * @throws {RequiredError} * @memberof UsersApi */ - public usersUpdate(id: number, user: User, options?: AxiosRequestConfig) { + public usersUpdate(id: number, user: User, options?: RawAxiosRequestConfig) { return UsersApiFp(this.configuration).usersUpdate(id, user, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/version-api.ts b/javascript-client/api/version-api.ts index a7c05ab7..15721f9b 100644 --- a/javascript-client/api/version-api.ts +++ b/javascript-client/api/version-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { Version } from '../model'; /** @@ -34,7 +34,7 @@ export const VersionApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - versionRetrieve: async (options: AxiosRequestConfig = {}): Promise => { + versionRetrieve: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/version`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -79,9 +79,11 @@ export const VersionApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async versionRetrieve(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async versionRetrieve(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.versionRetrieve(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['VersionApi.versionRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -117,7 +119,7 @@ export class VersionApi extends BaseAPI { * @throws {RequiredError} * @memberof VersionApi */ - public versionRetrieve(options?: AxiosRequestConfig) { + public versionRetrieve(options?: RawAxiosRequestConfig) { return VersionApiFp(this.configuration).versionRetrieve(options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/webstream-metadata-api.ts b/javascript-client/api/webstream-metadata-api.ts index b4818e7f..75f4ae99 100644 --- a/javascript-client/api/webstream-metadata-api.ts +++ b/javascript-client/api/webstream-metadata-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedWebstreamMetadata } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const WebstreamMetadataApiAxiosParamCreator = function (configuration?: C * @param {*} [options] Override http request option. * @throws {RequiredError} */ - webstreamMetadataCreate: async (webstreamMetadata: WebstreamMetadata, options: AxiosRequestConfig = {}): Promise => { + webstreamMetadataCreate: async (webstreamMetadata: WebstreamMetadata, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'webstreamMetadata' is not null or undefined assertParamExists('webstreamMetadataCreate', 'webstreamMetadata', webstreamMetadata) const localVarPath = `/api/v2/webstream-metadata`; @@ -78,7 +78,7 @@ export const WebstreamMetadataApiAxiosParamCreator = function (configuration?: C * @param {*} [options] Override http request option. * @throws {RequiredError} */ - webstreamMetadataDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + webstreamMetadataDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('webstreamMetadataDestroy', 'id', id) const localVarPath = `/api/v2/webstream-metadata/{id}` @@ -116,7 +116,7 @@ export const WebstreamMetadataApiAxiosParamCreator = function (configuration?: C * @param {*} [options] Override http request option. * @throws {RequiredError} */ - webstreamMetadataList: async (options: AxiosRequestConfig = {}): Promise => { + webstreamMetadataList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/webstream-metadata`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const WebstreamMetadataApiAxiosParamCreator = function (configuration?: C * @param {*} [options] Override http request option. * @throws {RequiredError} */ - webstreamMetadataPartialUpdate: async (id: number, patchedWebstreamMetadata?: PatchedWebstreamMetadata, options: AxiosRequestConfig = {}): Promise => { + webstreamMetadataPartialUpdate: async (id: number, patchedWebstreamMetadata?: PatchedWebstreamMetadata, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('webstreamMetadataPartialUpdate', 'id', id) const localVarPath = `/api/v2/webstream-metadata/{id}` @@ -195,7 +195,7 @@ export const WebstreamMetadataApiAxiosParamCreator = function (configuration?: C * @param {*} [options] Override http request option. * @throws {RequiredError} */ - webstreamMetadataRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + webstreamMetadataRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('webstreamMetadataRetrieve', 'id', id) const localVarPath = `/api/v2/webstream-metadata/{id}` @@ -235,7 +235,7 @@ export const WebstreamMetadataApiAxiosParamCreator = function (configuration?: C * @param {*} [options] Override http request option. * @throws {RequiredError} */ - webstreamMetadataUpdate: async (id: number, webstreamMetadata: WebstreamMetadata, options: AxiosRequestConfig = {}): Promise => { + webstreamMetadataUpdate: async (id: number, webstreamMetadata: WebstreamMetadata, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('webstreamMetadataUpdate', 'id', id) // verify required parameter 'webstreamMetadata' is not null or undefined @@ -289,9 +289,11 @@ export const WebstreamMetadataApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async webstreamMetadataCreate(webstreamMetadata: WebstreamMetadata, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async webstreamMetadataCreate(webstreamMetadata: WebstreamMetadata, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.webstreamMetadataCreate(webstreamMetadata, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['WebstreamMetadataApi.webstreamMetadataCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const WebstreamMetadataApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async webstreamMetadataDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async webstreamMetadataDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.webstreamMetadataDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['WebstreamMetadataApi.webstreamMetadataDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async webstreamMetadataList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async webstreamMetadataList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.webstreamMetadataList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['WebstreamMetadataApi.webstreamMetadataList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const WebstreamMetadataApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async webstreamMetadataPartialUpdate(id: number, patchedWebstreamMetadata?: PatchedWebstreamMetadata, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async webstreamMetadataPartialUpdate(id: number, patchedWebstreamMetadata?: PatchedWebstreamMetadata, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.webstreamMetadataPartialUpdate(id, patchedWebstreamMetadata, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['WebstreamMetadataApi.webstreamMetadataPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const WebstreamMetadataApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async webstreamMetadataRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async webstreamMetadataRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.webstreamMetadataRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['WebstreamMetadataApi.webstreamMetadataRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const WebstreamMetadataApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async webstreamMetadataUpdate(id: number, webstreamMetadata: WebstreamMetadata, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async webstreamMetadataUpdate(id: number, webstreamMetadata: WebstreamMetadata, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.webstreamMetadataUpdate(id, webstreamMetadata, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['WebstreamMetadataApi.webstreamMetadataUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class WebstreamMetadataApi extends BaseAPI { * @throws {RequiredError} * @memberof WebstreamMetadataApi */ - public webstreamMetadataCreate(webstreamMetadata: WebstreamMetadata, options?: AxiosRequestConfig) { + public webstreamMetadataCreate(webstreamMetadata: WebstreamMetadata, options?: RawAxiosRequestConfig) { return WebstreamMetadataApiFp(this.configuration).webstreamMetadataCreate(webstreamMetadata, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class WebstreamMetadataApi extends BaseAPI { * @throws {RequiredError} * @memberof WebstreamMetadataApi */ - public webstreamMetadataDestroy(id: number, options?: AxiosRequestConfig) { + public webstreamMetadataDestroy(id: number, options?: RawAxiosRequestConfig) { return WebstreamMetadataApiFp(this.configuration).webstreamMetadataDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class WebstreamMetadataApi extends BaseAPI { * @throws {RequiredError} * @memberof WebstreamMetadataApi */ - public webstreamMetadataList(options?: AxiosRequestConfig) { + public webstreamMetadataList(options?: RawAxiosRequestConfig) { return WebstreamMetadataApiFp(this.configuration).webstreamMetadataList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class WebstreamMetadataApi extends BaseAPI { * @throws {RequiredError} * @memberof WebstreamMetadataApi */ - public webstreamMetadataPartialUpdate(id: number, patchedWebstreamMetadata?: PatchedWebstreamMetadata, options?: AxiosRequestConfig) { + public webstreamMetadataPartialUpdate(id: number, patchedWebstreamMetadata?: PatchedWebstreamMetadata, options?: RawAxiosRequestConfig) { return WebstreamMetadataApiFp(this.configuration).webstreamMetadataPartialUpdate(id, patchedWebstreamMetadata, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class WebstreamMetadataApi extends BaseAPI { * @throws {RequiredError} * @memberof WebstreamMetadataApi */ - public webstreamMetadataRetrieve(id: number, options?: AxiosRequestConfig) { + public webstreamMetadataRetrieve(id: number, options?: RawAxiosRequestConfig) { return WebstreamMetadataApiFp(this.configuration).webstreamMetadataRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class WebstreamMetadataApi extends BaseAPI { * @throws {RequiredError} * @memberof WebstreamMetadataApi */ - public webstreamMetadataUpdate(id: number, webstreamMetadata: WebstreamMetadata, options?: AxiosRequestConfig) { + public webstreamMetadataUpdate(id: number, webstreamMetadata: WebstreamMetadata, options?: RawAxiosRequestConfig) { return WebstreamMetadataApiFp(this.configuration).webstreamMetadataUpdate(id, webstreamMetadata, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/api/webstreams-api.ts b/javascript-client/api/webstreams-api.ts index 235a1587..ac5d0f7d 100644 --- a/javascript-client/api/webstreams-api.ts +++ b/javascript-client/api/webstreams-api.ts @@ -14,13 +14,13 @@ import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { PatchedWebstream } from '../model'; // @ts-ignore @@ -37,7 +37,7 @@ export const WebstreamsApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - webstreamsCreate: async (webstream: Webstream, options: AxiosRequestConfig = {}): Promise => { + webstreamsCreate: async (webstream: Webstream, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'webstream' is not null or undefined assertParamExists('webstreamsCreate', 'webstream', webstream) const localVarPath = `/api/v2/webstreams`; @@ -78,7 +78,7 @@ export const WebstreamsApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - webstreamsDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + webstreamsDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('webstreamsDestroy', 'id', id) const localVarPath = `/api/v2/webstreams/{id}` @@ -116,7 +116,7 @@ export const WebstreamsApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - webstreamsList: async (options: AxiosRequestConfig = {}): Promise => { + webstreamsList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v2/webstreams`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -153,7 +153,7 @@ export const WebstreamsApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - webstreamsPartialUpdate: async (id: number, patchedWebstream?: PatchedWebstream, options: AxiosRequestConfig = {}): Promise => { + webstreamsPartialUpdate: async (id: number, patchedWebstream?: PatchedWebstream, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('webstreamsPartialUpdate', 'id', id) const localVarPath = `/api/v2/webstreams/{id}` @@ -195,7 +195,7 @@ export const WebstreamsApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - webstreamsRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + webstreamsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('webstreamsRetrieve', 'id', id) const localVarPath = `/api/v2/webstreams/{id}` @@ -235,7 +235,7 @@ export const WebstreamsApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - webstreamsUpdate: async (id: number, webstream: Webstream, options: AxiosRequestConfig = {}): Promise => { + webstreamsUpdate: async (id: number, webstream: Webstream, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('webstreamsUpdate', 'id', id) // verify required parameter 'webstream' is not null or undefined @@ -289,9 +289,11 @@ export const WebstreamsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async webstreamsCreate(webstream: Webstream, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async webstreamsCreate(webstream: Webstream, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.webstreamsCreate(webstream, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['WebstreamsApi.webstreamsCreate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -299,18 +301,22 @@ export const WebstreamsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async webstreamsDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async webstreamsDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.webstreamsDestroy(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['WebstreamsApi.webstreamsDestroy']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async webstreamsList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async webstreamsList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.webstreamsList(options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['WebstreamsApi.webstreamsList']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -319,9 +325,11 @@ export const WebstreamsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async webstreamsPartialUpdate(id: number, patchedWebstream?: PatchedWebstream, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async webstreamsPartialUpdate(id: number, patchedWebstream?: PatchedWebstream, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.webstreamsPartialUpdate(id, patchedWebstream, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['WebstreamsApi.webstreamsPartialUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -329,9 +337,11 @@ export const WebstreamsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async webstreamsRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async webstreamsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.webstreamsRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['WebstreamsApi.webstreamsRetrieve']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * @@ -340,9 +350,11 @@ export const WebstreamsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async webstreamsUpdate(id: number, webstream: Webstream, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async webstreamsUpdate(id: number, webstream: Webstream, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.webstreamsUpdate(id, webstream, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['WebstreamsApi.webstreamsUpdate']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -426,7 +438,7 @@ export class WebstreamsApi extends BaseAPI { * @throws {RequiredError} * @memberof WebstreamsApi */ - public webstreamsCreate(webstream: Webstream, options?: AxiosRequestConfig) { + public webstreamsCreate(webstream: Webstream, options?: RawAxiosRequestConfig) { return WebstreamsApiFp(this.configuration).webstreamsCreate(webstream, options).then((request) => request(this.axios, this.basePath)); } @@ -437,7 +449,7 @@ export class WebstreamsApi extends BaseAPI { * @throws {RequiredError} * @memberof WebstreamsApi */ - public webstreamsDestroy(id: number, options?: AxiosRequestConfig) { + public webstreamsDestroy(id: number, options?: RawAxiosRequestConfig) { return WebstreamsApiFp(this.configuration).webstreamsDestroy(id, options).then((request) => request(this.axios, this.basePath)); } @@ -447,7 +459,7 @@ export class WebstreamsApi extends BaseAPI { * @throws {RequiredError} * @memberof WebstreamsApi */ - public webstreamsList(options?: AxiosRequestConfig) { + public webstreamsList(options?: RawAxiosRequestConfig) { return WebstreamsApiFp(this.configuration).webstreamsList(options).then((request) => request(this.axios, this.basePath)); } @@ -459,7 +471,7 @@ export class WebstreamsApi extends BaseAPI { * @throws {RequiredError} * @memberof WebstreamsApi */ - public webstreamsPartialUpdate(id: number, patchedWebstream?: PatchedWebstream, options?: AxiosRequestConfig) { + public webstreamsPartialUpdate(id: number, patchedWebstream?: PatchedWebstream, options?: RawAxiosRequestConfig) { return WebstreamsApiFp(this.configuration).webstreamsPartialUpdate(id, patchedWebstream, options).then((request) => request(this.axios, this.basePath)); } @@ -470,7 +482,7 @@ export class WebstreamsApi extends BaseAPI { * @throws {RequiredError} * @memberof WebstreamsApi */ - public webstreamsRetrieve(id: number, options?: AxiosRequestConfig) { + public webstreamsRetrieve(id: number, options?: RawAxiosRequestConfig) { return WebstreamsApiFp(this.configuration).webstreamsRetrieve(id, options).then((request) => request(this.axios, this.basePath)); } @@ -482,7 +494,7 @@ export class WebstreamsApi extends BaseAPI { * @throws {RequiredError} * @memberof WebstreamsApi */ - public webstreamsUpdate(id: number, webstream: Webstream, options?: AxiosRequestConfig) { + public webstreamsUpdate(id: number, webstream: Webstream, options?: RawAxiosRequestConfig) { return WebstreamsApiFp(this.configuration).webstreamsUpdate(id, webstream, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/javascript-client/base.ts b/javascript-client/base.ts index f832fb2e..4c3b9708 100644 --- a/javascript-client/base.ts +++ b/javascript-client/base.ts @@ -16,7 +16,7 @@ import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -39,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: AxiosRequestConfig; + options: RawAxiosRequestConfig; } /** @@ -53,7 +53,7 @@ export class BaseAPI { constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { if (configuration) { this.configuration = configuration; - this.basePath = configuration.basePath || this.basePath; + this.basePath = configuration.basePath ?? basePath; } } }; @@ -70,3 +70,17 @@ export class RequiredError extends Error { this.name = "RequiredError" } } + +interface ServerMap { + [key: string]: { + url: string, + description: string, + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = { +} diff --git a/javascript-client/common.ts b/javascript-client/common.ts index 5ae41eef..0ab57715 100644 --- a/javascript-client/common.ts +++ b/javascript-client/common.ts @@ -144,7 +144,7 @@ export const toPathString = function (url: URL) { */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || axios.defaults.baseURL || basePath) + axiosArgs.url}; + const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; return axios.request(axiosRequestArgs); }; } diff --git a/javascript-client/configuration.ts b/javascript-client/configuration.ts index 264a9ac9..b4949ed0 100644 --- a/javascript-client/configuration.ts +++ b/javascript-client/configuration.ts @@ -19,6 +19,7 @@ export interface ConfigurationParameters { password?: string; accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); basePath?: string; + serverIndex?: number; baseOptions?: any; formDataCtor?: new () => any; } @@ -58,6 +59,13 @@ export class Configuration { * @memberof Configuration */ basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; /** * base options for axios calls * @@ -80,6 +88,7 @@ export class Configuration { this.password = param.password; this.accessToken = param.accessToken; this.basePath = param.basePath; + this.serverIndex = param.serverIndex; this.baseOptions = param.baseOptions; this.formDataCtor = param.formDataCtor; } diff --git a/php-client/.openapi-generator/FILES b/php-client/.openapi-generator/FILES index 2180620b..c2e139c5 100644 --- a/php-client/.openapi-generator/FILES +++ b/php-client/.openapi-generator/FILES @@ -252,4 +252,3 @@ lib/Model/WebstreamMetadata.php lib/Model/WeekDayEnum.php lib/ObjectSerializer.php phpunit.xml.dist -test/Model/FileImportStatusEnumTest.php diff --git a/php-client/.openapi-generator/VERSION b/php-client/.openapi-generator/VERSION index 73a86b19..8b23b8d4 100644 --- a/php-client/.openapi-generator/VERSION +++ b/php-client/.openapi-generator/VERSION @@ -1 +1 @@ -7.0.1 \ No newline at end of file +7.3.0 \ No newline at end of file diff --git a/php-client/lib/Api/CeleryTasksApi.php b/php-client/lib/Api/CeleryTasksApi.php index a04f8565..00550767 100644 --- a/php-client/lib/Api/CeleryTasksApi.php +++ b/php-client/lib/Api/CeleryTasksApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class CeleryTasksApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\CeleryTask $celery_task celery_task (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['celeryTasksCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\CeleryTask */ @@ -165,7 +165,7 @@ public function celeryTasksCreate($celery_task, string $contentType = self::cont * @param \Libretime\Client\Model\CeleryTask $celery_task (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['celeryTasksCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\CeleryTask, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function celeryTasksCreateWithHttpInfo($celery_task, string $contentType } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\CeleryTask' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function celeryTasksCreateWithHttpInfo($celery_task, string $contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function celeryTasksCreateRequest($celery_task, string $contentType = sel * @param int $id A unique integer value identifying this celery task. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['celeryTasksDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function celeryTasksDestroy($id, string $contentType = self::contentTypes * @param int $id A unique integer value identifying this celery task. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['celeryTasksDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function celeryTasksDestroyRequest($id, string $contentType = self::conte * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['celeryTasksList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\CeleryTask[] */ @@ -676,7 +700,7 @@ public function celeryTasksList(string $contentType = self::contentTypes['celery * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['celeryTasksList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\CeleryTask[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function celeryTasksListWithHttpInfo(string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\CeleryTask[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function celeryTasksListWithHttpInfo(string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function celeryTasksListRequest(string $contentType = self::contentTypes[ * @param \Libretime\Client\Model\PatchedCeleryTask $patched_celery_task patched_celery_task (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['celeryTasksPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\CeleryTask */ @@ -944,7 +992,7 @@ public function celeryTasksPartialUpdate($id, $patched_celery_task = null, strin * @param \Libretime\Client\Model\PatchedCeleryTask $patched_celery_task (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['celeryTasksPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\CeleryTask, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function celeryTasksPartialUpdateWithHttpInfo($id, $patched_celery_task = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\CeleryTask' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function celeryTasksPartialUpdateWithHttpInfo($id, $patched_celery_task = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function celeryTasksPartialUpdateRequest($id, $patched_celery_task = null * @param int $id A unique integer value identifying this celery task. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['celeryTasksRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\CeleryTask */ @@ -1239,7 +1311,7 @@ public function celeryTasksRetrieve($id, string $contentType = self::contentType * @param int $id A unique integer value identifying this celery task. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['celeryTasksRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\CeleryTask, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function celeryTasksRetrieveWithHttpInfo($id, string $contentType = self: } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\CeleryTask' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function celeryTasksRetrieveWithHttpInfo($id, string $contentType = self: } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function celeryTasksRetrieveRequest($id, string $contentType = self::cont * @param \Libretime\Client\Model\CeleryTask $celery_task celery_task (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['celeryTasksUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\CeleryTask */ @@ -1525,7 +1621,7 @@ public function celeryTasksUpdate($id, $celery_task, string $contentType = self: * @param \Libretime\Client\Model\CeleryTask $celery_task (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['celeryTasksUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\CeleryTask, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function celeryTasksUpdateWithHttpInfo($id, $celery_task, string $content } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\CeleryTask' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function celeryTasksUpdateWithHttpInfo($id, $celery_task, string $content } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/FilesApi.php b/php-client/lib/Api/FilesApi.php index 0d0379b6..1fc174eb 100644 --- a/php-client/lib/Api/FilesApi.php +++ b/php-client/lib/Api/FilesApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -100,7 +100,7 @@ class FilesApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -152,7 +152,7 @@ public function getConfig() * @param \Libretime\Client\Model\File $file file (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\File */ @@ -168,7 +168,7 @@ public function filesCreate($file, string $contentType = self::contentTypes['fil * @param \Libretime\Client\Model\File $file (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\File, HTTP status code, HTTP response headers (array of strings) */ @@ -218,7 +218,19 @@ public function filesCreateWithHttpInfo($file, string $contentType = self::conte } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\File' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -235,7 +247,19 @@ public function filesCreateWithHttpInfo($file, string $contentType = self::conte } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -435,7 +459,7 @@ public function filesCreateRequest($file, string $contentType = self::contentTyp * @param int $id A unique integer value identifying this file. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -450,7 +474,7 @@ public function filesDestroy($id, string $contentType = self::contentTypes['file * @param int $id A unique integer value identifying this file. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -665,7 +689,7 @@ public function filesDestroyRequest($id, string $contentType = self::contentType * @param int $id A unique integer value identifying this file. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesDownloadRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\File */ @@ -681,7 +705,7 @@ public function filesDownloadRetrieve($id, string $contentType = self::contentTy * @param int $id A unique integer value identifying this file. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesDownloadRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\File, HTTP status code, HTTP response headers (array of strings) */ @@ -731,7 +755,19 @@ public function filesDownloadRetrieveWithHttpInfo($id, string $contentType = sel } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\File' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -748,7 +784,19 @@ public function filesDownloadRetrieveWithHttpInfo($id, string $contentType = sel } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -948,7 +996,7 @@ public function filesDownloadRetrieveRequest($id, string $contentType = self::co * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\File[] */ @@ -963,7 +1011,7 @@ public function filesList(string $contentType = self::contentTypes['filesList'][ * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\File[], HTTP status code, HTTP response headers (array of strings) */ @@ -1013,7 +1061,19 @@ public function filesListWithHttpInfo(string $contentType = self::contentTypes[' } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\File[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1030,7 +1090,19 @@ public function filesListWithHttpInfo(string $contentType = self::contentTypes[' } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1214,7 +1286,7 @@ public function filesListRequest(string $contentType = self::contentTypes['files * @param \Libretime\Client\Model\PatchedFile $patched_file patched_file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\File */ @@ -1231,7 +1303,7 @@ public function filesPartialUpdate($id, $patched_file = null, string $contentTyp * @param \Libretime\Client\Model\PatchedFile $patched_file (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\File, HTTP status code, HTTP response headers (array of strings) */ @@ -1281,7 +1353,19 @@ public function filesPartialUpdateWithHttpInfo($id, $patched_file = null, string } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\File' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1298,7 +1382,19 @@ public function filesPartialUpdateWithHttpInfo($id, $patched_file = null, string } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1510,7 +1606,7 @@ public function filesPartialUpdateRequest($id, $patched_file = null, string $con * @param int $id A unique integer value identifying this file. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\File */ @@ -1526,7 +1622,7 @@ public function filesRetrieve($id, string $contentType = self::contentTypes['fil * @param int $id A unique integer value identifying this file. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\File, HTTP status code, HTTP response headers (array of strings) */ @@ -1576,7 +1672,19 @@ public function filesRetrieveWithHttpInfo($id, string $contentType = self::conte } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\File' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1593,7 +1701,19 @@ public function filesRetrieveWithHttpInfo($id, string $contentType = self::conte } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1795,7 +1915,7 @@ public function filesRetrieveRequest($id, string $contentType = self::contentTyp * @param \Libretime\Client\Model\File $file file (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\File */ @@ -1812,7 +1932,7 @@ public function filesUpdate($id, $file, string $contentType = self::contentTypes * @param \Libretime\Client\Model\File $file (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['filesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\File, HTTP status code, HTTP response headers (array of strings) */ @@ -1862,7 +1982,19 @@ public function filesUpdateWithHttpInfo($id, $file, string $contentType = self:: } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\File' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1879,7 +2011,19 @@ public function filesUpdateWithHttpInfo($id, $file, string $contentType = self:: } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/ImportedPodcastsApi.php b/php-client/lib/Api/ImportedPodcastsApi.php index 38bac62a..41135e00 100644 --- a/php-client/lib/Api/ImportedPodcastsApi.php +++ b/php-client/lib/Api/ImportedPodcastsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class ImportedPodcastsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\ImportedPodcast $imported_podcast imported_podcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importedPodcastsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ImportedPodcast */ @@ -165,7 +165,7 @@ public function importedPodcastsCreate($imported_podcast, string $contentType = * @param \Libretime\Client\Model\ImportedPodcast $imported_podcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importedPodcastsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ImportedPodcast, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function importedPodcastsCreateWithHttpInfo($imported_podcast, string $co } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ImportedPodcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function importedPodcastsCreateWithHttpInfo($imported_podcast, string $co } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function importedPodcastsCreateRequest($imported_podcast, string $content * @param int $id A unique integer value identifying this imported podcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importedPodcastsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function importedPodcastsDestroy($id, string $contentType = self::content * @param int $id A unique integer value identifying this imported podcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importedPodcastsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function importedPodcastsDestroyRequest($id, string $contentType = self:: * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importedPodcastsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ImportedPodcast[] */ @@ -676,7 +700,7 @@ public function importedPodcastsList(string $contentType = self::contentTypes['i * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importedPodcastsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ImportedPodcast[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function importedPodcastsListWithHttpInfo(string $contentType = self::con } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ImportedPodcast[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function importedPodcastsListWithHttpInfo(string $contentType = self::con } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function importedPodcastsListRequest(string $contentType = self::contentT * @param \Libretime\Client\Model\PatchedImportedPodcast $patched_imported_podcast patched_imported_podcast (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importedPodcastsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ImportedPodcast */ @@ -944,7 +992,7 @@ public function importedPodcastsPartialUpdate($id, $patched_imported_podcast = n * @param \Libretime\Client\Model\PatchedImportedPodcast $patched_imported_podcast (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importedPodcastsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ImportedPodcast, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function importedPodcastsPartialUpdateWithHttpInfo($id, $patched_imported } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ImportedPodcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function importedPodcastsPartialUpdateWithHttpInfo($id, $patched_imported } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function importedPodcastsPartialUpdateRequest($id, $patched_imported_podc * @param int $id A unique integer value identifying this imported podcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importedPodcastsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ImportedPodcast */ @@ -1239,7 +1311,7 @@ public function importedPodcastsRetrieve($id, string $contentType = self::conten * @param int $id A unique integer value identifying this imported podcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importedPodcastsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ImportedPodcast, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function importedPodcastsRetrieveWithHttpInfo($id, string $contentType = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ImportedPodcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function importedPodcastsRetrieveWithHttpInfo($id, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function importedPodcastsRetrieveRequest($id, string $contentType = self: * @param \Libretime\Client\Model\ImportedPodcast $imported_podcast imported_podcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importedPodcastsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ImportedPodcast */ @@ -1525,7 +1621,7 @@ public function importedPodcastsUpdate($id, $imported_podcast, string $contentTy * @param \Libretime\Client\Model\ImportedPodcast $imported_podcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importedPodcastsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ImportedPodcast, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function importedPodcastsUpdateWithHttpInfo($id, $imported_podcast, strin } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ImportedPodcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function importedPodcastsUpdateWithHttpInfo($id, $imported_podcast, strin } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/InfoApi.php b/php-client/lib/Api/InfoApi.php index 027f9726..05b4079e 100644 --- a/php-client/lib/Api/InfoApi.php +++ b/php-client/lib/Api/InfoApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -76,7 +76,7 @@ class InfoApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -127,7 +127,7 @@ public function getConfig() * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['infoRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Info */ @@ -142,7 +142,7 @@ public function infoRetrieve(string $contentType = self::contentTypes['infoRetri * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['infoRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Info, HTTP status code, HTTP response headers (array of strings) */ @@ -192,7 +192,19 @@ public function infoRetrieveWithHttpInfo(string $contentType = self::contentType } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Info' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -209,7 +221,19 @@ public function infoRetrieveWithHttpInfo(string $contentType = self::contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/LibrariesApi.php b/php-client/lib/Api/LibrariesApi.php index d6764283..42b7677d 100644 --- a/php-client/lib/Api/LibrariesApi.php +++ b/php-client/lib/Api/LibrariesApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class LibrariesApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\Library $library library (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['librariesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Library */ @@ -165,7 +165,7 @@ public function librariesCreate($library, string $contentType = self::contentTyp * @param \Libretime\Client\Model\Library $library (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['librariesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Library, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function librariesCreateWithHttpInfo($library, string $contentType = self } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Library' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function librariesCreateWithHttpInfo($library, string $contentType = self } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function librariesCreateRequest($library, string $contentType = self::con * @param int $id A unique integer value identifying this library. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['librariesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function librariesDestroy($id, string $contentType = self::contentTypes[' * @param int $id A unique integer value identifying this library. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['librariesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function librariesDestroyRequest($id, string $contentType = self::content * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['librariesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Library[] */ @@ -676,7 +700,7 @@ public function librariesList(string $contentType = self::contentTypes['librarie * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['librariesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Library[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function librariesListWithHttpInfo(string $contentType = self::contentTyp } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Library[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function librariesListWithHttpInfo(string $contentType = self::contentTyp } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function librariesListRequest(string $contentType = self::contentTypes['l * @param \Libretime\Client\Model\PatchedLibrary $patched_library patched_library (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['librariesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Library */ @@ -944,7 +992,7 @@ public function librariesPartialUpdate($id, $patched_library = null, string $con * @param \Libretime\Client\Model\PatchedLibrary $patched_library (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['librariesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Library, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function librariesPartialUpdateWithHttpInfo($id, $patched_library = null, } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Library' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function librariesPartialUpdateWithHttpInfo($id, $patched_library = null, } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function librariesPartialUpdateRequest($id, $patched_library = null, stri * @param int $id A unique integer value identifying this library. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['librariesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Library */ @@ -1239,7 +1311,7 @@ public function librariesRetrieve($id, string $contentType = self::contentTypes[ * @param int $id A unique integer value identifying this library. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['librariesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Library, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function librariesRetrieveWithHttpInfo($id, string $contentType = self::c } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Library' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function librariesRetrieveWithHttpInfo($id, string $contentType = self::c } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function librariesRetrieveRequest($id, string $contentType = self::conten * @param \Libretime\Client\Model\Library $library library (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['librariesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Library */ @@ -1525,7 +1621,7 @@ public function librariesUpdate($id, $library, string $contentType = self::conte * @param \Libretime\Client\Model\Library $library (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['librariesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Library, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function librariesUpdateWithHttpInfo($id, $library, string $contentType = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Library' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function librariesUpdateWithHttpInfo($id, $library, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/ListenerCountsApi.php b/php-client/lib/Api/ListenerCountsApi.php index 67d7b667..8d9df365 100644 --- a/php-client/lib/Api/ListenerCountsApi.php +++ b/php-client/lib/Api/ListenerCountsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class ListenerCountsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\ListenerCount $listener_count listener_count (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listenerCountsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ListenerCount */ @@ -165,7 +165,7 @@ public function listenerCountsCreate($listener_count, string $contentType = self * @param \Libretime\Client\Model\ListenerCount $listener_count (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listenerCountsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ListenerCount, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function listenerCountsCreateWithHttpInfo($listener_count, string $conten } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ListenerCount' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function listenerCountsCreateWithHttpInfo($listener_count, string $conten } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function listenerCountsCreateRequest($listener_count, string $contentType * @param int $id A unique integer value identifying this listener count. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listenerCountsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function listenerCountsDestroy($id, string $contentType = self::contentTy * @param int $id A unique integer value identifying this listener count. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listenerCountsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function listenerCountsDestroyRequest($id, string $contentType = self::co * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listenerCountsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ListenerCount[] */ @@ -676,7 +700,7 @@ public function listenerCountsList(string $contentType = self::contentTypes['lis * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listenerCountsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ListenerCount[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function listenerCountsListWithHttpInfo(string $contentType = self::conte } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ListenerCount[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function listenerCountsListWithHttpInfo(string $contentType = self::conte } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function listenerCountsListRequest(string $contentType = self::contentTyp * @param \Libretime\Client\Model\PatchedListenerCount $patched_listener_count patched_listener_count (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listenerCountsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ListenerCount */ @@ -944,7 +992,7 @@ public function listenerCountsPartialUpdate($id, $patched_listener_count = null, * @param \Libretime\Client\Model\PatchedListenerCount $patched_listener_count (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listenerCountsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ListenerCount, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function listenerCountsPartialUpdateWithHttpInfo($id, $patched_listener_c } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ListenerCount' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function listenerCountsPartialUpdateWithHttpInfo($id, $patched_listener_c } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function listenerCountsPartialUpdateRequest($id, $patched_listener_count * @param int $id A unique integer value identifying this listener count. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listenerCountsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ListenerCount */ @@ -1239,7 +1311,7 @@ public function listenerCountsRetrieve($id, string $contentType = self::contentT * @param int $id A unique integer value identifying this listener count. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listenerCountsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ListenerCount, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function listenerCountsRetrieveWithHttpInfo($id, string $contentType = se } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ListenerCount' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function listenerCountsRetrieveWithHttpInfo($id, string $contentType = se } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function listenerCountsRetrieveRequest($id, string $contentType = self::c * @param \Libretime\Client\Model\ListenerCount $listener_count listener_count (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listenerCountsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ListenerCount */ @@ -1525,7 +1621,7 @@ public function listenerCountsUpdate($id, $listener_count, string $contentType = * @param \Libretime\Client\Model\ListenerCount $listener_count (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listenerCountsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ListenerCount, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function listenerCountsUpdateWithHttpInfo($id, $listener_count, string $c } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ListenerCount' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function listenerCountsUpdateWithHttpInfo($id, $listener_count, string $c } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/LiveLogsApi.php b/php-client/lib/Api/LiveLogsApi.php index 7dc2cd84..31445191 100644 --- a/php-client/lib/Api/LiveLogsApi.php +++ b/php-client/lib/Api/LiveLogsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class LiveLogsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\LiveLog $live_log live_log (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveLogsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\LiveLog */ @@ -165,7 +165,7 @@ public function liveLogsCreate($live_log, string $contentType = self::contentTyp * @param \Libretime\Client\Model\LiveLog $live_log (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveLogsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\LiveLog, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function liveLogsCreateWithHttpInfo($live_log, string $contentType = self } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\LiveLog' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function liveLogsCreateWithHttpInfo($live_log, string $contentType = self } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function liveLogsCreateRequest($live_log, string $contentType = self::con * @param int $id A unique integer value identifying this live log. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveLogsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function liveLogsDestroy($id, string $contentType = self::contentTypes['l * @param int $id A unique integer value identifying this live log. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveLogsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function liveLogsDestroyRequest($id, string $contentType = self::contentT * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveLogsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\LiveLog[] */ @@ -676,7 +700,7 @@ public function liveLogsList(string $contentType = self::contentTypes['liveLogsL * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveLogsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\LiveLog[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function liveLogsListWithHttpInfo(string $contentType = self::contentType } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\LiveLog[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function liveLogsListWithHttpInfo(string $contentType = self::contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function liveLogsListRequest(string $contentType = self::contentTypes['li * @param \Libretime\Client\Model\PatchedLiveLog $patched_live_log patched_live_log (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveLogsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\LiveLog */ @@ -944,7 +992,7 @@ public function liveLogsPartialUpdate($id, $patched_live_log = null, string $con * @param \Libretime\Client\Model\PatchedLiveLog $patched_live_log (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveLogsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\LiveLog, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function liveLogsPartialUpdateWithHttpInfo($id, $patched_live_log = null, } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\LiveLog' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function liveLogsPartialUpdateWithHttpInfo($id, $patched_live_log = null, } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function liveLogsPartialUpdateRequest($id, $patched_live_log = null, stri * @param int $id A unique integer value identifying this live log. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveLogsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\LiveLog */ @@ -1239,7 +1311,7 @@ public function liveLogsRetrieve($id, string $contentType = self::contentTypes[' * @param int $id A unique integer value identifying this live log. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveLogsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\LiveLog, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function liveLogsRetrieveWithHttpInfo($id, string $contentType = self::co } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\LiveLog' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function liveLogsRetrieveWithHttpInfo($id, string $contentType = self::co } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function liveLogsRetrieveRequest($id, string $contentType = self::content * @param \Libretime\Client\Model\LiveLog $live_log live_log (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveLogsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\LiveLog */ @@ -1525,7 +1621,7 @@ public function liveLogsUpdate($id, $live_log, string $contentType = self::conte * @param \Libretime\Client\Model\LiveLog $live_log (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['liveLogsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\LiveLog, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function liveLogsUpdateWithHttpInfo($id, $live_log, string $contentType = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\LiveLog' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function liveLogsUpdateWithHttpInfo($id, $live_log, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/LoginAttemptsApi.php b/php-client/lib/Api/LoginAttemptsApi.php index 0e427632..4e3b62d3 100644 --- a/php-client/lib/Api/LoginAttemptsApi.php +++ b/php-client/lib/Api/LoginAttemptsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class LoginAttemptsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\LoginAttempt $login_attempt login_attempt (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginAttemptsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\LoginAttempt */ @@ -165,7 +165,7 @@ public function loginAttemptsCreate($login_attempt, string $contentType = self:: * @param \Libretime\Client\Model\LoginAttempt $login_attempt (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginAttemptsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\LoginAttempt, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function loginAttemptsCreateWithHttpInfo($login_attempt, string $contentT } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\LoginAttempt' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function loginAttemptsCreateWithHttpInfo($login_attempt, string $contentT } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function loginAttemptsCreateRequest($login_attempt, string $contentType = * @param string $ip A unique value identifying this login attempt. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginAttemptsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function loginAttemptsDestroy($ip, string $contentType = self::contentTyp * @param string $ip A unique value identifying this login attempt. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginAttemptsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function loginAttemptsDestroyRequest($ip, string $contentType = self::con * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginAttemptsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\LoginAttempt[] */ @@ -676,7 +700,7 @@ public function loginAttemptsList(string $contentType = self::contentTypes['logi * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginAttemptsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\LoginAttempt[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function loginAttemptsListWithHttpInfo(string $contentType = self::conten } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\LoginAttempt[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function loginAttemptsListWithHttpInfo(string $contentType = self::conten } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function loginAttemptsListRequest(string $contentType = self::contentType * @param \Libretime\Client\Model\PatchedLoginAttempt $patched_login_attempt patched_login_attempt (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginAttemptsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\LoginAttempt */ @@ -944,7 +992,7 @@ public function loginAttemptsPartialUpdate($ip, $patched_login_attempt = null, s * @param \Libretime\Client\Model\PatchedLoginAttempt $patched_login_attempt (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginAttemptsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\LoginAttempt, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function loginAttemptsPartialUpdateWithHttpInfo($ip, $patched_login_attem } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\LoginAttempt' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function loginAttemptsPartialUpdateWithHttpInfo($ip, $patched_login_attem } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function loginAttemptsPartialUpdateRequest($ip, $patched_login_attempt = * @param string $ip A unique value identifying this login attempt. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginAttemptsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\LoginAttempt */ @@ -1239,7 +1311,7 @@ public function loginAttemptsRetrieve($ip, string $contentType = self::contentTy * @param string $ip A unique value identifying this login attempt. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginAttemptsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\LoginAttempt, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function loginAttemptsRetrieveWithHttpInfo($ip, string $contentType = sel } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\LoginAttempt' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function loginAttemptsRetrieveWithHttpInfo($ip, string $contentType = sel } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function loginAttemptsRetrieveRequest($ip, string $contentType = self::co * @param \Libretime\Client\Model\LoginAttempt $login_attempt login_attempt (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginAttemptsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\LoginAttempt */ @@ -1525,7 +1621,7 @@ public function loginAttemptsUpdate($ip, $login_attempt, string $contentType = s * @param \Libretime\Client\Model\LoginAttempt $login_attempt (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginAttemptsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\LoginAttempt, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function loginAttemptsUpdateWithHttpInfo($ip, $login_attempt, string $con } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\LoginAttempt' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function loginAttemptsUpdateWithHttpInfo($ip, $login_attempt, string $con } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/MountNamesApi.php b/php-client/lib/Api/MountNamesApi.php index b7ce25d8..92390f43 100644 --- a/php-client/lib/Api/MountNamesApi.php +++ b/php-client/lib/Api/MountNamesApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class MountNamesApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\MountName $mount_name mount_name (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mountNamesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\MountName */ @@ -165,7 +165,7 @@ public function mountNamesCreate($mount_name, string $contentType = self::conten * @param \Libretime\Client\Model\MountName $mount_name (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mountNamesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\MountName, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function mountNamesCreateWithHttpInfo($mount_name, string $contentType = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\MountName' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function mountNamesCreateWithHttpInfo($mount_name, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function mountNamesCreateRequest($mount_name, string $contentType = self: * @param int $id A unique integer value identifying this mount name. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mountNamesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function mountNamesDestroy($id, string $contentType = self::contentTypes[ * @param int $id A unique integer value identifying this mount name. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mountNamesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function mountNamesDestroyRequest($id, string $contentType = self::conten * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mountNamesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\MountName[] */ @@ -676,7 +700,7 @@ public function mountNamesList(string $contentType = self::contentTypes['mountNa * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mountNamesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\MountName[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function mountNamesListWithHttpInfo(string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\MountName[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function mountNamesListWithHttpInfo(string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function mountNamesListRequest(string $contentType = self::contentTypes[' * @param \Libretime\Client\Model\PatchedMountName $patched_mount_name patched_mount_name (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mountNamesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\MountName */ @@ -944,7 +992,7 @@ public function mountNamesPartialUpdate($id, $patched_mount_name = null, string * @param \Libretime\Client\Model\PatchedMountName $patched_mount_name (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mountNamesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\MountName, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function mountNamesPartialUpdateWithHttpInfo($id, $patched_mount_name = n } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\MountName' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function mountNamesPartialUpdateWithHttpInfo($id, $patched_mount_name = n } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function mountNamesPartialUpdateRequest($id, $patched_mount_name = null, * @param int $id A unique integer value identifying this mount name. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mountNamesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\MountName */ @@ -1239,7 +1311,7 @@ public function mountNamesRetrieve($id, string $contentType = self::contentTypes * @param int $id A unique integer value identifying this mount name. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mountNamesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\MountName, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function mountNamesRetrieveWithHttpInfo($id, string $contentType = self:: } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\MountName' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function mountNamesRetrieveWithHttpInfo($id, string $contentType = self:: } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function mountNamesRetrieveRequest($id, string $contentType = self::conte * @param \Libretime\Client\Model\MountName $mount_name mount_name (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mountNamesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\MountName */ @@ -1525,7 +1621,7 @@ public function mountNamesUpdate($id, $mount_name, string $contentType = self::c * @param \Libretime\Client\Model\MountName $mount_name (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mountNamesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\MountName, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function mountNamesUpdateWithHttpInfo($id, $mount_name, string $contentTy } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\MountName' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function mountNamesUpdateWithHttpInfo($id, $mount_name, string $contentTy } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/PlaylistContentsApi.php b/php-client/lib/Api/PlaylistContentsApi.php index 63b275de..5e0df90f 100644 --- a/php-client/lib/Api/PlaylistContentsApi.php +++ b/php-client/lib/Api/PlaylistContentsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class PlaylistContentsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\PlaylistContent $playlist_content playlist_content (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistContentsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlaylistContent */ @@ -165,7 +165,7 @@ public function playlistContentsCreate($playlist_content, string $contentType = * @param \Libretime\Client\Model\PlaylistContent $playlist_content (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistContentsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlaylistContent, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function playlistContentsCreateWithHttpInfo($playlist_content, string $co } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlaylistContent' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function playlistContentsCreateWithHttpInfo($playlist_content, string $co } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function playlistContentsCreateRequest($playlist_content, string $content * @param int $id A unique integer value identifying this playlist content. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistContentsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function playlistContentsDestroy($id, string $contentType = self::content * @param int $id A unique integer value identifying this playlist content. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistContentsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function playlistContentsDestroyRequest($id, string $contentType = self:: * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistContentsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlaylistContent[] */ @@ -676,7 +700,7 @@ public function playlistContentsList(string $contentType = self::contentTypes['p * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistContentsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlaylistContent[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function playlistContentsListWithHttpInfo(string $contentType = self::con } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlaylistContent[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function playlistContentsListWithHttpInfo(string $contentType = self::con } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function playlistContentsListRequest(string $contentType = self::contentT * @param \Libretime\Client\Model\PatchedPlaylistContent $patched_playlist_content patched_playlist_content (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistContentsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlaylistContent */ @@ -944,7 +992,7 @@ public function playlistContentsPartialUpdate($id, $patched_playlist_content = n * @param \Libretime\Client\Model\PatchedPlaylistContent $patched_playlist_content (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistContentsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlaylistContent, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function playlistContentsPartialUpdateWithHttpInfo($id, $patched_playlist } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlaylistContent' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function playlistContentsPartialUpdateWithHttpInfo($id, $patched_playlist } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function playlistContentsPartialUpdateRequest($id, $patched_playlist_cont * @param int $id A unique integer value identifying this playlist content. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistContentsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlaylistContent */ @@ -1239,7 +1311,7 @@ public function playlistContentsRetrieve($id, string $contentType = self::conten * @param int $id A unique integer value identifying this playlist content. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistContentsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlaylistContent, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function playlistContentsRetrieveWithHttpInfo($id, string $contentType = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlaylistContent' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function playlistContentsRetrieveWithHttpInfo($id, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function playlistContentsRetrieveRequest($id, string $contentType = self: * @param \Libretime\Client\Model\PlaylistContent $playlist_content playlist_content (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistContentsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlaylistContent */ @@ -1525,7 +1621,7 @@ public function playlistContentsUpdate($id, $playlist_content, string $contentTy * @param \Libretime\Client\Model\PlaylistContent $playlist_content (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistContentsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlaylistContent, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function playlistContentsUpdateWithHttpInfo($id, $playlist_content, strin } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlaylistContent' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function playlistContentsUpdateWithHttpInfo($id, $playlist_content, strin } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/PlaylistsApi.php b/php-client/lib/Api/PlaylistsApi.php index eb76fa2e..5c936b86 100644 --- a/php-client/lib/Api/PlaylistsApi.php +++ b/php-client/lib/Api/PlaylistsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class PlaylistsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\Playlist $playlist playlist (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Playlist */ @@ -165,7 +165,7 @@ public function playlistsCreate($playlist, string $contentType = self::contentTy * @param \Libretime\Client\Model\Playlist $playlist (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Playlist, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function playlistsCreateWithHttpInfo($playlist, string $contentType = sel } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Playlist' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function playlistsCreateWithHttpInfo($playlist, string $contentType = sel } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function playlistsCreateRequest($playlist, string $contentType = self::co * @param int $id A unique integer value identifying this playlist. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function playlistsDestroy($id, string $contentType = self::contentTypes[' * @param int $id A unique integer value identifying this playlist. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function playlistsDestroyRequest($id, string $contentType = self::content * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Playlist[] */ @@ -676,7 +700,7 @@ public function playlistsList(string $contentType = self::contentTypes['playlist * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Playlist[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function playlistsListWithHttpInfo(string $contentType = self::contentTyp } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Playlist[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function playlistsListWithHttpInfo(string $contentType = self::contentTyp } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function playlistsListRequest(string $contentType = self::contentTypes['p * @param \Libretime\Client\Model\PatchedPlaylist $patched_playlist patched_playlist (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Playlist */ @@ -944,7 +992,7 @@ public function playlistsPartialUpdate($id, $patched_playlist = null, string $co * @param \Libretime\Client\Model\PatchedPlaylist $patched_playlist (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Playlist, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function playlistsPartialUpdateWithHttpInfo($id, $patched_playlist = null } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Playlist' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function playlistsPartialUpdateWithHttpInfo($id, $patched_playlist = null } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function playlistsPartialUpdateRequest($id, $patched_playlist = null, str * @param int $id A unique integer value identifying this playlist. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Playlist */ @@ -1239,7 +1311,7 @@ public function playlistsRetrieve($id, string $contentType = self::contentTypes[ * @param int $id A unique integer value identifying this playlist. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Playlist, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function playlistsRetrieveWithHttpInfo($id, string $contentType = self::c } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Playlist' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function playlistsRetrieveWithHttpInfo($id, string $contentType = self::c } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function playlistsRetrieveRequest($id, string $contentType = self::conten * @param \Libretime\Client\Model\Playlist $playlist playlist (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Playlist */ @@ -1525,7 +1621,7 @@ public function playlistsUpdate($id, $playlist, string $contentType = self::cont * @param \Libretime\Client\Model\Playlist $playlist (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playlistsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Playlist, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function playlistsUpdateWithHttpInfo($id, $playlist, string $contentType } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Playlist' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function playlistsUpdateWithHttpInfo($id, $playlist, string $contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/PlayoutHistoryApi.php b/php-client/lib/Api/PlayoutHistoryApi.php index 5abd9adb..5f4a643b 100644 --- a/php-client/lib/Api/PlayoutHistoryApi.php +++ b/php-client/lib/Api/PlayoutHistoryApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class PlayoutHistoryApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\PlayoutHistory $playout_history playout_history (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistory */ @@ -165,7 +165,7 @@ public function playoutHistoryCreate($playout_history, string $contentType = sel * @param \Libretime\Client\Model\PlayoutHistory $playout_history (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistory, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function playoutHistoryCreateWithHttpInfo($playout_history, string $conte } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistory' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function playoutHistoryCreateWithHttpInfo($playout_history, string $conte } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function playoutHistoryCreateRequest($playout_history, string $contentTyp * @param int $id A unique integer value identifying this playout history. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function playoutHistoryDestroy($id, string $contentType = self::contentTy * @param int $id A unique integer value identifying this playout history. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function playoutHistoryDestroyRequest($id, string $contentType = self::co * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistory[] */ @@ -676,7 +700,7 @@ public function playoutHistoryList(string $contentType = self::contentTypes['pla * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistory[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function playoutHistoryListWithHttpInfo(string $contentType = self::conte } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistory[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function playoutHistoryListWithHttpInfo(string $contentType = self::conte } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function playoutHistoryListRequest(string $contentType = self::contentTyp * @param \Libretime\Client\Model\PatchedPlayoutHistory $patched_playout_history patched_playout_history (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistory */ @@ -944,7 +992,7 @@ public function playoutHistoryPartialUpdate($id, $patched_playout_history = null * @param \Libretime\Client\Model\PatchedPlayoutHistory $patched_playout_history (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistory, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function playoutHistoryPartialUpdateWithHttpInfo($id, $patched_playout_hi } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistory' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function playoutHistoryPartialUpdateWithHttpInfo($id, $patched_playout_hi } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function playoutHistoryPartialUpdateRequest($id, $patched_playout_history * @param int $id A unique integer value identifying this playout history. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistory */ @@ -1239,7 +1311,7 @@ public function playoutHistoryRetrieve($id, string $contentType = self::contentT * @param int $id A unique integer value identifying this playout history. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistory, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function playoutHistoryRetrieveWithHttpInfo($id, string $contentType = se } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistory' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function playoutHistoryRetrieveWithHttpInfo($id, string $contentType = se } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function playoutHistoryRetrieveRequest($id, string $contentType = self::c * @param \Libretime\Client\Model\PlayoutHistory $playout_history playout_history (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistory */ @@ -1525,7 +1621,7 @@ public function playoutHistoryUpdate($id, $playout_history, string $contentType * @param \Libretime\Client\Model\PlayoutHistory $playout_history (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistory, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function playoutHistoryUpdateWithHttpInfo($id, $playout_history, string $ } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistory' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function playoutHistoryUpdateWithHttpInfo($id, $playout_history, string $ } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/PlayoutHistoryMetadataApi.php b/php-client/lib/Api/PlayoutHistoryMetadataApi.php index 31214944..5d3c28c2 100644 --- a/php-client/lib/Api/PlayoutHistoryMetadataApi.php +++ b/php-client/lib/Api/PlayoutHistoryMetadataApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class PlayoutHistoryMetadataApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\PlayoutHistoryMetadata $playout_history_metadata playout_history_metadata (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryMetadataCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryMetadata */ @@ -165,7 +165,7 @@ public function playoutHistoryMetadataCreate($playout_history_metadata, string $ * @param \Libretime\Client\Model\PlayoutHistoryMetadata $playout_history_metadata (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryMetadataCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryMetadata, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function playoutHistoryMetadataCreateWithHttpInfo($playout_history_metada } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryMetadata' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function playoutHistoryMetadataCreateWithHttpInfo($playout_history_metada } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function playoutHistoryMetadataCreateRequest($playout_history_metadata, s * @param int $id A unique integer value identifying this playout history metadata. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryMetadataDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function playoutHistoryMetadataDestroy($id, string $contentType = self::c * @param int $id A unique integer value identifying this playout history metadata. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryMetadataDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function playoutHistoryMetadataDestroyRequest($id, string $contentType = * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryMetadataList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryMetadata[] */ @@ -676,7 +700,7 @@ public function playoutHistoryMetadataList(string $contentType = self::contentTy * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryMetadataList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryMetadata[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function playoutHistoryMetadataListWithHttpInfo(string $contentType = sel } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryMetadata[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function playoutHistoryMetadataListWithHttpInfo(string $contentType = sel } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function playoutHistoryMetadataListRequest(string $contentType = self::co * @param \Libretime\Client\Model\PatchedPlayoutHistoryMetadata $patched_playout_history_metadata patched_playout_history_metadata (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryMetadataPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryMetadata */ @@ -944,7 +992,7 @@ public function playoutHistoryMetadataPartialUpdate($id, $patched_playout_histor * @param \Libretime\Client\Model\PatchedPlayoutHistoryMetadata $patched_playout_history_metadata (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryMetadataPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryMetadata, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function playoutHistoryMetadataPartialUpdateWithHttpInfo($id, $patched_pl } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryMetadata' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function playoutHistoryMetadataPartialUpdateWithHttpInfo($id, $patched_pl } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function playoutHistoryMetadataPartialUpdateRequest($id, $patched_playout * @param int $id A unique integer value identifying this playout history metadata. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryMetadataRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryMetadata */ @@ -1239,7 +1311,7 @@ public function playoutHistoryMetadataRetrieve($id, string $contentType = self:: * @param int $id A unique integer value identifying this playout history metadata. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryMetadataRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryMetadata, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function playoutHistoryMetadataRetrieveWithHttpInfo($id, string $contentT } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryMetadata' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function playoutHistoryMetadataRetrieveWithHttpInfo($id, string $contentT } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function playoutHistoryMetadataRetrieveRequest($id, string $contentType = * @param \Libretime\Client\Model\PlayoutHistoryMetadata $playout_history_metadata playout_history_metadata (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryMetadataUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryMetadata */ @@ -1525,7 +1621,7 @@ public function playoutHistoryMetadataUpdate($id, $playout_history_metadata, str * @param \Libretime\Client\Model\PlayoutHistoryMetadata $playout_history_metadata (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryMetadataUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryMetadata, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function playoutHistoryMetadataUpdateWithHttpInfo($id, $playout_history_m } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryMetadata' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function playoutHistoryMetadataUpdateWithHttpInfo($id, $playout_history_m } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/PlayoutHistoryTemplateFieldsApi.php b/php-client/lib/Api/PlayoutHistoryTemplateFieldsApi.php index 799154bb..27d3d594 100644 --- a/php-client/lib/Api/PlayoutHistoryTemplateFieldsApi.php +++ b/php-client/lib/Api/PlayoutHistoryTemplateFieldsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class PlayoutHistoryTemplateFieldsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\PlayoutHistoryTemplateField $playout_history_template_field playout_history_template_field (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplateFieldsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryTemplateField */ @@ -165,7 +165,7 @@ public function playoutHistoryTemplateFieldsCreate($playout_history_template_fie * @param \Libretime\Client\Model\PlayoutHistoryTemplateField $playout_history_template_field (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplateFieldsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryTemplateField, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function playoutHistoryTemplateFieldsCreateWithHttpInfo($playout_history_ } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryTemplateField' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function playoutHistoryTemplateFieldsCreateWithHttpInfo($playout_history_ } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function playoutHistoryTemplateFieldsCreateRequest($playout_history_templ * @param int $id A unique integer value identifying this playout history template field. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplateFieldsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function playoutHistoryTemplateFieldsDestroy($id, string $contentType = s * @param int $id A unique integer value identifying this playout history template field. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplateFieldsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function playoutHistoryTemplateFieldsDestroyRequest($id, string $contentT * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplateFieldsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryTemplateField[] */ @@ -676,7 +700,7 @@ public function playoutHistoryTemplateFieldsList(string $contentType = self::con * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplateFieldsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryTemplateField[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function playoutHistoryTemplateFieldsListWithHttpInfo(string $contentType } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryTemplateField[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function playoutHistoryTemplateFieldsListWithHttpInfo(string $contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function playoutHistoryTemplateFieldsListRequest(string $contentType = se * @param \Libretime\Client\Model\PatchedPlayoutHistoryTemplateField $patched_playout_history_template_field patched_playout_history_template_field (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplateFieldsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryTemplateField */ @@ -944,7 +992,7 @@ public function playoutHistoryTemplateFieldsPartialUpdate($id, $patched_playout_ * @param \Libretime\Client\Model\PatchedPlayoutHistoryTemplateField $patched_playout_history_template_field (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplateFieldsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryTemplateField, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function playoutHistoryTemplateFieldsPartialUpdateWithHttpInfo($id, $patc } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryTemplateField' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function playoutHistoryTemplateFieldsPartialUpdateWithHttpInfo($id, $patc } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function playoutHistoryTemplateFieldsPartialUpdateRequest($id, $patched_p * @param int $id A unique integer value identifying this playout history template field. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplateFieldsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryTemplateField */ @@ -1239,7 +1311,7 @@ public function playoutHistoryTemplateFieldsRetrieve($id, string $contentType = * @param int $id A unique integer value identifying this playout history template field. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplateFieldsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryTemplateField, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function playoutHistoryTemplateFieldsRetrieveWithHttpInfo($id, string $co } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryTemplateField' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function playoutHistoryTemplateFieldsRetrieveWithHttpInfo($id, string $co } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function playoutHistoryTemplateFieldsRetrieveRequest($id, string $content * @param \Libretime\Client\Model\PlayoutHistoryTemplateField $playout_history_template_field playout_history_template_field (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplateFieldsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryTemplateField */ @@ -1525,7 +1621,7 @@ public function playoutHistoryTemplateFieldsUpdate($id, $playout_history_templat * @param \Libretime\Client\Model\PlayoutHistoryTemplateField $playout_history_template_field (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplateFieldsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryTemplateField, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function playoutHistoryTemplateFieldsUpdateWithHttpInfo($id, $playout_his } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryTemplateField' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function playoutHistoryTemplateFieldsUpdateWithHttpInfo($id, $playout_his } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/PlayoutHistoryTemplatesApi.php b/php-client/lib/Api/PlayoutHistoryTemplatesApi.php index 68d26624..3c505532 100644 --- a/php-client/lib/Api/PlayoutHistoryTemplatesApi.php +++ b/php-client/lib/Api/PlayoutHistoryTemplatesApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class PlayoutHistoryTemplatesApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\PlayoutHistoryTemplate $playout_history_template playout_history_template (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplatesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryTemplate */ @@ -165,7 +165,7 @@ public function playoutHistoryTemplatesCreate($playout_history_template, string * @param \Libretime\Client\Model\PlayoutHistoryTemplate $playout_history_template (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplatesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryTemplate, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function playoutHistoryTemplatesCreateWithHttpInfo($playout_history_templ } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryTemplate' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function playoutHistoryTemplatesCreateWithHttpInfo($playout_history_templ } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function playoutHistoryTemplatesCreateRequest($playout_history_template, * @param int $id A unique integer value identifying this playout history template. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplatesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function playoutHistoryTemplatesDestroy($id, string $contentType = self:: * @param int $id A unique integer value identifying this playout history template. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplatesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function playoutHistoryTemplatesDestroyRequest($id, string $contentType = * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplatesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryTemplate[] */ @@ -676,7 +700,7 @@ public function playoutHistoryTemplatesList(string $contentType = self::contentT * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplatesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryTemplate[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function playoutHistoryTemplatesListWithHttpInfo(string $contentType = se } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryTemplate[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function playoutHistoryTemplatesListWithHttpInfo(string $contentType = se } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function playoutHistoryTemplatesListRequest(string $contentType = self::c * @param \Libretime\Client\Model\PatchedPlayoutHistoryTemplate $patched_playout_history_template patched_playout_history_template (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplatesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryTemplate */ @@ -944,7 +992,7 @@ public function playoutHistoryTemplatesPartialUpdate($id, $patched_playout_histo * @param \Libretime\Client\Model\PatchedPlayoutHistoryTemplate $patched_playout_history_template (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplatesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryTemplate, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function playoutHistoryTemplatesPartialUpdateWithHttpInfo($id, $patched_p } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryTemplate' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function playoutHistoryTemplatesPartialUpdateWithHttpInfo($id, $patched_p } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function playoutHistoryTemplatesPartialUpdateRequest($id, $patched_playou * @param int $id A unique integer value identifying this playout history template. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplatesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryTemplate */ @@ -1239,7 +1311,7 @@ public function playoutHistoryTemplatesRetrieve($id, string $contentType = self: * @param int $id A unique integer value identifying this playout history template. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplatesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryTemplate, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function playoutHistoryTemplatesRetrieveWithHttpInfo($id, string $content } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryTemplate' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function playoutHistoryTemplatesRetrieveWithHttpInfo($id, string $content } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function playoutHistoryTemplatesRetrieveRequest($id, string $contentType * @param \Libretime\Client\Model\PlayoutHistoryTemplate $playout_history_template playout_history_template (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplatesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PlayoutHistoryTemplate */ @@ -1525,7 +1621,7 @@ public function playoutHistoryTemplatesUpdate($id, $playout_history_template, st * @param \Libretime\Client\Model\PlayoutHistoryTemplate $playout_history_template (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['playoutHistoryTemplatesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PlayoutHistoryTemplate, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function playoutHistoryTemplatesUpdateWithHttpInfo($id, $playout_history_ } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PlayoutHistoryTemplate' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function playoutHistoryTemplatesUpdateWithHttpInfo($id, $playout_history_ } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/PodcastEpisodesApi.php b/php-client/lib/Api/PodcastEpisodesApi.php index ae34ac1d..4e4cbcff 100644 --- a/php-client/lib/Api/PodcastEpisodesApi.php +++ b/php-client/lib/Api/PodcastEpisodesApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class PodcastEpisodesApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\PodcastEpisode $podcast_episode podcast_episode (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastEpisodesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PodcastEpisode */ @@ -165,7 +165,7 @@ public function podcastEpisodesCreate($podcast_episode, string $contentType = se * @param \Libretime\Client\Model\PodcastEpisode $podcast_episode (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastEpisodesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PodcastEpisode, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function podcastEpisodesCreateWithHttpInfo($podcast_episode, string $cont } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PodcastEpisode' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function podcastEpisodesCreateWithHttpInfo($podcast_episode, string $cont } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function podcastEpisodesCreateRequest($podcast_episode, string $contentTy * @param int $id A unique integer value identifying this podcast episode. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastEpisodesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function podcastEpisodesDestroy($id, string $contentType = self::contentT * @param int $id A unique integer value identifying this podcast episode. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastEpisodesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function podcastEpisodesDestroyRequest($id, string $contentType = self::c * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastEpisodesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PodcastEpisode[] */ @@ -676,7 +700,7 @@ public function podcastEpisodesList(string $contentType = self::contentTypes['po * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastEpisodesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PodcastEpisode[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function podcastEpisodesListWithHttpInfo(string $contentType = self::cont } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PodcastEpisode[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function podcastEpisodesListWithHttpInfo(string $contentType = self::cont } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function podcastEpisodesListRequest(string $contentType = self::contentTy * @param \Libretime\Client\Model\PatchedPodcastEpisode $patched_podcast_episode patched_podcast_episode (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastEpisodesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PodcastEpisode */ @@ -944,7 +992,7 @@ public function podcastEpisodesPartialUpdate($id, $patched_podcast_episode = nul * @param \Libretime\Client\Model\PatchedPodcastEpisode $patched_podcast_episode (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastEpisodesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PodcastEpisode, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function podcastEpisodesPartialUpdateWithHttpInfo($id, $patched_podcast_e } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PodcastEpisode' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function podcastEpisodesPartialUpdateWithHttpInfo($id, $patched_podcast_e } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function podcastEpisodesPartialUpdateRequest($id, $patched_podcast_episod * @param int $id A unique integer value identifying this podcast episode. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastEpisodesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PodcastEpisode */ @@ -1239,7 +1311,7 @@ public function podcastEpisodesRetrieve($id, string $contentType = self::content * @param int $id A unique integer value identifying this podcast episode. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastEpisodesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PodcastEpisode, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function podcastEpisodesRetrieveWithHttpInfo($id, string $contentType = s } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PodcastEpisode' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function podcastEpisodesRetrieveWithHttpInfo($id, string $contentType = s } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function podcastEpisodesRetrieveRequest($id, string $contentType = self:: * @param \Libretime\Client\Model\PodcastEpisode $podcast_episode podcast_episode (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastEpisodesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\PodcastEpisode */ @@ -1525,7 +1621,7 @@ public function podcastEpisodesUpdate($id, $podcast_episode, string $contentType * @param \Libretime\Client\Model\PodcastEpisode $podcast_episode (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastEpisodesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\PodcastEpisode, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function podcastEpisodesUpdateWithHttpInfo($id, $podcast_episode, string } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\PodcastEpisode' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function podcastEpisodesUpdateWithHttpInfo($id, $podcast_episode, string } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/PodcastsApi.php b/php-client/lib/Api/PodcastsApi.php index 084f676a..8dec3ea2 100644 --- a/php-client/lib/Api/PodcastsApi.php +++ b/php-client/lib/Api/PodcastsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class PodcastsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\Podcast $podcast podcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Podcast */ @@ -165,7 +165,7 @@ public function podcastsCreate($podcast, string $contentType = self::contentType * @param \Libretime\Client\Model\Podcast $podcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Podcast, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function podcastsCreateWithHttpInfo($podcast, string $contentType = self: } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Podcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function podcastsCreateWithHttpInfo($podcast, string $contentType = self: } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function podcastsCreateRequest($podcast, string $contentType = self::cont * @param int $id A unique integer value identifying this podcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function podcastsDestroy($id, string $contentType = self::contentTypes['p * @param int $id A unique integer value identifying this podcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function podcastsDestroyRequest($id, string $contentType = self::contentT * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Podcast[] */ @@ -676,7 +700,7 @@ public function podcastsList(string $contentType = self::contentTypes['podcastsL * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Podcast[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function podcastsListWithHttpInfo(string $contentType = self::contentType } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Podcast[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function podcastsListWithHttpInfo(string $contentType = self::contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function podcastsListRequest(string $contentType = self::contentTypes['po * @param \Libretime\Client\Model\PatchedPodcast $patched_podcast patched_podcast (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Podcast */ @@ -944,7 +992,7 @@ public function podcastsPartialUpdate($id, $patched_podcast = null, string $cont * @param \Libretime\Client\Model\PatchedPodcast $patched_podcast (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Podcast, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function podcastsPartialUpdateWithHttpInfo($id, $patched_podcast = null, } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Podcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function podcastsPartialUpdateWithHttpInfo($id, $patched_podcast = null, } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function podcastsPartialUpdateRequest($id, $patched_podcast = null, strin * @param int $id A unique integer value identifying this podcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Podcast */ @@ -1239,7 +1311,7 @@ public function podcastsRetrieve($id, string $contentType = self::contentTypes[' * @param int $id A unique integer value identifying this podcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Podcast, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function podcastsRetrieveWithHttpInfo($id, string $contentType = self::co } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Podcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function podcastsRetrieveWithHttpInfo($id, string $contentType = self::co } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function podcastsRetrieveRequest($id, string $contentType = self::content * @param \Libretime\Client\Model\Podcast $podcast podcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Podcast */ @@ -1525,7 +1621,7 @@ public function podcastsUpdate($id, $podcast, string $contentType = self::conten * @param \Libretime\Client\Model\Podcast $podcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['podcastsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Podcast, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function podcastsUpdateWithHttpInfo($id, $podcast, string $contentType = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Podcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function podcastsUpdateWithHttpInfo($id, $podcast, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/PreferencesApi.php b/php-client/lib/Api/PreferencesApi.php index 03c752ac..483fc3a2 100644 --- a/php-client/lib/Api/PreferencesApi.php +++ b/php-client/lib/Api/PreferencesApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class PreferencesApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\Preference $preference preference (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['preferencesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Preference */ @@ -165,7 +165,7 @@ public function preferencesCreate($preference, string $contentType = self::conte * @param \Libretime\Client\Model\Preference $preference (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['preferencesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Preference, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function preferencesCreateWithHttpInfo($preference, string $contentType = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Preference' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function preferencesCreateWithHttpInfo($preference, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function preferencesCreateRequest($preference, string $contentType = self * @param int $id A unique integer value identifying this preference. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['preferencesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function preferencesDestroy($id, string $contentType = self::contentTypes * @param int $id A unique integer value identifying this preference. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['preferencesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function preferencesDestroyRequest($id, string $contentType = self::conte * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['preferencesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Preference[] */ @@ -676,7 +700,7 @@ public function preferencesList(string $contentType = self::contentTypes['prefer * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['preferencesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Preference[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function preferencesListWithHttpInfo(string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Preference[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function preferencesListWithHttpInfo(string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function preferencesListRequest(string $contentType = self::contentTypes[ * @param \Libretime\Client\Model\PatchedPreference $patched_preference patched_preference (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['preferencesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Preference */ @@ -944,7 +992,7 @@ public function preferencesPartialUpdate($id, $patched_preference = null, string * @param \Libretime\Client\Model\PatchedPreference $patched_preference (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['preferencesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Preference, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function preferencesPartialUpdateWithHttpInfo($id, $patched_preference = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Preference' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function preferencesPartialUpdateWithHttpInfo($id, $patched_preference = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function preferencesPartialUpdateRequest($id, $patched_preference = null, * @param int $id A unique integer value identifying this preference. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['preferencesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Preference */ @@ -1239,7 +1311,7 @@ public function preferencesRetrieve($id, string $contentType = self::contentType * @param int $id A unique integer value identifying this preference. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['preferencesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Preference, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function preferencesRetrieveWithHttpInfo($id, string $contentType = self: } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Preference' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function preferencesRetrieveWithHttpInfo($id, string $contentType = self: } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function preferencesRetrieveRequest($id, string $contentType = self::cont * @param \Libretime\Client\Model\Preference $preference preference (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['preferencesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Preference */ @@ -1525,7 +1621,7 @@ public function preferencesUpdate($id, $preference, string $contentType = self:: * @param \Libretime\Client\Model\Preference $preference (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['preferencesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Preference, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function preferencesUpdateWithHttpInfo($id, $preference, string $contentT } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Preference' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function preferencesUpdateWithHttpInfo($id, $preference, string $contentT } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/ScheduleApi.php b/php-client/lib/Api/ScheduleApi.php index b42fc8ab..f9e4a0bb 100644 --- a/php-client/lib/Api/ScheduleApi.php +++ b/php-client/lib/Api/ScheduleApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class ScheduleApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\Schedule $schedule schedule (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Schedule */ @@ -165,7 +165,7 @@ public function scheduleCreate($schedule, string $contentType = self::contentTyp * @param \Libretime\Client\Model\Schedule $schedule (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Schedule, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function scheduleCreateWithHttpInfo($schedule, string $contentType = self } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Schedule' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function scheduleCreateWithHttpInfo($schedule, string $contentType = self } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function scheduleCreateRequest($schedule, string $contentType = self::con * @param int $id A unique integer value identifying this schedule. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function scheduleDestroy($id, string $contentType = self::contentTypes['s * @param int $id A unique integer value identifying this schedule. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -668,7 +692,7 @@ public function scheduleDestroyRequest($id, string $contentType = self::contentT * @param \DateTime $starts_before starts_before (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Schedule[] */ @@ -690,7 +714,7 @@ public function scheduleList($broadcasted = null, $ends_after = null, $ends_befo * @param \DateTime $starts_before (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Schedule[], HTTP status code, HTTP response headers (array of strings) */ @@ -740,7 +764,19 @@ public function scheduleListWithHttpInfo($broadcasted = null, $ends_after = null } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Schedule[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -757,7 +793,19 @@ public function scheduleListWithHttpInfo($broadcasted = null, $ends_after = null } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1032,7 +1080,7 @@ public function scheduleListRequest($broadcasted = null, $ends_after = null, $en * @param \Libretime\Client\Model\PatchedSchedule $patched_schedule patched_schedule (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['schedulePartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Schedule */ @@ -1049,7 +1097,7 @@ public function schedulePartialUpdate($id, $patched_schedule = null, string $con * @param \Libretime\Client\Model\PatchedSchedule $patched_schedule (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['schedulePartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Schedule, HTTP status code, HTTP response headers (array of strings) */ @@ -1099,7 +1147,19 @@ public function schedulePartialUpdateWithHttpInfo($id, $patched_schedule = null, } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Schedule' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1116,7 +1176,19 @@ public function schedulePartialUpdateWithHttpInfo($id, $patched_schedule = null, } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1328,7 +1400,7 @@ public function schedulePartialUpdateRequest($id, $patched_schedule = null, stri * @param int $id A unique integer value identifying this schedule. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Schedule */ @@ -1344,7 +1416,7 @@ public function scheduleRetrieve($id, string $contentType = self::contentTypes[' * @param int $id A unique integer value identifying this schedule. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Schedule, HTTP status code, HTTP response headers (array of strings) */ @@ -1394,7 +1466,19 @@ public function scheduleRetrieveWithHttpInfo($id, string $contentType = self::co } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Schedule' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1411,7 +1495,19 @@ public function scheduleRetrieveWithHttpInfo($id, string $contentType = self::co } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1613,7 +1709,7 @@ public function scheduleRetrieveRequest($id, string $contentType = self::content * @param \Libretime\Client\Model\Schedule $schedule schedule (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Schedule */ @@ -1630,7 +1726,7 @@ public function scheduleUpdate($id, $schedule, string $contentType = self::conte * @param \Libretime\Client\Model\Schedule $schedule (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Schedule, HTTP status code, HTTP response headers (array of strings) */ @@ -1680,7 +1776,19 @@ public function scheduleUpdateWithHttpInfo($id, $schedule, string $contentType = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Schedule' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1697,7 +1805,19 @@ public function scheduleUpdateWithHttpInfo($id, $schedule, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/SchemaApi.php b/php-client/lib/Api/SchemaApi.php index 5ec86376..ec003bfd 100644 --- a/php-client/lib/Api/SchemaApi.php +++ b/php-client/lib/Api/SchemaApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -76,7 +76,7 @@ class SchemaApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -129,7 +129,7 @@ public function getConfig() * @param string $lang lang (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['schemaRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array */ @@ -146,7 +146,7 @@ public function schemaRetrieve($format = null, $lang = null, string $contentType * @param string $lang (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['schemaRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of array, HTTP status code, HTTP response headers (array of strings) */ @@ -196,7 +196,19 @@ public function schemaRetrieveWithHttpInfo($format = null, $lang = null, string } else { $content = (string) $response->getBody(); if ('array' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -213,7 +225,19 @@ public function schemaRetrieveWithHttpInfo($format = null, $lang = null, string } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/ServiceRegistersApi.php b/php-client/lib/Api/ServiceRegistersApi.php index e96e2b59..5891dda0 100644 --- a/php-client/lib/Api/ServiceRegistersApi.php +++ b/php-client/lib/Api/ServiceRegistersApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class ServiceRegistersApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\ServiceRegister $service_register service_register (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['serviceRegistersCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ServiceRegister */ @@ -165,7 +165,7 @@ public function serviceRegistersCreate($service_register, string $contentType = * @param \Libretime\Client\Model\ServiceRegister $service_register (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['serviceRegistersCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ServiceRegister, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function serviceRegistersCreateWithHttpInfo($service_register, string $co } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ServiceRegister' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function serviceRegistersCreateWithHttpInfo($service_register, string $co } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function serviceRegistersCreateRequest($service_register, string $content * @param string $name A unique value identifying this service register. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['serviceRegistersDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function serviceRegistersDestroy($name, string $contentType = self::conte * @param string $name A unique value identifying this service register. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['serviceRegistersDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function serviceRegistersDestroyRequest($name, string $contentType = self * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['serviceRegistersList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ServiceRegister[] */ @@ -676,7 +700,7 @@ public function serviceRegistersList(string $contentType = self::contentTypes['s * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['serviceRegistersList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ServiceRegister[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function serviceRegistersListWithHttpInfo(string $contentType = self::con } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ServiceRegister[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function serviceRegistersListWithHttpInfo(string $contentType = self::con } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function serviceRegistersListRequest(string $contentType = self::contentT * @param \Libretime\Client\Model\PatchedServiceRegister $patched_service_register patched_service_register (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['serviceRegistersPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ServiceRegister */ @@ -944,7 +992,7 @@ public function serviceRegistersPartialUpdate($name, $patched_service_register = * @param \Libretime\Client\Model\PatchedServiceRegister $patched_service_register (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['serviceRegistersPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ServiceRegister, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function serviceRegistersPartialUpdateWithHttpInfo($name, $patched_servic } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ServiceRegister' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function serviceRegistersPartialUpdateWithHttpInfo($name, $patched_servic } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function serviceRegistersPartialUpdateRequest($name, $patched_service_reg * @param string $name A unique value identifying this service register. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['serviceRegistersRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ServiceRegister */ @@ -1239,7 +1311,7 @@ public function serviceRegistersRetrieve($name, string $contentType = self::cont * @param string $name A unique value identifying this service register. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['serviceRegistersRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ServiceRegister, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function serviceRegistersRetrieveWithHttpInfo($name, string $contentType } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ServiceRegister' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function serviceRegistersRetrieveWithHttpInfo($name, string $contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function serviceRegistersRetrieveRequest($name, string $contentType = sel * @param \Libretime\Client\Model\ServiceRegister $service_register service_register (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['serviceRegistersUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ServiceRegister */ @@ -1525,7 +1621,7 @@ public function serviceRegistersUpdate($name, $service_register, string $content * @param \Libretime\Client\Model\ServiceRegister $service_register (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['serviceRegistersUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ServiceRegister, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function serviceRegistersUpdateWithHttpInfo($name, $service_register, str } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ServiceRegister' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function serviceRegistersUpdateWithHttpInfo($name, $service_register, str } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/ShowDaysApi.php b/php-client/lib/Api/ShowDaysApi.php index 4ae62881..52210880 100644 --- a/php-client/lib/Api/ShowDaysApi.php +++ b/php-client/lib/Api/ShowDaysApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class ShowDaysApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\ShowDays $show_days show_days (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showDaysCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowDays */ @@ -165,7 +165,7 @@ public function showDaysCreate($show_days, string $contentType = self::contentTy * @param \Libretime\Client\Model\ShowDays $show_days (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showDaysCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowDays, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function showDaysCreateWithHttpInfo($show_days, string $contentType = sel } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowDays' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function showDaysCreateWithHttpInfo($show_days, string $contentType = sel } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function showDaysCreateRequest($show_days, string $contentType = self::co * @param int $id A unique integer value identifying this show days. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showDaysDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function showDaysDestroy($id, string $contentType = self::contentTypes['s * @param int $id A unique integer value identifying this show days. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showDaysDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function showDaysDestroyRequest($id, string $contentType = self::contentT * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showDaysList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowDays[] */ @@ -676,7 +700,7 @@ public function showDaysList(string $contentType = self::contentTypes['showDaysL * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showDaysList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowDays[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function showDaysListWithHttpInfo(string $contentType = self::contentType } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowDays[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function showDaysListWithHttpInfo(string $contentType = self::contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function showDaysListRequest(string $contentType = self::contentTypes['sh * @param \Libretime\Client\Model\PatchedShowDays $patched_show_days patched_show_days (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showDaysPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowDays */ @@ -944,7 +992,7 @@ public function showDaysPartialUpdate($id, $patched_show_days = null, string $co * @param \Libretime\Client\Model\PatchedShowDays $patched_show_days (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showDaysPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowDays, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function showDaysPartialUpdateWithHttpInfo($id, $patched_show_days = null } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowDays' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function showDaysPartialUpdateWithHttpInfo($id, $patched_show_days = null } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function showDaysPartialUpdateRequest($id, $patched_show_days = null, str * @param int $id A unique integer value identifying this show days. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showDaysRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowDays */ @@ -1239,7 +1311,7 @@ public function showDaysRetrieve($id, string $contentType = self::contentTypes[' * @param int $id A unique integer value identifying this show days. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showDaysRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowDays, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function showDaysRetrieveWithHttpInfo($id, string $contentType = self::co } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowDays' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function showDaysRetrieveWithHttpInfo($id, string $contentType = self::co } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function showDaysRetrieveRequest($id, string $contentType = self::content * @param \Libretime\Client\Model\ShowDays $show_days show_days (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showDaysUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowDays */ @@ -1525,7 +1621,7 @@ public function showDaysUpdate($id, $show_days, string $contentType = self::cont * @param \Libretime\Client\Model\ShowDays $show_days (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showDaysUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowDays, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function showDaysUpdateWithHttpInfo($id, $show_days, string $contentType } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowDays' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function showDaysUpdateWithHttpInfo($id, $show_days, string $contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/ShowHostsApi.php b/php-client/lib/Api/ShowHostsApi.php index c2bef0c9..3fd13f3e 100644 --- a/php-client/lib/Api/ShowHostsApi.php +++ b/php-client/lib/Api/ShowHostsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class ShowHostsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\ShowHost $show_host show_host (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showHostsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowHost */ @@ -165,7 +165,7 @@ public function showHostsCreate($show_host, string $contentType = self::contentT * @param \Libretime\Client\Model\ShowHost $show_host (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showHostsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowHost, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function showHostsCreateWithHttpInfo($show_host, string $contentType = se } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowHost' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function showHostsCreateWithHttpInfo($show_host, string $contentType = se } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function showHostsCreateRequest($show_host, string $contentType = self::c * @param int $id A unique integer value identifying this show host. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showHostsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function showHostsDestroy($id, string $contentType = self::contentTypes[' * @param int $id A unique integer value identifying this show host. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showHostsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function showHostsDestroyRequest($id, string $contentType = self::content * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showHostsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowHost[] */ @@ -676,7 +700,7 @@ public function showHostsList(string $contentType = self::contentTypes['showHost * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showHostsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowHost[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function showHostsListWithHttpInfo(string $contentType = self::contentTyp } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowHost[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function showHostsListWithHttpInfo(string $contentType = self::contentTyp } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function showHostsListRequest(string $contentType = self::contentTypes['s * @param \Libretime\Client\Model\PatchedShowHost $patched_show_host patched_show_host (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showHostsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowHost */ @@ -944,7 +992,7 @@ public function showHostsPartialUpdate($id, $patched_show_host = null, string $c * @param \Libretime\Client\Model\PatchedShowHost $patched_show_host (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showHostsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowHost, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function showHostsPartialUpdateWithHttpInfo($id, $patched_show_host = nul } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowHost' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function showHostsPartialUpdateWithHttpInfo($id, $patched_show_host = nul } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function showHostsPartialUpdateRequest($id, $patched_show_host = null, st * @param int $id A unique integer value identifying this show host. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showHostsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowHost */ @@ -1239,7 +1311,7 @@ public function showHostsRetrieve($id, string $contentType = self::contentTypes[ * @param int $id A unique integer value identifying this show host. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showHostsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowHost, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function showHostsRetrieveWithHttpInfo($id, string $contentType = self::c } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowHost' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function showHostsRetrieveWithHttpInfo($id, string $contentType = self::c } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function showHostsRetrieveRequest($id, string $contentType = self::conten * @param \Libretime\Client\Model\ShowHost $show_host show_host (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showHostsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowHost */ @@ -1525,7 +1621,7 @@ public function showHostsUpdate($id, $show_host, string $contentType = self::con * @param \Libretime\Client\Model\ShowHost $show_host (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showHostsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowHost, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function showHostsUpdateWithHttpInfo($id, $show_host, string $contentType } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowHost' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function showHostsUpdateWithHttpInfo($id, $show_host, string $contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/ShowInstancesApi.php b/php-client/lib/Api/ShowInstancesApi.php index 2b00bf4e..491b8826 100644 --- a/php-client/lib/Api/ShowInstancesApi.php +++ b/php-client/lib/Api/ShowInstancesApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class ShowInstancesApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\ShowInstance $show_instance show_instance (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showInstancesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowInstance */ @@ -165,7 +165,7 @@ public function showInstancesCreate($show_instance, string $contentType = self:: * @param \Libretime\Client\Model\ShowInstance $show_instance (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showInstancesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowInstance, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function showInstancesCreateWithHttpInfo($show_instance, string $contentT } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowInstance' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function showInstancesCreateWithHttpInfo($show_instance, string $contentT } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function showInstancesCreateRequest($show_instance, string $contentType = * @param int $id A unique integer value identifying this show instance. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showInstancesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function showInstancesDestroy($id, string $contentType = self::contentTyp * @param int $id A unique integer value identifying this show instance. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showInstancesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function showInstancesDestroyRequest($id, string $contentType = self::con * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showInstancesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowInstance[] */ @@ -676,7 +700,7 @@ public function showInstancesList(string $contentType = self::contentTypes['show * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showInstancesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowInstance[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function showInstancesListWithHttpInfo(string $contentType = self::conten } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowInstance[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function showInstancesListWithHttpInfo(string $contentType = self::conten } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function showInstancesListRequest(string $contentType = self::contentType * @param \Libretime\Client\Model\PatchedShowInstance $patched_show_instance patched_show_instance (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showInstancesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowInstance */ @@ -944,7 +992,7 @@ public function showInstancesPartialUpdate($id, $patched_show_instance = null, s * @param \Libretime\Client\Model\PatchedShowInstance $patched_show_instance (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showInstancesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowInstance, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function showInstancesPartialUpdateWithHttpInfo($id, $patched_show_instan } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowInstance' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function showInstancesPartialUpdateWithHttpInfo($id, $patched_show_instan } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function showInstancesPartialUpdateRequest($id, $patched_show_instance = * @param int $id A unique integer value identifying this show instance. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showInstancesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowInstance */ @@ -1239,7 +1311,7 @@ public function showInstancesRetrieve($id, string $contentType = self::contentTy * @param int $id A unique integer value identifying this show instance. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showInstancesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowInstance, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function showInstancesRetrieveWithHttpInfo($id, string $contentType = sel } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowInstance' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function showInstancesRetrieveWithHttpInfo($id, string $contentType = sel } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function showInstancesRetrieveRequest($id, string $contentType = self::co * @param \Libretime\Client\Model\ShowInstance $show_instance show_instance (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showInstancesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowInstance */ @@ -1525,7 +1621,7 @@ public function showInstancesUpdate($id, $show_instance, string $contentType = s * @param \Libretime\Client\Model\ShowInstance $show_instance (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showInstancesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowInstance, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function showInstancesUpdateWithHttpInfo($id, $show_instance, string $con } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowInstance' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function showInstancesUpdateWithHttpInfo($id, $show_instance, string $con } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/ShowRebroadcastsApi.php b/php-client/lib/Api/ShowRebroadcastsApi.php index 5fc34a3e..80de6b68 100644 --- a/php-client/lib/Api/ShowRebroadcastsApi.php +++ b/php-client/lib/Api/ShowRebroadcastsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class ShowRebroadcastsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\ShowRebroadcast $show_rebroadcast show_rebroadcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showRebroadcastsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowRebroadcast */ @@ -165,7 +165,7 @@ public function showRebroadcastsCreate($show_rebroadcast, string $contentType = * @param \Libretime\Client\Model\ShowRebroadcast $show_rebroadcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showRebroadcastsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowRebroadcast, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function showRebroadcastsCreateWithHttpInfo($show_rebroadcast, string $co } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowRebroadcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function showRebroadcastsCreateWithHttpInfo($show_rebroadcast, string $co } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function showRebroadcastsCreateRequest($show_rebroadcast, string $content * @param int $id A unique integer value identifying this show rebroadcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showRebroadcastsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function showRebroadcastsDestroy($id, string $contentType = self::content * @param int $id A unique integer value identifying this show rebroadcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showRebroadcastsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function showRebroadcastsDestroyRequest($id, string $contentType = self:: * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showRebroadcastsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowRebroadcast[] */ @@ -676,7 +700,7 @@ public function showRebroadcastsList(string $contentType = self::contentTypes['s * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showRebroadcastsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowRebroadcast[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function showRebroadcastsListWithHttpInfo(string $contentType = self::con } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowRebroadcast[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function showRebroadcastsListWithHttpInfo(string $contentType = self::con } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function showRebroadcastsListRequest(string $contentType = self::contentT * @param \Libretime\Client\Model\PatchedShowRebroadcast $patched_show_rebroadcast patched_show_rebroadcast (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showRebroadcastsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowRebroadcast */ @@ -944,7 +992,7 @@ public function showRebroadcastsPartialUpdate($id, $patched_show_rebroadcast = n * @param \Libretime\Client\Model\PatchedShowRebroadcast $patched_show_rebroadcast (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showRebroadcastsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowRebroadcast, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function showRebroadcastsPartialUpdateWithHttpInfo($id, $patched_show_reb } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowRebroadcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function showRebroadcastsPartialUpdateWithHttpInfo($id, $patched_show_reb } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function showRebroadcastsPartialUpdateRequest($id, $patched_show_rebroadc * @param int $id A unique integer value identifying this show rebroadcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showRebroadcastsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowRebroadcast */ @@ -1239,7 +1311,7 @@ public function showRebroadcastsRetrieve($id, string $contentType = self::conten * @param int $id A unique integer value identifying this show rebroadcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showRebroadcastsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowRebroadcast, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function showRebroadcastsRetrieveWithHttpInfo($id, string $contentType = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowRebroadcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function showRebroadcastsRetrieveWithHttpInfo($id, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function showRebroadcastsRetrieveRequest($id, string $contentType = self: * @param \Libretime\Client\Model\ShowRebroadcast $show_rebroadcast show_rebroadcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showRebroadcastsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ShowRebroadcast */ @@ -1525,7 +1621,7 @@ public function showRebroadcastsUpdate($id, $show_rebroadcast, string $contentTy * @param \Libretime\Client\Model\ShowRebroadcast $show_rebroadcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showRebroadcastsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ShowRebroadcast, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function showRebroadcastsUpdateWithHttpInfo($id, $show_rebroadcast, strin } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ShowRebroadcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function showRebroadcastsUpdateWithHttpInfo($id, $show_rebroadcast, strin } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/ShowsApi.php b/php-client/lib/Api/ShowsApi.php index 0c23341f..7b302edd 100644 --- a/php-client/lib/Api/ShowsApi.php +++ b/php-client/lib/Api/ShowsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class ShowsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\Show $show show (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Show */ @@ -165,7 +165,7 @@ public function showsCreate($show, string $contentType = self::contentTypes['sho * @param \Libretime\Client\Model\Show $show (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Show, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function showsCreateWithHttpInfo($show, string $contentType = self::conte } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Show' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function showsCreateWithHttpInfo($show, string $contentType = self::conte } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function showsCreateRequest($show, string $contentType = self::contentTyp * @param int $id A unique integer value identifying this show. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function showsDestroy($id, string $contentType = self::contentTypes['show * @param int $id A unique integer value identifying this show. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function showsDestroyRequest($id, string $contentType = self::contentType * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Show[] */ @@ -676,7 +700,7 @@ public function showsList(string $contentType = self::contentTypes['showsList'][ * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Show[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function showsListWithHttpInfo(string $contentType = self::contentTypes[' } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Show[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function showsListWithHttpInfo(string $contentType = self::contentTypes[' } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function showsListRequest(string $contentType = self::contentTypes['shows * @param \Libretime\Client\Model\PatchedShow $patched_show patched_show (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Show */ @@ -944,7 +992,7 @@ public function showsPartialUpdate($id, $patched_show = null, string $contentTyp * @param \Libretime\Client\Model\PatchedShow $patched_show (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Show, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function showsPartialUpdateWithHttpInfo($id, $patched_show = null, string } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Show' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function showsPartialUpdateWithHttpInfo($id, $patched_show = null, string } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function showsPartialUpdateRequest($id, $patched_show = null, string $con * @param int $id A unique integer value identifying this show. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Show */ @@ -1239,7 +1311,7 @@ public function showsRetrieve($id, string $contentType = self::contentTypes['sho * @param int $id A unique integer value identifying this show. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Show, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function showsRetrieveWithHttpInfo($id, string $contentType = self::conte } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Show' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function showsRetrieveWithHttpInfo($id, string $contentType = self::conte } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function showsRetrieveRequest($id, string $contentType = self::contentTyp * @param \Libretime\Client\Model\Show $show show (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Show */ @@ -1525,7 +1621,7 @@ public function showsUpdate($id, $show, string $contentType = self::contentTypes * @param \Libretime\Client\Model\Show $show (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Show, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function showsUpdateWithHttpInfo($id, $show, string $contentType = self:: } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Show' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function showsUpdateWithHttpInfo($id, $show, string $contentType = self:: } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/SmartBlockContentsApi.php b/php-client/lib/Api/SmartBlockContentsApi.php index 855dd04c..c12614c2 100644 --- a/php-client/lib/Api/SmartBlockContentsApi.php +++ b/php-client/lib/Api/SmartBlockContentsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class SmartBlockContentsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\SmartBlockContent $smart_block_content smart_block_content (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockContentsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlockContent */ @@ -165,7 +165,7 @@ public function smartBlockContentsCreate($smart_block_content, string $contentTy * @param \Libretime\Client\Model\SmartBlockContent $smart_block_content (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockContentsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlockContent, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function smartBlockContentsCreateWithHttpInfo($smart_block_content, strin } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlockContent' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function smartBlockContentsCreateWithHttpInfo($smart_block_content, strin } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function smartBlockContentsCreateRequest($smart_block_content, string $co * @param int $id A unique integer value identifying this smart block content. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockContentsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function smartBlockContentsDestroy($id, string $contentType = self::conte * @param int $id A unique integer value identifying this smart block content. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockContentsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function smartBlockContentsDestroyRequest($id, string $contentType = self * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockContentsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlockContent[] */ @@ -676,7 +700,7 @@ public function smartBlockContentsList(string $contentType = self::contentTypes[ * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockContentsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlockContent[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function smartBlockContentsListWithHttpInfo(string $contentType = self::c } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlockContent[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function smartBlockContentsListWithHttpInfo(string $contentType = self::c } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function smartBlockContentsListRequest(string $contentType = self::conten * @param \Libretime\Client\Model\PatchedSmartBlockContent $patched_smart_block_content patched_smart_block_content (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockContentsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlockContent */ @@ -944,7 +992,7 @@ public function smartBlockContentsPartialUpdate($id, $patched_smart_block_conten * @param \Libretime\Client\Model\PatchedSmartBlockContent $patched_smart_block_content (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockContentsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlockContent, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function smartBlockContentsPartialUpdateWithHttpInfo($id, $patched_smart_ } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlockContent' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function smartBlockContentsPartialUpdateWithHttpInfo($id, $patched_smart_ } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function smartBlockContentsPartialUpdateRequest($id, $patched_smart_block * @param int $id A unique integer value identifying this smart block content. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockContentsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlockContent */ @@ -1239,7 +1311,7 @@ public function smartBlockContentsRetrieve($id, string $contentType = self::cont * @param int $id A unique integer value identifying this smart block content. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockContentsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlockContent, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function smartBlockContentsRetrieveWithHttpInfo($id, string $contentType } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlockContent' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function smartBlockContentsRetrieveWithHttpInfo($id, string $contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function smartBlockContentsRetrieveRequest($id, string $contentType = sel * @param \Libretime\Client\Model\SmartBlockContent $smart_block_content smart_block_content (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockContentsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlockContent */ @@ -1525,7 +1621,7 @@ public function smartBlockContentsUpdate($id, $smart_block_content, string $cont * @param \Libretime\Client\Model\SmartBlockContent $smart_block_content (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockContentsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlockContent, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function smartBlockContentsUpdateWithHttpInfo($id, $smart_block_content, } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlockContent' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function smartBlockContentsUpdateWithHttpInfo($id, $smart_block_content, } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/SmartBlockCriteriaApi.php b/php-client/lib/Api/SmartBlockCriteriaApi.php index 49aa9cf7..5492f518 100644 --- a/php-client/lib/Api/SmartBlockCriteriaApi.php +++ b/php-client/lib/Api/SmartBlockCriteriaApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class SmartBlockCriteriaApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\SmartBlockCriteria $smart_block_criteria smart_block_criteria (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockCriteriaCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlockCriteria */ @@ -165,7 +165,7 @@ public function smartBlockCriteriaCreate($smart_block_criteria, string $contentT * @param \Libretime\Client\Model\SmartBlockCriteria $smart_block_criteria (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockCriteriaCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlockCriteria, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function smartBlockCriteriaCreateWithHttpInfo($smart_block_criteria, stri } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlockCriteria' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function smartBlockCriteriaCreateWithHttpInfo($smart_block_criteria, stri } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function smartBlockCriteriaCreateRequest($smart_block_criteria, string $c * @param int $id A unique integer value identifying this smart block criteria. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockCriteriaDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function smartBlockCriteriaDestroy($id, string $contentType = self::conte * @param int $id A unique integer value identifying this smart block criteria. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockCriteriaDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function smartBlockCriteriaDestroyRequest($id, string $contentType = self * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockCriteriaList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlockCriteria[] */ @@ -676,7 +700,7 @@ public function smartBlockCriteriaList(string $contentType = self::contentTypes[ * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockCriteriaList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlockCriteria[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function smartBlockCriteriaListWithHttpInfo(string $contentType = self::c } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlockCriteria[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function smartBlockCriteriaListWithHttpInfo(string $contentType = self::c } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function smartBlockCriteriaListRequest(string $contentType = self::conten * @param \Libretime\Client\Model\PatchedSmartBlockCriteria $patched_smart_block_criteria patched_smart_block_criteria (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockCriteriaPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlockCriteria */ @@ -944,7 +992,7 @@ public function smartBlockCriteriaPartialUpdate($id, $patched_smart_block_criter * @param \Libretime\Client\Model\PatchedSmartBlockCriteria $patched_smart_block_criteria (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockCriteriaPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlockCriteria, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function smartBlockCriteriaPartialUpdateWithHttpInfo($id, $patched_smart_ } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlockCriteria' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function smartBlockCriteriaPartialUpdateWithHttpInfo($id, $patched_smart_ } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function smartBlockCriteriaPartialUpdateRequest($id, $patched_smart_block * @param int $id A unique integer value identifying this smart block criteria. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockCriteriaRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlockCriteria */ @@ -1239,7 +1311,7 @@ public function smartBlockCriteriaRetrieve($id, string $contentType = self::cont * @param int $id A unique integer value identifying this smart block criteria. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockCriteriaRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlockCriteria, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function smartBlockCriteriaRetrieveWithHttpInfo($id, string $contentType } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlockCriteria' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function smartBlockCriteriaRetrieveWithHttpInfo($id, string $contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function smartBlockCriteriaRetrieveRequest($id, string $contentType = sel * @param \Libretime\Client\Model\SmartBlockCriteria $smart_block_criteria smart_block_criteria (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockCriteriaUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlockCriteria */ @@ -1525,7 +1621,7 @@ public function smartBlockCriteriaUpdate($id, $smart_block_criteria, string $con * @param \Libretime\Client\Model\SmartBlockCriteria $smart_block_criteria (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlockCriteriaUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlockCriteria, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function smartBlockCriteriaUpdateWithHttpInfo($id, $smart_block_criteria, } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlockCriteria' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function smartBlockCriteriaUpdateWithHttpInfo($id, $smart_block_criteria, } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/SmartBlocksApi.php b/php-client/lib/Api/SmartBlocksApi.php index 835b4323..48b83b5f 100644 --- a/php-client/lib/Api/SmartBlocksApi.php +++ b/php-client/lib/Api/SmartBlocksApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class SmartBlocksApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\SmartBlock $smart_block smart_block (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlocksCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlock */ @@ -165,7 +165,7 @@ public function smartBlocksCreate($smart_block, string $contentType = self::cont * @param \Libretime\Client\Model\SmartBlock $smart_block (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlocksCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlock, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function smartBlocksCreateWithHttpInfo($smart_block, string $contentType } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlock' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function smartBlocksCreateWithHttpInfo($smart_block, string $contentType } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function smartBlocksCreateRequest($smart_block, string $contentType = sel * @param int $id A unique integer value identifying this smart block. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlocksDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function smartBlocksDestroy($id, string $contentType = self::contentTypes * @param int $id A unique integer value identifying this smart block. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlocksDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function smartBlocksDestroyRequest($id, string $contentType = self::conte * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlocksList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlock[] */ @@ -676,7 +700,7 @@ public function smartBlocksList(string $contentType = self::contentTypes['smartB * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlocksList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlock[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function smartBlocksListWithHttpInfo(string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlock[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function smartBlocksListWithHttpInfo(string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function smartBlocksListRequest(string $contentType = self::contentTypes[ * @param \Libretime\Client\Model\PatchedSmartBlock $patched_smart_block patched_smart_block (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlocksPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlock */ @@ -944,7 +992,7 @@ public function smartBlocksPartialUpdate($id, $patched_smart_block = null, strin * @param \Libretime\Client\Model\PatchedSmartBlock $patched_smart_block (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlocksPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlock, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function smartBlocksPartialUpdateWithHttpInfo($id, $patched_smart_block = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlock' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function smartBlocksPartialUpdateWithHttpInfo($id, $patched_smart_block = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function smartBlocksPartialUpdateRequest($id, $patched_smart_block = null * @param int $id A unique integer value identifying this smart block. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlocksRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlock */ @@ -1239,7 +1311,7 @@ public function smartBlocksRetrieve($id, string $contentType = self::contentType * @param int $id A unique integer value identifying this smart block. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlocksRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlock, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function smartBlocksRetrieveWithHttpInfo($id, string $contentType = self: } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlock' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function smartBlocksRetrieveWithHttpInfo($id, string $contentType = self: } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function smartBlocksRetrieveRequest($id, string $contentType = self::cont * @param \Libretime\Client\Model\SmartBlock $smart_block smart_block (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlocksUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\SmartBlock */ @@ -1525,7 +1621,7 @@ public function smartBlocksUpdate($id, $smart_block, string $contentType = self: * @param \Libretime\Client\Model\SmartBlock $smart_block (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smartBlocksUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\SmartBlock, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function smartBlocksUpdateWithHttpInfo($id, $smart_block, string $content } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\SmartBlock' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function smartBlocksUpdateWithHttpInfo($id, $smart_block, string $content } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/StationPodcastsApi.php b/php-client/lib/Api/StationPodcastsApi.php index 3cabf081..c73ead54 100644 --- a/php-client/lib/Api/StationPodcastsApi.php +++ b/php-client/lib/Api/StationPodcastsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class StationPodcastsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\StationPodcast $station_podcast station_podcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['stationPodcastsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\StationPodcast */ @@ -165,7 +165,7 @@ public function stationPodcastsCreate($station_podcast, string $contentType = se * @param \Libretime\Client\Model\StationPodcast $station_podcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['stationPodcastsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\StationPodcast, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function stationPodcastsCreateWithHttpInfo($station_podcast, string $cont } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\StationPodcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function stationPodcastsCreateWithHttpInfo($station_podcast, string $cont } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function stationPodcastsCreateRequest($station_podcast, string $contentTy * @param int $id A unique integer value identifying this station podcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['stationPodcastsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function stationPodcastsDestroy($id, string $contentType = self::contentT * @param int $id A unique integer value identifying this station podcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['stationPodcastsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function stationPodcastsDestroyRequest($id, string $contentType = self::c * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['stationPodcastsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\StationPodcast[] */ @@ -676,7 +700,7 @@ public function stationPodcastsList(string $contentType = self::contentTypes['st * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['stationPodcastsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\StationPodcast[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function stationPodcastsListWithHttpInfo(string $contentType = self::cont } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\StationPodcast[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function stationPodcastsListWithHttpInfo(string $contentType = self::cont } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function stationPodcastsListRequest(string $contentType = self::contentTy * @param \Libretime\Client\Model\PatchedStationPodcast $patched_station_podcast patched_station_podcast (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['stationPodcastsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\StationPodcast */ @@ -944,7 +992,7 @@ public function stationPodcastsPartialUpdate($id, $patched_station_podcast = nul * @param \Libretime\Client\Model\PatchedStationPodcast $patched_station_podcast (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['stationPodcastsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\StationPodcast, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function stationPodcastsPartialUpdateWithHttpInfo($id, $patched_station_p } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\StationPodcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function stationPodcastsPartialUpdateWithHttpInfo($id, $patched_station_p } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function stationPodcastsPartialUpdateRequest($id, $patched_station_podcas * @param int $id A unique integer value identifying this station podcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['stationPodcastsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\StationPodcast */ @@ -1239,7 +1311,7 @@ public function stationPodcastsRetrieve($id, string $contentType = self::content * @param int $id A unique integer value identifying this station podcast. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['stationPodcastsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\StationPodcast, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function stationPodcastsRetrieveWithHttpInfo($id, string $contentType = s } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\StationPodcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function stationPodcastsRetrieveWithHttpInfo($id, string $contentType = s } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function stationPodcastsRetrieveRequest($id, string $contentType = self:: * @param \Libretime\Client\Model\StationPodcast $station_podcast station_podcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['stationPodcastsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\StationPodcast */ @@ -1525,7 +1621,7 @@ public function stationPodcastsUpdate($id, $station_podcast, string $contentType * @param \Libretime\Client\Model\StationPodcast $station_podcast (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['stationPodcastsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\StationPodcast, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function stationPodcastsUpdateWithHttpInfo($id, $station_podcast, string } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\StationPodcast' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function stationPodcastsUpdateWithHttpInfo($id, $station_podcast, string } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/StreamApi.php b/php-client/lib/Api/StreamApi.php index 1be3a479..cdc5c6a6 100644 --- a/php-client/lib/Api/StreamApi.php +++ b/php-client/lib/Api/StreamApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -79,7 +79,7 @@ class StreamApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -130,7 +130,7 @@ public function getConfig() * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['streamPreferencesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\StreamPreferences */ @@ -145,7 +145,7 @@ public function streamPreferencesRetrieve(string $contentType = self::contentTyp * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['streamPreferencesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\StreamPreferences, HTTP status code, HTTP response headers (array of strings) */ @@ -195,7 +195,19 @@ public function streamPreferencesRetrieveWithHttpInfo(string $contentType = self } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\StreamPreferences' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -212,7 +224,19 @@ public function streamPreferencesRetrieveWithHttpInfo(string $contentType = self } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -394,7 +418,7 @@ public function streamPreferencesRetrieveRequest(string $contentType = self::con * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['streamStateRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\StreamState */ @@ -409,7 +433,7 @@ public function streamStateRetrieve(string $contentType = self::contentTypes['st * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['streamStateRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\StreamState, HTTP status code, HTTP response headers (array of strings) */ @@ -459,7 +483,19 @@ public function streamStateRetrieveWithHttpInfo(string $contentType = self::cont } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\StreamState' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -476,7 +512,19 @@ public function streamStateRetrieveWithHttpInfo(string $contentType = self::cont } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/ThirdPartyTrackReferencesApi.php b/php-client/lib/Api/ThirdPartyTrackReferencesApi.php index db9fb65c..ce2c4ea1 100644 --- a/php-client/lib/Api/ThirdPartyTrackReferencesApi.php +++ b/php-client/lib/Api/ThirdPartyTrackReferencesApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class ThirdPartyTrackReferencesApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\ThirdPartyTrackReference $third_party_track_reference third_party_track_reference (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['thirdPartyTrackReferencesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ThirdPartyTrackReference */ @@ -165,7 +165,7 @@ public function thirdPartyTrackReferencesCreate($third_party_track_reference, st * @param \Libretime\Client\Model\ThirdPartyTrackReference $third_party_track_reference (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['thirdPartyTrackReferencesCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ThirdPartyTrackReference, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function thirdPartyTrackReferencesCreateWithHttpInfo($third_party_track_r } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ThirdPartyTrackReference' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function thirdPartyTrackReferencesCreateWithHttpInfo($third_party_track_r } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function thirdPartyTrackReferencesCreateRequest($third_party_track_refere * @param int $id A unique integer value identifying this third party track reference. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['thirdPartyTrackReferencesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function thirdPartyTrackReferencesDestroy($id, string $contentType = self * @param int $id A unique integer value identifying this third party track reference. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['thirdPartyTrackReferencesDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function thirdPartyTrackReferencesDestroyRequest($id, string $contentType * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['thirdPartyTrackReferencesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ThirdPartyTrackReference[] */ @@ -676,7 +700,7 @@ public function thirdPartyTrackReferencesList(string $contentType = self::conten * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['thirdPartyTrackReferencesList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ThirdPartyTrackReference[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function thirdPartyTrackReferencesListWithHttpInfo(string $contentType = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ThirdPartyTrackReference[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function thirdPartyTrackReferencesListWithHttpInfo(string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function thirdPartyTrackReferencesListRequest(string $contentType = self: * @param \Libretime\Client\Model\PatchedThirdPartyTrackReference $patched_third_party_track_reference patched_third_party_track_reference (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['thirdPartyTrackReferencesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ThirdPartyTrackReference */ @@ -944,7 +992,7 @@ public function thirdPartyTrackReferencesPartialUpdate($id, $patched_third_party * @param \Libretime\Client\Model\PatchedThirdPartyTrackReference $patched_third_party_track_reference (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['thirdPartyTrackReferencesPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ThirdPartyTrackReference, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function thirdPartyTrackReferencesPartialUpdateWithHttpInfo($id, $patched } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ThirdPartyTrackReference' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function thirdPartyTrackReferencesPartialUpdateWithHttpInfo($id, $patched } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function thirdPartyTrackReferencesPartialUpdateRequest($id, $patched_thir * @param int $id A unique integer value identifying this third party track reference. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['thirdPartyTrackReferencesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ThirdPartyTrackReference */ @@ -1239,7 +1311,7 @@ public function thirdPartyTrackReferencesRetrieve($id, string $contentType = sel * @param int $id A unique integer value identifying this third party track reference. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['thirdPartyTrackReferencesRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ThirdPartyTrackReference, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function thirdPartyTrackReferencesRetrieveWithHttpInfo($id, string $conte } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ThirdPartyTrackReference' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function thirdPartyTrackReferencesRetrieveWithHttpInfo($id, string $conte } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function thirdPartyTrackReferencesRetrieveRequest($id, string $contentTyp * @param \Libretime\Client\Model\ThirdPartyTrackReference $third_party_track_reference third_party_track_reference (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['thirdPartyTrackReferencesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\ThirdPartyTrackReference */ @@ -1525,7 +1621,7 @@ public function thirdPartyTrackReferencesUpdate($id, $third_party_track_referenc * @param \Libretime\Client\Model\ThirdPartyTrackReference $third_party_track_reference (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['thirdPartyTrackReferencesUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\ThirdPartyTrackReference, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function thirdPartyTrackReferencesUpdateWithHttpInfo($id, $third_party_tr } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\ThirdPartyTrackReference' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function thirdPartyTrackReferencesUpdateWithHttpInfo($id, $third_party_tr } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/TimestampsApi.php b/php-client/lib/Api/TimestampsApi.php index bc9426e2..f20d3d58 100644 --- a/php-client/lib/Api/TimestampsApi.php +++ b/php-client/lib/Api/TimestampsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class TimestampsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\Timestamp $timestamp timestamp (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timestampsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Timestamp */ @@ -165,7 +165,7 @@ public function timestampsCreate($timestamp, string $contentType = self::content * @param \Libretime\Client\Model\Timestamp $timestamp (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timestampsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Timestamp, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function timestampsCreateWithHttpInfo($timestamp, string $contentType = s } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Timestamp' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function timestampsCreateWithHttpInfo($timestamp, string $contentType = s } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function timestampsCreateRequest($timestamp, string $contentType = self:: * @param int $id A unique integer value identifying this timestamp. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timestampsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function timestampsDestroy($id, string $contentType = self::contentTypes[ * @param int $id A unique integer value identifying this timestamp. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timestampsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function timestampsDestroyRequest($id, string $contentType = self::conten * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timestampsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Timestamp[] */ @@ -676,7 +700,7 @@ public function timestampsList(string $contentType = self::contentTypes['timesta * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timestampsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Timestamp[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function timestampsListWithHttpInfo(string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Timestamp[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function timestampsListWithHttpInfo(string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function timestampsListRequest(string $contentType = self::contentTypes[' * @param \Libretime\Client\Model\PatchedTimestamp $patched_timestamp patched_timestamp (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timestampsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Timestamp */ @@ -944,7 +992,7 @@ public function timestampsPartialUpdate($id, $patched_timestamp = null, string $ * @param \Libretime\Client\Model\PatchedTimestamp $patched_timestamp (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timestampsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Timestamp, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function timestampsPartialUpdateWithHttpInfo($id, $patched_timestamp = nu } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Timestamp' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function timestampsPartialUpdateWithHttpInfo($id, $patched_timestamp = nu } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function timestampsPartialUpdateRequest($id, $patched_timestamp = null, s * @param int $id A unique integer value identifying this timestamp. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timestampsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Timestamp */ @@ -1239,7 +1311,7 @@ public function timestampsRetrieve($id, string $contentType = self::contentTypes * @param int $id A unique integer value identifying this timestamp. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timestampsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Timestamp, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function timestampsRetrieveWithHttpInfo($id, string $contentType = self:: } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Timestamp' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function timestampsRetrieveWithHttpInfo($id, string $contentType = self:: } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function timestampsRetrieveRequest($id, string $contentType = self::conte * @param \Libretime\Client\Model\Timestamp $timestamp timestamp (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timestampsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Timestamp */ @@ -1525,7 +1621,7 @@ public function timestampsUpdate($id, $timestamp, string $contentType = self::co * @param \Libretime\Client\Model\Timestamp $timestamp (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timestampsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Timestamp, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function timestampsUpdateWithHttpInfo($id, $timestamp, string $contentTyp } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Timestamp' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function timestampsUpdateWithHttpInfo($id, $timestamp, string $contentTyp } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/UserTokensApi.php b/php-client/lib/Api/UserTokensApi.php index a2eaf7e3..cd9e2ab4 100644 --- a/php-client/lib/Api/UserTokensApi.php +++ b/php-client/lib/Api/UserTokensApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class UserTokensApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\UserToken $user_token user_token (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTokensCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\UserToken */ @@ -165,7 +165,7 @@ public function userTokensCreate($user_token, string $contentType = self::conten * @param \Libretime\Client\Model\UserToken $user_token (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTokensCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\UserToken, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function userTokensCreateWithHttpInfo($user_token, string $contentType = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\UserToken' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function userTokensCreateWithHttpInfo($user_token, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function userTokensCreateRequest($user_token, string $contentType = self: * @param int $id A unique integer value identifying this user token. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTokensDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function userTokensDestroy($id, string $contentType = self::contentTypes[ * @param int $id A unique integer value identifying this user token. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTokensDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function userTokensDestroyRequest($id, string $contentType = self::conten * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTokensList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\UserToken[] */ @@ -676,7 +700,7 @@ public function userTokensList(string $contentType = self::contentTypes['userTok * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTokensList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\UserToken[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function userTokensListWithHttpInfo(string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\UserToken[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function userTokensListWithHttpInfo(string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function userTokensListRequest(string $contentType = self::contentTypes[' * @param \Libretime\Client\Model\PatchedUserToken $patched_user_token patched_user_token (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTokensPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\UserToken */ @@ -944,7 +992,7 @@ public function userTokensPartialUpdate($id, $patched_user_token = null, string * @param \Libretime\Client\Model\PatchedUserToken $patched_user_token (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTokensPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\UserToken, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function userTokensPartialUpdateWithHttpInfo($id, $patched_user_token = n } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\UserToken' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function userTokensPartialUpdateWithHttpInfo($id, $patched_user_token = n } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function userTokensPartialUpdateRequest($id, $patched_user_token = null, * @param int $id A unique integer value identifying this user token. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTokensRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\UserToken */ @@ -1239,7 +1311,7 @@ public function userTokensRetrieve($id, string $contentType = self::contentTypes * @param int $id A unique integer value identifying this user token. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTokensRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\UserToken, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function userTokensRetrieveWithHttpInfo($id, string $contentType = self:: } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\UserToken' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function userTokensRetrieveWithHttpInfo($id, string $contentType = self:: } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function userTokensRetrieveRequest($id, string $contentType = self::conte * @param \Libretime\Client\Model\UserToken $user_token user_token (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTokensUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\UserToken */ @@ -1525,7 +1621,7 @@ public function userTokensUpdate($id, $user_token, string $contentType = self::c * @param \Libretime\Client\Model\UserToken $user_token (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTokensUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\UserToken, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function userTokensUpdateWithHttpInfo($id, $user_token, string $contentTy } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\UserToken' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function userTokensUpdateWithHttpInfo($id, $user_token, string $contentTy } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/UsersApi.php b/php-client/lib/Api/UsersApi.php index 87479465..dba863bc 100644 --- a/php-client/lib/Api/UsersApi.php +++ b/php-client/lib/Api/UsersApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class UsersApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\User $user user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\User */ @@ -165,7 +165,7 @@ public function usersCreate($user, string $contentType = self::contentTypes['use * @param \Libretime\Client\Model\User $user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\User, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function usersCreateWithHttpInfo($user, string $contentType = self::conte } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\User' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function usersCreateWithHttpInfo($user, string $contentType = self::conte } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function usersCreateRequest($user, string $contentType = self::contentTyp * @param int $id A unique integer value identifying this user. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function usersDestroy($id, string $contentType = self::contentTypes['user * @param int $id A unique integer value identifying this user. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function usersDestroyRequest($id, string $contentType = self::contentType * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\User[] */ @@ -676,7 +700,7 @@ public function usersList(string $contentType = self::contentTypes['usersList'][ * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\User[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function usersListWithHttpInfo(string $contentType = self::contentTypes[' } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\User[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function usersListWithHttpInfo(string $contentType = self::contentTypes[' } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function usersListRequest(string $contentType = self::contentTypes['users * @param \Libretime\Client\Model\PatchedUser $patched_user patched_user (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\User */ @@ -944,7 +992,7 @@ public function usersPartialUpdate($id, $patched_user = null, string $contentTyp * @param \Libretime\Client\Model\PatchedUser $patched_user (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\User, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function usersPartialUpdateWithHttpInfo($id, $patched_user = null, string } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\User' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function usersPartialUpdateWithHttpInfo($id, $patched_user = null, string } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function usersPartialUpdateRequest($id, $patched_user = null, string $con * @param int $id A unique integer value identifying this user. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\User */ @@ -1239,7 +1311,7 @@ public function usersRetrieve($id, string $contentType = self::contentTypes['use * @param int $id A unique integer value identifying this user. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\User, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function usersRetrieveWithHttpInfo($id, string $contentType = self::conte } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\User' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function usersRetrieveWithHttpInfo($id, string $contentType = self::conte } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function usersRetrieveRequest($id, string $contentType = self::contentTyp * @param \Libretime\Client\Model\User $user user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\User */ @@ -1525,7 +1621,7 @@ public function usersUpdate($id, $user, string $contentType = self::contentTypes * @param \Libretime\Client\Model\User $user (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\User, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function usersUpdateWithHttpInfo($id, $user, string $contentType = self:: } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\User' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function usersUpdateWithHttpInfo($id, $user, string $contentType = self:: } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/VersionApi.php b/php-client/lib/Api/VersionApi.php index ad8a8253..f73a354e 100644 --- a/php-client/lib/Api/VersionApi.php +++ b/php-client/lib/Api/VersionApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -76,7 +76,7 @@ class VersionApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -127,7 +127,7 @@ public function getConfig() * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['versionRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Version */ @@ -142,7 +142,7 @@ public function versionRetrieve(string $contentType = self::contentTypes['versio * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['versionRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Version, HTTP status code, HTTP response headers (array of strings) */ @@ -192,7 +192,19 @@ public function versionRetrieveWithHttpInfo(string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Version' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -209,7 +221,19 @@ public function versionRetrieveWithHttpInfo(string $contentType = self::contentT } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/WebstreamMetadataApi.php b/php-client/lib/Api/WebstreamMetadataApi.php index 17897741..1659fabf 100644 --- a/php-client/lib/Api/WebstreamMetadataApi.php +++ b/php-client/lib/Api/WebstreamMetadataApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class WebstreamMetadataApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\WebstreamMetadata $webstream_metadata webstream_metadata (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamMetadataCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\WebstreamMetadata */ @@ -165,7 +165,7 @@ public function webstreamMetadataCreate($webstream_metadata, string $contentType * @param \Libretime\Client\Model\WebstreamMetadata $webstream_metadata (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamMetadataCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\WebstreamMetadata, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function webstreamMetadataCreateWithHttpInfo($webstream_metadata, string } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\WebstreamMetadata' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function webstreamMetadataCreateWithHttpInfo($webstream_metadata, string } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function webstreamMetadataCreateRequest($webstream_metadata, string $cont * @param int $id A unique integer value identifying this webstream metadata. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamMetadataDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function webstreamMetadataDestroy($id, string $contentType = self::conten * @param int $id A unique integer value identifying this webstream metadata. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamMetadataDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function webstreamMetadataDestroyRequest($id, string $contentType = self: * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamMetadataList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\WebstreamMetadata[] */ @@ -676,7 +700,7 @@ public function webstreamMetadataList(string $contentType = self::contentTypes[' * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamMetadataList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\WebstreamMetadata[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function webstreamMetadataListWithHttpInfo(string $contentType = self::co } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\WebstreamMetadata[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function webstreamMetadataListWithHttpInfo(string $contentType = self::co } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function webstreamMetadataListRequest(string $contentType = self::content * @param \Libretime\Client\Model\PatchedWebstreamMetadata $patched_webstream_metadata patched_webstream_metadata (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamMetadataPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\WebstreamMetadata */ @@ -944,7 +992,7 @@ public function webstreamMetadataPartialUpdate($id, $patched_webstream_metadata * @param \Libretime\Client\Model\PatchedWebstreamMetadata $patched_webstream_metadata (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamMetadataPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\WebstreamMetadata, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function webstreamMetadataPartialUpdateWithHttpInfo($id, $patched_webstre } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\WebstreamMetadata' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function webstreamMetadataPartialUpdateWithHttpInfo($id, $patched_webstre } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function webstreamMetadataPartialUpdateRequest($id, $patched_webstream_me * @param int $id A unique integer value identifying this webstream metadata. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamMetadataRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\WebstreamMetadata */ @@ -1239,7 +1311,7 @@ public function webstreamMetadataRetrieve($id, string $contentType = self::conte * @param int $id A unique integer value identifying this webstream metadata. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamMetadataRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\WebstreamMetadata, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function webstreamMetadataRetrieveWithHttpInfo($id, string $contentType = } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\WebstreamMetadata' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function webstreamMetadataRetrieveWithHttpInfo($id, string $contentType = } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function webstreamMetadataRetrieveRequest($id, string $contentType = self * @param \Libretime\Client\Model\WebstreamMetadata $webstream_metadata webstream_metadata (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamMetadataUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\WebstreamMetadata */ @@ -1525,7 +1621,7 @@ public function webstreamMetadataUpdate($id, $webstream_metadata, string $conten * @param \Libretime\Client\Model\WebstreamMetadata $webstream_metadata (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamMetadataUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\WebstreamMetadata, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function webstreamMetadataUpdateWithHttpInfo($id, $webstream_metadata, st } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\WebstreamMetadata' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function webstreamMetadataUpdateWithHttpInfo($id, $webstream_metadata, st } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/Api/WebstreamsApi.php b/php-client/lib/Api/WebstreamsApi.php index 13e5ba2c..27a0f204 100644 --- a/php-client/lib/Api/WebstreamsApi.php +++ b/php-client/lib/Api/WebstreamsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -97,7 +97,7 @@ class WebstreamsApi ], ]; -/** + /** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -149,7 +149,7 @@ public function getConfig() * @param \Libretime\Client\Model\Webstream $webstream webstream (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Webstream */ @@ -165,7 +165,7 @@ public function webstreamsCreate($webstream, string $contentType = self::content * @param \Libretime\Client\Model\Webstream $webstream (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamsCreate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Webstream, HTTP status code, HTTP response headers (array of strings) */ @@ -215,7 +215,19 @@ public function webstreamsCreateWithHttpInfo($webstream, string $contentType = s } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Webstream' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -232,7 +244,19 @@ public function webstreamsCreateWithHttpInfo($webstream, string $contentType = s } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -432,7 +456,7 @@ public function webstreamsCreateRequest($webstream, string $contentType = self:: * @param int $id A unique integer value identifying this webstream. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -447,7 +471,7 @@ public function webstreamsDestroy($id, string $contentType = self::contentTypes[ * @param int $id A unique integer value identifying this webstream. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamsDestroy'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -661,7 +685,7 @@ public function webstreamsDestroyRequest($id, string $contentType = self::conten * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Webstream[] */ @@ -676,7 +700,7 @@ public function webstreamsList(string $contentType = self::contentTypes['webstre * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamsList'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Webstream[], HTTP status code, HTTP response headers (array of strings) */ @@ -726,7 +750,19 @@ public function webstreamsListWithHttpInfo(string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Webstream[]' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -743,7 +779,19 @@ public function webstreamsListWithHttpInfo(string $contentType = self::contentTy } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -927,7 +975,7 @@ public function webstreamsListRequest(string $contentType = self::contentTypes[' * @param \Libretime\Client\Model\PatchedWebstream $patched_webstream patched_webstream (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Webstream */ @@ -944,7 +992,7 @@ public function webstreamsPartialUpdate($id, $patched_webstream = null, string $ * @param \Libretime\Client\Model\PatchedWebstream $patched_webstream (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamsPartialUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Webstream, HTTP status code, HTTP response headers (array of strings) */ @@ -994,7 +1042,19 @@ public function webstreamsPartialUpdateWithHttpInfo($id, $patched_webstream = nu } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Webstream' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1011,7 +1071,19 @@ public function webstreamsPartialUpdateWithHttpInfo($id, $patched_webstream = nu } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1223,7 +1295,7 @@ public function webstreamsPartialUpdateRequest($id, $patched_webstream = null, s * @param int $id A unique integer value identifying this webstream. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Webstream */ @@ -1239,7 +1311,7 @@ public function webstreamsRetrieve($id, string $contentType = self::contentTypes * @param int $id A unique integer value identifying this webstream. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamsRetrieve'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Webstream, HTTP status code, HTTP response headers (array of strings) */ @@ -1289,7 +1361,19 @@ public function webstreamsRetrieveWithHttpInfo($id, string $contentType = self:: } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Webstream' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1306,7 +1390,19 @@ public function webstreamsRetrieveWithHttpInfo($id, string $contentType = self:: } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1508,7 +1604,7 @@ public function webstreamsRetrieveRequest($id, string $contentType = self::conte * @param \Libretime\Client\Model\Webstream $webstream webstream (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Libretime\Client\Model\Webstream */ @@ -1525,7 +1621,7 @@ public function webstreamsUpdate($id, $webstream, string $contentType = self::co * @param \Libretime\Client\Model\Webstream $webstream (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['webstreamsUpdate'] to see the possible values for this operation * - * @throws \Libretime\Client\ApiException on non-2xx response + * @throws \Libretime\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Libretime\Client\Model\Webstream, HTTP status code, HTTP response headers (array of strings) */ @@ -1575,7 +1671,19 @@ public function webstreamsUpdateWithHttpInfo($id, $webstream, string $contentTyp } else { $content = (string) $response->getBody(); if ('\Libretime\Client\Model\Webstream' !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } @@ -1592,7 +1700,19 @@ public function webstreamsUpdateWithHttpInfo($id, $webstream, string $contentTyp } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { - $content = json_decode($content); + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } } } diff --git a/php-client/lib/ApiException.php b/php-client/lib/ApiException.php index 1731429b..817ed59a 100644 --- a/php-client/lib/ApiException.php +++ b/php-client/lib/ApiException.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Configuration.php b/php-client/lib/Configuration.php index 962e16c5..7ef5acc7 100644 --- a/php-client/lib/Configuration.php +++ b/php-client/lib/Configuration.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -209,7 +209,7 @@ public function getAccessToken() /** * Sets boolean format for query string. * - * @param string $booleanFormatForQueryString Boolean format for query string + * @param string $booleanFormat Boolean format for query string * * @return $this */ @@ -486,18 +486,18 @@ public function getHostSettings() * @param array|null $variables hash of variable and the corresponding value (optional) * @return string URL based on host settings */ - public static function getHostString(array $hostsSettings, $hostIndex, array $variables = null) + public static function getHostString(array $hostSettings, $hostIndex, array $variables = null) { if (null === $variables) { $variables = []; } // check array index out of bound - if ($hostIndex < 0 || $hostIndex >= count($hostsSettings)) { - throw new \InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostsSettings)); + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new \InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings)); } - $host = $hostsSettings[$hostIndex]; + $host = $hostSettings[$hostIndex]; $url = $host["url"]; // go through variable and assign a value diff --git a/php-client/lib/HeaderSelector.php b/php-client/lib/HeaderSelector.php index 5aba1f46..6229aeea 100644 --- a/php-client/lib/HeaderSelector.php +++ b/php-client/lib/HeaderSelector.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/BlankEnum.php b/php-client/lib/Model/BlankEnum.php index 59aa3fd6..ee3fc253 100644 --- a/php-client/lib/Model/BlankEnum.php +++ b/php-client/lib/Model/BlankEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/CeleryTask.php b/php-client/lib/Model/CeleryTask.php index b4c0a083..a51d24c4 100644 --- a/php-client/lib/Model/CeleryTask.php +++ b/php-client/lib/Model/CeleryTask.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -88,11 +88,11 @@ class CeleryTask implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'task_id' => false, - 'name' => true, - 'dispatch_time' => true, - 'status' => false, - 'track_reference' => false + 'task_id' => false, + 'name' => true, + 'dispatch_time' => true, + 'status' => false, + 'track_reference' => false ]; /** diff --git a/php-client/lib/Model/File.php b/php-client/lib/Model/File.php index f49c1a04..a0de3622 100644 --- a/php-client/lib/Model/File.php +++ b/php-client/lib/Model/File.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -206,70 +206,70 @@ class File implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'import_status' => false, - 'filepath' => true, - 'size' => false, - 'exists' => true, - 'mime' => false, - 'md5' => true, - 'hidden' => true, - 'accessed' => false, - 'scheduled' => true, - 'part_of_list' => true, - 'created_at' => true, - 'updated_at' => true, - 'last_played_at' => true, - 'bit_rate' => true, - 'sample_rate' => true, - 'format' => true, - 'channels' => true, - 'length' => true, - 'bpm' => true, - 'replay_gain' => true, - 'cue_in' => true, - 'cue_out' => true, - 'name' => false, - 'description' => true, - 'artwork' => true, - 'artist_name' => true, - 'artist_url' => true, - 'original_artist' => true, - 'album_title' => true, - 'track_title' => true, - 'genre' => true, - 'mood' => true, - 'date' => true, - 'track_number' => true, - 'disc_number' => true, - 'comment' => true, - 'language' => true, - 'label' => true, - 'copyright' => true, - 'composer' => true, - 'conductor' => true, - 'orchestra' => true, - 'encoder' => true, - 'encoded_by' => true, - 'isrc' => true, - 'lyrics' => true, - 'lyricist' => true, - 'original_lyricist' => true, - 'subject' => true, - 'contributor' => true, - 'rating' => true, - 'url' => true, - 'info_url' => true, - 'audio_source_url' => true, - 'buy_this_url' => true, - 'catalog_number' => true, - 'radio_station_name' => true, - 'radio_station_url' => true, - 'report_datetime' => true, - 'report_location' => true, - 'report_organization' => true, - 'library' => true, - 'owner' => true, - 'edited_by' => true + 'import_status' => false, + 'filepath' => true, + 'size' => false, + 'exists' => true, + 'mime' => false, + 'md5' => true, + 'hidden' => true, + 'accessed' => false, + 'scheduled' => true, + 'part_of_list' => true, + 'created_at' => true, + 'updated_at' => true, + 'last_played_at' => true, + 'bit_rate' => true, + 'sample_rate' => true, + 'format' => true, + 'channels' => true, + 'length' => true, + 'bpm' => true, + 'replay_gain' => true, + 'cue_in' => true, + 'cue_out' => true, + 'name' => false, + 'description' => true, + 'artwork' => true, + 'artist_name' => true, + 'artist_url' => true, + 'original_artist' => true, + 'album_title' => true, + 'track_title' => true, + 'genre' => true, + 'mood' => true, + 'date' => true, + 'track_number' => true, + 'disc_number' => true, + 'comment' => true, + 'language' => true, + 'label' => true, + 'copyright' => true, + 'composer' => true, + 'conductor' => true, + 'orchestra' => true, + 'encoder' => true, + 'encoded_by' => true, + 'isrc' => true, + 'lyrics' => true, + 'lyricist' => true, + 'original_lyricist' => true, + 'subject' => true, + 'contributor' => true, + 'rating' => true, + 'url' => true, + 'info_url' => true, + 'audio_source_url' => true, + 'buy_this_url' => true, + 'catalog_number' => true, + 'radio_station_name' => true, + 'radio_station_url' => true, + 'report_datetime' => true, + 'report_location' => true, + 'report_organization' => true, + 'library' => true, + 'owner' => true, + 'edited_by' => true ]; /** diff --git a/php-client/lib/Model/FileImportStatusEnum.php b/php-client/lib/Model/FileImportStatusEnum.php index e468d813..3286d95f 100644 --- a/php-client/lib/Model/FileImportStatusEnum.php +++ b/php-client/lib/Model/FileImportStatusEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/ImportedPodcast.php b/php-client/lib/Model/ImportedPodcast.php index a8a4ed2b..69c36f6d 100644 --- a/php-client/lib/Model/ImportedPodcast.php +++ b/php-client/lib/Model/ImportedPodcast.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -86,10 +86,10 @@ class ImportedPodcast implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'override_album' => false, - 'auto_ingest' => false, - 'auto_ingested_at' => true, - 'podcast' => false + 'override_album' => false, + 'auto_ingest' => false, + 'auto_ingested_at' => true, + 'podcast' => false ]; /** diff --git a/php-client/lib/Model/Info.php b/php-client/lib/Model/Info.php index 807afd54..782996ff 100644 --- a/php-client/lib/Model/Info.php +++ b/php-client/lib/Model/Info.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/Library.php b/php-client/lib/Model/Library.php index f3848893..4b01b5bc 100644 --- a/php-client/lib/Model/Library.php +++ b/php-client/lib/Model/Library.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -88,11 +88,11 @@ class Library implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'name' => true, - 'code' => false, - 'description' => true, - 'enabled' => false, - 'analyze_cue_points' => false + 'name' => true, + 'code' => false, + 'description' => true, + 'enabled' => false, + 'analyze_cue_points' => false ]; /** diff --git a/php-client/lib/Model/ListenerCount.php b/php-client/lib/Model/ListenerCount.php index 22feb9f4..1ba33c7c 100644 --- a/php-client/lib/Model/ListenerCount.php +++ b/php-client/lib/Model/ListenerCount.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -84,9 +84,9 @@ class ListenerCount implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'listener_count' => false, - 'timestamp' => false, - 'mount_name' => false + 'listener_count' => false, + 'timestamp' => false, + 'mount_name' => false ]; /** diff --git a/php-client/lib/Model/LiveLog.php b/php-client/lib/Model/LiveLog.php index ed76c95c..974359e2 100644 --- a/php-client/lib/Model/LiveLog.php +++ b/php-client/lib/Model/LiveLog.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -84,9 +84,9 @@ class LiveLog implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'state' => false, - 'start_time' => false, - 'end_time' => true + 'state' => false, + 'start_time' => false, + 'end_time' => true ]; /** diff --git a/php-client/lib/Model/LoginAttempt.php b/php-client/lib/Model/LoginAttempt.php index 28f8e729..c6bed101 100644 --- a/php-client/lib/Model/LoginAttempt.php +++ b/php-client/lib/Model/LoginAttempt.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -80,7 +80,7 @@ class LoginAttempt implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'ip' => false, - 'attempts' => true + 'attempts' => true ]; /** diff --git a/php-client/lib/Model/ModelInterface.php b/php-client/lib/Model/ModelInterface.php index 6e8dd3e6..43f37b54 100644 --- a/php-client/lib/Model/ModelInterface.php +++ b/php-client/lib/Model/ModelInterface.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/MountName.php b/php-client/lib/Model/MountName.php index 0dfc0d26..fd2baf47 100644 --- a/php-client/lib/Model/MountName.php +++ b/php-client/lib/Model/MountName.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -80,7 +80,7 @@ class MountName implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'mount_name' => false + 'mount_name' => false ]; /** diff --git a/php-client/lib/Model/NullEnum.php b/php-client/lib/Model/NullEnum.php index 7918e84a..78ea236f 100644 --- a/php-client/lib/Model/NullEnum.php +++ b/php-client/lib/Model/NullEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/PatchedCeleryTask.php b/php-client/lib/Model/PatchedCeleryTask.php index c4744322..8ebb132e 100644 --- a/php-client/lib/Model/PatchedCeleryTask.php +++ b/php-client/lib/Model/PatchedCeleryTask.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -88,11 +88,11 @@ class PatchedCeleryTask implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static array $openAPINullables = [ 'id' => false, - 'task_id' => false, - 'name' => true, - 'dispatch_time' => true, - 'status' => false, - 'track_reference' => false + 'task_id' => false, + 'name' => true, + 'dispatch_time' => true, + 'status' => false, + 'track_reference' => false ]; /** diff --git a/php-client/lib/Model/PatchedFile.php b/php-client/lib/Model/PatchedFile.php index 009a652f..1014a105 100644 --- a/php-client/lib/Model/PatchedFile.php +++ b/php-client/lib/Model/PatchedFile.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -206,70 +206,70 @@ class PatchedFile implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'import_status' => false, - 'filepath' => true, - 'size' => false, - 'exists' => true, - 'mime' => false, - 'md5' => true, - 'hidden' => true, - 'accessed' => false, - 'scheduled' => true, - 'part_of_list' => true, - 'created_at' => true, - 'updated_at' => true, - 'last_played_at' => true, - 'bit_rate' => true, - 'sample_rate' => true, - 'format' => true, - 'channels' => true, - 'length' => true, - 'bpm' => true, - 'replay_gain' => true, - 'cue_in' => true, - 'cue_out' => true, - 'name' => false, - 'description' => true, - 'artwork' => true, - 'artist_name' => true, - 'artist_url' => true, - 'original_artist' => true, - 'album_title' => true, - 'track_title' => true, - 'genre' => true, - 'mood' => true, - 'date' => true, - 'track_number' => true, - 'disc_number' => true, - 'comment' => true, - 'language' => true, - 'label' => true, - 'copyright' => true, - 'composer' => true, - 'conductor' => true, - 'orchestra' => true, - 'encoder' => true, - 'encoded_by' => true, - 'isrc' => true, - 'lyrics' => true, - 'lyricist' => true, - 'original_lyricist' => true, - 'subject' => true, - 'contributor' => true, - 'rating' => true, - 'url' => true, - 'info_url' => true, - 'audio_source_url' => true, - 'buy_this_url' => true, - 'catalog_number' => true, - 'radio_station_name' => true, - 'radio_station_url' => true, - 'report_datetime' => true, - 'report_location' => true, - 'report_organization' => true, - 'library' => true, - 'owner' => true, - 'edited_by' => true + 'import_status' => false, + 'filepath' => true, + 'size' => false, + 'exists' => true, + 'mime' => false, + 'md5' => true, + 'hidden' => true, + 'accessed' => false, + 'scheduled' => true, + 'part_of_list' => true, + 'created_at' => true, + 'updated_at' => true, + 'last_played_at' => true, + 'bit_rate' => true, + 'sample_rate' => true, + 'format' => true, + 'channels' => true, + 'length' => true, + 'bpm' => true, + 'replay_gain' => true, + 'cue_in' => true, + 'cue_out' => true, + 'name' => false, + 'description' => true, + 'artwork' => true, + 'artist_name' => true, + 'artist_url' => true, + 'original_artist' => true, + 'album_title' => true, + 'track_title' => true, + 'genre' => true, + 'mood' => true, + 'date' => true, + 'track_number' => true, + 'disc_number' => true, + 'comment' => true, + 'language' => true, + 'label' => true, + 'copyright' => true, + 'composer' => true, + 'conductor' => true, + 'orchestra' => true, + 'encoder' => true, + 'encoded_by' => true, + 'isrc' => true, + 'lyrics' => true, + 'lyricist' => true, + 'original_lyricist' => true, + 'subject' => true, + 'contributor' => true, + 'rating' => true, + 'url' => true, + 'info_url' => true, + 'audio_source_url' => true, + 'buy_this_url' => true, + 'catalog_number' => true, + 'radio_station_name' => true, + 'radio_station_url' => true, + 'report_datetime' => true, + 'report_location' => true, + 'report_organization' => true, + 'library' => true, + 'owner' => true, + 'edited_by' => true ]; /** diff --git a/php-client/lib/Model/PatchedImportedPodcast.php b/php-client/lib/Model/PatchedImportedPodcast.php index 400fa8a3..489eef17 100644 --- a/php-client/lib/Model/PatchedImportedPodcast.php +++ b/php-client/lib/Model/PatchedImportedPodcast.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -86,10 +86,10 @@ class PatchedImportedPodcast implements ModelInterface, ArrayAccess, \JsonSerial */ protected static array $openAPINullables = [ 'id' => false, - 'override_album' => false, - 'auto_ingest' => false, - 'auto_ingested_at' => true, - 'podcast' => false + 'override_album' => false, + 'auto_ingest' => false, + 'auto_ingested_at' => true, + 'podcast' => false ]; /** diff --git a/php-client/lib/Model/PatchedLibrary.php b/php-client/lib/Model/PatchedLibrary.php index c50bec3b..05ab434f 100644 --- a/php-client/lib/Model/PatchedLibrary.php +++ b/php-client/lib/Model/PatchedLibrary.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -88,11 +88,11 @@ class PatchedLibrary implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'name' => true, - 'code' => false, - 'description' => true, - 'enabled' => false, - 'analyze_cue_points' => false + 'name' => true, + 'code' => false, + 'description' => true, + 'enabled' => false, + 'analyze_cue_points' => false ]; /** diff --git a/php-client/lib/Model/PatchedListenerCount.php b/php-client/lib/Model/PatchedListenerCount.php index 23bdae48..a99b57e7 100644 --- a/php-client/lib/Model/PatchedListenerCount.php +++ b/php-client/lib/Model/PatchedListenerCount.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -84,9 +84,9 @@ class PatchedListenerCount implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static array $openAPINullables = [ 'id' => false, - 'listener_count' => false, - 'timestamp' => false, - 'mount_name' => false + 'listener_count' => false, + 'timestamp' => false, + 'mount_name' => false ]; /** diff --git a/php-client/lib/Model/PatchedLiveLog.php b/php-client/lib/Model/PatchedLiveLog.php index d3b49b4e..7e4c9743 100644 --- a/php-client/lib/Model/PatchedLiveLog.php +++ b/php-client/lib/Model/PatchedLiveLog.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -84,9 +84,9 @@ class PatchedLiveLog implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'state' => false, - 'start_time' => false, - 'end_time' => true + 'state' => false, + 'start_time' => false, + 'end_time' => true ]; /** diff --git a/php-client/lib/Model/PatchedLoginAttempt.php b/php-client/lib/Model/PatchedLoginAttempt.php index 84efee7f..3b6cdadd 100644 --- a/php-client/lib/Model/PatchedLoginAttempt.php +++ b/php-client/lib/Model/PatchedLoginAttempt.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -80,7 +80,7 @@ class PatchedLoginAttempt implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static array $openAPINullables = [ 'ip' => false, - 'attempts' => true + 'attempts' => true ]; /** diff --git a/php-client/lib/Model/PatchedMountName.php b/php-client/lib/Model/PatchedMountName.php index 34a2a0aa..c801856b 100644 --- a/php-client/lib/Model/PatchedMountName.php +++ b/php-client/lib/Model/PatchedMountName.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -80,7 +80,7 @@ class PatchedMountName implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'mount_name' => false + 'mount_name' => false ]; /** diff --git a/php-client/lib/Model/PatchedPlaylist.php b/php-client/lib/Model/PatchedPlaylist.php index e9d65598..4ec7c269 100644 --- a/php-client/lib/Model/PatchedPlaylist.php +++ b/php-client/lib/Model/PatchedPlaylist.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -90,12 +90,12 @@ class PatchedPlaylist implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'created_at' => true, - 'updated_at' => true, - 'name' => false, - 'description' => true, - 'length' => true, - 'owner' => true + 'created_at' => true, + 'updated_at' => true, + 'name' => false, + 'description' => true, + 'length' => true, + 'owner' => true ]; /** diff --git a/php-client/lib/Model/PatchedPlaylistContent.php b/php-client/lib/Model/PatchedPlaylistContent.php index 4fe671fc..af894859 100644 --- a/php-client/lib/Model/PatchedPlaylistContent.php +++ b/php-client/lib/Model/PatchedPlaylistContent.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -102,18 +102,18 @@ class PatchedPlaylistContent implements ModelInterface, ArrayAccess, \JsonSerial */ protected static array $openAPINullables = [ 'id' => false, - 'kind' => false, - 'position' => true, - 'offset' => false, - 'length' => true, - 'cue_in' => true, - 'cue_out' => true, - 'fade_in' => true, - 'fade_out' => true, - 'playlist' => true, - 'file' => true, - 'stream' => true, - 'block' => true + 'kind' => false, + 'position' => true, + 'offset' => false, + 'length' => true, + 'cue_in' => true, + 'cue_out' => true, + 'fade_in' => true, + 'fade_out' => true, + 'playlist' => true, + 'file' => true, + 'stream' => true, + 'block' => true ]; /** diff --git a/php-client/lib/Model/PatchedPlayoutHistory.php b/php-client/lib/Model/PatchedPlayoutHistory.php index bf1e6c1e..f3903941 100644 --- a/php-client/lib/Model/PatchedPlayoutHistory.php +++ b/php-client/lib/Model/PatchedPlayoutHistory.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -86,10 +86,10 @@ class PatchedPlayoutHistory implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static array $openAPINullables = [ 'id' => false, - 'starts' => false, - 'ends' => true, - 'file' => true, - 'instance' => true + 'starts' => false, + 'ends' => true, + 'file' => true, + 'instance' => true ]; /** diff --git a/php-client/lib/Model/PatchedPlayoutHistoryMetadata.php b/php-client/lib/Model/PatchedPlayoutHistoryMetadata.php index c3836edc..8accdbc3 100644 --- a/php-client/lib/Model/PatchedPlayoutHistoryMetadata.php +++ b/php-client/lib/Model/PatchedPlayoutHistoryMetadata.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -84,9 +84,9 @@ class PatchedPlayoutHistoryMetadata implements ModelInterface, ArrayAccess, \Jso */ protected static array $openAPINullables = [ 'id' => false, - 'key' => false, - 'value' => false, - 'history' => false + 'key' => false, + 'value' => false, + 'history' => false ]; /** diff --git a/php-client/lib/Model/PatchedPlayoutHistoryTemplate.php b/php-client/lib/Model/PatchedPlayoutHistoryTemplate.php index d5415ada..e7bf4978 100644 --- a/php-client/lib/Model/PatchedPlayoutHistoryTemplate.php +++ b/php-client/lib/Model/PatchedPlayoutHistoryTemplate.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -82,8 +82,8 @@ class PatchedPlayoutHistoryTemplate implements ModelInterface, ArrayAccess, \Jso */ protected static array $openAPINullables = [ 'id' => false, - 'name' => false, - 'type' => false + 'name' => false, + 'type' => false ]; /** diff --git a/php-client/lib/Model/PatchedPlayoutHistoryTemplateField.php b/php-client/lib/Model/PatchedPlayoutHistoryTemplateField.php index 029d76bb..65e37367 100644 --- a/php-client/lib/Model/PatchedPlayoutHistoryTemplateField.php +++ b/php-client/lib/Model/PatchedPlayoutHistoryTemplateField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -90,12 +90,12 @@ class PatchedPlayoutHistoryTemplateField implements ModelInterface, ArrayAccess, */ protected static array $openAPINullables = [ 'id' => false, - 'name' => false, - 'label' => false, - 'type' => false, - 'is_file_md' => false, - 'position' => false, - 'template' => false + 'name' => false, + 'label' => false, + 'type' => false, + 'is_file_md' => false, + 'position' => false, + 'template' => false ]; /** diff --git a/php-client/lib/Model/PatchedPodcast.php b/php-client/lib/Model/PatchedPodcast.php index aca5ad5c..2b1ab11c 100644 --- a/php-client/lib/Model/PatchedPodcast.php +++ b/php-client/lib/Model/PatchedPodcast.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -106,20 +106,20 @@ class PatchedPodcast implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'url' => false, - 'title' => false, - 'creator' => true, - 'description' => true, - 'language' => true, - 'copyright' => true, - 'link' => true, - 'itunes_author' => true, - 'itunes_keywords' => true, - 'itunes_summary' => true, - 'itunes_subtitle' => true, - 'itunes_category' => true, - 'itunes_explicit' => true, - 'owner' => true + 'url' => false, + 'title' => false, + 'creator' => true, + 'description' => true, + 'language' => true, + 'copyright' => true, + 'link' => true, + 'itunes_author' => true, + 'itunes_keywords' => true, + 'itunes_summary' => true, + 'itunes_subtitle' => true, + 'itunes_category' => true, + 'itunes_explicit' => true, + 'owner' => true ]; /** diff --git a/php-client/lib/Model/PatchedPodcastEpisode.php b/php-client/lib/Model/PatchedPodcastEpisode.php index df679da6..155884d8 100644 --- a/php-client/lib/Model/PatchedPodcastEpisode.php +++ b/php-client/lib/Model/PatchedPodcastEpisode.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -92,13 +92,13 @@ class PatchedPodcastEpisode implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static array $openAPINullables = [ 'id' => false, - 'published_at' => false, - 'download_url' => false, - 'episode_guid' => false, - 'episode_title' => false, - 'episode_description' => false, - 'podcast' => false, - 'file' => true + 'published_at' => false, + 'download_url' => false, + 'episode_guid' => false, + 'episode_title' => false, + 'episode_description' => false, + 'podcast' => false, + 'file' => true ]; /** diff --git a/php-client/lib/Model/PatchedPreference.php b/php-client/lib/Model/PatchedPreference.php index f06519f3..f50cd2a9 100644 --- a/php-client/lib/Model/PatchedPreference.php +++ b/php-client/lib/Model/PatchedPreference.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -84,9 +84,9 @@ class PatchedPreference implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static array $openAPINullables = [ 'id' => false, - 'key' => true, - 'value' => true, - 'user' => true + 'key' => true, + 'value' => true, + 'user' => true ]; /** diff --git a/php-client/lib/Model/PatchedSchedule.php b/php-client/lib/Model/PatchedSchedule.php index d6aad272..97c2aefd 100644 --- a/php-client/lib/Model/PatchedSchedule.php +++ b/php-client/lib/Model/PatchedSchedule.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -106,20 +106,20 @@ class PatchedSchedule implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'cue_out' => false, - 'ends_at' => false, - 'starts_at' => false, - 'length' => true, - 'fade_in' => true, - 'fade_out' => true, - 'cue_in' => false, - 'position' => false, - 'position_status' => false, - 'broadcasted' => false, - 'played' => true, - 'instance' => false, - 'file' => true, - 'stream' => true + 'cue_out' => false, + 'ends_at' => false, + 'starts_at' => false, + 'length' => true, + 'fade_in' => true, + 'fade_out' => true, + 'cue_in' => false, + 'position' => false, + 'position_status' => false, + 'broadcasted' => false, + 'played' => true, + 'instance' => false, + 'file' => true, + 'stream' => true ]; /** diff --git a/php-client/lib/Model/PatchedServiceRegister.php b/php-client/lib/Model/PatchedServiceRegister.php index 7ea66628..043de74b 100644 --- a/php-client/lib/Model/PatchedServiceRegister.php +++ b/php-client/lib/Model/PatchedServiceRegister.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -80,7 +80,7 @@ class PatchedServiceRegister implements ModelInterface, ArrayAccess, \JsonSerial */ protected static array $openAPINullables = [ 'name' => false, - 'ip' => false + 'ip' => false ]; /** diff --git a/php-client/lib/Model/PatchedShow.php b/php-client/lib/Model/PatchedShow.php index 29fff34c..e8a716e1 100644 --- a/php-client/lib/Model/PatchedShow.php +++ b/php-client/lib/Model/PatchedShow.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -104,19 +104,19 @@ class PatchedShow implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'name' => false, - 'description' => true, - 'genre' => true, - 'url' => true, - 'image' => true, - 'foreground_color' => true, - 'background_color' => true, - 'live_enabled' => false, - 'linked' => false, - 'linkable' => false, - 'auto_playlist' => true, - 'auto_playlist_enabled' => false, - 'auto_playlist_repeat' => false + 'name' => false, + 'description' => true, + 'genre' => true, + 'url' => true, + 'image' => true, + 'foreground_color' => true, + 'background_color' => true, + 'live_enabled' => false, + 'linked' => false, + 'linkable' => false, + 'auto_playlist' => true, + 'auto_playlist_enabled' => false, + 'auto_playlist_repeat' => false ]; /** diff --git a/php-client/lib/Model/PatchedShowDays.php b/php-client/lib/Model/PatchedShowDays.php index fa268e55..f1fb2d8a 100644 --- a/php-client/lib/Model/PatchedShowDays.php +++ b/php-client/lib/Model/PatchedShowDays.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -98,16 +98,16 @@ class PatchedShowDays implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'first_show_on' => false, - 'last_show_on' => true, - 'start_time' => false, - 'timezone' => false, - 'duration' => false, - 'record_enabled' => true, - 'week_day' => true, - 'repeat_kind' => false, - 'repeat_next_on' => true, - 'show' => false + 'first_show_on' => false, + 'last_show_on' => true, + 'start_time' => false, + 'timezone' => false, + 'duration' => false, + 'record_enabled' => true, + 'week_day' => true, + 'repeat_kind' => false, + 'repeat_next_on' => true, + 'show' => false ]; /** diff --git a/php-client/lib/Model/PatchedShowHost.php b/php-client/lib/Model/PatchedShowHost.php index 0f7773a5..7af75805 100644 --- a/php-client/lib/Model/PatchedShowHost.php +++ b/php-client/lib/Model/PatchedShowHost.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -82,8 +82,8 @@ class PatchedShowHost implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'show' => false, - 'user' => false + 'show' => false, + 'user' => false ]; /** diff --git a/php-client/lib/Model/PatchedShowInstance.php b/php-client/lib/Model/PatchedShowInstance.php index b4436a0a..4f954846 100644 --- a/php-client/lib/Model/PatchedShowInstance.php +++ b/php-client/lib/Model/PatchedShowInstance.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -104,19 +104,19 @@ class PatchedShowInstance implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static array $openAPINullables = [ 'id' => false, - 'created_at' => false, - 'starts_at' => false, - 'ends_at' => false, - 'filled_time' => true, - 'last_scheduled_at' => true, - 'description' => true, - 'modified' => false, - 'rebroadcast' => true, - 'auto_playlist_built' => false, - 'record_enabled' => true, - 'show' => false, - 'instance' => true, - 'record_file' => true + 'created_at' => false, + 'starts_at' => false, + 'ends_at' => false, + 'filled_time' => true, + 'last_scheduled_at' => true, + 'description' => true, + 'modified' => false, + 'rebroadcast' => true, + 'auto_playlist_built' => false, + 'record_enabled' => true, + 'show' => false, + 'instance' => true, + 'record_file' => true ]; /** diff --git a/php-client/lib/Model/PatchedShowRebroadcast.php b/php-client/lib/Model/PatchedShowRebroadcast.php index c49937f0..7dfa8d26 100644 --- a/php-client/lib/Model/PatchedShowRebroadcast.php +++ b/php-client/lib/Model/PatchedShowRebroadcast.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -84,9 +84,9 @@ class PatchedShowRebroadcast implements ModelInterface, ArrayAccess, \JsonSerial */ protected static array $openAPINullables = [ 'id' => false, - 'day_offset' => false, - 'start_time' => false, - 'show' => false + 'day_offset' => false, + 'start_time' => false, + 'show' => false ]; /** diff --git a/php-client/lib/Model/PatchedSmartBlock.php b/php-client/lib/Model/PatchedSmartBlock.php index 081d9e82..3746c4a7 100644 --- a/php-client/lib/Model/PatchedSmartBlock.php +++ b/php-client/lib/Model/PatchedSmartBlock.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -92,13 +92,13 @@ class PatchedSmartBlock implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static array $openAPINullables = [ 'id' => false, - 'created_at' => true, - 'updated_at' => true, - 'name' => false, - 'description' => true, - 'length' => true, - 'kind' => true, - 'owner' => true + 'created_at' => true, + 'updated_at' => true, + 'name' => false, + 'description' => true, + 'length' => true, + 'kind' => true, + 'owner' => true ]; /** diff --git a/php-client/lib/Model/PatchedSmartBlockContent.php b/php-client/lib/Model/PatchedSmartBlockContent.php index efbe767d..42930922 100644 --- a/php-client/lib/Model/PatchedSmartBlockContent.php +++ b/php-client/lib/Model/PatchedSmartBlockContent.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -96,15 +96,15 @@ class PatchedSmartBlockContent implements ModelInterface, ArrayAccess, \JsonSeri */ protected static array $openAPINullables = [ 'id' => false, - 'position' => true, - 'offset' => false, - 'length' => true, - 'cue_in' => true, - 'cue_out' => true, - 'fade_in' => true, - 'fade_out' => true, - 'block' => true, - 'file' => true + 'position' => true, + 'offset' => false, + 'length' => true, + 'cue_in' => true, + 'cue_out' => true, + 'fade_in' => true, + 'fade_out' => true, + 'block' => true, + 'file' => true ]; /** diff --git a/php-client/lib/Model/PatchedSmartBlockCriteria.php b/php-client/lib/Model/PatchedSmartBlockCriteria.php index 31434e4b..4f7056a6 100644 --- a/php-client/lib/Model/PatchedSmartBlockCriteria.php +++ b/php-client/lib/Model/PatchedSmartBlockCriteria.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -90,12 +90,12 @@ class PatchedSmartBlockCriteria implements ModelInterface, ArrayAccess, \JsonSer */ protected static array $openAPINullables = [ 'id' => false, - 'group' => true, - 'criteria' => false, - 'condition' => false, - 'value' => false, - 'extra' => true, - 'block' => false + 'group' => true, + 'criteria' => false, + 'condition' => false, + 'value' => false, + 'extra' => true, + 'block' => false ]; /** diff --git a/php-client/lib/Model/PatchedSmartBlockKind.php b/php-client/lib/Model/PatchedSmartBlockKind.php index 1c69e412..0a2ed4f9 100644 --- a/php-client/lib/Model/PatchedSmartBlockKind.php +++ b/php-client/lib/Model/PatchedSmartBlockKind.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/PatchedStationPodcast.php b/php-client/lib/Model/PatchedStationPodcast.php index 7998fe00..7709213b 100644 --- a/php-client/lib/Model/PatchedStationPodcast.php +++ b/php-client/lib/Model/PatchedStationPodcast.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -80,7 +80,7 @@ class PatchedStationPodcast implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static array $openAPINullables = [ 'id' => false, - 'podcast' => false + 'podcast' => false ]; /** diff --git a/php-client/lib/Model/PatchedThirdPartyTrackReference.php b/php-client/lib/Model/PatchedThirdPartyTrackReference.php index fd5c5db1..062cac55 100644 --- a/php-client/lib/Model/PatchedThirdPartyTrackReference.php +++ b/php-client/lib/Model/PatchedThirdPartyTrackReference.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -88,11 +88,11 @@ class PatchedThirdPartyTrackReference implements ModelInterface, ArrayAccess, \J */ protected static array $openAPINullables = [ 'id' => false, - 'service' => false, - 'foreign_id' => true, - 'upload_time' => true, - 'status' => true, - 'file' => true + 'service' => false, + 'foreign_id' => true, + 'upload_time' => true, + 'status' => true, + 'file' => true ]; /** diff --git a/php-client/lib/Model/PatchedTimestamp.php b/php-client/lib/Model/PatchedTimestamp.php index 2c86ff77..615dc162 100644 --- a/php-client/lib/Model/PatchedTimestamp.php +++ b/php-client/lib/Model/PatchedTimestamp.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -80,7 +80,7 @@ class PatchedTimestamp implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'timestamp' => false + 'timestamp' => false ]; /** diff --git a/php-client/lib/Model/PatchedUser.php b/php-client/lib/Model/PatchedUser.php index e1482d54..66cc17ee 100644 --- a/php-client/lib/Model/PatchedUser.php +++ b/php-client/lib/Model/PatchedUser.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -100,17 +100,17 @@ class PatchedUser implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'role' => false, - 'username' => false, - 'email' => true, - 'first_name' => false, - 'last_name' => false, - 'login_attempts' => true, - 'last_login' => true, - 'last_failed_login' => true, - 'skype' => true, - 'jabber' => true, - 'phone' => true + 'role' => false, + 'username' => false, + 'email' => true, + 'first_name' => false, + 'last_name' => false, + 'login_attempts' => true, + 'last_login' => true, + 'last_failed_login' => true, + 'skype' => true, + 'jabber' => true, + 'phone' => true ]; /** diff --git a/php-client/lib/Model/PatchedUserToken.php b/php-client/lib/Model/PatchedUserToken.php index 35cdca50..e0d8cfa1 100644 --- a/php-client/lib/Model/PatchedUserToken.php +++ b/php-client/lib/Model/PatchedUserToken.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -86,10 +86,10 @@ class PatchedUserToken implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'action' => false, - 'token' => false, - 'created' => false, - 'user' => false + 'action' => false, + 'token' => false, + 'created' => false, + 'user' => false ]; /** diff --git a/php-client/lib/Model/PatchedWebstream.php b/php-client/lib/Model/PatchedWebstream.php index dae7e246..1d4379aa 100644 --- a/php-client/lib/Model/PatchedWebstream.php +++ b/php-client/lib/Model/PatchedWebstream.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -96,15 +96,15 @@ class PatchedWebstream implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'created_at' => false, - 'updated_at' => false, - 'last_played_at' => true, - 'name' => false, - 'description' => false, - 'url' => false, - 'length' => false, - 'mime' => true, - 'owner' => true + 'created_at' => false, + 'updated_at' => false, + 'last_played_at' => true, + 'name' => false, + 'description' => false, + 'url' => false, + 'length' => false, + 'mime' => true, + 'owner' => true ]; /** diff --git a/php-client/lib/Model/PatchedWebstreamMetadata.php b/php-client/lib/Model/PatchedWebstreamMetadata.php index 34b8b405..3f5d7060 100644 --- a/php-client/lib/Model/PatchedWebstreamMetadata.php +++ b/php-client/lib/Model/PatchedWebstreamMetadata.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -84,9 +84,9 @@ class PatchedWebstreamMetadata implements ModelInterface, ArrayAccess, \JsonSeri */ protected static array $openAPINullables = [ 'id' => false, - 'starts_at' => false, - 'data' => false, - 'schedule' => false + 'starts_at' => false, + 'data' => false, + 'schedule' => false ]; /** diff --git a/php-client/lib/Model/Playlist.php b/php-client/lib/Model/Playlist.php index 02e97cbe..9b1597ca 100644 --- a/php-client/lib/Model/Playlist.php +++ b/php-client/lib/Model/Playlist.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -90,12 +90,12 @@ class Playlist implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'created_at' => true, - 'updated_at' => true, - 'name' => false, - 'description' => true, - 'length' => true, - 'owner' => true + 'created_at' => true, + 'updated_at' => true, + 'name' => false, + 'description' => true, + 'length' => true, + 'owner' => true ]; /** diff --git a/php-client/lib/Model/PlaylistContent.php b/php-client/lib/Model/PlaylistContent.php index f92f6b00..5719828f 100644 --- a/php-client/lib/Model/PlaylistContent.php +++ b/php-client/lib/Model/PlaylistContent.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -102,18 +102,18 @@ class PlaylistContent implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'kind' => false, - 'position' => true, - 'offset' => false, - 'length' => true, - 'cue_in' => true, - 'cue_out' => true, - 'fade_in' => true, - 'fade_out' => true, - 'playlist' => true, - 'file' => true, - 'stream' => true, - 'block' => true + 'kind' => false, + 'position' => true, + 'offset' => false, + 'length' => true, + 'cue_in' => true, + 'cue_out' => true, + 'fade_in' => true, + 'fade_out' => true, + 'playlist' => true, + 'file' => true, + 'stream' => true, + 'block' => true ]; /** diff --git a/php-client/lib/Model/PlaylistContentKindEnum.php b/php-client/lib/Model/PlaylistContentKindEnum.php index c8b50144..f4696653 100644 --- a/php-client/lib/Model/PlaylistContentKindEnum.php +++ b/php-client/lib/Model/PlaylistContentKindEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/PlayoutHistory.php b/php-client/lib/Model/PlayoutHistory.php index e77cb41b..bbbd6a6e 100644 --- a/php-client/lib/Model/PlayoutHistory.php +++ b/php-client/lib/Model/PlayoutHistory.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -86,10 +86,10 @@ class PlayoutHistory implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'starts' => false, - 'ends' => true, - 'file' => true, - 'instance' => true + 'starts' => false, + 'ends' => true, + 'file' => true, + 'instance' => true ]; /** diff --git a/php-client/lib/Model/PlayoutHistoryMetadata.php b/php-client/lib/Model/PlayoutHistoryMetadata.php index 97da762b..b3a4a7e2 100644 --- a/php-client/lib/Model/PlayoutHistoryMetadata.php +++ b/php-client/lib/Model/PlayoutHistoryMetadata.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -84,9 +84,9 @@ class PlayoutHistoryMetadata implements ModelInterface, ArrayAccess, \JsonSerial */ protected static array $openAPINullables = [ 'id' => false, - 'key' => false, - 'value' => false, - 'history' => false + 'key' => false, + 'value' => false, + 'history' => false ]; /** diff --git a/php-client/lib/Model/PlayoutHistoryTemplate.php b/php-client/lib/Model/PlayoutHistoryTemplate.php index 7d6d28a7..4183d1f9 100644 --- a/php-client/lib/Model/PlayoutHistoryTemplate.php +++ b/php-client/lib/Model/PlayoutHistoryTemplate.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -82,8 +82,8 @@ class PlayoutHistoryTemplate implements ModelInterface, ArrayAccess, \JsonSerial */ protected static array $openAPINullables = [ 'id' => false, - 'name' => false, - 'type' => false + 'name' => false, + 'type' => false ]; /** diff --git a/php-client/lib/Model/PlayoutHistoryTemplateField.php b/php-client/lib/Model/PlayoutHistoryTemplateField.php index 51a99ebe..d4d85879 100644 --- a/php-client/lib/Model/PlayoutHistoryTemplateField.php +++ b/php-client/lib/Model/PlayoutHistoryTemplateField.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -90,12 +90,12 @@ class PlayoutHistoryTemplateField implements ModelInterface, ArrayAccess, \JsonS */ protected static array $openAPINullables = [ 'id' => false, - 'name' => false, - 'label' => false, - 'type' => false, - 'is_file_md' => false, - 'position' => false, - 'template' => false + 'name' => false, + 'label' => false, + 'type' => false, + 'is_file_md' => false, + 'position' => false, + 'template' => false ]; /** diff --git a/php-client/lib/Model/Podcast.php b/php-client/lib/Model/Podcast.php index 66e294bc..62d93858 100644 --- a/php-client/lib/Model/Podcast.php +++ b/php-client/lib/Model/Podcast.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -106,20 +106,20 @@ class Podcast implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'url' => false, - 'title' => false, - 'creator' => true, - 'description' => true, - 'language' => true, - 'copyright' => true, - 'link' => true, - 'itunes_author' => true, - 'itunes_keywords' => true, - 'itunes_summary' => true, - 'itunes_subtitle' => true, - 'itunes_category' => true, - 'itunes_explicit' => true, - 'owner' => true + 'url' => false, + 'title' => false, + 'creator' => true, + 'description' => true, + 'language' => true, + 'copyright' => true, + 'link' => true, + 'itunes_author' => true, + 'itunes_keywords' => true, + 'itunes_summary' => true, + 'itunes_subtitle' => true, + 'itunes_category' => true, + 'itunes_explicit' => true, + 'owner' => true ]; /** diff --git a/php-client/lib/Model/PodcastEpisode.php b/php-client/lib/Model/PodcastEpisode.php index 556efdaa..4ed2bb64 100644 --- a/php-client/lib/Model/PodcastEpisode.php +++ b/php-client/lib/Model/PodcastEpisode.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -92,13 +92,13 @@ class PodcastEpisode implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'published_at' => false, - 'download_url' => false, - 'episode_guid' => false, - 'episode_title' => false, - 'episode_description' => false, - 'podcast' => false, - 'file' => true + 'published_at' => false, + 'download_url' => false, + 'episode_guid' => false, + 'episode_title' => false, + 'episode_description' => false, + 'podcast' => false, + 'file' => true ]; /** diff --git a/php-client/lib/Model/PositionStatusEnum.php b/php-client/lib/Model/PositionStatusEnum.php index 105e8930..bd6186e1 100644 --- a/php-client/lib/Model/PositionStatusEnum.php +++ b/php-client/lib/Model/PositionStatusEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/Preference.php b/php-client/lib/Model/Preference.php index 3f39f7b9..577f4cf2 100644 --- a/php-client/lib/Model/Preference.php +++ b/php-client/lib/Model/Preference.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -84,9 +84,9 @@ class Preference implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'key' => true, - 'value' => true, - 'user' => true + 'key' => true, + 'value' => true, + 'user' => true ]; /** diff --git a/php-client/lib/Model/RecordEnabledEnum.php b/php-client/lib/Model/RecordEnabledEnum.php index 63cea2f0..a8fcaf72 100644 --- a/php-client/lib/Model/RecordEnabledEnum.php +++ b/php-client/lib/Model/RecordEnabledEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/RepeatKindEnum.php b/php-client/lib/Model/RepeatKindEnum.php index 401115e3..888d74f9 100644 --- a/php-client/lib/Model/RepeatKindEnum.php +++ b/php-client/lib/Model/RepeatKindEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/RoleEnum.php b/php-client/lib/Model/RoleEnum.php index 39d63bba..f831b735 100644 --- a/php-client/lib/Model/RoleEnum.php +++ b/php-client/lib/Model/RoleEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/Schedule.php b/php-client/lib/Model/Schedule.php index f6c9d4cd..3f1b39ab 100644 --- a/php-client/lib/Model/Schedule.php +++ b/php-client/lib/Model/Schedule.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -106,20 +106,20 @@ class Schedule implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'cue_out' => false, - 'ends_at' => false, - 'starts_at' => false, - 'length' => true, - 'fade_in' => true, - 'fade_out' => true, - 'cue_in' => false, - 'position' => false, - 'position_status' => false, - 'broadcasted' => false, - 'played' => true, - 'instance' => false, - 'file' => true, - 'stream' => true + 'cue_out' => false, + 'ends_at' => false, + 'starts_at' => false, + 'length' => true, + 'fade_in' => true, + 'fade_out' => true, + 'cue_in' => false, + 'position' => false, + 'position_status' => false, + 'broadcasted' => false, + 'played' => true, + 'instance' => false, + 'file' => true, + 'stream' => true ]; /** diff --git a/php-client/lib/Model/ServiceRegister.php b/php-client/lib/Model/ServiceRegister.php index 8cc9a67a..cb209f20 100644 --- a/php-client/lib/Model/ServiceRegister.php +++ b/php-client/lib/Model/ServiceRegister.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -80,7 +80,7 @@ class ServiceRegister implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'name' => false, - 'ip' => false + 'ip' => false ]; /** diff --git a/php-client/lib/Model/Show.php b/php-client/lib/Model/Show.php index 5f5267af..7b3d60ce 100644 --- a/php-client/lib/Model/Show.php +++ b/php-client/lib/Model/Show.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -104,19 +104,19 @@ class Show implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'name' => false, - 'description' => true, - 'genre' => true, - 'url' => true, - 'image' => true, - 'foreground_color' => true, - 'background_color' => true, - 'live_enabled' => false, - 'linked' => false, - 'linkable' => false, - 'auto_playlist' => true, - 'auto_playlist_enabled' => false, - 'auto_playlist_repeat' => false + 'name' => false, + 'description' => true, + 'genre' => true, + 'url' => true, + 'image' => true, + 'foreground_color' => true, + 'background_color' => true, + 'live_enabled' => false, + 'linked' => false, + 'linkable' => false, + 'auto_playlist' => true, + 'auto_playlist_enabled' => false, + 'auto_playlist_repeat' => false ]; /** diff --git a/php-client/lib/Model/ShowDays.php b/php-client/lib/Model/ShowDays.php index 7d88adc8..3e894ab6 100644 --- a/php-client/lib/Model/ShowDays.php +++ b/php-client/lib/Model/ShowDays.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -98,16 +98,16 @@ class ShowDays implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'first_show_on' => false, - 'last_show_on' => true, - 'start_time' => false, - 'timezone' => false, - 'duration' => false, - 'record_enabled' => true, - 'week_day' => true, - 'repeat_kind' => false, - 'repeat_next_on' => true, - 'show' => false + 'first_show_on' => false, + 'last_show_on' => true, + 'start_time' => false, + 'timezone' => false, + 'duration' => false, + 'record_enabled' => true, + 'week_day' => true, + 'repeat_kind' => false, + 'repeat_next_on' => true, + 'show' => false ]; /** diff --git a/php-client/lib/Model/ShowHost.php b/php-client/lib/Model/ShowHost.php index 29eba818..a87c3204 100644 --- a/php-client/lib/Model/ShowHost.php +++ b/php-client/lib/Model/ShowHost.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -82,8 +82,8 @@ class ShowHost implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'show' => false, - 'user' => false + 'show' => false, + 'user' => false ]; /** diff --git a/php-client/lib/Model/ShowInstance.php b/php-client/lib/Model/ShowInstance.php index 6a00e8f9..3c5b7d0c 100644 --- a/php-client/lib/Model/ShowInstance.php +++ b/php-client/lib/Model/ShowInstance.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -104,19 +104,19 @@ class ShowInstance implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'created_at' => false, - 'starts_at' => false, - 'ends_at' => false, - 'filled_time' => true, - 'last_scheduled_at' => true, - 'description' => true, - 'modified' => false, - 'rebroadcast' => true, - 'auto_playlist_built' => false, - 'record_enabled' => true, - 'show' => false, - 'instance' => true, - 'record_file' => true + 'created_at' => false, + 'starts_at' => false, + 'ends_at' => false, + 'filled_time' => true, + 'last_scheduled_at' => true, + 'description' => true, + 'modified' => false, + 'rebroadcast' => true, + 'auto_playlist_built' => false, + 'record_enabled' => true, + 'show' => false, + 'instance' => true, + 'record_file' => true ]; /** diff --git a/php-client/lib/Model/ShowRebroadcast.php b/php-client/lib/Model/ShowRebroadcast.php index df06415c..b55312dd 100644 --- a/php-client/lib/Model/ShowRebroadcast.php +++ b/php-client/lib/Model/ShowRebroadcast.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -84,9 +84,9 @@ class ShowRebroadcast implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'day_offset' => false, - 'start_time' => false, - 'show' => false + 'day_offset' => false, + 'start_time' => false, + 'show' => false ]; /** diff --git a/php-client/lib/Model/SmartBlock.php b/php-client/lib/Model/SmartBlock.php index 58cb5ff3..fd9a4ebd 100644 --- a/php-client/lib/Model/SmartBlock.php +++ b/php-client/lib/Model/SmartBlock.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -92,13 +92,13 @@ class SmartBlock implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'created_at' => true, - 'updated_at' => true, - 'name' => false, - 'description' => true, - 'length' => true, - 'kind' => true, - 'owner' => true + 'created_at' => true, + 'updated_at' => true, + 'name' => false, + 'description' => true, + 'length' => true, + 'kind' => true, + 'owner' => true ]; /** diff --git a/php-client/lib/Model/SmartBlockContent.php b/php-client/lib/Model/SmartBlockContent.php index a8388c64..dfd9715e 100644 --- a/php-client/lib/Model/SmartBlockContent.php +++ b/php-client/lib/Model/SmartBlockContent.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -96,15 +96,15 @@ class SmartBlockContent implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static array $openAPINullables = [ 'id' => false, - 'position' => true, - 'offset' => false, - 'length' => true, - 'cue_in' => true, - 'cue_out' => true, - 'fade_in' => true, - 'fade_out' => true, - 'block' => true, - 'file' => true + 'position' => true, + 'offset' => false, + 'length' => true, + 'cue_in' => true, + 'cue_out' => true, + 'fade_in' => true, + 'fade_out' => true, + 'block' => true, + 'file' => true ]; /** diff --git a/php-client/lib/Model/SmartBlockCriteria.php b/php-client/lib/Model/SmartBlockCriteria.php index 7f68ad28..51c3fc50 100644 --- a/php-client/lib/Model/SmartBlockCriteria.php +++ b/php-client/lib/Model/SmartBlockCriteria.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -90,12 +90,12 @@ class SmartBlockCriteria implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static array $openAPINullables = [ 'id' => false, - 'group' => true, - 'criteria' => false, - 'condition' => false, - 'value' => false, - 'extra' => true, - 'block' => false + 'group' => true, + 'criteria' => false, + 'condition' => false, + 'value' => false, + 'extra' => true, + 'block' => false ]; /** diff --git a/php-client/lib/Model/SmartBlockKindEnum.php b/php-client/lib/Model/SmartBlockKindEnum.php index 9c775f7f..3c2b6730 100644 --- a/php-client/lib/Model/SmartBlockKindEnum.php +++ b/php-client/lib/Model/SmartBlockKindEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/StationPodcast.php b/php-client/lib/Model/StationPodcast.php index c8019ffe..3fbd5703 100644 --- a/php-client/lib/Model/StationPodcast.php +++ b/php-client/lib/Model/StationPodcast.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -80,7 +80,7 @@ class StationPodcast implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'podcast' => false + 'podcast' => false ]; /** diff --git a/php-client/lib/Model/StreamPreferences.php b/php-client/lib/Model/StreamPreferences.php index e3267c67..d022136b 100644 --- a/php-client/lib/Model/StreamPreferences.php +++ b/php-client/lib/Model/StreamPreferences.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -82,8 +82,8 @@ class StreamPreferences implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static array $openAPINullables = [ 'input_fade_transition' => false, - 'message_format' => false, - 'message_offline' => false + 'message_format' => false, + 'message_offline' => false ]; /** diff --git a/php-client/lib/Model/StreamState.php b/php-client/lib/Model/StreamState.php index 1cb3b781..a3c493ca 100644 --- a/php-client/lib/Model/StreamState.php +++ b/php-client/lib/Model/StreamState.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -86,10 +86,10 @@ class StreamState implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'input_main_connected' => false, - 'input_main_streaming' => false, - 'input_show_connected' => false, - 'input_show_streaming' => false, - 'schedule_streaming' => false + 'input_main_streaming' => false, + 'input_show_connected' => false, + 'input_show_streaming' => false, + 'schedule_streaming' => false ]; /** diff --git a/php-client/lib/Model/ThirdPartyTrackReference.php b/php-client/lib/Model/ThirdPartyTrackReference.php index 3d1961aa..d15093b5 100644 --- a/php-client/lib/Model/ThirdPartyTrackReference.php +++ b/php-client/lib/Model/ThirdPartyTrackReference.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -88,11 +88,11 @@ class ThirdPartyTrackReference implements ModelInterface, ArrayAccess, \JsonSeri */ protected static array $openAPINullables = [ 'id' => false, - 'service' => false, - 'foreign_id' => true, - 'upload_time' => true, - 'status' => true, - 'file' => true + 'service' => false, + 'foreign_id' => true, + 'upload_time' => true, + 'status' => true, + 'file' => true ]; /** diff --git a/php-client/lib/Model/Timestamp.php b/php-client/lib/Model/Timestamp.php index 5700324b..ce504eea 100644 --- a/php-client/lib/Model/Timestamp.php +++ b/php-client/lib/Model/Timestamp.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -80,7 +80,7 @@ class Timestamp implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'timestamp' => false + 'timestamp' => false ]; /** diff --git a/php-client/lib/Model/User.php b/php-client/lib/Model/User.php index ef5627e7..f8354350 100644 --- a/php-client/lib/Model/User.php +++ b/php-client/lib/Model/User.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -100,17 +100,17 @@ class User implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'role' => false, - 'username' => false, - 'email' => true, - 'first_name' => false, - 'last_name' => false, - 'login_attempts' => true, - 'last_login' => true, - 'last_failed_login' => true, - 'skype' => true, - 'jabber' => true, - 'phone' => true + 'role' => false, + 'username' => false, + 'email' => true, + 'first_name' => false, + 'last_name' => false, + 'login_attempts' => true, + 'last_login' => true, + 'last_failed_login' => true, + 'skype' => true, + 'jabber' => true, + 'phone' => true ]; /** diff --git a/php-client/lib/Model/UserToken.php b/php-client/lib/Model/UserToken.php index efb272c9..32d29bd6 100644 --- a/php-client/lib/Model/UserToken.php +++ b/php-client/lib/Model/UserToken.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -86,10 +86,10 @@ class UserToken implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'action' => false, - 'token' => false, - 'created' => false, - 'user' => false + 'action' => false, + 'token' => false, + 'created' => false, + 'user' => false ]; /** diff --git a/php-client/lib/Model/Version.php b/php-client/lib/Model/Version.php index 8e82ca5d..aac65b26 100644 --- a/php-client/lib/Model/Version.php +++ b/php-client/lib/Model/Version.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/Model/Webstream.php b/php-client/lib/Model/Webstream.php index 513d8d62..9b3dd6b7 100644 --- a/php-client/lib/Model/Webstream.php +++ b/php-client/lib/Model/Webstream.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -96,15 +96,15 @@ class Webstream implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'created_at' => false, - 'updated_at' => false, - 'last_played_at' => true, - 'name' => false, - 'description' => false, - 'url' => false, - 'length' => false, - 'mime' => true, - 'owner' => true + 'created_at' => false, + 'updated_at' => false, + 'last_played_at' => true, + 'name' => false, + 'description' => false, + 'url' => false, + 'length' => false, + 'mime' => true, + 'owner' => true ]; /** diff --git a/php-client/lib/Model/WebstreamMetadata.php b/php-client/lib/Model/WebstreamMetadata.php index 1b7a65cd..75ea4c44 100644 --- a/php-client/lib/Model/WebstreamMetadata.php +++ b/php-client/lib/Model/WebstreamMetadata.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** @@ -84,9 +84,9 @@ class WebstreamMetadata implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static array $openAPINullables = [ 'id' => false, - 'starts_at' => false, - 'data' => false, - 'schedule' => false + 'starts_at' => false, + 'data' => false, + 'schedule' => false ]; /** diff --git a/php-client/lib/Model/WeekDayEnum.php b/php-client/lib/Model/WeekDayEnum.php index 525dfbc7..c7e63406 100644 --- a/php-client/lib/Model/WeekDayEnum.php +++ b/php-client/lib/Model/WeekDayEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/php-client/lib/ObjectSerializer.php b/php-client/lib/ObjectSerializer.php index acfc615f..6c83754a 100644 --- a/php-client/lib/ObjectSerializer.php +++ b/php-client/lib/ObjectSerializer.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 2.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.0.1 + * OpenAPI Generator version: 7.3.0 */ /** diff --git a/python-client/.openapi-generator/FILES b/python-client/.openapi-generator/FILES index aa9a8dea..39b4452c 100644 --- a/python-client/.openapi-generator/FILES +++ b/python-client/.openapi-generator/FILES @@ -261,5 +261,4 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_file_import_status_enum.py tox.ini diff --git a/python-client/.openapi-generator/VERSION b/python-client/.openapi-generator/VERSION index 73a86b19..8b23b8d4 100644 --- a/python-client/.openapi-generator/VERSION +++ b/python-client/.openapi-generator/VERSION @@ -1 +1 @@ -7.0.1 \ No newline at end of file +7.3.0 \ No newline at end of file diff --git a/python-client/README.md b/python-client/README.md index 5c745269..687ce279 100644 --- a/python-client/README.md +++ b/python-client/README.md @@ -50,7 +50,6 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python -import time import libretime_client from libretime_client.rest import ApiException from pprint import pprint diff --git a/python-client/docs/BlankEnum.md b/python-client/docs/BlankEnum.md index 860a0dd8..89a678c3 100644 --- a/python-client/docs/BlankEnum.md +++ b/python-client/docs/BlankEnum.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/python-client/docs/CeleryTask.md b/python-client/docs/CeleryTask.md index cd356ea1..61294da4 100644 --- a/python-client/docs/CeleryTask.md +++ b/python-client/docs/CeleryTask.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/CeleryTasksApi.md b/python-client/docs/CeleryTasksApi.md index af8de038..c4ad31fb 100644 --- a/python-client/docs/CeleryTasksApi.md +++ b/python-client/docs/CeleryTasksApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.celery_task import CeleryTask from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **celery_task** | [**CeleryTask**](CeleryTask.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this celery task. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.celery_task import CeleryTask from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.celery_task import CeleryTask from libretime_client.models.patched_celery_task import PatchedCeleryTask @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this celery task. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.celery_task import CeleryTask from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this celery task. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.celery_task import CeleryTask from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this celery task. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/File.md b/python-client/docs/File.md index e7b2ec36..c78f1b04 100644 --- a/python-client/docs/File.md +++ b/python-client/docs/File.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/FileImportStatusEnum.md b/python-client/docs/FileImportStatusEnum.md index bb393dc8..782fe24f 100644 --- a/python-client/docs/FileImportStatusEnum.md +++ b/python-client/docs/FileImportStatusEnum.md @@ -3,6 +3,7 @@ * `0` - Success * `1` - Pending * `2` - Failed ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/python-client/docs/FilesApi.md b/python-client/docs/FilesApi.md index 715bd124..1bf4bc94 100644 --- a/python-client/docs/FilesApi.md +++ b/python-client/docs/FilesApi.md @@ -22,9 +22,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.file import File from libretime_client.rest import ApiException @@ -71,6 +70,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **file** | [**File**](File.md)| | @@ -89,6 +89,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -104,9 +105,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -150,6 +150,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this file. | @@ -168,6 +169,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -183,9 +185,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.file import File from libretime_client.rest import ApiException @@ -232,6 +233,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this file. | @@ -250,6 +252,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -265,9 +268,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.file import File from libretime_client.rest import ApiException @@ -312,6 +314,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -328,6 +331,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -343,9 +347,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.file import File from libretime_client.models.patched_file import PatchedFile @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this file. | @@ -413,6 +417,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -428,9 +433,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.file import File from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this file. | @@ -495,6 +500,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -510,9 +516,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.file import File from libretime_client.rest import ApiException @@ -560,6 +565,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this file. | @@ -579,6 +585,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/ImportedPodcast.md b/python-client/docs/ImportedPodcast.md index fb5ddba1..cd99f93d 100644 --- a/python-client/docs/ImportedPodcast.md +++ b/python-client/docs/ImportedPodcast.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/ImportedPodcastsApi.md b/python-client/docs/ImportedPodcastsApi.md index 51d6b854..9d3ca0cc 100644 --- a/python-client/docs/ImportedPodcastsApi.md +++ b/python-client/docs/ImportedPodcastsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.imported_podcast import ImportedPodcast from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **imported_podcast** | [**ImportedPodcast**](ImportedPodcast.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this imported podcast. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.imported_podcast import ImportedPodcast from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.imported_podcast import ImportedPodcast from libretime_client.models.patched_imported_podcast import PatchedImportedPodcast @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this imported podcast. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.imported_podcast import ImportedPodcast from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this imported podcast. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.imported_podcast import ImportedPodcast from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this imported podcast. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/Info.md b/python-client/docs/Info.md index ef0da81c..029a1d88 100644 --- a/python-client/docs/Info.md +++ b/python-client/docs/Info.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **station_name** | **str** | | [readonly] diff --git a/python-client/docs/InfoApi.md b/python-client/docs/InfoApi.md index a9a97909..03ae939c 100644 --- a/python-client/docs/InfoApi.md +++ b/python-client/docs/InfoApi.md @@ -16,9 +16,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.info import Info from libretime_client.rest import ApiException @@ -63,6 +62,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -79,6 +79,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/LibrariesApi.md b/python-client/docs/LibrariesApi.md index 4252c5dc..70ee497e 100644 --- a/python-client/docs/LibrariesApi.md +++ b/python-client/docs/LibrariesApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.library import Library from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **library** | [**Library**](Library.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this library. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.library import Library from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.library import Library from libretime_client.models.patched_library import PatchedLibrary @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this library. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.library import Library from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this library. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.library import Library from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this library. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/Library.md b/python-client/docs/Library.md index 87e18f2a..6a2f36a0 100644 --- a/python-client/docs/Library.md +++ b/python-client/docs/Library.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/ListenerCount.md b/python-client/docs/ListenerCount.md index e25c395d..74974375 100644 --- a/python-client/docs/ListenerCount.md +++ b/python-client/docs/ListenerCount.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/ListenerCountsApi.md b/python-client/docs/ListenerCountsApi.md index 9ea3b743..a40259ad 100644 --- a/python-client/docs/ListenerCountsApi.md +++ b/python-client/docs/ListenerCountsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.listener_count import ListenerCount from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listener_count** | [**ListenerCount**](ListenerCount.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this listener count. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.listener_count import ListenerCount from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.listener_count import ListenerCount from libretime_client.models.patched_listener_count import PatchedListenerCount @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this listener count. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.listener_count import ListenerCount from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this listener count. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.listener_count import ListenerCount from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this listener count. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/LiveLog.md b/python-client/docs/LiveLog.md index dd88b215..0c9e01ca 100644 --- a/python-client/docs/LiveLog.md +++ b/python-client/docs/LiveLog.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/LiveLogsApi.md b/python-client/docs/LiveLogsApi.md index e3dcb368..d1d97955 100644 --- a/python-client/docs/LiveLogsApi.md +++ b/python-client/docs/LiveLogsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.live_log import LiveLog from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **live_log** | [**LiveLog**](LiveLog.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this live log. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.live_log import LiveLog from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.live_log import LiveLog from libretime_client.models.patched_live_log import PatchedLiveLog @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this live log. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.live_log import LiveLog from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this live log. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.live_log import LiveLog from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this live log. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/LoginAttempt.md b/python-client/docs/LoginAttempt.md index 357be121..de43064a 100644 --- a/python-client/docs/LoginAttempt.md +++ b/python-client/docs/LoginAttempt.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ip** | **str** | | diff --git a/python-client/docs/LoginAttemptsApi.md b/python-client/docs/LoginAttemptsApi.md index fdf40e1e..5be6dfe3 100644 --- a/python-client/docs/LoginAttemptsApi.md +++ b/python-client/docs/LoginAttemptsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.login_attempt import LoginAttempt from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **login_attempt** | [**LoginAttempt**](LoginAttempt.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ip** | **str**| A unique value identifying this login attempt. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.login_attempt import LoginAttempt from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.login_attempt import LoginAttempt from libretime_client.models.patched_login_attempt import PatchedLoginAttempt @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ip** | **str**| A unique value identifying this login attempt. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.login_attempt import LoginAttempt from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ip** | **str**| A unique value identifying this login attempt. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.login_attempt import LoginAttempt from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ip** | **str**| A unique value identifying this login attempt. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/MountName.md b/python-client/docs/MountName.md index 9ce67933..923bed81 100644 --- a/python-client/docs/MountName.md +++ b/python-client/docs/MountName.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/MountNamesApi.md b/python-client/docs/MountNamesApi.md index 8eaae5e9..754f3f3d 100644 --- a/python-client/docs/MountNamesApi.md +++ b/python-client/docs/MountNamesApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.mount_name import MountName from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **mount_name** | [**MountName**](MountName.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this mount name. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.mount_name import MountName from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.mount_name import MountName from libretime_client.models.patched_mount_name import PatchedMountName @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this mount name. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.mount_name import MountName from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this mount name. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.mount_name import MountName from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this mount name. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/NullEnum.md b/python-client/docs/NullEnum.md index e2b7d254..a595b200 100644 --- a/python-client/docs/NullEnum.md +++ b/python-client/docs/NullEnum.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/python-client/docs/PatchedCeleryTask.md b/python-client/docs/PatchedCeleryTask.md index a2491416..1df88a6d 100644 --- a/python-client/docs/PatchedCeleryTask.md +++ b/python-client/docs/PatchedCeleryTask.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedFile.md b/python-client/docs/PatchedFile.md index adbf10d6..b60988ce 100644 --- a/python-client/docs/PatchedFile.md +++ b/python-client/docs/PatchedFile.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedImportedPodcast.md b/python-client/docs/PatchedImportedPodcast.md index c6535121..49a3d78c 100644 --- a/python-client/docs/PatchedImportedPodcast.md +++ b/python-client/docs/PatchedImportedPodcast.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedLibrary.md b/python-client/docs/PatchedLibrary.md index 287351a4..232a5bd6 100644 --- a/python-client/docs/PatchedLibrary.md +++ b/python-client/docs/PatchedLibrary.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedListenerCount.md b/python-client/docs/PatchedListenerCount.md index 32e669f3..21d579d0 100644 --- a/python-client/docs/PatchedListenerCount.md +++ b/python-client/docs/PatchedListenerCount.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedLiveLog.md b/python-client/docs/PatchedLiveLog.md index 99450491..38f1b8e9 100644 --- a/python-client/docs/PatchedLiveLog.md +++ b/python-client/docs/PatchedLiveLog.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedLoginAttempt.md b/python-client/docs/PatchedLoginAttempt.md index 6492f481..4287ed69 100644 --- a/python-client/docs/PatchedLoginAttempt.md +++ b/python-client/docs/PatchedLoginAttempt.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ip** | **str** | | [optional] diff --git a/python-client/docs/PatchedMountName.md b/python-client/docs/PatchedMountName.md index f4560931..a4516914 100644 --- a/python-client/docs/PatchedMountName.md +++ b/python-client/docs/PatchedMountName.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedPlaylist.md b/python-client/docs/PatchedPlaylist.md index 8d56af61..90882ab9 100644 --- a/python-client/docs/PatchedPlaylist.md +++ b/python-client/docs/PatchedPlaylist.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedPlaylistContent.md b/python-client/docs/PatchedPlaylistContent.md index 1519ae82..a0487dc3 100644 --- a/python-client/docs/PatchedPlaylistContent.md +++ b/python-client/docs/PatchedPlaylistContent.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedPlayoutHistory.md b/python-client/docs/PatchedPlayoutHistory.md index 3e32ce09..f18f103f 100644 --- a/python-client/docs/PatchedPlayoutHistory.md +++ b/python-client/docs/PatchedPlayoutHistory.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedPlayoutHistoryMetadata.md b/python-client/docs/PatchedPlayoutHistoryMetadata.md index c4e2f271..9d59725b 100644 --- a/python-client/docs/PatchedPlayoutHistoryMetadata.md +++ b/python-client/docs/PatchedPlayoutHistoryMetadata.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedPlayoutHistoryTemplate.md b/python-client/docs/PatchedPlayoutHistoryTemplate.md index 532ca140..0379d12a 100644 --- a/python-client/docs/PatchedPlayoutHistoryTemplate.md +++ b/python-client/docs/PatchedPlayoutHistoryTemplate.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedPlayoutHistoryTemplateField.md b/python-client/docs/PatchedPlayoutHistoryTemplateField.md index c9e2cf75..5e2e358c 100644 --- a/python-client/docs/PatchedPlayoutHistoryTemplateField.md +++ b/python-client/docs/PatchedPlayoutHistoryTemplateField.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedPodcast.md b/python-client/docs/PatchedPodcast.md index 5aa6941c..7f48eb69 100644 --- a/python-client/docs/PatchedPodcast.md +++ b/python-client/docs/PatchedPodcast.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedPodcastEpisode.md b/python-client/docs/PatchedPodcastEpisode.md index 63411029..4471ba41 100644 --- a/python-client/docs/PatchedPodcastEpisode.md +++ b/python-client/docs/PatchedPodcastEpisode.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedPreference.md b/python-client/docs/PatchedPreference.md index 76735e39..126bbe8d 100644 --- a/python-client/docs/PatchedPreference.md +++ b/python-client/docs/PatchedPreference.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedSchedule.md b/python-client/docs/PatchedSchedule.md index 0775059f..e5aa65d2 100644 --- a/python-client/docs/PatchedSchedule.md +++ b/python-client/docs/PatchedSchedule.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedServiceRegister.md b/python-client/docs/PatchedServiceRegister.md index a89d1620..0e5e280d 100644 --- a/python-client/docs/PatchedServiceRegister.md +++ b/python-client/docs/PatchedServiceRegister.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] diff --git a/python-client/docs/PatchedShow.md b/python-client/docs/PatchedShow.md index d2a69e6f..4e5f1d95 100644 --- a/python-client/docs/PatchedShow.md +++ b/python-client/docs/PatchedShow.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedShowDays.md b/python-client/docs/PatchedShowDays.md index 4d865809..c8f199f8 100644 --- a/python-client/docs/PatchedShowDays.md +++ b/python-client/docs/PatchedShowDays.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedShowHost.md b/python-client/docs/PatchedShowHost.md index cd5ead6b..1144f87b 100644 --- a/python-client/docs/PatchedShowHost.md +++ b/python-client/docs/PatchedShowHost.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedShowInstance.md b/python-client/docs/PatchedShowInstance.md index d7beecc2..ed18e42e 100644 --- a/python-client/docs/PatchedShowInstance.md +++ b/python-client/docs/PatchedShowInstance.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedShowRebroadcast.md b/python-client/docs/PatchedShowRebroadcast.md index 797e281a..727215f2 100644 --- a/python-client/docs/PatchedShowRebroadcast.md +++ b/python-client/docs/PatchedShowRebroadcast.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedSmartBlock.md b/python-client/docs/PatchedSmartBlock.md index b78a959c..c082f3c1 100644 --- a/python-client/docs/PatchedSmartBlock.md +++ b/python-client/docs/PatchedSmartBlock.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedSmartBlockContent.md b/python-client/docs/PatchedSmartBlockContent.md index 5330f9dc..094841a4 100644 --- a/python-client/docs/PatchedSmartBlockContent.md +++ b/python-client/docs/PatchedSmartBlockContent.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedSmartBlockCriteria.md b/python-client/docs/PatchedSmartBlockCriteria.md index dbd3f840..984aa242 100644 --- a/python-client/docs/PatchedSmartBlockCriteria.md +++ b/python-client/docs/PatchedSmartBlockCriteria.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedSmartBlockKind.md b/python-client/docs/PatchedSmartBlockKind.md index c453ee20..1a39773b 100644 --- a/python-client/docs/PatchedSmartBlockKind.md +++ b/python-client/docs/PatchedSmartBlockKind.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/python-client/docs/PatchedStationPodcast.md b/python-client/docs/PatchedStationPodcast.md index bd68f1c9..76ce8c65 100644 --- a/python-client/docs/PatchedStationPodcast.md +++ b/python-client/docs/PatchedStationPodcast.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedThirdPartyTrackReference.md b/python-client/docs/PatchedThirdPartyTrackReference.md index f4a5ad67..eb829171 100644 --- a/python-client/docs/PatchedThirdPartyTrackReference.md +++ b/python-client/docs/PatchedThirdPartyTrackReference.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedTimestamp.md b/python-client/docs/PatchedTimestamp.md index a2ba00b6..ff71e850 100644 --- a/python-client/docs/PatchedTimestamp.md +++ b/python-client/docs/PatchedTimestamp.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedUser.md b/python-client/docs/PatchedUser.md index 4d31f8e3..4b98a1b9 100644 --- a/python-client/docs/PatchedUser.md +++ b/python-client/docs/PatchedUser.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedUserToken.md b/python-client/docs/PatchedUserToken.md index cd28c34a..31bd0f00 100644 --- a/python-client/docs/PatchedUserToken.md +++ b/python-client/docs/PatchedUserToken.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedWebstream.md b/python-client/docs/PatchedWebstream.md index f675d715..18c1e132 100644 --- a/python-client/docs/PatchedWebstream.md +++ b/python-client/docs/PatchedWebstream.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/PatchedWebstreamMetadata.md b/python-client/docs/PatchedWebstreamMetadata.md index 0277a72b..5bb9dabd 100644 --- a/python-client/docs/PatchedWebstreamMetadata.md +++ b/python-client/docs/PatchedWebstreamMetadata.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] [readonly] diff --git a/python-client/docs/Playlist.md b/python-client/docs/Playlist.md index 0a37eaa1..6b9128f9 100644 --- a/python-client/docs/Playlist.md +++ b/python-client/docs/Playlist.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/PlaylistContent.md b/python-client/docs/PlaylistContent.md index a8500cc9..54d015c1 100644 --- a/python-client/docs/PlaylistContent.md +++ b/python-client/docs/PlaylistContent.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/PlaylistContentKindEnum.md b/python-client/docs/PlaylistContentKindEnum.md index b38e7381..4eae359e 100644 --- a/python-client/docs/PlaylistContentKindEnum.md +++ b/python-client/docs/PlaylistContentKindEnum.md @@ -3,6 +3,7 @@ * `0` - File * `1` - Stream * `2` - Block ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/python-client/docs/PlaylistContentsApi.md b/python-client/docs/PlaylistContentsApi.md index b3d40fd0..3824e838 100644 --- a/python-client/docs/PlaylistContentsApi.md +++ b/python-client/docs/PlaylistContentsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playlist_content import PlaylistContent from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **playlist_content** | [**PlaylistContent**](PlaylistContent.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playlist content. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playlist_content import PlaylistContent from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_playlist_content import PatchedPlaylistContent from libretime_client.models.playlist_content import PlaylistContent @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playlist content. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playlist_content import PlaylistContent from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playlist content. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playlist_content import PlaylistContent from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playlist content. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/PlaylistsApi.md b/python-client/docs/PlaylistsApi.md index ef8b25b4..ca68013d 100644 --- a/python-client/docs/PlaylistsApi.md +++ b/python-client/docs/PlaylistsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playlist import Playlist from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **playlist** | [**Playlist**](Playlist.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playlist. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playlist import Playlist from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_playlist import PatchedPlaylist from libretime_client.models.playlist import Playlist @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playlist. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playlist import Playlist from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playlist. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playlist import Playlist from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playlist. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/PlayoutHistory.md b/python-client/docs/PlayoutHistory.md index 4dbc175b..7f9b0c78 100644 --- a/python-client/docs/PlayoutHistory.md +++ b/python-client/docs/PlayoutHistory.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/PlayoutHistoryApi.md b/python-client/docs/PlayoutHistoryApi.md index 5bc61955..cfd58a8b 100644 --- a/python-client/docs/PlayoutHistoryApi.md +++ b/python-client/docs/PlayoutHistoryApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history import PlayoutHistory from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **playout_history** | [**PlayoutHistory**](PlayoutHistory.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history import PlayoutHistory from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_playout_history import PatchedPlayoutHistory from libretime_client.models.playout_history import PlayoutHistory @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history import PlayoutHistory from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history import PlayoutHistory from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/PlayoutHistoryMetadata.md b/python-client/docs/PlayoutHistoryMetadata.md index f073ef53..4f4a8a5a 100644 --- a/python-client/docs/PlayoutHistoryMetadata.md +++ b/python-client/docs/PlayoutHistoryMetadata.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/PlayoutHistoryMetadataApi.md b/python-client/docs/PlayoutHistoryMetadataApi.md index 46795841..88cb5c9c 100644 --- a/python-client/docs/PlayoutHistoryMetadataApi.md +++ b/python-client/docs/PlayoutHistoryMetadataApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history_metadata import PlayoutHistoryMetadata from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **playout_history_metadata** | [**PlayoutHistoryMetadata**](PlayoutHistoryMetadata.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history metadata. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history_metadata import PlayoutHistoryMetadata from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_playout_history_metadata import PatchedPlayoutHistoryMetadata from libretime_client.models.playout_history_metadata import PlayoutHistoryMetadata @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history metadata. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history_metadata import PlayoutHistoryMetadata from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history metadata. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history_metadata import PlayoutHistoryMetadata from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history metadata. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/PlayoutHistoryTemplate.md b/python-client/docs/PlayoutHistoryTemplate.md index ed86bca2..bf7af38b 100644 --- a/python-client/docs/PlayoutHistoryTemplate.md +++ b/python-client/docs/PlayoutHistoryTemplate.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/PlayoutHistoryTemplateField.md b/python-client/docs/PlayoutHistoryTemplateField.md index 8a8b0681..6bc8a2e7 100644 --- a/python-client/docs/PlayoutHistoryTemplateField.md +++ b/python-client/docs/PlayoutHistoryTemplateField.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/PlayoutHistoryTemplateFieldsApi.md b/python-client/docs/PlayoutHistoryTemplateFieldsApi.md index 7055b91b..f86796bc 100644 --- a/python-client/docs/PlayoutHistoryTemplateFieldsApi.md +++ b/python-client/docs/PlayoutHistoryTemplateFieldsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history_template_field import PlayoutHistoryTemplateField from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **playout_history_template_field** | [**PlayoutHistoryTemplateField**](PlayoutHistoryTemplateField.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history template field. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history_template_field import PlayoutHistoryTemplateField from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_playout_history_template_field import PatchedPlayoutHistoryTemplateField from libretime_client.models.playout_history_template_field import PlayoutHistoryTemplateField @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history template field. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history_template_field import PlayoutHistoryTemplateField from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history template field. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history_template_field import PlayoutHistoryTemplateField from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history template field. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/PlayoutHistoryTemplatesApi.md b/python-client/docs/PlayoutHistoryTemplatesApi.md index 3c8cddae..0a47b329 100644 --- a/python-client/docs/PlayoutHistoryTemplatesApi.md +++ b/python-client/docs/PlayoutHistoryTemplatesApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history_template import PlayoutHistoryTemplate from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **playout_history_template** | [**PlayoutHistoryTemplate**](PlayoutHistoryTemplate.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history template. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history_template import PlayoutHistoryTemplate from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_playout_history_template import PatchedPlayoutHistoryTemplate from libretime_client.models.playout_history_template import PlayoutHistoryTemplate @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history template. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history_template import PlayoutHistoryTemplate from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history template. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.playout_history_template import PlayoutHistoryTemplate from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this playout history template. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/Podcast.md b/python-client/docs/Podcast.md index 2fe961b6..47fdd0f3 100644 --- a/python-client/docs/Podcast.md +++ b/python-client/docs/Podcast.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/PodcastEpisode.md b/python-client/docs/PodcastEpisode.md index 4420b22d..f854de58 100644 --- a/python-client/docs/PodcastEpisode.md +++ b/python-client/docs/PodcastEpisode.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/PodcastEpisodesApi.md b/python-client/docs/PodcastEpisodesApi.md index 1870745d..d31bd135 100644 --- a/python-client/docs/PodcastEpisodesApi.md +++ b/python-client/docs/PodcastEpisodesApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.podcast_episode import PodcastEpisode from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **podcast_episode** | [**PodcastEpisode**](PodcastEpisode.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this podcast episode. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.podcast_episode import PodcastEpisode from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_podcast_episode import PatchedPodcastEpisode from libretime_client.models.podcast_episode import PodcastEpisode @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this podcast episode. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.podcast_episode import PodcastEpisode from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this podcast episode. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.podcast_episode import PodcastEpisode from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this podcast episode. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/PodcastsApi.md b/python-client/docs/PodcastsApi.md index be98b0ad..adcce5bd 100644 --- a/python-client/docs/PodcastsApi.md +++ b/python-client/docs/PodcastsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.podcast import Podcast from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **podcast** | [**Podcast**](Podcast.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this podcast. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.podcast import Podcast from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_podcast import PatchedPodcast from libretime_client.models.podcast import Podcast @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this podcast. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.podcast import Podcast from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this podcast. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.podcast import Podcast from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this podcast. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/PositionStatusEnum.md b/python-client/docs/PositionStatusEnum.md index e4c592f9..10495f6f 100644 --- a/python-client/docs/PositionStatusEnum.md +++ b/python-client/docs/PositionStatusEnum.md @@ -3,6 +3,7 @@ * `-1` - Filler * `0` - Outside * `1` - Inside * `2` - Boundary ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/python-client/docs/Preference.md b/python-client/docs/Preference.md index cdec486a..6ddb08ef 100644 --- a/python-client/docs/Preference.md +++ b/python-client/docs/Preference.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/PreferencesApi.md b/python-client/docs/PreferencesApi.md index 9498a8a2..960d0e31 100644 --- a/python-client/docs/PreferencesApi.md +++ b/python-client/docs/PreferencesApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.preference import Preference from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **preference** | [**Preference**](Preference.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this preference. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.preference import Preference from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_preference import PatchedPreference from libretime_client.models.preference import Preference @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this preference. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.preference import Preference from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this preference. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.preference import Preference from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this preference. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/RecordEnabledEnum.md b/python-client/docs/RecordEnabledEnum.md index b5dcc9cc..77697617 100644 --- a/python-client/docs/RecordEnabledEnum.md +++ b/python-client/docs/RecordEnabledEnum.md @@ -3,6 +3,7 @@ * `0` - No * `1` - Yes ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/python-client/docs/RepeatKindEnum.md b/python-client/docs/RepeatKindEnum.md index 0902fc41..4efbf253 100644 --- a/python-client/docs/RepeatKindEnum.md +++ b/python-client/docs/RepeatKindEnum.md @@ -3,6 +3,7 @@ * `0` - Every week * `1` - Every 2 weeks * `4` - Every 3 weeks * `5` - Every 4 weeks * `2` - Every month ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/python-client/docs/RoleEnum.md b/python-client/docs/RoleEnum.md index f22370b8..acac9e4e 100644 --- a/python-client/docs/RoleEnum.md +++ b/python-client/docs/RoleEnum.md @@ -3,6 +3,7 @@ * `G` - Guest * `H` - Host * `P` - Manager * `A` - Admin ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/python-client/docs/Schedule.md b/python-client/docs/Schedule.md index a13f5841..7f1f2af2 100644 --- a/python-client/docs/Schedule.md +++ b/python-client/docs/Schedule.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/ScheduleApi.md b/python-client/docs/ScheduleApi.md index b72d1140..54aaf4d2 100644 --- a/python-client/docs/ScheduleApi.md +++ b/python-client/docs/ScheduleApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.schedule import Schedule from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **schedule** | [**Schedule**](Schedule.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this schedule. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.schedule import Schedule from libretime_client.rest import ApiException @@ -237,6 +238,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **broadcasted** | **int**| | [optional] @@ -261,6 +263,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -276,9 +279,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_schedule import PatchedSchedule from libretime_client.models.schedule import Schedule @@ -327,6 +329,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this schedule. | @@ -346,6 +349,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -361,9 +365,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.schedule import Schedule from libretime_client.rest import ApiException @@ -410,6 +413,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this schedule. | @@ -428,6 +432,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -443,9 +448,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.schedule import Schedule from libretime_client.rest import ApiException @@ -493,6 +497,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this schedule. | @@ -512,6 +517,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/SchemaApi.md b/python-client/docs/SchemaApi.md index d0839b86..6752e01d 100644 --- a/python-client/docs/SchemaApi.md +++ b/python-client/docs/SchemaApi.md @@ -18,9 +18,8 @@ OpenApi3 schema for this API. Format can be selected via content negotiation. - * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -67,6 +66,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **format** | **str**| | [optional] @@ -86,6 +86,7 @@ Name | Type | Description | Notes - **Accept**: application/vnd.oai.openapi, application/yaml, application/vnd.oai.openapi+json, application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/ServiceRegister.md b/python-client/docs/ServiceRegister.md index 0e35517b..611e65ec 100644 --- a/python-client/docs/ServiceRegister.md +++ b/python-client/docs/ServiceRegister.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | diff --git a/python-client/docs/ServiceRegistersApi.md b/python-client/docs/ServiceRegistersApi.md index 620606e7..7a95d631 100644 --- a/python-client/docs/ServiceRegistersApi.md +++ b/python-client/docs/ServiceRegistersApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.service_register import ServiceRegister from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **service_register** | [**ServiceRegister**](ServiceRegister.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **name** | **str**| A unique value identifying this service register. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.service_register import ServiceRegister from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_service_register import PatchedServiceRegister from libretime_client.models.service_register import ServiceRegister @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **name** | **str**| A unique value identifying this service register. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.service_register import ServiceRegister from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **name** | **str**| A unique value identifying this service register. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.service_register import ServiceRegister from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **name** | **str**| A unique value identifying this service register. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/Show.md b/python-client/docs/Show.md index 15f74423..0891181b 100644 --- a/python-client/docs/Show.md +++ b/python-client/docs/Show.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/ShowDays.md b/python-client/docs/ShowDays.md index 0b6221d3..785d4382 100644 --- a/python-client/docs/ShowDays.md +++ b/python-client/docs/ShowDays.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/ShowDaysApi.md b/python-client/docs/ShowDaysApi.md index d9ed1064..62cc861f 100644 --- a/python-client/docs/ShowDaysApi.md +++ b/python-client/docs/ShowDaysApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_days import ShowDays from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **show_days** | [**ShowDays**](ShowDays.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show days. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_days import ShowDays from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_show_days import PatchedShowDays from libretime_client.models.show_days import ShowDays @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show days. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_days import ShowDays from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show days. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_days import ShowDays from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show days. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/ShowHost.md b/python-client/docs/ShowHost.md index 695c61d1..2db5cf57 100644 --- a/python-client/docs/ShowHost.md +++ b/python-client/docs/ShowHost.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/ShowHostsApi.md b/python-client/docs/ShowHostsApi.md index f159e889..2491ef83 100644 --- a/python-client/docs/ShowHostsApi.md +++ b/python-client/docs/ShowHostsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_host import ShowHost from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **show_host** | [**ShowHost**](ShowHost.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show host. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_host import ShowHost from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_show_host import PatchedShowHost from libretime_client.models.show_host import ShowHost @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show host. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_host import ShowHost from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show host. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_host import ShowHost from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show host. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/ShowInstance.md b/python-client/docs/ShowInstance.md index 1334859c..5378fbfe 100644 --- a/python-client/docs/ShowInstance.md +++ b/python-client/docs/ShowInstance.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/ShowInstancesApi.md b/python-client/docs/ShowInstancesApi.md index 6a2025b1..242fd2bc 100644 --- a/python-client/docs/ShowInstancesApi.md +++ b/python-client/docs/ShowInstancesApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_instance import ShowInstance from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **show_instance** | [**ShowInstance**](ShowInstance.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show instance. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_instance import ShowInstance from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_show_instance import PatchedShowInstance from libretime_client.models.show_instance import ShowInstance @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show instance. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_instance import ShowInstance from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show instance. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_instance import ShowInstance from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show instance. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/ShowRebroadcast.md b/python-client/docs/ShowRebroadcast.md index df12887a..1e674bbf 100644 --- a/python-client/docs/ShowRebroadcast.md +++ b/python-client/docs/ShowRebroadcast.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/ShowRebroadcastsApi.md b/python-client/docs/ShowRebroadcastsApi.md index a08eca67..bce7d0a3 100644 --- a/python-client/docs/ShowRebroadcastsApi.md +++ b/python-client/docs/ShowRebroadcastsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_rebroadcast import ShowRebroadcast from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **show_rebroadcast** | [**ShowRebroadcast**](ShowRebroadcast.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show rebroadcast. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_rebroadcast import ShowRebroadcast from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_show_rebroadcast import PatchedShowRebroadcast from libretime_client.models.show_rebroadcast import ShowRebroadcast @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show rebroadcast. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_rebroadcast import ShowRebroadcast from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show rebroadcast. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show_rebroadcast import ShowRebroadcast from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show rebroadcast. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/ShowsApi.md b/python-client/docs/ShowsApi.md index c07200d7..0f7d7caa 100644 --- a/python-client/docs/ShowsApi.md +++ b/python-client/docs/ShowsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show import Show from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **show** | [**Show**](Show.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show import Show from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_show import PatchedShow from libretime_client.models.show import Show @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show import Show from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.show import Show from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this show. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/SmartBlock.md b/python-client/docs/SmartBlock.md index f9478a64..2b4fb4aa 100644 --- a/python-client/docs/SmartBlock.md +++ b/python-client/docs/SmartBlock.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/SmartBlockContent.md b/python-client/docs/SmartBlockContent.md index fea6858a..df784143 100644 --- a/python-client/docs/SmartBlockContent.md +++ b/python-client/docs/SmartBlockContent.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/SmartBlockContentsApi.md b/python-client/docs/SmartBlockContentsApi.md index e80d8bad..b147fd2b 100644 --- a/python-client/docs/SmartBlockContentsApi.md +++ b/python-client/docs/SmartBlockContentsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.smart_block_content import SmartBlockContent from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **smart_block_content** | [**SmartBlockContent**](SmartBlockContent.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this smart block content. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.smart_block_content import SmartBlockContent from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_smart_block_content import PatchedSmartBlockContent from libretime_client.models.smart_block_content import SmartBlockContent @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this smart block content. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.smart_block_content import SmartBlockContent from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this smart block content. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.smart_block_content import SmartBlockContent from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this smart block content. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/SmartBlockCriteria.md b/python-client/docs/SmartBlockCriteria.md index b6c949c5..c73910ee 100644 --- a/python-client/docs/SmartBlockCriteria.md +++ b/python-client/docs/SmartBlockCriteria.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/SmartBlockCriteriaApi.md b/python-client/docs/SmartBlockCriteriaApi.md index 93d6916e..78c9ce62 100644 --- a/python-client/docs/SmartBlockCriteriaApi.md +++ b/python-client/docs/SmartBlockCriteriaApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.smart_block_criteria import SmartBlockCriteria from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **smart_block_criteria** | [**SmartBlockCriteria**](SmartBlockCriteria.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this smart block criteria. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.smart_block_criteria import SmartBlockCriteria from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_smart_block_criteria import PatchedSmartBlockCriteria from libretime_client.models.smart_block_criteria import SmartBlockCriteria @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this smart block criteria. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.smart_block_criteria import SmartBlockCriteria from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this smart block criteria. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.smart_block_criteria import SmartBlockCriteria from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this smart block criteria. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/SmartBlockKindEnum.md b/python-client/docs/SmartBlockKindEnum.md index 21844195..4434e161 100644 --- a/python-client/docs/SmartBlockKindEnum.md +++ b/python-client/docs/SmartBlockKindEnum.md @@ -3,6 +3,7 @@ * `static` - Static * `dynamic` - Dynamic ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/python-client/docs/SmartBlocksApi.md b/python-client/docs/SmartBlocksApi.md index e2363c57..9b732482 100644 --- a/python-client/docs/SmartBlocksApi.md +++ b/python-client/docs/SmartBlocksApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.smart_block import SmartBlock from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **smart_block** | [**SmartBlock**](SmartBlock.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this smart block. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.smart_block import SmartBlock from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_smart_block import PatchedSmartBlock from libretime_client.models.smart_block import SmartBlock @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this smart block. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.smart_block import SmartBlock from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this smart block. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.smart_block import SmartBlock from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this smart block. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/StationPodcast.md b/python-client/docs/StationPodcast.md index acb38196..fef70614 100644 --- a/python-client/docs/StationPodcast.md +++ b/python-client/docs/StationPodcast.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/StationPodcastsApi.md b/python-client/docs/StationPodcastsApi.md index b6b84ba8..d11b6f9c 100644 --- a/python-client/docs/StationPodcastsApi.md +++ b/python-client/docs/StationPodcastsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.station_podcast import StationPodcast from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **station_podcast** | [**StationPodcast**](StationPodcast.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this station podcast. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.station_podcast import StationPodcast from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_station_podcast import PatchedStationPodcast from libretime_client.models.station_podcast import StationPodcast @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this station podcast. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.station_podcast import StationPodcast from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this station podcast. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.station_podcast import StationPodcast from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this station podcast. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/StreamApi.md b/python-client/docs/StreamApi.md index f96e7955..000f808e 100644 --- a/python-client/docs/StreamApi.md +++ b/python-client/docs/StreamApi.md @@ -17,9 +17,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.stream_preferences import StreamPreferences from libretime_client.rest import ApiException @@ -64,6 +63,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -80,6 +80,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -95,9 +96,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.stream_state import StreamState from libretime_client.rest import ApiException @@ -142,6 +142,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -158,6 +159,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/StreamPreferences.md b/python-client/docs/StreamPreferences.md index 04a17074..21498dd2 100644 --- a/python-client/docs/StreamPreferences.md +++ b/python-client/docs/StreamPreferences.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **input_fade_transition** | **float** | | [readonly] diff --git a/python-client/docs/StreamState.md b/python-client/docs/StreamState.md index 47827025..3b8132a8 100644 --- a/python-client/docs/StreamState.md +++ b/python-client/docs/StreamState.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **input_main_connected** | **bool** | | [readonly] diff --git a/python-client/docs/ThirdPartyTrackReference.md b/python-client/docs/ThirdPartyTrackReference.md index 47cff122..82119fbf 100644 --- a/python-client/docs/ThirdPartyTrackReference.md +++ b/python-client/docs/ThirdPartyTrackReference.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/ThirdPartyTrackReferencesApi.md b/python-client/docs/ThirdPartyTrackReferencesApi.md index 4ac73a0c..e6e31935 100644 --- a/python-client/docs/ThirdPartyTrackReferencesApi.md +++ b/python-client/docs/ThirdPartyTrackReferencesApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.third_party_track_reference import ThirdPartyTrackReference from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **third_party_track_reference** | [**ThirdPartyTrackReference**](ThirdPartyTrackReference.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this third party track reference. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.third_party_track_reference import ThirdPartyTrackReference from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_third_party_track_reference import PatchedThirdPartyTrackReference from libretime_client.models.third_party_track_reference import ThirdPartyTrackReference @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this third party track reference. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.third_party_track_reference import ThirdPartyTrackReference from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this third party track reference. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.third_party_track_reference import ThirdPartyTrackReference from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this third party track reference. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/Timestamp.md b/python-client/docs/Timestamp.md index 98c77bbd..50529694 100644 --- a/python-client/docs/Timestamp.md +++ b/python-client/docs/Timestamp.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/TimestampsApi.md b/python-client/docs/TimestampsApi.md index 8d7a00dd..6ee6e4dc 100644 --- a/python-client/docs/TimestampsApi.md +++ b/python-client/docs/TimestampsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.timestamp import Timestamp from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **timestamp** | [**Timestamp**](Timestamp.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this timestamp. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.timestamp import Timestamp from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_timestamp import PatchedTimestamp from libretime_client.models.timestamp import Timestamp @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this timestamp. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.timestamp import Timestamp from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this timestamp. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.timestamp import Timestamp from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this timestamp. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/User.md b/python-client/docs/User.md index b47f1740..234b725c 100644 --- a/python-client/docs/User.md +++ b/python-client/docs/User.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/UserToken.md b/python-client/docs/UserToken.md index 6cea5825..bfc32036 100644 --- a/python-client/docs/UserToken.md +++ b/python-client/docs/UserToken.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/UserTokensApi.md b/python-client/docs/UserTokensApi.md index fbb1bf64..2fc2651b 100644 --- a/python-client/docs/UserTokensApi.md +++ b/python-client/docs/UserTokensApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.user_token import UserToken from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_token** | [**UserToken**](UserToken.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this user token. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.user_token import UserToken from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_user_token import PatchedUserToken from libretime_client.models.user_token import UserToken @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this user token. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.user_token import UserToken from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this user token. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.user_token import UserToken from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this user token. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/UsersApi.md b/python-client/docs/UsersApi.md index 2b53e09e..0be995d3 100644 --- a/python-client/docs/UsersApi.md +++ b/python-client/docs/UsersApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.user import User from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user** | [**User**](User.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this user. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.user import User from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_user import PatchedUser from libretime_client.models.user import User @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this user. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.user import User from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this user. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.user import User from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this user. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/Version.md b/python-client/docs/Version.md index dc62c5f2..cdce64ab 100644 --- a/python-client/docs/Version.md +++ b/python-client/docs/Version.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_version** | **str** | | [readonly] diff --git a/python-client/docs/VersionApi.md b/python-client/docs/VersionApi.md index 0452fbb9..667c8b20 100644 --- a/python-client/docs/VersionApi.md +++ b/python-client/docs/VersionApi.md @@ -16,9 +16,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.version import Version from libretime_client.rest import ApiException @@ -63,6 +62,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -79,6 +79,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/Webstream.md b/python-client/docs/Webstream.md index 1c68b844..9cd8672b 100644 --- a/python-client/docs/Webstream.md +++ b/python-client/docs/Webstream.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/WebstreamMetadata.md b/python-client/docs/WebstreamMetadata.md index 35568b3a..1b7239f3 100644 --- a/python-client/docs/WebstreamMetadata.md +++ b/python-client/docs/WebstreamMetadata.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [readonly] diff --git a/python-client/docs/WebstreamMetadataApi.md b/python-client/docs/WebstreamMetadataApi.md index 983d497b..29282393 100644 --- a/python-client/docs/WebstreamMetadataApi.md +++ b/python-client/docs/WebstreamMetadataApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.webstream_metadata import WebstreamMetadata from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **webstream_metadata** | [**WebstreamMetadata**](WebstreamMetadata.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this webstream metadata. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.webstream_metadata import WebstreamMetadata from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_webstream_metadata import PatchedWebstreamMetadata from libretime_client.models.webstream_metadata import WebstreamMetadata @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this webstream metadata. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.webstream_metadata import WebstreamMetadata from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this webstream metadata. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.webstream_metadata import WebstreamMetadata from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this webstream metadata. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/WebstreamsApi.md b/python-client/docs/WebstreamsApi.md index ba344a8b..915e9523 100644 --- a/python-client/docs/WebstreamsApi.md +++ b/python-client/docs/WebstreamsApi.md @@ -21,9 +21,8 @@ Method | HTTP request | Description * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.webstream import Webstream from libretime_client.rest import ApiException @@ -70,6 +69,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **webstream** | [**Webstream**](Webstream.md)| | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | | - | @@ -103,9 +104,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.rest import ApiException from pprint import pprint @@ -149,6 +149,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this webstream. | @@ -167,6 +168,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No response body | - | @@ -182,9 +184,8 @@ void (empty response body) * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.webstream import Webstream from libretime_client.rest import ApiException @@ -229,6 +230,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -245,6 +247,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -260,9 +263,8 @@ This endpoint does not need any parameter. * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.patched_webstream import PatchedWebstream from libretime_client.models.webstream import Webstream @@ -311,6 +313,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this webstream. | @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -345,9 +349,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.webstream import Webstream from libretime_client.rest import ApiException @@ -394,6 +397,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this webstream. | @@ -412,6 +416,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | @@ -427,9 +432,8 @@ Name | Type | Description | Notes * Basic Authentication (basicAuth): * Api Key Authentication (cookieAuth): + ```python -import time -import os import libretime_client from libretime_client.models.webstream import Webstream from libretime_client.rest import ApiException @@ -477,6 +481,7 @@ with libretime_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| A unique integer value identifying this webstream. | @@ -496,6 +501,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | | - | diff --git a/python-client/docs/WeekDayEnum.md b/python-client/docs/WeekDayEnum.md index 3b00bd3e..add6b197 100644 --- a/python-client/docs/WeekDayEnum.md +++ b/python-client/docs/WeekDayEnum.md @@ -3,6 +3,7 @@ * `0` - Monday * `1` - Tuesday * `2` - Wednesday * `3` - Thursday * `4` - Friday * `5` - Saturday * `6` - Sunday ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/python-client/libretime_client/api/celery_tasks_api.py b/python-client/libretime_client/api/celery_tasks_api.py index deab1890..15fed8ef 100644 --- a/python-client/libretime_client/api/celery_tasks_api.py +++ b/python-client/libretime_client/api/celery_tasks_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.celery_task import CeleryTask from libretime_client.models.patched_celery_task import PatchedCeleryTask -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class CeleryTasksApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def celery_tasks_create(self, celery_task : CeleryTask, **kwargs) -> CeleryTask: # noqa: E501 - """celery_tasks_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def celery_tasks_create( + self, + celery_task: CeleryTask, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CeleryTask: + """celery_tasks_create - >>> thread = api.celery_tasks_create(celery_task, async_req=True) - >>> result = thread.get() :param celery_task: (required) :type celery_task: CeleryTask - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CeleryTask - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the celery_tasks_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.celery_tasks_create_with_http_info(celery_task, **kwargs) # noqa: E501 - - @validate_arguments - def celery_tasks_create_with_http_info(self, celery_task : CeleryTask, **kwargs) -> ApiResponse: # noqa: E501 - """celery_tasks_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.celery_tasks_create_with_http_info(celery_task, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._celery_tasks_create_serialize( + celery_task=celery_task, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CeleryTask", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def celery_tasks_create_with_http_info( + self, + celery_task: CeleryTask, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CeleryTask]: + """celery_tasks_create + :param celery_task: (required) :type celery_task: CeleryTask - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CeleryTask, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._celery_tasks_create_serialize( + celery_task=celery_task, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "CeleryTask", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'celery_task' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def celery_tasks_create_without_preload_content( + self, + celery_task: CeleryTask, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """celery_tasks_create + + + :param celery_task: (required) + :type celery_task: CeleryTask + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._celery_tasks_create_serialize( + celery_task=celery_task, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method celery_tasks_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "CeleryTask", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _celery_tasks_create_serialize( + self, + celery_task, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['celery_task'] is not None: - _body_params = _params['celery_task'] + if celery_task is not None: + _body_params = celery_task + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "CeleryTask", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/celery-tasks', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/celery-tasks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def celery_tasks_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this celery task.")], **kwargs) -> None: # noqa: E501 - """celery_tasks_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.celery_tasks_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def celery_tasks_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this celery task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """celery_tasks_destroy + :param id: A unique integer value identifying this celery task. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the celery_tasks_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.celery_tasks_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def celery_tasks_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this celery task.")], **kwargs) -> ApiResponse: # noqa: E501 - """celery_tasks_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.celery_tasks_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._celery_tasks_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def celery_tasks_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this celery task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """celery_tasks_destroy + :param id: A unique integer value identifying this celery task. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._celery_tasks_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def celery_tasks_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this celery task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """celery_tasks_destroy + + + :param id: A unique integer value identifying this celery task. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._celery_tasks_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method celery_tasks_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _celery_tasks_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/celery-tasks/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/celery-tasks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def celery_tasks_list(self, **kwargs) -> List[CeleryTask]: # noqa: E501 - """celery_tasks_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.celery_tasks_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def celery_tasks_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[CeleryTask]: + """celery_tasks_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[CeleryTask] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the celery_tasks_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.celery_tasks_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def celery_tasks_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """celery_tasks_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.celery_tasks_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._celery_tasks_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CeleryTask]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def celery_tasks_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[CeleryTask]]: + """celery_tasks_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[CeleryTask], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._celery_tasks_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CeleryTask]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def celery_tasks_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """celery_tasks_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._celery_tasks_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method celery_tasks_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CeleryTask]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _celery_tasks_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[CeleryTask]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/celery-tasks', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/celery-tasks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def celery_tasks_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this celery task.")], patched_celery_task : Optional[PatchedCeleryTask] = None, **kwargs) -> CeleryTask: # noqa: E501 - """celery_tasks_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.celery_tasks_partial_update(id, patched_celery_task, async_req=True) - >>> result = thread.get() + + @validate_call + def celery_tasks_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this celery task.")], + patched_celery_task: Optional[PatchedCeleryTask] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CeleryTask: + """celery_tasks_partial_update + :param id: A unique integer value identifying this celery task. (required) :type id: int :param patched_celery_task: :type patched_celery_task: PatchedCeleryTask - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CeleryTask - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the celery_tasks_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.celery_tasks_partial_update_with_http_info(id, patched_celery_task, **kwargs) # noqa: E501 - - @validate_arguments - def celery_tasks_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this celery task.")], patched_celery_task : Optional[PatchedCeleryTask] = None, **kwargs) -> ApiResponse: # noqa: E501 - """celery_tasks_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.celery_tasks_partial_update_with_http_info(id, patched_celery_task, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._celery_tasks_partial_update_serialize( + id=id, + patched_celery_task=patched_celery_task, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CeleryTask", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def celery_tasks_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this celery task.")], + patched_celery_task: Optional[PatchedCeleryTask] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CeleryTask]: + """celery_tasks_partial_update + :param id: A unique integer value identifying this celery task. (required) :type id: int :param patched_celery_task: :type patched_celery_task: PatchedCeleryTask - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CeleryTask, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._celery_tasks_partial_update_serialize( + id=id, + patched_celery_task=patched_celery_task, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "CeleryTask", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_celery_task' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def celery_tasks_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this celery task.")], + patched_celery_task: Optional[PatchedCeleryTask] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """celery_tasks_partial_update + + + :param id: A unique integer value identifying this celery task. (required) + :type id: int + :param patched_celery_task: + :type patched_celery_task: PatchedCeleryTask + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._celery_tasks_partial_update_serialize( + id=id, + patched_celery_task=patched_celery_task, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method celery_tasks_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "CeleryTask", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _celery_tasks_partial_update_serialize( + self, + id, + patched_celery_task, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_celery_task'] is not None: - _body_params = _params['patched_celery_task'] + if patched_celery_task is not None: + _body_params = patched_celery_task + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "CeleryTask", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/celery-tasks/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/celery-tasks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def celery_tasks_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this celery task.")], **kwargs) -> CeleryTask: # noqa: E501 - """celery_tasks_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.celery_tasks_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def celery_tasks_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this celery task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CeleryTask: + """celery_tasks_retrieve + :param id: A unique integer value identifying this celery task. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CeleryTask - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the celery_tasks_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.celery_tasks_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def celery_tasks_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this celery task.")], **kwargs) -> ApiResponse: # noqa: E501 - """celery_tasks_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.celery_tasks_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._celery_tasks_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CeleryTask", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def celery_tasks_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this celery task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CeleryTask]: + """celery_tasks_retrieve + :param id: A unique integer value identifying this celery task. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CeleryTask, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._celery_tasks_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CeleryTask", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def celery_tasks_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this celery task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """celery_tasks_retrieve + + + :param id: A unique integer value identifying this celery task. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._celery_tasks_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method celery_tasks_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "CeleryTask", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _celery_tasks_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "CeleryTask", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/celery-tasks/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/celery-tasks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def celery_tasks_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this celery task.")], celery_task : CeleryTask, **kwargs) -> CeleryTask: # noqa: E501 - """celery_tasks_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.celery_tasks_update(id, celery_task, async_req=True) - >>> result = thread.get() + + @validate_call + def celery_tasks_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this celery task.")], + celery_task: CeleryTask, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CeleryTask: + """celery_tasks_update + :param id: A unique integer value identifying this celery task. (required) :type id: int :param celery_task: (required) :type celery_task: CeleryTask - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CeleryTask - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the celery_tasks_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.celery_tasks_update_with_http_info(id, celery_task, **kwargs) # noqa: E501 - - @validate_arguments - def celery_tasks_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this celery task.")], celery_task : CeleryTask, **kwargs) -> ApiResponse: # noqa: E501 - """celery_tasks_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.celery_tasks_update_with_http_info(id, celery_task, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._celery_tasks_update_serialize( + id=id, + celery_task=celery_task, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CeleryTask", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def celery_tasks_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this celery task.")], + celery_task: CeleryTask, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CeleryTask]: + """celery_tasks_update + :param id: A unique integer value identifying this celery task. (required) :type id: int :param celery_task: (required) :type celery_task: CeleryTask - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CeleryTask, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._celery_tasks_update_serialize( + id=id, + celery_task=celery_task, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "CeleryTask", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'celery_task' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def celery_tasks_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this celery task.")], + celery_task: CeleryTask, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """celery_tasks_update + + + :param id: A unique integer value identifying this celery task. (required) + :type id: int + :param celery_task: (required) + :type celery_task: CeleryTask + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._celery_tasks_update_serialize( + id=id, + celery_task=celery_task, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method celery_tasks_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "CeleryTask", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _celery_tasks_update_serialize( + self, + id, + celery_task, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['celery_task'] is not None: - _body_params = _params['celery_task'] + if celery_task is not None: + _body_params = celery_task + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "CeleryTask", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/celery-tasks/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/celery-tasks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/files_api.py b/python-client/libretime_client/api/files_api.py index 743e34ef..0c6bac7f 100644 --- a/python-client/libretime_client/api/files_api.py +++ b/python-client/libretime_client/api/files_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.file import File from libretime_client.models.patched_file import PatchedFile -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class FilesApi: @@ -46,991 +39,1848 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def files_create(self, file : File, **kwargs) -> File: # noqa: E501 - """files_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def files_create( + self, + file: File, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> File: + """files_create - >>> thread = api.files_create(file, async_req=True) - >>> result = thread.get() :param file: (required) :type file: File - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: File - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the files_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.files_create_with_http_info(file, **kwargs) # noqa: E501 - - @validate_arguments - def files_create_with_http_info(self, file : File, **kwargs) -> ApiResponse: # noqa: E501 - """files_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.files_create_with_http_info(file, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._files_create_serialize( + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def files_create_with_http_info( + self, + file: File, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[File]: + """files_create + :param file: (required) :type file: File - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(File, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._files_create_serialize( + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'file' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def files_create_without_preload_content( + self, + file: File, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """files_create + + + :param file: (required) + :type file: File + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._files_create_serialize( + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method files_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _files_create_serialize( + self, + file, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['file'] is not None: - _body_params = _params['file'] + if file is not None: + _body_params = file + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "File", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/files', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/files', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def files_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this file.")], **kwargs) -> None: # noqa: E501 - """files_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def files_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """files_destroy - >>> thread = api.files_destroy(id, async_req=True) - >>> result = thread.get() :param id: A unique integer value identifying this file. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the files_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.files_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def files_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this file.")], **kwargs) -> ApiResponse: # noqa: E501 - """files_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.files_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._files_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def files_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """files_destroy + :param id: A unique integer value identifying this file. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._files_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def files_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """files_destroy + + + :param id: A unique integer value identifying this file. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._files_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method files_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _files_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/files/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/files/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def files_download_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this file.")], **kwargs) -> File: # noqa: E501 - """files_download_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def files_download_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> File: + """files_download_retrieve - >>> thread = api.files_download_retrieve(id, async_req=True) - >>> result = thread.get() :param id: A unique integer value identifying this file. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: File - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the files_download_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.files_download_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def files_download_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this file.")], **kwargs) -> ApiResponse: # noqa: E501 - """files_download_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.files_download_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._files_download_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def files_download_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[File]: + """files_download_retrieve + :param id: A unique integer value identifying this file. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(File, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._files_download_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def files_download_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """files_download_retrieve + + + :param id: A unique integer value identifying this file. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._files_download_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method files_download_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _files_download_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "File", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/files/{id}/download', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/files/{id}/download', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def files_list(self, **kwargs) -> List[File]: # noqa: E501 - """files_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.files_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def files_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[File]: + """files_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[File] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the files_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.files_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def files_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """files_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.files_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._files_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[File]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def files_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[File]]: + """files_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[File], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._files_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[File]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def files_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """files_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._files_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method files_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[File]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _files_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[File]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/files', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/files', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def files_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this file.")], patched_file : Optional[PatchedFile] = None, **kwargs) -> File: # noqa: E501 - """files_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.files_partial_update(id, patched_file, async_req=True) - >>> result = thread.get() + @validate_call + def files_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + patched_file: Optional[PatchedFile] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> File: + """files_partial_update + :param id: A unique integer value identifying this file. (required) :type id: int :param patched_file: :type patched_file: PatchedFile - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: File - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the files_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.files_partial_update_with_http_info(id, patched_file, **kwargs) # noqa: E501 - - @validate_arguments - def files_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this file.")], patched_file : Optional[PatchedFile] = None, **kwargs) -> ApiResponse: # noqa: E501 - """files_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.files_partial_update_with_http_info(id, patched_file, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._files_partial_update_serialize( + id=id, + patched_file=patched_file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def files_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + patched_file: Optional[PatchedFile] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[File]: + """files_partial_update + :param id: A unique integer value identifying this file. (required) :type id: int :param patched_file: :type patched_file: PatchedFile - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(File, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._files_partial_update_serialize( + id=id, + patched_file=patched_file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_file' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def files_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + patched_file: Optional[PatchedFile] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """files_partial_update + + + :param id: A unique integer value identifying this file. (required) + :type id: int + :param patched_file: + :type patched_file: PatchedFile + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._files_partial_update_serialize( + id=id, + patched_file=patched_file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method files_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _files_partial_update_serialize( + self, + id, + patched_file, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_file'] is not None: - _body_params = _params['patched_file'] + if patched_file is not None: + _body_params = patched_file + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "File", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/files/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/files/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def files_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this file.")], **kwargs) -> File: # noqa: E501 - """files_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def files_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> File: + """files_retrieve - >>> thread = api.files_retrieve(id, async_req=True) - >>> result = thread.get() :param id: A unique integer value identifying this file. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: File - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the files_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.files_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def files_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this file.")], **kwargs) -> ApiResponse: # noqa: E501 - """files_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.files_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._files_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def files_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[File]: + """files_retrieve + :param id: A unique integer value identifying this file. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(File, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._files_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def files_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """files_retrieve + + + :param id: A unique integer value identifying this file. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._files_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method files_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _files_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "File", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/files/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/files/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def files_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this file.")], file : File, **kwargs) -> File: # noqa: E501 - """files_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.files_update(id, file, async_req=True) - >>> result = thread.get() + @validate_call + def files_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + file: File, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> File: + """files_update + :param id: A unique integer value identifying this file. (required) :type id: int :param file: (required) :type file: File - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: File - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the files_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.files_update_with_http_info(id, file, **kwargs) # noqa: E501 - - @validate_arguments - def files_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this file.")], file : File, **kwargs) -> ApiResponse: # noqa: E501 - """files_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.files_update_with_http_info(id, file, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._files_update_serialize( + id=id, + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def files_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + file: File, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[File]: + """files_update + :param id: A unique integer value identifying this file. (required) :type id: int :param file: (required) :type file: File - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(File, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._files_update_serialize( + id=id, + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'file' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def files_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this file.")], + file: File, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """files_update + + + :param id: A unique integer value identifying this file. (required) + :type id: int + :param file: (required) + :type file: File + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._files_update_serialize( + id=id, + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method files_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "File", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _files_update_serialize( + self, + id, + file, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['file'] is not None: - _body_params = _params['file'] + if file is not None: + _body_params = file + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "File", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/files/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/files/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/imported_podcasts_api.py b/python-client/libretime_client/api/imported_podcasts_api.py index 332ee6f2..2c6c9ce5 100644 --- a/python-client/libretime_client/api/imported_podcasts_api.py +++ b/python-client/libretime_client/api/imported_podcasts_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.imported_podcast import ImportedPodcast from libretime_client.models.patched_imported_podcast import PatchedImportedPodcast -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class ImportedPodcastsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def imported_podcasts_create(self, imported_podcast : ImportedPodcast, **kwargs) -> ImportedPodcast: # noqa: E501 - """imported_podcasts_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def imported_podcasts_create( + self, + imported_podcast: ImportedPodcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImportedPodcast: + """imported_podcasts_create - >>> thread = api.imported_podcasts_create(imported_podcast, async_req=True) - >>> result = thread.get() :param imported_podcast: (required) :type imported_podcast: ImportedPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImportedPodcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the imported_podcasts_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.imported_podcasts_create_with_http_info(imported_podcast, **kwargs) # noqa: E501 - - @validate_arguments - def imported_podcasts_create_with_http_info(self, imported_podcast : ImportedPodcast, **kwargs) -> ApiResponse: # noqa: E501 - """imported_podcasts_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.imported_podcasts_create_with_http_info(imported_podcast, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._imported_podcasts_create_serialize( + imported_podcast=imported_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ImportedPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def imported_podcasts_create_with_http_info( + self, + imported_podcast: ImportedPodcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImportedPodcast]: + """imported_podcasts_create + :param imported_podcast: (required) :type imported_podcast: ImportedPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImportedPodcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._imported_podcasts_create_serialize( + imported_podcast=imported_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "ImportedPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'imported_podcast' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def imported_podcasts_create_without_preload_content( + self, + imported_podcast: ImportedPodcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """imported_podcasts_create + + + :param imported_podcast: (required) + :type imported_podcast: ImportedPodcast + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._imported_podcasts_create_serialize( + imported_podcast=imported_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method imported_podcasts_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "ImportedPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _imported_podcasts_create_serialize( + self, + imported_podcast, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['imported_podcast'] is not None: - _body_params = _params['imported_podcast'] + if imported_podcast is not None: + _body_params = imported_podcast + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "ImportedPodcast", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/imported-podcasts', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/imported-podcasts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def imported_podcasts_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this imported podcast.")], **kwargs) -> None: # noqa: E501 - """imported_podcasts_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.imported_podcasts_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def imported_podcasts_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this imported podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """imported_podcasts_destroy + :param id: A unique integer value identifying this imported podcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the imported_podcasts_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.imported_podcasts_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def imported_podcasts_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this imported podcast.")], **kwargs) -> ApiResponse: # noqa: E501 - """imported_podcasts_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.imported_podcasts_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._imported_podcasts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def imported_podcasts_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this imported podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """imported_podcasts_destroy + :param id: A unique integer value identifying this imported podcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._imported_podcasts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def imported_podcasts_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this imported podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """imported_podcasts_destroy + + + :param id: A unique integer value identifying this imported podcast. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._imported_podcasts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method imported_podcasts_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _imported_podcasts_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/imported-podcasts/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/imported-podcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def imported_podcasts_list(self, **kwargs) -> List[ImportedPodcast]: # noqa: E501 - """imported_podcasts_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.imported_podcasts_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def imported_podcasts_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ImportedPodcast]: + """imported_podcasts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[ImportedPodcast] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the imported_podcasts_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.imported_podcasts_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def imported_podcasts_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """imported_podcasts_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.imported_podcasts_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._imported_podcasts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ImportedPodcast]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def imported_podcasts_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ImportedPodcast]]: + """imported_podcasts_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[ImportedPodcast], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._imported_podcasts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ImportedPodcast]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def imported_podcasts_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """imported_podcasts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._imported_podcasts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method imported_podcasts_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ImportedPodcast]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _imported_podcasts_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[ImportedPodcast]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/imported-podcasts', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/imported-podcasts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def imported_podcasts_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this imported podcast.")], patched_imported_podcast : Optional[PatchedImportedPodcast] = None, **kwargs) -> ImportedPodcast: # noqa: E501 - """imported_podcasts_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.imported_podcasts_partial_update(id, patched_imported_podcast, async_req=True) - >>> result = thread.get() + + @validate_call + def imported_podcasts_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this imported podcast.")], + patched_imported_podcast: Optional[PatchedImportedPodcast] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImportedPodcast: + """imported_podcasts_partial_update + :param id: A unique integer value identifying this imported podcast. (required) :type id: int :param patched_imported_podcast: :type patched_imported_podcast: PatchedImportedPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImportedPodcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the imported_podcasts_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.imported_podcasts_partial_update_with_http_info(id, patched_imported_podcast, **kwargs) # noqa: E501 - - @validate_arguments - def imported_podcasts_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this imported podcast.")], patched_imported_podcast : Optional[PatchedImportedPodcast] = None, **kwargs) -> ApiResponse: # noqa: E501 - """imported_podcasts_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.imported_podcasts_partial_update_with_http_info(id, patched_imported_podcast, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._imported_podcasts_partial_update_serialize( + id=id, + patched_imported_podcast=patched_imported_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImportedPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def imported_podcasts_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this imported podcast.")], + patched_imported_podcast: Optional[PatchedImportedPodcast] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImportedPodcast]: + """imported_podcasts_partial_update + :param id: A unique integer value identifying this imported podcast. (required) :type id: int :param patched_imported_podcast: :type patched_imported_podcast: PatchedImportedPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImportedPodcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._imported_podcasts_partial_update_serialize( + id=id, + patched_imported_podcast=patched_imported_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImportedPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_imported_podcast' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def imported_podcasts_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this imported podcast.")], + patched_imported_podcast: Optional[PatchedImportedPodcast] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """imported_podcasts_partial_update + + + :param id: A unique integer value identifying this imported podcast. (required) + :type id: int + :param patched_imported_podcast: + :type patched_imported_podcast: PatchedImportedPodcast + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._imported_podcasts_partial_update_serialize( + id=id, + patched_imported_podcast=patched_imported_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method imported_podcasts_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImportedPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _imported_podcasts_partial_update_serialize( + self, + id, + patched_imported_podcast, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_imported_podcast'] is not None: - _body_params = _params['patched_imported_podcast'] + if patched_imported_podcast is not None: + _body_params = patched_imported_podcast + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ImportedPodcast", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/imported-podcasts/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/imported-podcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def imported_podcasts_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this imported podcast.")], **kwargs) -> ImportedPodcast: # noqa: E501 - """imported_podcasts_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.imported_podcasts_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def imported_podcasts_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this imported podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImportedPodcast: + """imported_podcasts_retrieve + :param id: A unique integer value identifying this imported podcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImportedPodcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the imported_podcasts_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.imported_podcasts_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def imported_podcasts_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this imported podcast.")], **kwargs) -> ApiResponse: # noqa: E501 - """imported_podcasts_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.imported_podcasts_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._imported_podcasts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImportedPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def imported_podcasts_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this imported podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImportedPodcast]: + """imported_podcasts_retrieve + :param id: A unique integer value identifying this imported podcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImportedPodcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._imported_podcasts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImportedPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def imported_podcasts_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this imported podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """imported_podcasts_retrieve + + + :param id: A unique integer value identifying this imported podcast. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._imported_podcasts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method imported_podcasts_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImportedPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _imported_podcasts_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "ImportedPodcast", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/imported-podcasts/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/imported-podcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def imported_podcasts_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this imported podcast.")], imported_podcast : ImportedPodcast, **kwargs) -> ImportedPodcast: # noqa: E501 - """imported_podcasts_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.imported_podcasts_update(id, imported_podcast, async_req=True) - >>> result = thread.get() + + @validate_call + def imported_podcasts_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this imported podcast.")], + imported_podcast: ImportedPodcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImportedPodcast: + """imported_podcasts_update + :param id: A unique integer value identifying this imported podcast. (required) :type id: int :param imported_podcast: (required) :type imported_podcast: ImportedPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImportedPodcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the imported_podcasts_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.imported_podcasts_update_with_http_info(id, imported_podcast, **kwargs) # noqa: E501 - - @validate_arguments - def imported_podcasts_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this imported podcast.")], imported_podcast : ImportedPodcast, **kwargs) -> ApiResponse: # noqa: E501 - """imported_podcasts_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.imported_podcasts_update_with_http_info(id, imported_podcast, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._imported_podcasts_update_serialize( + id=id, + imported_podcast=imported_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImportedPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def imported_podcasts_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this imported podcast.")], + imported_podcast: ImportedPodcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImportedPodcast]: + """imported_podcasts_update + :param id: A unique integer value identifying this imported podcast. (required) :type id: int :param imported_podcast: (required) :type imported_podcast: ImportedPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImportedPodcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._imported_podcasts_update_serialize( + id=id, + imported_podcast=imported_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImportedPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'imported_podcast' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def imported_podcasts_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this imported podcast.")], + imported_podcast: ImportedPodcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """imported_podcasts_update + + + :param id: A unique integer value identifying this imported podcast. (required) + :type id: int + :param imported_podcast: (required) + :type imported_podcast: ImportedPodcast + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._imported_podcasts_update_serialize( + id=id, + imported_podcast=imported_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method imported_podcasts_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImportedPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _imported_podcasts_update_serialize( + self, + id, + imported_podcast, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['imported_podcast'] is not None: - _body_params = _params['imported_podcast'] + if imported_podcast is not None: + _body_params = imported_podcast + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ImportedPodcast", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/imported-podcasts/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/imported-podcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/info_api.py b/python-client/libretime_client/api/info_api.py index 3e518bc4..ba978ab8 100644 --- a/python-client/libretime_client/api/info_api.py +++ b/python-client/libretime_client/api/info_api.py @@ -11,21 +11,16 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated from libretime_client.models.info import Info -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class InfoApi: @@ -40,132 +35,243 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def info_retrieve(self, **kwargs) -> Info: # noqa: E501 - """info_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def info_retrieve( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Info: + """info_retrieve - >>> thread = api.info_retrieve(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Info - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the info_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.info_retrieve_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def info_retrieve_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """info_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.info_retrieve_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._info_retrieve_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Info", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def info_retrieve_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Info]: + """info_retrieve + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Info, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._info_retrieve_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "Info", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def info_retrieve_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """info_retrieve + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._info_retrieve_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Info", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method info_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _info_retrieve_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "Info", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/info', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/info', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/libraries_api.py b/python-client/libretime_client/api/libraries_api.py index 735709a6..f3610887 100644 --- a/python-client/libretime_client/api/libraries_api.py +++ b/python-client/libretime_client/api/libraries_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.library import Library from libretime_client.models.patched_library import PatchedLibrary -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class LibrariesApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def libraries_create(self, library : Library, **kwargs) -> Library: # noqa: E501 - """libraries_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def libraries_create( + self, + library: Library, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Library: + """libraries_create - >>> thread = api.libraries_create(library, async_req=True) - >>> result = thread.get() :param library: (required) :type library: Library - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Library - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the libraries_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.libraries_create_with_http_info(library, **kwargs) # noqa: E501 - - @validate_arguments - def libraries_create_with_http_info(self, library : Library, **kwargs) -> ApiResponse: # noqa: E501 - """libraries_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.libraries_create_with_http_info(library, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._libraries_create_serialize( + library=library, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Library", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def libraries_create_with_http_info( + self, + library: Library, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Library]: + """libraries_create + :param library: (required) :type library: Library - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Library, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._libraries_create_serialize( + library=library, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "Library", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'library' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def libraries_create_without_preload_content( + self, + library: Library, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """libraries_create + + + :param library: (required) + :type library: Library + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._libraries_create_serialize( + library=library, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method libraries_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Library", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _libraries_create_serialize( + self, + library, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['library'] is not None: - _body_params = _params['library'] + if library is not None: + _body_params = library + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "Library", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/libraries', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/libraries', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def libraries_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this library.")], **kwargs) -> None: # noqa: E501 - """libraries_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.libraries_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def libraries_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this library.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """libraries_destroy + :param id: A unique integer value identifying this library. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the libraries_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.libraries_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def libraries_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this library.")], **kwargs) -> ApiResponse: # noqa: E501 - """libraries_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.libraries_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._libraries_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def libraries_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this library.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """libraries_destroy + :param id: A unique integer value identifying this library. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._libraries_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def libraries_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this library.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """libraries_destroy + + + :param id: A unique integer value identifying this library. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._libraries_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method libraries_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _libraries_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/libraries/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/libraries/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def libraries_list(self, **kwargs) -> List[Library]: # noqa: E501 - """libraries_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.libraries_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def libraries_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Library]: + """libraries_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[Library] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the libraries_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.libraries_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def libraries_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """libraries_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.libraries_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._libraries_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Library]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def libraries_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Library]]: + """libraries_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[Library], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._libraries_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Library]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def libraries_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """libraries_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._libraries_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method libraries_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Library]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _libraries_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[Library]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/libraries', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/libraries', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def libraries_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this library.")], patched_library : Optional[PatchedLibrary] = None, **kwargs) -> Library: # noqa: E501 - """libraries_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.libraries_partial_update(id, patched_library, async_req=True) - >>> result = thread.get() + + @validate_call + def libraries_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this library.")], + patched_library: Optional[PatchedLibrary] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Library: + """libraries_partial_update + :param id: A unique integer value identifying this library. (required) :type id: int :param patched_library: :type patched_library: PatchedLibrary - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Library - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the libraries_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.libraries_partial_update_with_http_info(id, patched_library, **kwargs) # noqa: E501 - - @validate_arguments - def libraries_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this library.")], patched_library : Optional[PatchedLibrary] = None, **kwargs) -> ApiResponse: # noqa: E501 - """libraries_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.libraries_partial_update_with_http_info(id, patched_library, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._libraries_partial_update_serialize( + id=id, + patched_library=patched_library, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Library", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def libraries_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this library.")], + patched_library: Optional[PatchedLibrary] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Library]: + """libraries_partial_update + :param id: A unique integer value identifying this library. (required) :type id: int :param patched_library: :type patched_library: PatchedLibrary - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Library, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._libraries_partial_update_serialize( + id=id, + patched_library=patched_library, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Library", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_library' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def libraries_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this library.")], + patched_library: Optional[PatchedLibrary] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """libraries_partial_update + + + :param id: A unique integer value identifying this library. (required) + :type id: int + :param patched_library: + :type patched_library: PatchedLibrary + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._libraries_partial_update_serialize( + id=id, + patched_library=patched_library, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method libraries_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Library", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _libraries_partial_update_serialize( + self, + id, + patched_library, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_library'] is not None: - _body_params = _params['patched_library'] + if patched_library is not None: + _body_params = patched_library + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Library", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/libraries/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/libraries/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def libraries_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this library.")], **kwargs) -> Library: # noqa: E501 - """libraries_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.libraries_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def libraries_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this library.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Library: + """libraries_retrieve + :param id: A unique integer value identifying this library. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Library - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the libraries_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.libraries_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def libraries_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this library.")], **kwargs) -> ApiResponse: # noqa: E501 - """libraries_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.libraries_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._libraries_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Library", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def libraries_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this library.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Library]: + """libraries_retrieve + :param id: A unique integer value identifying this library. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Library, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._libraries_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Library", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def libraries_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this library.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """libraries_retrieve + + + :param id: A unique integer value identifying this library. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._libraries_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method libraries_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Library", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _libraries_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "Library", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/libraries/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/libraries/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def libraries_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this library.")], library : Library, **kwargs) -> Library: # noqa: E501 - """libraries_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.libraries_update(id, library, async_req=True) - >>> result = thread.get() + + @validate_call + def libraries_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this library.")], + library: Library, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Library: + """libraries_update + :param id: A unique integer value identifying this library. (required) :type id: int :param library: (required) :type library: Library - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Library - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the libraries_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.libraries_update_with_http_info(id, library, **kwargs) # noqa: E501 - - @validate_arguments - def libraries_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this library.")], library : Library, **kwargs) -> ApiResponse: # noqa: E501 - """libraries_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.libraries_update_with_http_info(id, library, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._libraries_update_serialize( + id=id, + library=library, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Library", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def libraries_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this library.")], + library: Library, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Library]: + """libraries_update + :param id: A unique integer value identifying this library. (required) :type id: int :param library: (required) :type library: Library - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Library, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._libraries_update_serialize( + id=id, + library=library, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Library", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'library' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def libraries_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this library.")], + library: Library, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """libraries_update + + + :param id: A unique integer value identifying this library. (required) + :type id: int + :param library: (required) + :type library: Library + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._libraries_update_serialize( + id=id, + library=library, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method libraries_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Library", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _libraries_update_serialize( + self, + id, + library, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['library'] is not None: - _body_params = _params['library'] + if library is not None: + _body_params = library + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Library", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/libraries/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/libraries/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/listener_counts_api.py b/python-client/libretime_client/api/listener_counts_api.py index c14cefa5..fa87f478 100644 --- a/python-client/libretime_client/api/listener_counts_api.py +++ b/python-client/libretime_client/api/listener_counts_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.listener_count import ListenerCount from libretime_client.models.patched_listener_count import PatchedListenerCount -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class ListenerCountsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def listener_counts_create(self, listener_count : ListenerCount, **kwargs) -> ListenerCount: # noqa: E501 - """listener_counts_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def listener_counts_create( + self, + listener_count: ListenerCount, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListenerCount: + """listener_counts_create - >>> thread = api.listener_counts_create(listener_count, async_req=True) - >>> result = thread.get() :param listener_count: (required) :type listener_count: ListenerCount - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ListenerCount - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the listener_counts_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.listener_counts_create_with_http_info(listener_count, **kwargs) # noqa: E501 - - @validate_arguments - def listener_counts_create_with_http_info(self, listener_count : ListenerCount, **kwargs) -> ApiResponse: # noqa: E501 - """listener_counts_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.listener_counts_create_with_http_info(listener_count, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._listener_counts_create_serialize( + listener_count=listener_count, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ListenerCount", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def listener_counts_create_with_http_info( + self, + listener_count: ListenerCount, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListenerCount]: + """listener_counts_create + :param listener_count: (required) :type listener_count: ListenerCount - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ListenerCount, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._listener_counts_create_serialize( + listener_count=listener_count, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "ListenerCount", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'listener_count' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def listener_counts_create_without_preload_content( + self, + listener_count: ListenerCount, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """listener_counts_create + + + :param listener_count: (required) + :type listener_count: ListenerCount + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._listener_counts_create_serialize( + listener_count=listener_count, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method listener_counts_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "ListenerCount", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _listener_counts_create_serialize( + self, + listener_count, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['listener_count'] is not None: - _body_params = _params['listener_count'] + if listener_count is not None: + _body_params = listener_count + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "ListenerCount", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/listener-counts', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/listener-counts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def listener_counts_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this listener count.")], **kwargs) -> None: # noqa: E501 - """listener_counts_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.listener_counts_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def listener_counts_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this listener count.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """listener_counts_destroy + :param id: A unique integer value identifying this listener count. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the listener_counts_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.listener_counts_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def listener_counts_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this listener count.")], **kwargs) -> ApiResponse: # noqa: E501 - """listener_counts_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.listener_counts_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._listener_counts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def listener_counts_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this listener count.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """listener_counts_destroy + :param id: A unique integer value identifying this listener count. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._listener_counts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def listener_counts_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this listener count.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """listener_counts_destroy + + + :param id: A unique integer value identifying this listener count. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._listener_counts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method listener_counts_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _listener_counts_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/listener-counts/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/listener-counts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def listener_counts_list(self, **kwargs) -> List[ListenerCount]: # noqa: E501 - """listener_counts_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.listener_counts_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def listener_counts_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ListenerCount]: + """listener_counts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[ListenerCount] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the listener_counts_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.listener_counts_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def listener_counts_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """listener_counts_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.listener_counts_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._listener_counts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ListenerCount]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def listener_counts_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ListenerCount]]: + """listener_counts_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[ListenerCount], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._listener_counts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ListenerCount]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def listener_counts_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """listener_counts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._listener_counts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method listener_counts_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ListenerCount]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _listener_counts_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[ListenerCount]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/listener-counts', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/listener-counts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def listener_counts_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this listener count.")], patched_listener_count : Optional[PatchedListenerCount] = None, **kwargs) -> ListenerCount: # noqa: E501 - """listener_counts_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.listener_counts_partial_update(id, patched_listener_count, async_req=True) - >>> result = thread.get() + + @validate_call + def listener_counts_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this listener count.")], + patched_listener_count: Optional[PatchedListenerCount] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListenerCount: + """listener_counts_partial_update + :param id: A unique integer value identifying this listener count. (required) :type id: int :param patched_listener_count: :type patched_listener_count: PatchedListenerCount - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ListenerCount - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the listener_counts_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.listener_counts_partial_update_with_http_info(id, patched_listener_count, **kwargs) # noqa: E501 - - @validate_arguments - def listener_counts_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this listener count.")], patched_listener_count : Optional[PatchedListenerCount] = None, **kwargs) -> ApiResponse: # noqa: E501 - """listener_counts_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.listener_counts_partial_update_with_http_info(id, patched_listener_count, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._listener_counts_partial_update_serialize( + id=id, + patched_listener_count=patched_listener_count, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListenerCount", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def listener_counts_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this listener count.")], + patched_listener_count: Optional[PatchedListenerCount] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListenerCount]: + """listener_counts_partial_update + :param id: A unique integer value identifying this listener count. (required) :type id: int :param patched_listener_count: :type patched_listener_count: PatchedListenerCount - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ListenerCount, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._listener_counts_partial_update_serialize( + id=id, + patched_listener_count=patched_listener_count, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListenerCount", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_listener_count' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def listener_counts_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this listener count.")], + patched_listener_count: Optional[PatchedListenerCount] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """listener_counts_partial_update + + + :param id: A unique integer value identifying this listener count. (required) + :type id: int + :param patched_listener_count: + :type patched_listener_count: PatchedListenerCount + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._listener_counts_partial_update_serialize( + id=id, + patched_listener_count=patched_listener_count, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method listener_counts_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListenerCount", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _listener_counts_partial_update_serialize( + self, + id, + patched_listener_count, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_listener_count'] is not None: - _body_params = _params['patched_listener_count'] + if patched_listener_count is not None: + _body_params = patched_listener_count + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ListenerCount", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/listener-counts/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/listener-counts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def listener_counts_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this listener count.")], **kwargs) -> ListenerCount: # noqa: E501 - """listener_counts_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.listener_counts_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def listener_counts_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this listener count.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListenerCount: + """listener_counts_retrieve + :param id: A unique integer value identifying this listener count. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ListenerCount - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the listener_counts_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.listener_counts_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def listener_counts_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this listener count.")], **kwargs) -> ApiResponse: # noqa: E501 - """listener_counts_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.listener_counts_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._listener_counts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListenerCount", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def listener_counts_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this listener count.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListenerCount]: + """listener_counts_retrieve + :param id: A unique integer value identifying this listener count. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ListenerCount, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._listener_counts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListenerCount", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def listener_counts_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this listener count.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """listener_counts_retrieve + + + :param id: A unique integer value identifying this listener count. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._listener_counts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method listener_counts_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListenerCount", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _listener_counts_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "ListenerCount", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/listener-counts/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/listener-counts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def listener_counts_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this listener count.")], listener_count : ListenerCount, **kwargs) -> ListenerCount: # noqa: E501 - """listener_counts_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.listener_counts_update(id, listener_count, async_req=True) - >>> result = thread.get() + + @validate_call + def listener_counts_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this listener count.")], + listener_count: ListenerCount, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListenerCount: + """listener_counts_update + :param id: A unique integer value identifying this listener count. (required) :type id: int :param listener_count: (required) :type listener_count: ListenerCount - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ListenerCount - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the listener_counts_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.listener_counts_update_with_http_info(id, listener_count, **kwargs) # noqa: E501 - - @validate_arguments - def listener_counts_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this listener count.")], listener_count : ListenerCount, **kwargs) -> ApiResponse: # noqa: E501 - """listener_counts_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.listener_counts_update_with_http_info(id, listener_count, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._listener_counts_update_serialize( + id=id, + listener_count=listener_count, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListenerCount", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def listener_counts_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this listener count.")], + listener_count: ListenerCount, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListenerCount]: + """listener_counts_update + :param id: A unique integer value identifying this listener count. (required) :type id: int :param listener_count: (required) :type listener_count: ListenerCount - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ListenerCount, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._listener_counts_update_serialize( + id=id, + listener_count=listener_count, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListenerCount", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'listener_count' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def listener_counts_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this listener count.")], + listener_count: ListenerCount, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """listener_counts_update + + + :param id: A unique integer value identifying this listener count. (required) + :type id: int + :param listener_count: (required) + :type listener_count: ListenerCount + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._listener_counts_update_serialize( + id=id, + listener_count=listener_count, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method listener_counts_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListenerCount", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _listener_counts_update_serialize( + self, + id, + listener_count, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['listener_count'] is not None: - _body_params = _params['listener_count'] + if listener_count is not None: + _body_params = listener_count + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ListenerCount", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/listener-counts/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/listener-counts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/live_logs_api.py b/python-client/libretime_client/api/live_logs_api.py index 9aefd7c0..f8a20940 100644 --- a/python-client/libretime_client/api/live_logs_api.py +++ b/python-client/libretime_client/api/live_logs_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.live_log import LiveLog from libretime_client.models.patched_live_log import PatchedLiveLog -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class LiveLogsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def live_logs_create(self, live_log : LiveLog, **kwargs) -> LiveLog: # noqa: E501 - """live_logs_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def live_logs_create( + self, + live_log: LiveLog, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LiveLog: + """live_logs_create - >>> thread = api.live_logs_create(live_log, async_req=True) - >>> result = thread.get() :param live_log: (required) :type live_log: LiveLog - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: LiveLog - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the live_logs_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.live_logs_create_with_http_info(live_log, **kwargs) # noqa: E501 - - @validate_arguments - def live_logs_create_with_http_info(self, live_log : LiveLog, **kwargs) -> ApiResponse: # noqa: E501 - """live_logs_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.live_logs_create_with_http_info(live_log, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._live_logs_create_serialize( + live_log=live_log, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "LiveLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def live_logs_create_with_http_info( + self, + live_log: LiveLog, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LiveLog]: + """live_logs_create + :param live_log: (required) :type live_log: LiveLog - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(LiveLog, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._live_logs_create_serialize( + live_log=live_log, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "LiveLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'live_log' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def live_logs_create_without_preload_content( + self, + live_log: LiveLog, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """live_logs_create + + + :param live_log: (required) + :type live_log: LiveLog + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._live_logs_create_serialize( + live_log=live_log, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method live_logs_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "LiveLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _live_logs_create_serialize( + self, + live_log, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['live_log'] is not None: - _body_params = _params['live_log'] + if live_log is not None: + _body_params = live_log + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "LiveLog", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/live-logs', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/live-logs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def live_logs_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this live log.")], **kwargs) -> None: # noqa: E501 - """live_logs_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.live_logs_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def live_logs_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this live log.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """live_logs_destroy + :param id: A unique integer value identifying this live log. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the live_logs_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.live_logs_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def live_logs_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this live log.")], **kwargs) -> ApiResponse: # noqa: E501 - """live_logs_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.live_logs_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._live_logs_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def live_logs_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this live log.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """live_logs_destroy + :param id: A unique integer value identifying this live log. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._live_logs_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def live_logs_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this live log.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """live_logs_destroy + + + :param id: A unique integer value identifying this live log. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._live_logs_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method live_logs_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _live_logs_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/live-logs/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/live-logs/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def live_logs_list(self, **kwargs) -> List[LiveLog]: # noqa: E501 - """live_logs_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.live_logs_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def live_logs_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[LiveLog]: + """live_logs_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[LiveLog] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the live_logs_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.live_logs_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def live_logs_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """live_logs_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.live_logs_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._live_logs_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LiveLog]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def live_logs_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[LiveLog]]: + """live_logs_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[LiveLog], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._live_logs_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LiveLog]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def live_logs_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """live_logs_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._live_logs_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method live_logs_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LiveLog]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _live_logs_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[LiveLog]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/live-logs', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/live-logs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def live_logs_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this live log.")], patched_live_log : Optional[PatchedLiveLog] = None, **kwargs) -> LiveLog: # noqa: E501 - """live_logs_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.live_logs_partial_update(id, patched_live_log, async_req=True) - >>> result = thread.get() + + @validate_call + def live_logs_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this live log.")], + patched_live_log: Optional[PatchedLiveLog] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LiveLog: + """live_logs_partial_update + :param id: A unique integer value identifying this live log. (required) :type id: int :param patched_live_log: :type patched_live_log: PatchedLiveLog - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: LiveLog - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the live_logs_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.live_logs_partial_update_with_http_info(id, patched_live_log, **kwargs) # noqa: E501 - - @validate_arguments - def live_logs_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this live log.")], patched_live_log : Optional[PatchedLiveLog] = None, **kwargs) -> ApiResponse: # noqa: E501 - """live_logs_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.live_logs_partial_update_with_http_info(id, patched_live_log, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._live_logs_partial_update_serialize( + id=id, + patched_live_log=patched_live_log, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LiveLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def live_logs_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this live log.")], + patched_live_log: Optional[PatchedLiveLog] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LiveLog]: + """live_logs_partial_update + :param id: A unique integer value identifying this live log. (required) :type id: int :param patched_live_log: :type patched_live_log: PatchedLiveLog - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(LiveLog, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._live_logs_partial_update_serialize( + id=id, + patched_live_log=patched_live_log, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "LiveLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_live_log' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def live_logs_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this live log.")], + patched_live_log: Optional[PatchedLiveLog] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """live_logs_partial_update + + + :param id: A unique integer value identifying this live log. (required) + :type id: int + :param patched_live_log: + :type patched_live_log: PatchedLiveLog + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._live_logs_partial_update_serialize( + id=id, + patched_live_log=patched_live_log, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method live_logs_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "LiveLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _live_logs_partial_update_serialize( + self, + id, + patched_live_log, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_live_log'] is not None: - _body_params = _params['patched_live_log'] + if patched_live_log is not None: + _body_params = patched_live_log + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "LiveLog", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/live-logs/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/live-logs/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def live_logs_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this live log.")], **kwargs) -> LiveLog: # noqa: E501 - """live_logs_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.live_logs_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def live_logs_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this live log.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LiveLog: + """live_logs_retrieve + :param id: A unique integer value identifying this live log. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: LiveLog - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the live_logs_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.live_logs_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def live_logs_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this live log.")], **kwargs) -> ApiResponse: # noqa: E501 - """live_logs_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.live_logs_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._live_logs_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LiveLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def live_logs_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this live log.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LiveLog]: + """live_logs_retrieve + :param id: A unique integer value identifying this live log. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(LiveLog, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._live_logs_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LiveLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def live_logs_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this live log.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """live_logs_retrieve + + + :param id: A unique integer value identifying this live log. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._live_logs_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method live_logs_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "LiveLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _live_logs_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "LiveLog", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/live-logs/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/live-logs/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def live_logs_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this live log.")], live_log : LiveLog, **kwargs) -> LiveLog: # noqa: E501 - """live_logs_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.live_logs_update(id, live_log, async_req=True) - >>> result = thread.get() + + @validate_call + def live_logs_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this live log.")], + live_log: LiveLog, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LiveLog: + """live_logs_update + :param id: A unique integer value identifying this live log. (required) :type id: int :param live_log: (required) :type live_log: LiveLog - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: LiveLog - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the live_logs_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.live_logs_update_with_http_info(id, live_log, **kwargs) # noqa: E501 - - @validate_arguments - def live_logs_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this live log.")], live_log : LiveLog, **kwargs) -> ApiResponse: # noqa: E501 - """live_logs_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.live_logs_update_with_http_info(id, live_log, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._live_logs_update_serialize( + id=id, + live_log=live_log, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LiveLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def live_logs_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this live log.")], + live_log: LiveLog, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LiveLog]: + """live_logs_update + :param id: A unique integer value identifying this live log. (required) :type id: int :param live_log: (required) :type live_log: LiveLog - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(LiveLog, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._live_logs_update_serialize( + id=id, + live_log=live_log, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "LiveLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'live_log' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def live_logs_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this live log.")], + live_log: LiveLog, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """live_logs_update + + + :param id: A unique integer value identifying this live log. (required) + :type id: int + :param live_log: (required) + :type live_log: LiveLog + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._live_logs_update_serialize( + id=id, + live_log=live_log, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method live_logs_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "LiveLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _live_logs_update_serialize( + self, + id, + live_log, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['live_log'] is not None: - _body_params = _params['live_log'] + if live_log is not None: + _body_params = live_log + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "LiveLog", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/live-logs/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/live-logs/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/login_attempts_api.py b/python-client/libretime_client/api/login_attempts_api.py index 4b9870ff..517ef0b6 100644 --- a/python-client/libretime_client/api/login_attempts_api.py +++ b/python-client/libretime_client/api/login_attempts_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr - -from typing import List, Optional +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.login_attempt import LoginAttempt from libretime_client.models.patched_login_attempt import PatchedLoginAttempt -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class LoginAttemptsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def login_attempts_create(self, login_attempt : LoginAttempt, **kwargs) -> LoginAttempt: # noqa: E501 - """login_attempts_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def login_attempts_create( + self, + login_attempt: LoginAttempt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LoginAttempt: + """login_attempts_create - >>> thread = api.login_attempts_create(login_attempt, async_req=True) - >>> result = thread.get() :param login_attempt: (required) :type login_attempt: LoginAttempt - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: LoginAttempt - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the login_attempts_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.login_attempts_create_with_http_info(login_attempt, **kwargs) # noqa: E501 - - @validate_arguments - def login_attempts_create_with_http_info(self, login_attempt : LoginAttempt, **kwargs) -> ApiResponse: # noqa: E501 - """login_attempts_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_attempts_create_with_http_info(login_attempt, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._login_attempts_create_serialize( + login_attempt=login_attempt, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "LoginAttempt", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def login_attempts_create_with_http_info( + self, + login_attempt: LoginAttempt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LoginAttempt]: + """login_attempts_create + :param login_attempt: (required) :type login_attempt: LoginAttempt - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(LoginAttempt, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._login_attempts_create_serialize( + login_attempt=login_attempt, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "LoginAttempt", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'login_attempt' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def login_attempts_create_without_preload_content( + self, + login_attempt: LoginAttempt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """login_attempts_create + + + :param login_attempt: (required) + :type login_attempt: LoginAttempt + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_attempts_create_serialize( + login_attempt=login_attempt, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method login_attempts_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "LoginAttempt", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _login_attempts_create_serialize( + self, + login_attempt, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['login_attempt'] is not None: - _body_params = _params['login_attempt'] + if login_attempt is not None: + _body_params = login_attempt + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "LoginAttempt", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/login-attempts', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/login-attempts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def login_attempts_destroy(self, ip : Annotated[StrictStr, Field(..., description="A unique value identifying this login attempt.")], **kwargs) -> None: # noqa: E501 - """login_attempts_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.login_attempts_destroy(ip, async_req=True) - >>> result = thread.get() + @validate_call + def login_attempts_destroy( + self, + ip: Annotated[StrictStr, Field(description="A unique value identifying this login attempt.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """login_attempts_destroy + :param ip: A unique value identifying this login attempt. (required) :type ip: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the login_attempts_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.login_attempts_destroy_with_http_info(ip, **kwargs) # noqa: E501 - - @validate_arguments - def login_attempts_destroy_with_http_info(self, ip : Annotated[StrictStr, Field(..., description="A unique value identifying this login attempt.")], **kwargs) -> ApiResponse: # noqa: E501 - """login_attempts_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_attempts_destroy_with_http_info(ip, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._login_attempts_destroy_serialize( + ip=ip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def login_attempts_destroy_with_http_info( + self, + ip: Annotated[StrictStr, Field(description="A unique value identifying this login attempt.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """login_attempts_destroy + :param ip: A unique value identifying this login attempt. (required) :type ip: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._login_attempts_destroy_serialize( + ip=ip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'ip' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def login_attempts_destroy_without_preload_content( + self, + ip: Annotated[StrictStr, Field(description="A unique value identifying this login attempt.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """login_attempts_destroy + + + :param ip: A unique value identifying this login attempt. (required) + :type ip: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_attempts_destroy_serialize( + ip=ip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method login_attempts_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['ip']: - _path_params['ip'] = _params['ip'] + def _login_attempts_destroy_serialize( + self, + ip, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if ip is not None: + _path_params['ip'] = ip # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/login-attempts/{ip}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/login-attempts/{ip}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def login_attempts_list(self, **kwargs) -> List[LoginAttempt]: # noqa: E501 - """login_attempts_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.login_attempts_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def login_attempts_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[LoginAttempt]: + """login_attempts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[LoginAttempt] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the login_attempts_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.login_attempts_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def login_attempts_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """login_attempts_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_attempts_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._login_attempts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LoginAttempt]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def login_attempts_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[LoginAttempt]]: + """login_attempts_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[LoginAttempt], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._login_attempts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LoginAttempt]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def login_attempts_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """login_attempts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_attempts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method login_attempts_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LoginAttempt]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _login_attempts_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[LoginAttempt]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/login-attempts', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/login-attempts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def login_attempts_partial_update(self, ip : Annotated[StrictStr, Field(..., description="A unique value identifying this login attempt.")], patched_login_attempt : Optional[PatchedLoginAttempt] = None, **kwargs) -> LoginAttempt: # noqa: E501 - """login_attempts_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.login_attempts_partial_update(ip, patched_login_attempt, async_req=True) - >>> result = thread.get() + + @validate_call + def login_attempts_partial_update( + self, + ip: Annotated[StrictStr, Field(description="A unique value identifying this login attempt.")], + patched_login_attempt: Optional[PatchedLoginAttempt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LoginAttempt: + """login_attempts_partial_update + :param ip: A unique value identifying this login attempt. (required) :type ip: str :param patched_login_attempt: :type patched_login_attempt: PatchedLoginAttempt - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: LoginAttempt - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the login_attempts_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.login_attempts_partial_update_with_http_info(ip, patched_login_attempt, **kwargs) # noqa: E501 - - @validate_arguments - def login_attempts_partial_update_with_http_info(self, ip : Annotated[StrictStr, Field(..., description="A unique value identifying this login attempt.")], patched_login_attempt : Optional[PatchedLoginAttempt] = None, **kwargs) -> ApiResponse: # noqa: E501 - """login_attempts_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_attempts_partial_update_with_http_info(ip, patched_login_attempt, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._login_attempts_partial_update_serialize( + ip=ip, + patched_login_attempt=patched_login_attempt, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoginAttempt", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def login_attempts_partial_update_with_http_info( + self, + ip: Annotated[StrictStr, Field(description="A unique value identifying this login attempt.")], + patched_login_attempt: Optional[PatchedLoginAttempt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LoginAttempt]: + """login_attempts_partial_update + :param ip: A unique value identifying this login attempt. (required) :type ip: str :param patched_login_attempt: :type patched_login_attempt: PatchedLoginAttempt - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(LoginAttempt, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._login_attempts_partial_update_serialize( + ip=ip, + patched_login_attempt=patched_login_attempt, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoginAttempt", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'ip', - 'patched_login_attempt' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def login_attempts_partial_update_without_preload_content( + self, + ip: Annotated[StrictStr, Field(description="A unique value identifying this login attempt.")], + patched_login_attempt: Optional[PatchedLoginAttempt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """login_attempts_partial_update + + + :param ip: A unique value identifying this login attempt. (required) + :type ip: str + :param patched_login_attempt: + :type patched_login_attempt: PatchedLoginAttempt + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_attempts_partial_update_serialize( + ip=ip, + patched_login_attempt=patched_login_attempt, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method login_attempts_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoginAttempt", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['ip']: - _path_params['ip'] = _params['ip'] + def _login_attempts_partial_update_serialize( + self, + ip, + patched_login_attempt, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if ip is not None: + _path_params['ip'] = ip # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_login_attempt'] is not None: - _body_params = _params['patched_login_attempt'] + if patched_login_attempt is not None: + _body_params = patched_login_attempt + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "LoginAttempt", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/login-attempts/{ip}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/login-attempts/{ip}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def login_attempts_retrieve(self, ip : Annotated[StrictStr, Field(..., description="A unique value identifying this login attempt.")], **kwargs) -> LoginAttempt: # noqa: E501 - """login_attempts_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.login_attempts_retrieve(ip, async_req=True) - >>> result = thread.get() + @validate_call + def login_attempts_retrieve( + self, + ip: Annotated[StrictStr, Field(description="A unique value identifying this login attempt.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LoginAttempt: + """login_attempts_retrieve + :param ip: A unique value identifying this login attempt. (required) :type ip: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: LoginAttempt - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the login_attempts_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.login_attempts_retrieve_with_http_info(ip, **kwargs) # noqa: E501 - - @validate_arguments - def login_attempts_retrieve_with_http_info(self, ip : Annotated[StrictStr, Field(..., description="A unique value identifying this login attempt.")], **kwargs) -> ApiResponse: # noqa: E501 - """login_attempts_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_attempts_retrieve_with_http_info(ip, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._login_attempts_retrieve_serialize( + ip=ip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoginAttempt", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def login_attempts_retrieve_with_http_info( + self, + ip: Annotated[StrictStr, Field(description="A unique value identifying this login attempt.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LoginAttempt]: + """login_attempts_retrieve + :param ip: A unique value identifying this login attempt. (required) :type ip: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(LoginAttempt, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._login_attempts_retrieve_serialize( + ip=ip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoginAttempt", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'ip' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def login_attempts_retrieve_without_preload_content( + self, + ip: Annotated[StrictStr, Field(description="A unique value identifying this login attempt.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """login_attempts_retrieve + + + :param ip: A unique value identifying this login attempt. (required) + :type ip: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_attempts_retrieve_serialize( + ip=ip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method login_attempts_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoginAttempt", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['ip']: - _path_params['ip'] = _params['ip'] + def _login_attempts_retrieve_serialize( + self, + ip, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if ip is not None: + _path_params['ip'] = ip # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "LoginAttempt", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/login-attempts/{ip}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/login-attempts/{ip}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def login_attempts_update(self, ip : Annotated[StrictStr, Field(..., description="A unique value identifying this login attempt.")], login_attempt : LoginAttempt, **kwargs) -> LoginAttempt: # noqa: E501 - """login_attempts_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.login_attempts_update(ip, login_attempt, async_req=True) - >>> result = thread.get() + + @validate_call + def login_attempts_update( + self, + ip: Annotated[StrictStr, Field(description="A unique value identifying this login attempt.")], + login_attempt: LoginAttempt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LoginAttempt: + """login_attempts_update + :param ip: A unique value identifying this login attempt. (required) :type ip: str :param login_attempt: (required) :type login_attempt: LoginAttempt - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: LoginAttempt - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the login_attempts_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.login_attempts_update_with_http_info(ip, login_attempt, **kwargs) # noqa: E501 - - @validate_arguments - def login_attempts_update_with_http_info(self, ip : Annotated[StrictStr, Field(..., description="A unique value identifying this login attempt.")], login_attempt : LoginAttempt, **kwargs) -> ApiResponse: # noqa: E501 - """login_attempts_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_attempts_update_with_http_info(ip, login_attempt, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._login_attempts_update_serialize( + ip=ip, + login_attempt=login_attempt, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoginAttempt", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def login_attempts_update_with_http_info( + self, + ip: Annotated[StrictStr, Field(description="A unique value identifying this login attempt.")], + login_attempt: LoginAttempt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LoginAttempt]: + """login_attempts_update + :param ip: A unique value identifying this login attempt. (required) :type ip: str :param login_attempt: (required) :type login_attempt: LoginAttempt - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(LoginAttempt, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._login_attempts_update_serialize( + ip=ip, + login_attempt=login_attempt, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoginAttempt", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'ip', - 'login_attempt' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def login_attempts_update_without_preload_content( + self, + ip: Annotated[StrictStr, Field(description="A unique value identifying this login attempt.")], + login_attempt: LoginAttempt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """login_attempts_update + + + :param ip: A unique value identifying this login attempt. (required) + :type ip: str + :param login_attempt: (required) + :type login_attempt: LoginAttempt + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_attempts_update_serialize( + ip=ip, + login_attempt=login_attempt, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method login_attempts_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoginAttempt", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['ip']: - _path_params['ip'] = _params['ip'] + def _login_attempts_update_serialize( + self, + ip, + login_attempt, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if ip is not None: + _path_params['ip'] = ip # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['login_attempt'] is not None: - _body_params = _params['login_attempt'] + if login_attempt is not None: + _body_params = login_attempt + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "LoginAttempt", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/login-attempts/{ip}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/login-attempts/{ip}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/mount_names_api.py b/python-client/libretime_client/api/mount_names_api.py index feb41d52..9b2ea4fe 100644 --- a/python-client/libretime_client/api/mount_names_api.py +++ b/python-client/libretime_client/api/mount_names_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.mount_name import MountName from libretime_client.models.patched_mount_name import PatchedMountName -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class MountNamesApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def mount_names_create(self, mount_name : MountName, **kwargs) -> MountName: # noqa: E501 - """mount_names_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def mount_names_create( + self, + mount_name: MountName, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MountName: + """mount_names_create - >>> thread = api.mount_names_create(mount_name, async_req=True) - >>> result = thread.get() :param mount_name: (required) :type mount_name: MountName - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: MountName - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the mount_names_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.mount_names_create_with_http_info(mount_name, **kwargs) # noqa: E501 - - @validate_arguments - def mount_names_create_with_http_info(self, mount_name : MountName, **kwargs) -> ApiResponse: # noqa: E501 - """mount_names_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.mount_names_create_with_http_info(mount_name, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._mount_names_create_serialize( + mount_name=mount_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "MountName", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def mount_names_create_with_http_info( + self, + mount_name: MountName, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MountName]: + """mount_names_create + :param mount_name: (required) :type mount_name: MountName - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(MountName, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._mount_names_create_serialize( + mount_name=mount_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "MountName", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'mount_name' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def mount_names_create_without_preload_content( + self, + mount_name: MountName, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """mount_names_create + + + :param mount_name: (required) + :type mount_name: MountName + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mount_names_create_serialize( + mount_name=mount_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method mount_names_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "MountName", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _mount_names_create_serialize( + self, + mount_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['mount_name'] is not None: - _body_params = _params['mount_name'] + if mount_name is not None: + _body_params = mount_name + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "MountName", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/mount-names', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/mount-names', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def mount_names_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this mount name.")], **kwargs) -> None: # noqa: E501 - """mount_names_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.mount_names_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def mount_names_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this mount name.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """mount_names_destroy + :param id: A unique integer value identifying this mount name. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the mount_names_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.mount_names_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def mount_names_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this mount name.")], **kwargs) -> ApiResponse: # noqa: E501 - """mount_names_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.mount_names_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._mount_names_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def mount_names_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this mount name.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """mount_names_destroy + :param id: A unique integer value identifying this mount name. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._mount_names_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def mount_names_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this mount name.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """mount_names_destroy + + + :param id: A unique integer value identifying this mount name. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mount_names_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method mount_names_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _mount_names_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/mount-names/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/mount-names/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def mount_names_list(self, **kwargs) -> List[MountName]: # noqa: E501 - """mount_names_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.mount_names_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def mount_names_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[MountName]: + """mount_names_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[MountName] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the mount_names_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.mount_names_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def mount_names_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """mount_names_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.mount_names_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._mount_names_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[MountName]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def mount_names_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[MountName]]: + """mount_names_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[MountName], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._mount_names_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[MountName]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def mount_names_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """mount_names_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mount_names_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method mount_names_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[MountName]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _mount_names_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[MountName]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/mount-names', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/mount-names', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def mount_names_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this mount name.")], patched_mount_name : Optional[PatchedMountName] = None, **kwargs) -> MountName: # noqa: E501 - """mount_names_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.mount_names_partial_update(id, patched_mount_name, async_req=True) - >>> result = thread.get() + + @validate_call + def mount_names_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this mount name.")], + patched_mount_name: Optional[PatchedMountName] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MountName: + """mount_names_partial_update + :param id: A unique integer value identifying this mount name. (required) :type id: int :param patched_mount_name: :type patched_mount_name: PatchedMountName - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: MountName - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the mount_names_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.mount_names_partial_update_with_http_info(id, patched_mount_name, **kwargs) # noqa: E501 - - @validate_arguments - def mount_names_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this mount name.")], patched_mount_name : Optional[PatchedMountName] = None, **kwargs) -> ApiResponse: # noqa: E501 - """mount_names_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.mount_names_partial_update_with_http_info(id, patched_mount_name, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._mount_names_partial_update_serialize( + id=id, + patched_mount_name=patched_mount_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MountName", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def mount_names_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this mount name.")], + patched_mount_name: Optional[PatchedMountName] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MountName]: + """mount_names_partial_update + :param id: A unique integer value identifying this mount name. (required) :type id: int :param patched_mount_name: :type patched_mount_name: PatchedMountName - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(MountName, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._mount_names_partial_update_serialize( + id=id, + patched_mount_name=patched_mount_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "MountName", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_mount_name' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def mount_names_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this mount name.")], + patched_mount_name: Optional[PatchedMountName] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """mount_names_partial_update + + + :param id: A unique integer value identifying this mount name. (required) + :type id: int + :param patched_mount_name: + :type patched_mount_name: PatchedMountName + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mount_names_partial_update_serialize( + id=id, + patched_mount_name=patched_mount_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method mount_names_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "MountName", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _mount_names_partial_update_serialize( + self, + id, + patched_mount_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_mount_name'] is not None: - _body_params = _params['patched_mount_name'] + if patched_mount_name is not None: + _body_params = patched_mount_name + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "MountName", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/mount-names/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/mount-names/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def mount_names_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this mount name.")], **kwargs) -> MountName: # noqa: E501 - """mount_names_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.mount_names_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def mount_names_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this mount name.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MountName: + """mount_names_retrieve + :param id: A unique integer value identifying this mount name. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: MountName - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the mount_names_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.mount_names_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def mount_names_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this mount name.")], **kwargs) -> ApiResponse: # noqa: E501 - """mount_names_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.mount_names_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._mount_names_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MountName", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def mount_names_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this mount name.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MountName]: + """mount_names_retrieve + :param id: A unique integer value identifying this mount name. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(MountName, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._mount_names_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MountName", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def mount_names_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this mount name.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """mount_names_retrieve + + + :param id: A unique integer value identifying this mount name. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mount_names_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method mount_names_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "MountName", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _mount_names_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "MountName", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/mount-names/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/mount-names/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def mount_names_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this mount name.")], mount_name : MountName, **kwargs) -> MountName: # noqa: E501 - """mount_names_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.mount_names_update(id, mount_name, async_req=True) - >>> result = thread.get() + + @validate_call + def mount_names_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this mount name.")], + mount_name: MountName, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MountName: + """mount_names_update + :param id: A unique integer value identifying this mount name. (required) :type id: int :param mount_name: (required) :type mount_name: MountName - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: MountName - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the mount_names_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.mount_names_update_with_http_info(id, mount_name, **kwargs) # noqa: E501 - - @validate_arguments - def mount_names_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this mount name.")], mount_name : MountName, **kwargs) -> ApiResponse: # noqa: E501 - """mount_names_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.mount_names_update_with_http_info(id, mount_name, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._mount_names_update_serialize( + id=id, + mount_name=mount_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MountName", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def mount_names_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this mount name.")], + mount_name: MountName, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MountName]: + """mount_names_update + :param id: A unique integer value identifying this mount name. (required) :type id: int :param mount_name: (required) :type mount_name: MountName - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(MountName, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._mount_names_update_serialize( + id=id, + mount_name=mount_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "MountName", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'mount_name' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def mount_names_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this mount name.")], + mount_name: MountName, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """mount_names_update + + + :param id: A unique integer value identifying this mount name. (required) + :type id: int + :param mount_name: (required) + :type mount_name: MountName + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mount_names_update_serialize( + id=id, + mount_name=mount_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method mount_names_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "MountName", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _mount_names_update_serialize( + self, + id, + mount_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['mount_name'] is not None: - _body_params = _params['mount_name'] + if mount_name is not None: + _body_params = mount_name + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "MountName", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/mount-names/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/mount-names/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/playlist_contents_api.py b/python-client/libretime_client/api/playlist_contents_api.py index 8fc07e4e..9a985aa4 100644 --- a/python-client/libretime_client/api/playlist_contents_api.py +++ b/python-client/libretime_client/api/playlist_contents_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_playlist_content import PatchedPlaylistContent from libretime_client.models.playlist_content import PlaylistContent -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class PlaylistContentsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def playlist_contents_create(self, playlist_content : PlaylistContent, **kwargs) -> PlaylistContent: # noqa: E501 - """playlist_contents_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def playlist_contents_create( + self, + playlist_content: PlaylistContent, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlaylistContent: + """playlist_contents_create - >>> thread = api.playlist_contents_create(playlist_content, async_req=True) - >>> result = thread.get() :param playlist_content: (required) :type playlist_content: PlaylistContent - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlaylistContent - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playlist_contents_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playlist_contents_create_with_http_info(playlist_content, **kwargs) # noqa: E501 - - @validate_arguments - def playlist_contents_create_with_http_info(self, playlist_content : PlaylistContent, **kwargs) -> ApiResponse: # noqa: E501 - """playlist_contents_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playlist_contents_create_with_http_info(playlist_content, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playlist_contents_create_serialize( + playlist_content=playlist_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlaylistContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playlist_contents_create_with_http_info( + self, + playlist_content: PlaylistContent, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlaylistContent]: + """playlist_contents_create + :param playlist_content: (required) :type playlist_content: PlaylistContent - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlaylistContent, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playlist_contents_create_serialize( + playlist_content=playlist_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlaylistContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'playlist_content' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playlist_contents_create_without_preload_content( + self, + playlist_content: PlaylistContent, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playlist_contents_create + + + :param playlist_content: (required) + :type playlist_content: PlaylistContent + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playlist_contents_create_serialize( + playlist_content=playlist_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playlist_contents_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlaylistContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _playlist_contents_create_serialize( + self, + playlist_content, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['playlist_content'] is not None: - _body_params = _params['playlist_content'] + if playlist_content is not None: + _body_params = playlist_content + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "PlaylistContent", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playlist-contents', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/playlist-contents', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def playlist_contents_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist content.")], **kwargs) -> None: # noqa: E501 - """playlist_contents_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playlist_contents_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def playlist_contents_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist content.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """playlist_contents_destroy + :param id: A unique integer value identifying this playlist content. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playlist_contents_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playlist_contents_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def playlist_contents_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist content.")], **kwargs) -> ApiResponse: # noqa: E501 - """playlist_contents_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playlist_contents_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playlist_contents_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playlist_contents_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist content.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """playlist_contents_destroy + :param id: A unique integer value identifying this playlist content. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._playlist_contents_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playlist_contents_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist content.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playlist_contents_destroy + + + :param id: A unique integer value identifying this playlist content. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playlist_contents_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playlist_contents_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playlist_contents_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/playlist-contents/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/playlist-contents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playlist_contents_list(self, **kwargs) -> List[PlaylistContent]: # noqa: E501 - """playlist_contents_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playlist_contents_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def playlist_contents_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[PlaylistContent]: + """playlist_contents_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[PlaylistContent] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playlist_contents_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playlist_contents_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def playlist_contents_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """playlist_contents_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playlist_contents_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._playlist_contents_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlaylistContent]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playlist_contents_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[PlaylistContent]]: + """playlist_contents_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[PlaylistContent], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._playlist_contents_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlaylistContent]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def playlist_contents_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playlist_contents_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playlist_contents_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playlist_contents_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlaylistContent]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _playlist_contents_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[PlaylistContent]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playlist-contents', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/playlist-contents', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playlist_contents_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist content.")], patched_playlist_content : Optional[PatchedPlaylistContent] = None, **kwargs) -> PlaylistContent: # noqa: E501 - """playlist_contents_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playlist_contents_partial_update(id, patched_playlist_content, async_req=True) - >>> result = thread.get() + + @validate_call + def playlist_contents_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist content.")], + patched_playlist_content: Optional[PatchedPlaylistContent] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlaylistContent: + """playlist_contents_partial_update + :param id: A unique integer value identifying this playlist content. (required) :type id: int :param patched_playlist_content: :type patched_playlist_content: PatchedPlaylistContent - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlaylistContent - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playlist_contents_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playlist_contents_partial_update_with_http_info(id, patched_playlist_content, **kwargs) # noqa: E501 - - @validate_arguments - def playlist_contents_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist content.")], patched_playlist_content : Optional[PatchedPlaylistContent] = None, **kwargs) -> ApiResponse: # noqa: E501 - """playlist_contents_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playlist_contents_partial_update_with_http_info(id, patched_playlist_content, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playlist_contents_partial_update_serialize( + id=id, + patched_playlist_content=patched_playlist_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaylistContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playlist_contents_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist content.")], + patched_playlist_content: Optional[PatchedPlaylistContent] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlaylistContent]: + """playlist_contents_partial_update + :param id: A unique integer value identifying this playlist content. (required) :type id: int :param patched_playlist_content: :type patched_playlist_content: PatchedPlaylistContent - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlaylistContent, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playlist_contents_partial_update_serialize( + id=id, + patched_playlist_content=patched_playlist_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaylistContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_playlist_content' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playlist_contents_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist content.")], + patched_playlist_content: Optional[PatchedPlaylistContent] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playlist_contents_partial_update + + + :param id: A unique integer value identifying this playlist content. (required) + :type id: int + :param patched_playlist_content: + :type patched_playlist_content: PatchedPlaylistContent + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playlist_contents_partial_update_serialize( + id=id, + patched_playlist_content=patched_playlist_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playlist_contents_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaylistContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playlist_contents_partial_update_serialize( + self, + id, + patched_playlist_content, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_playlist_content'] is not None: - _body_params = _params['patched_playlist_content'] + if patched_playlist_content is not None: + _body_params = patched_playlist_content + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "PlaylistContent", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playlist-contents/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/playlist-contents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def playlist_contents_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist content.")], **kwargs) -> PlaylistContent: # noqa: E501 - """playlist_contents_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playlist_contents_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def playlist_contents_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist content.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlaylistContent: + """playlist_contents_retrieve + :param id: A unique integer value identifying this playlist content. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlaylistContent - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playlist_contents_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playlist_contents_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def playlist_contents_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist content.")], **kwargs) -> ApiResponse: # noqa: E501 - """playlist_contents_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playlist_contents_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playlist_contents_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaylistContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playlist_contents_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist content.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlaylistContent]: + """playlist_contents_retrieve + :param id: A unique integer value identifying this playlist content. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlaylistContent, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playlist_contents_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaylistContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def playlist_contents_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist content.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playlist_contents_retrieve + + + :param id: A unique integer value identifying this playlist content. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playlist_contents_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playlist_contents_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaylistContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playlist_contents_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "PlaylistContent", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playlist-contents/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/playlist-contents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playlist_contents_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist content.")], playlist_content : PlaylistContent, **kwargs) -> PlaylistContent: # noqa: E501 - """playlist_contents_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playlist_contents_update(id, playlist_content, async_req=True) - >>> result = thread.get() + + @validate_call + def playlist_contents_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist content.")], + playlist_content: PlaylistContent, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlaylistContent: + """playlist_contents_update + :param id: A unique integer value identifying this playlist content. (required) :type id: int :param playlist_content: (required) :type playlist_content: PlaylistContent - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlaylistContent - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playlist_contents_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playlist_contents_update_with_http_info(id, playlist_content, **kwargs) # noqa: E501 - - @validate_arguments - def playlist_contents_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist content.")], playlist_content : PlaylistContent, **kwargs) -> ApiResponse: # noqa: E501 - """playlist_contents_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playlist_contents_update_with_http_info(id, playlist_content, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playlist_contents_update_serialize( + id=id, + playlist_content=playlist_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaylistContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playlist_contents_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist content.")], + playlist_content: PlaylistContent, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlaylistContent]: + """playlist_contents_update + :param id: A unique integer value identifying this playlist content. (required) :type id: int :param playlist_content: (required) :type playlist_content: PlaylistContent - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlaylistContent, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playlist_contents_update_serialize( + id=id, + playlist_content=playlist_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaylistContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'playlist_content' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playlist_contents_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist content.")], + playlist_content: PlaylistContent, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playlist_contents_update + + + :param id: A unique integer value identifying this playlist content. (required) + :type id: int + :param playlist_content: (required) + :type playlist_content: PlaylistContent + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playlist_contents_update_serialize( + id=id, + playlist_content=playlist_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playlist_contents_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaylistContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playlist_contents_update_serialize( + self, + id, + playlist_content, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['playlist_content'] is not None: - _body_params = _params['playlist_content'] + if playlist_content is not None: + _body_params = playlist_content + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "PlaylistContent", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playlist-contents/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/playlist-contents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/playlists_api.py b/python-client/libretime_client/api/playlists_api.py index 492b7bfc..eabee300 100644 --- a/python-client/libretime_client/api/playlists_api.py +++ b/python-client/libretime_client/api/playlists_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_playlist import PatchedPlaylist from libretime_client.models.playlist import Playlist -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class PlaylistsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def playlists_create(self, playlist : Playlist, **kwargs) -> Playlist: # noqa: E501 - """playlists_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def playlists_create( + self, + playlist: Playlist, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Playlist: + """playlists_create - >>> thread = api.playlists_create(playlist, async_req=True) - >>> result = thread.get() :param playlist: (required) :type playlist: Playlist - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Playlist - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playlists_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playlists_create_with_http_info(playlist, **kwargs) # noqa: E501 - - @validate_arguments - def playlists_create_with_http_info(self, playlist : Playlist, **kwargs) -> ApiResponse: # noqa: E501 - """playlists_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playlists_create_with_http_info(playlist, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playlists_create_serialize( + playlist=playlist, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Playlist", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playlists_create_with_http_info( + self, + playlist: Playlist, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Playlist]: + """playlists_create + :param playlist: (required) :type playlist: Playlist - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Playlist, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playlists_create_serialize( + playlist=playlist, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "Playlist", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'playlist' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playlists_create_without_preload_content( + self, + playlist: Playlist, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playlists_create + + + :param playlist: (required) + :type playlist: Playlist + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playlists_create_serialize( + playlist=playlist, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playlists_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Playlist", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _playlists_create_serialize( + self, + playlist, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['playlist'] is not None: - _body_params = _params['playlist'] + if playlist is not None: + _body_params = playlist + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "Playlist", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playlists', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/playlists', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def playlists_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist.")], **kwargs) -> None: # noqa: E501 - """playlists_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playlists_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def playlists_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """playlists_destroy + :param id: A unique integer value identifying this playlist. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playlists_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playlists_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def playlists_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist.")], **kwargs) -> ApiResponse: # noqa: E501 - """playlists_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playlists_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playlists_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playlists_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """playlists_destroy + :param id: A unique integer value identifying this playlist. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._playlists_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playlists_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playlists_destroy + + + :param id: A unique integer value identifying this playlist. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playlists_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playlists_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playlists_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/playlists/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/playlists/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playlists_list(self, **kwargs) -> List[Playlist]: # noqa: E501 - """playlists_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playlists_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def playlists_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Playlist]: + """playlists_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[Playlist] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playlists_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playlists_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def playlists_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """playlists_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playlists_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._playlists_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Playlist]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playlists_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Playlist]]: + """playlists_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[Playlist], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._playlists_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Playlist]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def playlists_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playlists_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playlists_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playlists_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Playlist]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _playlists_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[Playlist]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playlists', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/playlists', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playlists_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist.")], patched_playlist : Optional[PatchedPlaylist] = None, **kwargs) -> Playlist: # noqa: E501 - """playlists_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playlists_partial_update(id, patched_playlist, async_req=True) - >>> result = thread.get() + + @validate_call + def playlists_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist.")], + patched_playlist: Optional[PatchedPlaylist] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Playlist: + """playlists_partial_update + :param id: A unique integer value identifying this playlist. (required) :type id: int :param patched_playlist: :type patched_playlist: PatchedPlaylist - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Playlist - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playlists_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playlists_partial_update_with_http_info(id, patched_playlist, **kwargs) # noqa: E501 - - @validate_arguments - def playlists_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist.")], patched_playlist : Optional[PatchedPlaylist] = None, **kwargs) -> ApiResponse: # noqa: E501 - """playlists_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playlists_partial_update_with_http_info(id, patched_playlist, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playlists_partial_update_serialize( + id=id, + patched_playlist=patched_playlist, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Playlist", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playlists_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist.")], + patched_playlist: Optional[PatchedPlaylist] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Playlist]: + """playlists_partial_update + :param id: A unique integer value identifying this playlist. (required) :type id: int :param patched_playlist: :type patched_playlist: PatchedPlaylist - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Playlist, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playlists_partial_update_serialize( + id=id, + patched_playlist=patched_playlist, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Playlist", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_playlist' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playlists_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist.")], + patched_playlist: Optional[PatchedPlaylist] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playlists_partial_update + + + :param id: A unique integer value identifying this playlist. (required) + :type id: int + :param patched_playlist: + :type patched_playlist: PatchedPlaylist + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playlists_partial_update_serialize( + id=id, + patched_playlist=patched_playlist, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playlists_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Playlist", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playlists_partial_update_serialize( + self, + id, + patched_playlist, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_playlist'] is not None: - _body_params = _params['patched_playlist'] + if patched_playlist is not None: + _body_params = patched_playlist + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Playlist", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playlists/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/playlists/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def playlists_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist.")], **kwargs) -> Playlist: # noqa: E501 - """playlists_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playlists_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def playlists_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Playlist: + """playlists_retrieve + :param id: A unique integer value identifying this playlist. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Playlist - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playlists_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playlists_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def playlists_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist.")], **kwargs) -> ApiResponse: # noqa: E501 - """playlists_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playlists_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playlists_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Playlist", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playlists_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Playlist]: + """playlists_retrieve + :param id: A unique integer value identifying this playlist. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Playlist, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playlists_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Playlist", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def playlists_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playlists_retrieve + + + :param id: A unique integer value identifying this playlist. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playlists_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playlists_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Playlist", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playlists_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "Playlist", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playlists/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/playlists/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playlists_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist.")], playlist : Playlist, **kwargs) -> Playlist: # noqa: E501 - """playlists_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playlists_update(id, playlist, async_req=True) - >>> result = thread.get() + + @validate_call + def playlists_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist.")], + playlist: Playlist, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Playlist: + """playlists_update + :param id: A unique integer value identifying this playlist. (required) :type id: int :param playlist: (required) :type playlist: Playlist - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Playlist - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playlists_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playlists_update_with_http_info(id, playlist, **kwargs) # noqa: E501 - - @validate_arguments - def playlists_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playlist.")], playlist : Playlist, **kwargs) -> ApiResponse: # noqa: E501 - """playlists_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playlists_update_with_http_info(id, playlist, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playlists_update_serialize( + id=id, + playlist=playlist, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Playlist", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playlists_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist.")], + playlist: Playlist, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Playlist]: + """playlists_update + :param id: A unique integer value identifying this playlist. (required) :type id: int :param playlist: (required) :type playlist: Playlist - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Playlist, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playlists_update_serialize( + id=id, + playlist=playlist, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Playlist", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'playlist' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playlists_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playlist.")], + playlist: Playlist, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playlists_update + + + :param id: A unique integer value identifying this playlist. (required) + :type id: int + :param playlist: (required) + :type playlist: Playlist + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playlists_update_serialize( + id=id, + playlist=playlist, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playlists_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Playlist", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playlists_update_serialize( + self, + id, + playlist, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['playlist'] is not None: - _body_params = _params['playlist'] + if playlist is not None: + _body_params = playlist + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Playlist", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playlists/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/playlists/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/playout_history_api.py b/python-client/libretime_client/api/playout_history_api.py index d42aade6..d38c537c 100644 --- a/python-client/libretime_client/api/playout_history_api.py +++ b/python-client/libretime_client/api/playout_history_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_playout_history import PatchedPlayoutHistory from libretime_client.models.playout_history import PlayoutHistory -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class PlayoutHistoryApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def playout_history_create(self, playout_history : PlayoutHistory, **kwargs) -> PlayoutHistory: # noqa: E501 - """playout_history_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def playout_history_create( + self, + playout_history: PlayoutHistory, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistory: + """playout_history_create - >>> thread = api.playout_history_create(playout_history, async_req=True) - >>> result = thread.get() :param playout_history: (required) :type playout_history: PlayoutHistory - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistory - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_create_with_http_info(playout_history, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_create_with_http_info(self, playout_history : PlayoutHistory, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_create_with_http_info(playout_history, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_create_serialize( + playout_history=playout_history, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlayoutHistory", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_create_with_http_info( + self, + playout_history: PlayoutHistory, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistory]: + """playout_history_create + :param playout_history: (required) :type playout_history: PlayoutHistory - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistory, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_create_serialize( + playout_history=playout_history, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlayoutHistory", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'playout_history' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_create_without_preload_content( + self, + playout_history: PlayoutHistory, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_create + + + :param playout_history: (required) + :type playout_history: PlayoutHistory + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_create_serialize( + playout_history=playout_history, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlayoutHistory", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _playout_history_create_serialize( + self, + playout_history, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['playout_history'] is not None: - _body_params = _params['playout_history'] + if playout_history is not None: + _body_params = playout_history + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "PlayoutHistory", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/playout-history', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def playout_history_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history.")], **kwargs) -> None: # noqa: E501 - """playout_history_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def playout_history_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """playout_history_destroy + :param id: A unique integer value identifying this playout history. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history.")], **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """playout_history_destroy + :param id: A unique integer value identifying this playout history. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._playout_history_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_destroy + + + :param id: A unique integer value identifying this playout history. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/playout-history/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/playout-history/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playout_history_list(self, **kwargs) -> List[PlayoutHistory]: # noqa: E501 - """playout_history_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def playout_history_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[PlayoutHistory]: + """playout_history_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[PlayoutHistory] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def playout_history_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._playout_history_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlayoutHistory]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[PlayoutHistory]]: + """playout_history_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[PlayoutHistory], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._playout_history_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlayoutHistory]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def playout_history_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlayoutHistory]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _playout_history_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[PlayoutHistory]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/playout-history', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playout_history_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history.")], patched_playout_history : Optional[PatchedPlayoutHistory] = None, **kwargs) -> PlayoutHistory: # noqa: E501 - """playout_history_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_partial_update(id, patched_playout_history, async_req=True) - >>> result = thread.get() + + @validate_call + def playout_history_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history.")], + patched_playout_history: Optional[PatchedPlayoutHistory] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistory: + """playout_history_partial_update + :param id: A unique integer value identifying this playout history. (required) :type id: int :param patched_playout_history: :type patched_playout_history: PatchedPlayoutHistory - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistory - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_partial_update_with_http_info(id, patched_playout_history, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history.")], patched_playout_history : Optional[PatchedPlayoutHistory] = None, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_partial_update_with_http_info(id, patched_playout_history, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_partial_update_serialize( + id=id, + patched_playout_history=patched_playout_history, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistory", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history.")], + patched_playout_history: Optional[PatchedPlayoutHistory] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistory]: + """playout_history_partial_update + :param id: A unique integer value identifying this playout history. (required) :type id: int :param patched_playout_history: :type patched_playout_history: PatchedPlayoutHistory - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistory, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_partial_update_serialize( + id=id, + patched_playout_history=patched_playout_history, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistory", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_playout_history' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history.")], + patched_playout_history: Optional[PatchedPlayoutHistory] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_partial_update + + + :param id: A unique integer value identifying this playout history. (required) + :type id: int + :param patched_playout_history: + :type patched_playout_history: PatchedPlayoutHistory + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_partial_update_serialize( + id=id, + patched_playout_history=patched_playout_history, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistory", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_partial_update_serialize( + self, + id, + patched_playout_history, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_playout_history'] is not None: - _body_params = _params['patched_playout_history'] + if patched_playout_history is not None: + _body_params = patched_playout_history + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "PlayoutHistory", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/playout-history/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def playout_history_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history.")], **kwargs) -> PlayoutHistory: # noqa: E501 - """playout_history_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def playout_history_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistory: + """playout_history_retrieve + :param id: A unique integer value identifying this playout history. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistory - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history.")], **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistory", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistory]: + """playout_history_retrieve + :param id: A unique integer value identifying this playout history. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistory, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistory", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def playout_history_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_retrieve + + + :param id: A unique integer value identifying this playout history. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistory", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "PlayoutHistory", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/playout-history/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playout_history_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history.")], playout_history : PlayoutHistory, **kwargs) -> PlayoutHistory: # noqa: E501 - """playout_history_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_update(id, playout_history, async_req=True) - >>> result = thread.get() + + @validate_call + def playout_history_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history.")], + playout_history: PlayoutHistory, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistory: + """playout_history_update + :param id: A unique integer value identifying this playout history. (required) :type id: int :param playout_history: (required) :type playout_history: PlayoutHistory - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistory - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_update_with_http_info(id, playout_history, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history.")], playout_history : PlayoutHistory, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_update_with_http_info(id, playout_history, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_update_serialize( + id=id, + playout_history=playout_history, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistory", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history.")], + playout_history: PlayoutHistory, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistory]: + """playout_history_update + :param id: A unique integer value identifying this playout history. (required) :type id: int :param playout_history: (required) :type playout_history: PlayoutHistory - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistory, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_update_serialize( + id=id, + playout_history=playout_history, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistory", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'playout_history' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history.")], + playout_history: PlayoutHistory, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_update + + + :param id: A unique integer value identifying this playout history. (required) + :type id: int + :param playout_history: (required) + :type playout_history: PlayoutHistory + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_update_serialize( + id=id, + playout_history=playout_history, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistory", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_update_serialize( + self, + id, + playout_history, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['playout_history'] is not None: - _body_params = _params['playout_history'] + if playout_history is not None: + _body_params = playout_history + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "PlayoutHistory", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/playout-history/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/playout_history_metadata_api.py b/python-client/libretime_client/api/playout_history_metadata_api.py index 2a9da320..664c92ad 100644 --- a/python-client/libretime_client/api/playout_history_metadata_api.py +++ b/python-client/libretime_client/api/playout_history_metadata_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_playout_history_metadata import PatchedPlayoutHistoryMetadata from libretime_client.models.playout_history_metadata import PlayoutHistoryMetadata -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class PlayoutHistoryMetadataApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def playout_history_metadata_create(self, playout_history_metadata : PlayoutHistoryMetadata, **kwargs) -> PlayoutHistoryMetadata: # noqa: E501 - """playout_history_metadata_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def playout_history_metadata_create( + self, + playout_history_metadata: PlayoutHistoryMetadata, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistoryMetadata: + """playout_history_metadata_create - >>> thread = api.playout_history_metadata_create(playout_history_metadata, async_req=True) - >>> result = thread.get() :param playout_history_metadata: (required) :type playout_history_metadata: PlayoutHistoryMetadata - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistoryMetadata - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_metadata_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_metadata_create_with_http_info(playout_history_metadata, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_metadata_create_with_http_info(self, playout_history_metadata : PlayoutHistoryMetadata, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_metadata_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_metadata_create_with_http_info(playout_history_metadata, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_metadata_create_serialize( + playout_history_metadata=playout_history_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlayoutHistoryMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_metadata_create_with_http_info( + self, + playout_history_metadata: PlayoutHistoryMetadata, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistoryMetadata]: + """playout_history_metadata_create + :param playout_history_metadata: (required) :type playout_history_metadata: PlayoutHistoryMetadata - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistoryMetadata, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_metadata_create_serialize( + playout_history_metadata=playout_history_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlayoutHistoryMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'playout_history_metadata' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_metadata_create_without_preload_content( + self, + playout_history_metadata: PlayoutHistoryMetadata, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_metadata_create + + + :param playout_history_metadata: (required) + :type playout_history_metadata: PlayoutHistoryMetadata + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_metadata_create_serialize( + playout_history_metadata=playout_history_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_metadata_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlayoutHistoryMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _playout_history_metadata_create_serialize( + self, + playout_history_metadata, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['playout_history_metadata'] is not None: - _body_params = _params['playout_history_metadata'] + if playout_history_metadata is not None: + _body_params = playout_history_metadata + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "PlayoutHistoryMetadata", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-metadata', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/playout-history-metadata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def playout_history_metadata_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history metadata.")], **kwargs) -> None: # noqa: E501 - """playout_history_metadata_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_metadata_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def playout_history_metadata_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history metadata.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """playout_history_metadata_destroy + :param id: A unique integer value identifying this playout history metadata. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_metadata_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_metadata_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_metadata_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history metadata.")], **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_metadata_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_metadata_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_metadata_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_metadata_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history metadata.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """playout_history_metadata_destroy + :param id: A unique integer value identifying this playout history metadata. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._playout_history_metadata_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_metadata_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history metadata.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_metadata_destroy + + + :param id: A unique integer value identifying this playout history metadata. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_metadata_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_metadata_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_metadata_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/playout-history-metadata/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/playout-history-metadata/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playout_history_metadata_list(self, **kwargs) -> List[PlayoutHistoryMetadata]: # noqa: E501 - """playout_history_metadata_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_metadata_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def playout_history_metadata_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[PlayoutHistoryMetadata]: + """playout_history_metadata_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[PlayoutHistoryMetadata] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_metadata_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_metadata_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def playout_history_metadata_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_metadata_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_metadata_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._playout_history_metadata_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlayoutHistoryMetadata]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_metadata_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[PlayoutHistoryMetadata]]: + """playout_history_metadata_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[PlayoutHistoryMetadata], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._playout_history_metadata_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlayoutHistoryMetadata]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def playout_history_metadata_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_metadata_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_metadata_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_metadata_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlayoutHistoryMetadata]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _playout_history_metadata_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[PlayoutHistoryMetadata]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-metadata', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/playout-history-metadata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playout_history_metadata_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history metadata.")], patched_playout_history_metadata : Optional[PatchedPlayoutHistoryMetadata] = None, **kwargs) -> PlayoutHistoryMetadata: # noqa: E501 - """playout_history_metadata_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_metadata_partial_update(id, patched_playout_history_metadata, async_req=True) - >>> result = thread.get() + + @validate_call + def playout_history_metadata_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history metadata.")], + patched_playout_history_metadata: Optional[PatchedPlayoutHistoryMetadata] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistoryMetadata: + """playout_history_metadata_partial_update + :param id: A unique integer value identifying this playout history metadata. (required) :type id: int :param patched_playout_history_metadata: :type patched_playout_history_metadata: PatchedPlayoutHistoryMetadata - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistoryMetadata - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_metadata_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_metadata_partial_update_with_http_info(id, patched_playout_history_metadata, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_metadata_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history metadata.")], patched_playout_history_metadata : Optional[PatchedPlayoutHistoryMetadata] = None, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_metadata_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_metadata_partial_update_with_http_info(id, patched_playout_history_metadata, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_metadata_partial_update_serialize( + id=id, + patched_playout_history_metadata=patched_playout_history_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_metadata_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history metadata.")], + patched_playout_history_metadata: Optional[PatchedPlayoutHistoryMetadata] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistoryMetadata]: + """playout_history_metadata_partial_update + :param id: A unique integer value identifying this playout history metadata. (required) :type id: int :param patched_playout_history_metadata: :type patched_playout_history_metadata: PatchedPlayoutHistoryMetadata - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistoryMetadata, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_metadata_partial_update_serialize( + id=id, + patched_playout_history_metadata=patched_playout_history_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_playout_history_metadata' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_metadata_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history metadata.")], + patched_playout_history_metadata: Optional[PatchedPlayoutHistoryMetadata] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_metadata_partial_update + + + :param id: A unique integer value identifying this playout history metadata. (required) + :type id: int + :param patched_playout_history_metadata: + :type patched_playout_history_metadata: PatchedPlayoutHistoryMetadata + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_metadata_partial_update_serialize( + id=id, + patched_playout_history_metadata=patched_playout_history_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_metadata_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_metadata_partial_update_serialize( + self, + id, + patched_playout_history_metadata, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_playout_history_metadata'] is not None: - _body_params = _params['patched_playout_history_metadata'] + if patched_playout_history_metadata is not None: + _body_params = patched_playout_history_metadata + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "PlayoutHistoryMetadata", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-metadata/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/playout-history-metadata/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def playout_history_metadata_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history metadata.")], **kwargs) -> PlayoutHistoryMetadata: # noqa: E501 - """playout_history_metadata_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_metadata_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def playout_history_metadata_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history metadata.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistoryMetadata: + """playout_history_metadata_retrieve + :param id: A unique integer value identifying this playout history metadata. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistoryMetadata - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_metadata_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_metadata_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_metadata_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history metadata.")], **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_metadata_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_metadata_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_metadata_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_metadata_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history metadata.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistoryMetadata]: + """playout_history_metadata_retrieve + :param id: A unique integer value identifying this playout history metadata. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistoryMetadata, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_metadata_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def playout_history_metadata_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history metadata.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_metadata_retrieve + + + :param id: A unique integer value identifying this playout history metadata. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_metadata_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_metadata_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_metadata_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "PlayoutHistoryMetadata", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-metadata/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/playout-history-metadata/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playout_history_metadata_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history metadata.")], playout_history_metadata : PlayoutHistoryMetadata, **kwargs) -> PlayoutHistoryMetadata: # noqa: E501 - """playout_history_metadata_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_metadata_update(id, playout_history_metadata, async_req=True) - >>> result = thread.get() + + @validate_call + def playout_history_metadata_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history metadata.")], + playout_history_metadata: PlayoutHistoryMetadata, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistoryMetadata: + """playout_history_metadata_update + :param id: A unique integer value identifying this playout history metadata. (required) :type id: int :param playout_history_metadata: (required) :type playout_history_metadata: PlayoutHistoryMetadata - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistoryMetadata - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_metadata_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_metadata_update_with_http_info(id, playout_history_metadata, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_metadata_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history metadata.")], playout_history_metadata : PlayoutHistoryMetadata, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_metadata_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_metadata_update_with_http_info(id, playout_history_metadata, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_metadata_update_serialize( + id=id, + playout_history_metadata=playout_history_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_metadata_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history metadata.")], + playout_history_metadata: PlayoutHistoryMetadata, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistoryMetadata]: + """playout_history_metadata_update + :param id: A unique integer value identifying this playout history metadata. (required) :type id: int :param playout_history_metadata: (required) :type playout_history_metadata: PlayoutHistoryMetadata - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistoryMetadata, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_metadata_update_serialize( + id=id, + playout_history_metadata=playout_history_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'playout_history_metadata' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_metadata_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history metadata.")], + playout_history_metadata: PlayoutHistoryMetadata, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_metadata_update + + + :param id: A unique integer value identifying this playout history metadata. (required) + :type id: int + :param playout_history_metadata: (required) + :type playout_history_metadata: PlayoutHistoryMetadata + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_metadata_update_serialize( + id=id, + playout_history_metadata=playout_history_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_metadata_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_metadata_update_serialize( + self, + id, + playout_history_metadata, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['playout_history_metadata'] is not None: - _body_params = _params['playout_history_metadata'] + if playout_history_metadata is not None: + _body_params = playout_history_metadata + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "PlayoutHistoryMetadata", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-metadata/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/playout-history-metadata/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/playout_history_template_fields_api.py b/python-client/libretime_client/api/playout_history_template_fields_api.py index 107d222d..a16c77d4 100644 --- a/python-client/libretime_client/api/playout_history_template_fields_api.py +++ b/python-client/libretime_client/api/playout_history_template_fields_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_playout_history_template_field import PatchedPlayoutHistoryTemplateField from libretime_client.models.playout_history_template_field import PlayoutHistoryTemplateField -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class PlayoutHistoryTemplateFieldsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def playout_history_template_fields_create(self, playout_history_template_field : PlayoutHistoryTemplateField, **kwargs) -> PlayoutHistoryTemplateField: # noqa: E501 - """playout_history_template_fields_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def playout_history_template_fields_create( + self, + playout_history_template_field: PlayoutHistoryTemplateField, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistoryTemplateField: + """playout_history_template_fields_create - >>> thread = api.playout_history_template_fields_create(playout_history_template_field, async_req=True) - >>> result = thread.get() :param playout_history_template_field: (required) :type playout_history_template_field: PlayoutHistoryTemplateField - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistoryTemplateField - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_template_fields_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_template_fields_create_with_http_info(playout_history_template_field, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_template_fields_create_with_http_info(self, playout_history_template_field : PlayoutHistoryTemplateField, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_template_fields_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_template_fields_create_with_http_info(playout_history_template_field, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_template_fields_create_serialize( + playout_history_template_field=playout_history_template_field, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlayoutHistoryTemplateField", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_template_fields_create_with_http_info( + self, + playout_history_template_field: PlayoutHistoryTemplateField, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistoryTemplateField]: + """playout_history_template_fields_create + :param playout_history_template_field: (required) :type playout_history_template_field: PlayoutHistoryTemplateField - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistoryTemplateField, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_template_fields_create_serialize( + playout_history_template_field=playout_history_template_field, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlayoutHistoryTemplateField", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'playout_history_template_field' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_template_fields_create_without_preload_content( + self, + playout_history_template_field: PlayoutHistoryTemplateField, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_template_fields_create + + + :param playout_history_template_field: (required) + :type playout_history_template_field: PlayoutHistoryTemplateField + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_template_fields_create_serialize( + playout_history_template_field=playout_history_template_field, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_template_fields_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlayoutHistoryTemplateField", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _playout_history_template_fields_create_serialize( + self, + playout_history_template_field, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['playout_history_template_field'] is not None: - _body_params = _params['playout_history_template_field'] + if playout_history_template_field is not None: + _body_params = playout_history_template_field + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "PlayoutHistoryTemplateField", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-template-fields', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/playout-history-template-fields', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def playout_history_template_fields_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template field.")], **kwargs) -> None: # noqa: E501 - """playout_history_template_fields_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_template_fields_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def playout_history_template_fields_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template field.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """playout_history_template_fields_destroy + :param id: A unique integer value identifying this playout history template field. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_template_fields_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_template_fields_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_template_fields_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template field.")], **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_template_fields_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_template_fields_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_template_fields_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_template_fields_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template field.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """playout_history_template_fields_destroy + :param id: A unique integer value identifying this playout history template field. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._playout_history_template_fields_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_template_fields_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template field.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_template_fields_destroy + + + :param id: A unique integer value identifying this playout history template field. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_template_fields_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_template_fields_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_template_fields_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/playout-history-template-fields/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/playout-history-template-fields/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playout_history_template_fields_list(self, **kwargs) -> List[PlayoutHistoryTemplateField]: # noqa: E501 - """playout_history_template_fields_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_template_fields_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def playout_history_template_fields_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[PlayoutHistoryTemplateField]: + """playout_history_template_fields_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[PlayoutHistoryTemplateField] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_template_fields_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_template_fields_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def playout_history_template_fields_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_template_fields_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_template_fields_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._playout_history_template_fields_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlayoutHistoryTemplateField]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_template_fields_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[PlayoutHistoryTemplateField]]: + """playout_history_template_fields_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[PlayoutHistoryTemplateField], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._playout_history_template_fields_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlayoutHistoryTemplateField]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def playout_history_template_fields_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_template_fields_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_template_fields_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_template_fields_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlayoutHistoryTemplateField]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _playout_history_template_fields_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[PlayoutHistoryTemplateField]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-template-fields', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/playout-history-template-fields', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playout_history_template_fields_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template field.")], patched_playout_history_template_field : Optional[PatchedPlayoutHistoryTemplateField] = None, **kwargs) -> PlayoutHistoryTemplateField: # noqa: E501 - """playout_history_template_fields_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_template_fields_partial_update(id, patched_playout_history_template_field, async_req=True) - >>> result = thread.get() + + @validate_call + def playout_history_template_fields_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template field.")], + patched_playout_history_template_field: Optional[PatchedPlayoutHistoryTemplateField] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistoryTemplateField: + """playout_history_template_fields_partial_update + :param id: A unique integer value identifying this playout history template field. (required) :type id: int :param patched_playout_history_template_field: :type patched_playout_history_template_field: PatchedPlayoutHistoryTemplateField - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistoryTemplateField - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_template_fields_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_template_fields_partial_update_with_http_info(id, patched_playout_history_template_field, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_template_fields_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template field.")], patched_playout_history_template_field : Optional[PatchedPlayoutHistoryTemplateField] = None, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_template_fields_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_template_fields_partial_update_with_http_info(id, patched_playout_history_template_field, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_template_fields_partial_update_serialize( + id=id, + patched_playout_history_template_field=patched_playout_history_template_field, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplateField", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_template_fields_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template field.")], + patched_playout_history_template_field: Optional[PatchedPlayoutHistoryTemplateField] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistoryTemplateField]: + """playout_history_template_fields_partial_update + :param id: A unique integer value identifying this playout history template field. (required) :type id: int :param patched_playout_history_template_field: :type patched_playout_history_template_field: PatchedPlayoutHistoryTemplateField - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistoryTemplateField, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_template_fields_partial_update_serialize( + id=id, + patched_playout_history_template_field=patched_playout_history_template_field, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplateField", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_playout_history_template_field' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_template_fields_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template field.")], + patched_playout_history_template_field: Optional[PatchedPlayoutHistoryTemplateField] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_template_fields_partial_update + + + :param id: A unique integer value identifying this playout history template field. (required) + :type id: int + :param patched_playout_history_template_field: + :type patched_playout_history_template_field: PatchedPlayoutHistoryTemplateField + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_template_fields_partial_update_serialize( + id=id, + patched_playout_history_template_field=patched_playout_history_template_field, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_template_fields_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplateField", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_template_fields_partial_update_serialize( + self, + id, + patched_playout_history_template_field, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_playout_history_template_field'] is not None: - _body_params = _params['patched_playout_history_template_field'] + if patched_playout_history_template_field is not None: + _body_params = patched_playout_history_template_field + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "PlayoutHistoryTemplateField", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-template-fields/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/playout-history-template-fields/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def playout_history_template_fields_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template field.")], **kwargs) -> PlayoutHistoryTemplateField: # noqa: E501 - """playout_history_template_fields_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_template_fields_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def playout_history_template_fields_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template field.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistoryTemplateField: + """playout_history_template_fields_retrieve + :param id: A unique integer value identifying this playout history template field. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistoryTemplateField - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_template_fields_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_template_fields_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_template_fields_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template field.")], **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_template_fields_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_template_fields_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_template_fields_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplateField", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_template_fields_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template field.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistoryTemplateField]: + """playout_history_template_fields_retrieve + :param id: A unique integer value identifying this playout history template field. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistoryTemplateField, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_template_fields_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplateField", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def playout_history_template_fields_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template field.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_template_fields_retrieve + + + :param id: A unique integer value identifying this playout history template field. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_template_fields_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_template_fields_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplateField", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_template_fields_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "PlayoutHistoryTemplateField", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-template-fields/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/playout-history-template-fields/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playout_history_template_fields_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template field.")], playout_history_template_field : PlayoutHistoryTemplateField, **kwargs) -> PlayoutHistoryTemplateField: # noqa: E501 - """playout_history_template_fields_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_template_fields_update(id, playout_history_template_field, async_req=True) - >>> result = thread.get() + + @validate_call + def playout_history_template_fields_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template field.")], + playout_history_template_field: PlayoutHistoryTemplateField, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistoryTemplateField: + """playout_history_template_fields_update + :param id: A unique integer value identifying this playout history template field. (required) :type id: int :param playout_history_template_field: (required) :type playout_history_template_field: PlayoutHistoryTemplateField - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistoryTemplateField - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_template_fields_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_template_fields_update_with_http_info(id, playout_history_template_field, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_template_fields_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template field.")], playout_history_template_field : PlayoutHistoryTemplateField, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_template_fields_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_template_fields_update_with_http_info(id, playout_history_template_field, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_template_fields_update_serialize( + id=id, + playout_history_template_field=playout_history_template_field, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplateField", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_template_fields_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template field.")], + playout_history_template_field: PlayoutHistoryTemplateField, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistoryTemplateField]: + """playout_history_template_fields_update + :param id: A unique integer value identifying this playout history template field. (required) :type id: int :param playout_history_template_field: (required) :type playout_history_template_field: PlayoutHistoryTemplateField - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistoryTemplateField, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_template_fields_update_serialize( + id=id, + playout_history_template_field=playout_history_template_field, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplateField", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'playout_history_template_field' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_template_fields_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template field.")], + playout_history_template_field: PlayoutHistoryTemplateField, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_template_fields_update + + + :param id: A unique integer value identifying this playout history template field. (required) + :type id: int + :param playout_history_template_field: (required) + :type playout_history_template_field: PlayoutHistoryTemplateField + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_template_fields_update_serialize( + id=id, + playout_history_template_field=playout_history_template_field, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_template_fields_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplateField", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_template_fields_update_serialize( + self, + id, + playout_history_template_field, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['playout_history_template_field'] is not None: - _body_params = _params['playout_history_template_field'] + if playout_history_template_field is not None: + _body_params = playout_history_template_field + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "PlayoutHistoryTemplateField", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-template-fields/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/playout-history-template-fields/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/playout_history_templates_api.py b/python-client/libretime_client/api/playout_history_templates_api.py index bb1c5754..62900d2a 100644 --- a/python-client/libretime_client/api/playout_history_templates_api.py +++ b/python-client/libretime_client/api/playout_history_templates_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_playout_history_template import PatchedPlayoutHistoryTemplate from libretime_client.models.playout_history_template import PlayoutHistoryTemplate -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class PlayoutHistoryTemplatesApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def playout_history_templates_create(self, playout_history_template : PlayoutHistoryTemplate, **kwargs) -> PlayoutHistoryTemplate: # noqa: E501 - """playout_history_templates_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def playout_history_templates_create( + self, + playout_history_template: PlayoutHistoryTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistoryTemplate: + """playout_history_templates_create - >>> thread = api.playout_history_templates_create(playout_history_template, async_req=True) - >>> result = thread.get() :param playout_history_template: (required) :type playout_history_template: PlayoutHistoryTemplate - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistoryTemplate - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_templates_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_templates_create_with_http_info(playout_history_template, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_templates_create_with_http_info(self, playout_history_template : PlayoutHistoryTemplate, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_templates_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_templates_create_with_http_info(playout_history_template, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_templates_create_serialize( + playout_history_template=playout_history_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlayoutHistoryTemplate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_templates_create_with_http_info( + self, + playout_history_template: PlayoutHistoryTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistoryTemplate]: + """playout_history_templates_create + :param playout_history_template: (required) :type playout_history_template: PlayoutHistoryTemplate - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistoryTemplate, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_templates_create_serialize( + playout_history_template=playout_history_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlayoutHistoryTemplate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'playout_history_template' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_templates_create_without_preload_content( + self, + playout_history_template: PlayoutHistoryTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_templates_create + + + :param playout_history_template: (required) + :type playout_history_template: PlayoutHistoryTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_templates_create_serialize( + playout_history_template=playout_history_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_templates_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "PlayoutHistoryTemplate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _playout_history_templates_create_serialize( + self, + playout_history_template, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['playout_history_template'] is not None: - _body_params = _params['playout_history_template'] + if playout_history_template is not None: + _body_params = playout_history_template + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "PlayoutHistoryTemplate", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-templates', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/playout-history-templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def playout_history_templates_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template.")], **kwargs) -> None: # noqa: E501 - """playout_history_templates_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_templates_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def playout_history_templates_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """playout_history_templates_destroy + :param id: A unique integer value identifying this playout history template. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_templates_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_templates_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_templates_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template.")], **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_templates_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_templates_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_templates_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_templates_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """playout_history_templates_destroy + :param id: A unique integer value identifying this playout history template. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._playout_history_templates_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_templates_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_templates_destroy + + + :param id: A unique integer value identifying this playout history template. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_templates_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_templates_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_templates_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/playout-history-templates/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/playout-history-templates/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playout_history_templates_list(self, **kwargs) -> List[PlayoutHistoryTemplate]: # noqa: E501 - """playout_history_templates_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_templates_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def playout_history_templates_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[PlayoutHistoryTemplate]: + """playout_history_templates_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[PlayoutHistoryTemplate] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_templates_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_templates_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def playout_history_templates_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_templates_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_templates_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._playout_history_templates_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlayoutHistoryTemplate]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_templates_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[PlayoutHistoryTemplate]]: + """playout_history_templates_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[PlayoutHistoryTemplate], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._playout_history_templates_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlayoutHistoryTemplate]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def playout_history_templates_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_templates_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_templates_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_templates_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PlayoutHistoryTemplate]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _playout_history_templates_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[PlayoutHistoryTemplate]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-templates', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/playout-history-templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playout_history_templates_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template.")], patched_playout_history_template : Optional[PatchedPlayoutHistoryTemplate] = None, **kwargs) -> PlayoutHistoryTemplate: # noqa: E501 - """playout_history_templates_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_templates_partial_update(id, patched_playout_history_template, async_req=True) - >>> result = thread.get() + + @validate_call + def playout_history_templates_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template.")], + patched_playout_history_template: Optional[PatchedPlayoutHistoryTemplate] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistoryTemplate: + """playout_history_templates_partial_update + :param id: A unique integer value identifying this playout history template. (required) :type id: int :param patched_playout_history_template: :type patched_playout_history_template: PatchedPlayoutHistoryTemplate - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistoryTemplate - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_templates_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_templates_partial_update_with_http_info(id, patched_playout_history_template, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_templates_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template.")], patched_playout_history_template : Optional[PatchedPlayoutHistoryTemplate] = None, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_templates_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_templates_partial_update_with_http_info(id, patched_playout_history_template, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_templates_partial_update_serialize( + id=id, + patched_playout_history_template=patched_playout_history_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_templates_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template.")], + patched_playout_history_template: Optional[PatchedPlayoutHistoryTemplate] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistoryTemplate]: + """playout_history_templates_partial_update + :param id: A unique integer value identifying this playout history template. (required) :type id: int :param patched_playout_history_template: :type patched_playout_history_template: PatchedPlayoutHistoryTemplate - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistoryTemplate, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_templates_partial_update_serialize( + id=id, + patched_playout_history_template=patched_playout_history_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_playout_history_template' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_templates_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template.")], + patched_playout_history_template: Optional[PatchedPlayoutHistoryTemplate] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_templates_partial_update + + + :param id: A unique integer value identifying this playout history template. (required) + :type id: int + :param patched_playout_history_template: + :type patched_playout_history_template: PatchedPlayoutHistoryTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_templates_partial_update_serialize( + id=id, + patched_playout_history_template=patched_playout_history_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_templates_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_templates_partial_update_serialize( + self, + id, + patched_playout_history_template, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_playout_history_template'] is not None: - _body_params = _params['patched_playout_history_template'] + if patched_playout_history_template is not None: + _body_params = patched_playout_history_template + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "PlayoutHistoryTemplate", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-templates/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/playout-history-templates/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def playout_history_templates_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template.")], **kwargs) -> PlayoutHistoryTemplate: # noqa: E501 - """playout_history_templates_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_templates_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def playout_history_templates_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistoryTemplate: + """playout_history_templates_retrieve + :param id: A unique integer value identifying this playout history template. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistoryTemplate - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_templates_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_templates_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_templates_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template.")], **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_templates_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_templates_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_templates_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_templates_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistoryTemplate]: + """playout_history_templates_retrieve + :param id: A unique integer value identifying this playout history template. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistoryTemplate, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_templates_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def playout_history_templates_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_templates_retrieve + + + :param id: A unique integer value identifying this playout history template. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_templates_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_templates_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_templates_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "PlayoutHistoryTemplate", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-templates/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/playout-history-templates/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def playout_history_templates_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template.")], playout_history_template : PlayoutHistoryTemplate, **kwargs) -> PlayoutHistoryTemplate: # noqa: E501 - """playout_history_templates_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.playout_history_templates_update(id, playout_history_template, async_req=True) - >>> result = thread.get() + + @validate_call + def playout_history_templates_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template.")], + playout_history_template: PlayoutHistoryTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlayoutHistoryTemplate: + """playout_history_templates_update + :param id: A unique integer value identifying this playout history template. (required) :type id: int :param playout_history_template: (required) :type playout_history_template: PlayoutHistoryTemplate - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlayoutHistoryTemplate - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the playout_history_templates_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.playout_history_templates_update_with_http_info(id, playout_history_template, **kwargs) # noqa: E501 - - @validate_arguments - def playout_history_templates_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this playout history template.")], playout_history_template : PlayoutHistoryTemplate, **kwargs) -> ApiResponse: # noqa: E501 - """playout_history_templates_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.playout_history_templates_update_with_http_info(id, playout_history_template, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._playout_history_templates_update_serialize( + id=id, + playout_history_template=playout_history_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playout_history_templates_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template.")], + playout_history_template: PlayoutHistoryTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlayoutHistoryTemplate]: + """playout_history_templates_update + :param id: A unique integer value identifying this playout history template. (required) :type id: int :param playout_history_template: (required) :type playout_history_template: PlayoutHistoryTemplate - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlayoutHistoryTemplate, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._playout_history_templates_update_serialize( + id=id, + playout_history_template=playout_history_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'playout_history_template' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def playout_history_templates_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this playout history template.")], + playout_history_template: PlayoutHistoryTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """playout_history_templates_update + + + :param id: A unique integer value identifying this playout history template. (required) + :type id: int + :param playout_history_template: (required) + :type playout_history_template: PlayoutHistoryTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playout_history_templates_update_serialize( + id=id, + playout_history_template=playout_history_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method playout_history_templates_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlayoutHistoryTemplate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _playout_history_templates_update_serialize( + self, + id, + playout_history_template, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['playout_history_template'] is not None: - _body_params = _params['playout_history_template'] + if playout_history_template is not None: + _body_params = playout_history_template + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "PlayoutHistoryTemplate", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/playout-history-templates/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/playout-history-templates/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/podcast_episodes_api.py b/python-client/libretime_client/api/podcast_episodes_api.py index 98cd38f7..1e79d662 100644 --- a/python-client/libretime_client/api/podcast_episodes_api.py +++ b/python-client/libretime_client/api/podcast_episodes_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_podcast_episode import PatchedPodcastEpisode from libretime_client.models.podcast_episode import PodcastEpisode -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class PodcastEpisodesApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def podcast_episodes_create(self, podcast_episode : PodcastEpisode, **kwargs) -> PodcastEpisode: # noqa: E501 - """podcast_episodes_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def podcast_episodes_create( + self, + podcast_episode: PodcastEpisode, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PodcastEpisode: + """podcast_episodes_create - >>> thread = api.podcast_episodes_create(podcast_episode, async_req=True) - >>> result = thread.get() :param podcast_episode: (required) :type podcast_episode: PodcastEpisode - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PodcastEpisode - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the podcast_episodes_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.podcast_episodes_create_with_http_info(podcast_episode, **kwargs) # noqa: E501 - - @validate_arguments - def podcast_episodes_create_with_http_info(self, podcast_episode : PodcastEpisode, **kwargs) -> ApiResponse: # noqa: E501 - """podcast_episodes_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.podcast_episodes_create_with_http_info(podcast_episode, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._podcast_episodes_create_serialize( + podcast_episode=podcast_episode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PodcastEpisode", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def podcast_episodes_create_with_http_info( + self, + podcast_episode: PodcastEpisode, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PodcastEpisode]: + """podcast_episodes_create + :param podcast_episode: (required) :type podcast_episode: PodcastEpisode - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PodcastEpisode, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._podcast_episodes_create_serialize( + podcast_episode=podcast_episode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "PodcastEpisode", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'podcast_episode' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def podcast_episodes_create_without_preload_content( + self, + podcast_episode: PodcastEpisode, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """podcast_episodes_create + + + :param podcast_episode: (required) + :type podcast_episode: PodcastEpisode + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._podcast_episodes_create_serialize( + podcast_episode=podcast_episode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method podcast_episodes_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "PodcastEpisode", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _podcast_episodes_create_serialize( + self, + podcast_episode, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['podcast_episode'] is not None: - _body_params = _params['podcast_episode'] + if podcast_episode is not None: + _body_params = podcast_episode + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "PodcastEpisode", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/podcast-episodes', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/podcast-episodes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def podcast_episodes_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast episode.")], **kwargs) -> None: # noqa: E501 - """podcast_episodes_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.podcast_episodes_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def podcast_episodes_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast episode.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """podcast_episodes_destroy + :param id: A unique integer value identifying this podcast episode. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the podcast_episodes_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.podcast_episodes_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def podcast_episodes_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast episode.")], **kwargs) -> ApiResponse: # noqa: E501 - """podcast_episodes_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.podcast_episodes_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._podcast_episodes_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def podcast_episodes_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast episode.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """podcast_episodes_destroy + :param id: A unique integer value identifying this podcast episode. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._podcast_episodes_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def podcast_episodes_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast episode.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """podcast_episodes_destroy + + + :param id: A unique integer value identifying this podcast episode. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._podcast_episodes_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method podcast_episodes_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _podcast_episodes_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/podcast-episodes/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/podcast-episodes/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def podcast_episodes_list(self, **kwargs) -> List[PodcastEpisode]: # noqa: E501 - """podcast_episodes_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.podcast_episodes_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def podcast_episodes_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[PodcastEpisode]: + """podcast_episodes_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[PodcastEpisode] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the podcast_episodes_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.podcast_episodes_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def podcast_episodes_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """podcast_episodes_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.podcast_episodes_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._podcast_episodes_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PodcastEpisode]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def podcast_episodes_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[PodcastEpisode]]: + """podcast_episodes_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[PodcastEpisode], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._podcast_episodes_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PodcastEpisode]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def podcast_episodes_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """podcast_episodes_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._podcast_episodes_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method podcast_episodes_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PodcastEpisode]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _podcast_episodes_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[PodcastEpisode]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/podcast-episodes', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/podcast-episodes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def podcast_episodes_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast episode.")], patched_podcast_episode : Optional[PatchedPodcastEpisode] = None, **kwargs) -> PodcastEpisode: # noqa: E501 - """podcast_episodes_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.podcast_episodes_partial_update(id, patched_podcast_episode, async_req=True) - >>> result = thread.get() + + @validate_call + def podcast_episodes_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast episode.")], + patched_podcast_episode: Optional[PatchedPodcastEpisode] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PodcastEpisode: + """podcast_episodes_partial_update + :param id: A unique integer value identifying this podcast episode. (required) :type id: int :param patched_podcast_episode: :type patched_podcast_episode: PatchedPodcastEpisode - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PodcastEpisode - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the podcast_episodes_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.podcast_episodes_partial_update_with_http_info(id, patched_podcast_episode, **kwargs) # noqa: E501 - - @validate_arguments - def podcast_episodes_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast episode.")], patched_podcast_episode : Optional[PatchedPodcastEpisode] = None, **kwargs) -> ApiResponse: # noqa: E501 - """podcast_episodes_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.podcast_episodes_partial_update_with_http_info(id, patched_podcast_episode, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._podcast_episodes_partial_update_serialize( + id=id, + patched_podcast_episode=patched_podcast_episode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PodcastEpisode", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def podcast_episodes_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast episode.")], + patched_podcast_episode: Optional[PatchedPodcastEpisode] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PodcastEpisode]: + """podcast_episodes_partial_update + :param id: A unique integer value identifying this podcast episode. (required) :type id: int :param patched_podcast_episode: :type patched_podcast_episode: PatchedPodcastEpisode - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PodcastEpisode, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._podcast_episodes_partial_update_serialize( + id=id, + patched_podcast_episode=patched_podcast_episode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PodcastEpisode", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_podcast_episode' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def podcast_episodes_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast episode.")], + patched_podcast_episode: Optional[PatchedPodcastEpisode] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """podcast_episodes_partial_update + + + :param id: A unique integer value identifying this podcast episode. (required) + :type id: int + :param patched_podcast_episode: + :type patched_podcast_episode: PatchedPodcastEpisode + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._podcast_episodes_partial_update_serialize( + id=id, + patched_podcast_episode=patched_podcast_episode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method podcast_episodes_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PodcastEpisode", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _podcast_episodes_partial_update_serialize( + self, + id, + patched_podcast_episode, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_podcast_episode'] is not None: - _body_params = _params['patched_podcast_episode'] + if patched_podcast_episode is not None: + _body_params = patched_podcast_episode + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "PodcastEpisode", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/podcast-episodes/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/podcast-episodes/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def podcast_episodes_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast episode.")], **kwargs) -> PodcastEpisode: # noqa: E501 - """podcast_episodes_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.podcast_episodes_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def podcast_episodes_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast episode.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PodcastEpisode: + """podcast_episodes_retrieve + :param id: A unique integer value identifying this podcast episode. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PodcastEpisode - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the podcast_episodes_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.podcast_episodes_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def podcast_episodes_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast episode.")], **kwargs) -> ApiResponse: # noqa: E501 - """podcast_episodes_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.podcast_episodes_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._podcast_episodes_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PodcastEpisode", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def podcast_episodes_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast episode.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PodcastEpisode]: + """podcast_episodes_retrieve + :param id: A unique integer value identifying this podcast episode. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PodcastEpisode, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._podcast_episodes_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PodcastEpisode", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def podcast_episodes_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast episode.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """podcast_episodes_retrieve + + + :param id: A unique integer value identifying this podcast episode. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._podcast_episodes_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method podcast_episodes_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PodcastEpisode", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _podcast_episodes_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "PodcastEpisode", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/podcast-episodes/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/podcast-episodes/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def podcast_episodes_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast episode.")], podcast_episode : PodcastEpisode, **kwargs) -> PodcastEpisode: # noqa: E501 - """podcast_episodes_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.podcast_episodes_update(id, podcast_episode, async_req=True) - >>> result = thread.get() + + @validate_call + def podcast_episodes_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast episode.")], + podcast_episode: PodcastEpisode, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PodcastEpisode: + """podcast_episodes_update + :param id: A unique integer value identifying this podcast episode. (required) :type id: int :param podcast_episode: (required) :type podcast_episode: PodcastEpisode - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PodcastEpisode - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the podcast_episodes_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.podcast_episodes_update_with_http_info(id, podcast_episode, **kwargs) # noqa: E501 - - @validate_arguments - def podcast_episodes_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast episode.")], podcast_episode : PodcastEpisode, **kwargs) -> ApiResponse: # noqa: E501 - """podcast_episodes_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.podcast_episodes_update_with_http_info(id, podcast_episode, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._podcast_episodes_update_serialize( + id=id, + podcast_episode=podcast_episode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PodcastEpisode", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def podcast_episodes_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast episode.")], + podcast_episode: PodcastEpisode, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PodcastEpisode]: + """podcast_episodes_update + :param id: A unique integer value identifying this podcast episode. (required) :type id: int :param podcast_episode: (required) :type podcast_episode: PodcastEpisode - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PodcastEpisode, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._podcast_episodes_update_serialize( + id=id, + podcast_episode=podcast_episode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PodcastEpisode", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'podcast_episode' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def podcast_episodes_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast episode.")], + podcast_episode: PodcastEpisode, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """podcast_episodes_update + + + :param id: A unique integer value identifying this podcast episode. (required) + :type id: int + :param podcast_episode: (required) + :type podcast_episode: PodcastEpisode + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._podcast_episodes_update_serialize( + id=id, + podcast_episode=podcast_episode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method podcast_episodes_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PodcastEpisode", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _podcast_episodes_update_serialize( + self, + id, + podcast_episode, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['podcast_episode'] is not None: - _body_params = _params['podcast_episode'] + if podcast_episode is not None: + _body_params = podcast_episode + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "PodcastEpisode", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/podcast-episodes/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/podcast-episodes/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/podcasts_api.py b/python-client/libretime_client/api/podcasts_api.py index 24c4f752..6c3b6a5b 100644 --- a/python-client/libretime_client/api/podcasts_api.py +++ b/python-client/libretime_client/api/podcasts_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_podcast import PatchedPodcast from libretime_client.models.podcast import Podcast -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class PodcastsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def podcasts_create(self, podcast : Podcast, **kwargs) -> Podcast: # noqa: E501 - """podcasts_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def podcasts_create( + self, + podcast: Podcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Podcast: + """podcasts_create - >>> thread = api.podcasts_create(podcast, async_req=True) - >>> result = thread.get() :param podcast: (required) :type podcast: Podcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Podcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the podcasts_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.podcasts_create_with_http_info(podcast, **kwargs) # noqa: E501 - - @validate_arguments - def podcasts_create_with_http_info(self, podcast : Podcast, **kwargs) -> ApiResponse: # noqa: E501 - """podcasts_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.podcasts_create_with_http_info(podcast, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._podcasts_create_serialize( + podcast=podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Podcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def podcasts_create_with_http_info( + self, + podcast: Podcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Podcast]: + """podcasts_create + :param podcast: (required) :type podcast: Podcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Podcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._podcasts_create_serialize( + podcast=podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "Podcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'podcast' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def podcasts_create_without_preload_content( + self, + podcast: Podcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """podcasts_create + + + :param podcast: (required) + :type podcast: Podcast + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._podcasts_create_serialize( + podcast=podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method podcasts_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Podcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _podcasts_create_serialize( + self, + podcast, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['podcast'] is not None: - _body_params = _params['podcast'] + if podcast is not None: + _body_params = podcast + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "Podcast", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/podcasts', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/podcasts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def podcasts_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast.")], **kwargs) -> None: # noqa: E501 - """podcasts_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.podcasts_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def podcasts_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """podcasts_destroy + :param id: A unique integer value identifying this podcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the podcasts_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.podcasts_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def podcasts_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast.")], **kwargs) -> ApiResponse: # noqa: E501 - """podcasts_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.podcasts_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._podcasts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def podcasts_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """podcasts_destroy + :param id: A unique integer value identifying this podcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._podcasts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def podcasts_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """podcasts_destroy + + + :param id: A unique integer value identifying this podcast. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._podcasts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method podcasts_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _podcasts_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/podcasts/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/podcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def podcasts_list(self, **kwargs) -> List[Podcast]: # noqa: E501 - """podcasts_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.podcasts_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def podcasts_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Podcast]: + """podcasts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[Podcast] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the podcasts_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.podcasts_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def podcasts_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """podcasts_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.podcasts_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._podcasts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Podcast]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def podcasts_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Podcast]]: + """podcasts_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[Podcast], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._podcasts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Podcast]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def podcasts_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """podcasts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._podcasts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method podcasts_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Podcast]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _podcasts_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[Podcast]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/podcasts', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/podcasts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def podcasts_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast.")], patched_podcast : Optional[PatchedPodcast] = None, **kwargs) -> Podcast: # noqa: E501 - """podcasts_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.podcasts_partial_update(id, patched_podcast, async_req=True) - >>> result = thread.get() + + @validate_call + def podcasts_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast.")], + patched_podcast: Optional[PatchedPodcast] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Podcast: + """podcasts_partial_update + :param id: A unique integer value identifying this podcast. (required) :type id: int :param patched_podcast: :type patched_podcast: PatchedPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Podcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the podcasts_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.podcasts_partial_update_with_http_info(id, patched_podcast, **kwargs) # noqa: E501 - - @validate_arguments - def podcasts_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast.")], patched_podcast : Optional[PatchedPodcast] = None, **kwargs) -> ApiResponse: # noqa: E501 - """podcasts_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.podcasts_partial_update_with_http_info(id, patched_podcast, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._podcasts_partial_update_serialize( + id=id, + patched_podcast=patched_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Podcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def podcasts_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast.")], + patched_podcast: Optional[PatchedPodcast] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Podcast]: + """podcasts_partial_update + :param id: A unique integer value identifying this podcast. (required) :type id: int :param patched_podcast: :type patched_podcast: PatchedPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Podcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._podcasts_partial_update_serialize( + id=id, + patched_podcast=patched_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Podcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_podcast' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def podcasts_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast.")], + patched_podcast: Optional[PatchedPodcast] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """podcasts_partial_update + + + :param id: A unique integer value identifying this podcast. (required) + :type id: int + :param patched_podcast: + :type patched_podcast: PatchedPodcast + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._podcasts_partial_update_serialize( + id=id, + patched_podcast=patched_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method podcasts_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Podcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _podcasts_partial_update_serialize( + self, + id, + patched_podcast, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_podcast'] is not None: - _body_params = _params['patched_podcast'] + if patched_podcast is not None: + _body_params = patched_podcast + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Podcast", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/podcasts/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/podcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def podcasts_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast.")], **kwargs) -> Podcast: # noqa: E501 - """podcasts_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.podcasts_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def podcasts_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Podcast: + """podcasts_retrieve + :param id: A unique integer value identifying this podcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Podcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the podcasts_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.podcasts_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def podcasts_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast.")], **kwargs) -> ApiResponse: # noqa: E501 - """podcasts_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.podcasts_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._podcasts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Podcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def podcasts_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Podcast]: + """podcasts_retrieve + :param id: A unique integer value identifying this podcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Podcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._podcasts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Podcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def podcasts_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """podcasts_retrieve + + + :param id: A unique integer value identifying this podcast. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._podcasts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method podcasts_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Podcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _podcasts_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "Podcast", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/podcasts/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/podcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def podcasts_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast.")], podcast : Podcast, **kwargs) -> Podcast: # noqa: E501 - """podcasts_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.podcasts_update(id, podcast, async_req=True) - >>> result = thread.get() + + @validate_call + def podcasts_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast.")], + podcast: Podcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Podcast: + """podcasts_update + :param id: A unique integer value identifying this podcast. (required) :type id: int :param podcast: (required) :type podcast: Podcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Podcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the podcasts_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.podcasts_update_with_http_info(id, podcast, **kwargs) # noqa: E501 - - @validate_arguments - def podcasts_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this podcast.")], podcast : Podcast, **kwargs) -> ApiResponse: # noqa: E501 - """podcasts_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.podcasts_update_with_http_info(id, podcast, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._podcasts_update_serialize( + id=id, + podcast=podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Podcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def podcasts_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast.")], + podcast: Podcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Podcast]: + """podcasts_update + :param id: A unique integer value identifying this podcast. (required) :type id: int :param podcast: (required) :type podcast: Podcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Podcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._podcasts_update_serialize( + id=id, + podcast=podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Podcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'podcast' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def podcasts_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this podcast.")], + podcast: Podcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """podcasts_update + + + :param id: A unique integer value identifying this podcast. (required) + :type id: int + :param podcast: (required) + :type podcast: Podcast + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._podcasts_update_serialize( + id=id, + podcast=podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method podcasts_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Podcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _podcasts_update_serialize( + self, + id, + podcast, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['podcast'] is not None: - _body_params = _params['podcast'] + if podcast is not None: + _body_params = podcast + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Podcast", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/podcasts/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/podcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/preferences_api.py b/python-client/libretime_client/api/preferences_api.py index 1569d60f..7d3f817c 100644 --- a/python-client/libretime_client/api/preferences_api.py +++ b/python-client/libretime_client/api/preferences_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_preference import PatchedPreference from libretime_client.models.preference import Preference -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class PreferencesApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def preferences_create(self, preference : Preference, **kwargs) -> Preference: # noqa: E501 - """preferences_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def preferences_create( + self, + preference: Preference, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Preference: + """preferences_create - >>> thread = api.preferences_create(preference, async_req=True) - >>> result = thread.get() :param preference: (required) :type preference: Preference - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Preference - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the preferences_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.preferences_create_with_http_info(preference, **kwargs) # noqa: E501 - - @validate_arguments - def preferences_create_with_http_info(self, preference : Preference, **kwargs) -> ApiResponse: # noqa: E501 - """preferences_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.preferences_create_with_http_info(preference, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._preferences_create_serialize( + preference=preference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Preference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def preferences_create_with_http_info( + self, + preference: Preference, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Preference]: + """preferences_create + :param preference: (required) :type preference: Preference - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Preference, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._preferences_create_serialize( + preference=preference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "Preference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'preference' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def preferences_create_without_preload_content( + self, + preference: Preference, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """preferences_create + + + :param preference: (required) + :type preference: Preference + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._preferences_create_serialize( + preference=preference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method preferences_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Preference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _preferences_create_serialize( + self, + preference, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['preference'] is not None: - _body_params = _params['preference'] + if preference is not None: + _body_params = preference + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "Preference", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/preferences', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/preferences', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def preferences_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this preference.")], **kwargs) -> None: # noqa: E501 - """preferences_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.preferences_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def preferences_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this preference.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """preferences_destroy + :param id: A unique integer value identifying this preference. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the preferences_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.preferences_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def preferences_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this preference.")], **kwargs) -> ApiResponse: # noqa: E501 - """preferences_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.preferences_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._preferences_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def preferences_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this preference.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """preferences_destroy + :param id: A unique integer value identifying this preference. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._preferences_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def preferences_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this preference.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """preferences_destroy + + + :param id: A unique integer value identifying this preference. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._preferences_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method preferences_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _preferences_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/preferences/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/preferences/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def preferences_list(self, **kwargs) -> List[Preference]: # noqa: E501 - """preferences_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.preferences_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def preferences_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Preference]: + """preferences_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[Preference] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the preferences_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.preferences_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def preferences_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """preferences_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.preferences_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._preferences_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Preference]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def preferences_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Preference]]: + """preferences_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[Preference], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._preferences_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Preference]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def preferences_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """preferences_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._preferences_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method preferences_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Preference]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _preferences_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[Preference]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/preferences', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/preferences', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def preferences_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this preference.")], patched_preference : Optional[PatchedPreference] = None, **kwargs) -> Preference: # noqa: E501 - """preferences_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.preferences_partial_update(id, patched_preference, async_req=True) - >>> result = thread.get() + + @validate_call + def preferences_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this preference.")], + patched_preference: Optional[PatchedPreference] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Preference: + """preferences_partial_update + :param id: A unique integer value identifying this preference. (required) :type id: int :param patched_preference: :type patched_preference: PatchedPreference - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Preference - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the preferences_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.preferences_partial_update_with_http_info(id, patched_preference, **kwargs) # noqa: E501 - - @validate_arguments - def preferences_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this preference.")], patched_preference : Optional[PatchedPreference] = None, **kwargs) -> ApiResponse: # noqa: E501 - """preferences_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.preferences_partial_update_with_http_info(id, patched_preference, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._preferences_partial_update_serialize( + id=id, + patched_preference=patched_preference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Preference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def preferences_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this preference.")], + patched_preference: Optional[PatchedPreference] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Preference]: + """preferences_partial_update + :param id: A unique integer value identifying this preference. (required) :type id: int :param patched_preference: :type patched_preference: PatchedPreference - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Preference, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._preferences_partial_update_serialize( + id=id, + patched_preference=patched_preference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Preference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_preference' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def preferences_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this preference.")], + patched_preference: Optional[PatchedPreference] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """preferences_partial_update + + + :param id: A unique integer value identifying this preference. (required) + :type id: int + :param patched_preference: + :type patched_preference: PatchedPreference + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._preferences_partial_update_serialize( + id=id, + patched_preference=patched_preference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method preferences_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Preference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _preferences_partial_update_serialize( + self, + id, + patched_preference, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_preference'] is not None: - _body_params = _params['patched_preference'] + if patched_preference is not None: + _body_params = patched_preference + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Preference", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/preferences/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/preferences/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def preferences_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this preference.")], **kwargs) -> Preference: # noqa: E501 - """preferences_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.preferences_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def preferences_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this preference.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Preference: + """preferences_retrieve + :param id: A unique integer value identifying this preference. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Preference - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the preferences_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.preferences_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def preferences_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this preference.")], **kwargs) -> ApiResponse: # noqa: E501 - """preferences_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.preferences_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._preferences_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Preference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def preferences_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this preference.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Preference]: + """preferences_retrieve + :param id: A unique integer value identifying this preference. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Preference, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._preferences_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Preference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def preferences_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this preference.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """preferences_retrieve + + + :param id: A unique integer value identifying this preference. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._preferences_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method preferences_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Preference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _preferences_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "Preference", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/preferences/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/preferences/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def preferences_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this preference.")], preference : Preference, **kwargs) -> Preference: # noqa: E501 - """preferences_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.preferences_update(id, preference, async_req=True) - >>> result = thread.get() + + @validate_call + def preferences_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this preference.")], + preference: Preference, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Preference: + """preferences_update + :param id: A unique integer value identifying this preference. (required) :type id: int :param preference: (required) :type preference: Preference - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Preference - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the preferences_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.preferences_update_with_http_info(id, preference, **kwargs) # noqa: E501 - - @validate_arguments - def preferences_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this preference.")], preference : Preference, **kwargs) -> ApiResponse: # noqa: E501 - """preferences_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.preferences_update_with_http_info(id, preference, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._preferences_update_serialize( + id=id, + preference=preference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Preference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def preferences_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this preference.")], + preference: Preference, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Preference]: + """preferences_update + :param id: A unique integer value identifying this preference. (required) :type id: int :param preference: (required) :type preference: Preference - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Preference, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._preferences_update_serialize( + id=id, + preference=preference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Preference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'preference' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def preferences_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this preference.")], + preference: Preference, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """preferences_update + + + :param id: A unique integer value identifying this preference. (required) + :type id: int + :param preference: (required) + :type preference: Preference + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._preferences_update_serialize( + id=id, + preference=preference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method preferences_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Preference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _preferences_update_serialize( + self, + id, + preference, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['preference'] is not None: - _body_params = _params['preference'] + if preference is not None: + _body_params = preference + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Preference", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/preferences/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/preferences/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/schedule_api.py b/python-client/libretime_client/api/schedule_api.py index 812e0809..86d4b578 100644 --- a/python-client/libretime_client/api/schedule_api.py +++ b/python-client/libretime_client/api/schedule_api.py @@ -11,29 +11,21 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from datetime import datetime +from datetime import datetime from pydantic import Field, StrictBool, StrictInt - -from typing import List, Optional - +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_schedule import PatchedSchedule from libretime_client.models.schedule import Schedule -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class ScheduleApi: @@ -48,292 +40,553 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def schedule_create(self, schedule : Schedule, **kwargs) -> Schedule: # noqa: E501 - """schedule_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def schedule_create( + self, + schedule: Schedule, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Schedule: + """schedule_create - >>> thread = api.schedule_create(schedule, async_req=True) - >>> result = thread.get() :param schedule: (required) :type schedule: Schedule - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Schedule - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the schedule_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.schedule_create_with_http_info(schedule, **kwargs) # noqa: E501 - - @validate_arguments - def schedule_create_with_http_info(self, schedule : Schedule, **kwargs) -> ApiResponse: # noqa: E501 - """schedule_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.schedule_create_with_http_info(schedule, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._schedule_create_serialize( + schedule=schedule, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Schedule", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def schedule_create_with_http_info( + self, + schedule: Schedule, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Schedule]: + """schedule_create + :param schedule: (required) :type schedule: Schedule - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Schedule, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._schedule_create_serialize( + schedule=schedule, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "Schedule", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'schedule' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def schedule_create_without_preload_content( + self, + schedule: Schedule, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """schedule_create + + + :param schedule: (required) + :type schedule: Schedule + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._schedule_create_serialize( + schedule=schedule, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method schedule_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Schedule", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _schedule_create_serialize( + self, + schedule, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['schedule'] is not None: - _body_params = _params['schedule'] + if schedule is not None: + _body_params = schedule + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "Schedule", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/schedule', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/schedule', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def schedule_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this schedule.")], **kwargs) -> None: # noqa: E501 - """schedule_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.schedule_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def schedule_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this schedule.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """schedule_destroy + :param id: A unique integer value identifying this schedule. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the schedule_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.schedule_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def schedule_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this schedule.")], **kwargs) -> ApiResponse: # noqa: E501 - """schedule_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.schedule_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._schedule_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def schedule_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this schedule.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """schedule_destroy + :param id: A unique integer value identifying this schedule. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._schedule_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def schedule_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this schedule.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """schedule_destroy + + + :param id: A unique integer value identifying this schedule. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._schedule_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method schedule_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _schedule_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/schedule/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/schedule/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def schedule_list(self, broadcasted : Optional[StrictInt] = None, ends_after : Optional[datetime] = None, ends_before : Optional[datetime] = None, overbooked : Optional[StrictBool] = None, position_status : Optional[StrictInt] = None, starts_after : Optional[datetime] = None, starts_before : Optional[datetime] = None, **kwargs) -> List[Schedule]: # noqa: E501 - """schedule_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.schedule_list(broadcasted, ends_after, ends_before, overbooked, position_status, starts_after, starts_before, async_req=True) - >>> result = thread.get() + + @validate_call + def schedule_list( + self, + broadcasted: Optional[StrictInt] = None, + ends_after: Optional[datetime] = None, + ends_before: Optional[datetime] = None, + overbooked: Optional[StrictBool] = None, + position_status: Optional[StrictInt] = None, + starts_after: Optional[datetime] = None, + starts_before: Optional[datetime] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Schedule]: + """schedule_list + :param broadcasted: :type broadcasted: int @@ -349,32 +602,81 @@ def schedule_list(self, broadcasted : Optional[StrictInt] = None, ends_after : O :type starts_after: datetime :param starts_before: :type starts_before: datetime - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[Schedule] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the schedule_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.schedule_list_with_http_info(broadcasted, ends_after, ends_before, overbooked, position_status, starts_after, starts_before, **kwargs) # noqa: E501 - - @validate_arguments - def schedule_list_with_http_info(self, broadcasted : Optional[StrictInt] = None, ends_after : Optional[datetime] = None, ends_before : Optional[datetime] = None, overbooked : Optional[StrictBool] = None, position_status : Optional[StrictInt] = None, starts_after : Optional[datetime] = None, starts_before : Optional[datetime] = None, **kwargs) -> ApiResponse: # noqa: E501 - """schedule_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.schedule_list_with_http_info(broadcasted, ends_after, ends_before, overbooked, position_status, starts_after, starts_before, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._schedule_list_serialize( + broadcasted=broadcasted, + ends_after=ends_after, + ends_before=ends_before, + overbooked=overbooked, + position_status=position_status, + starts_after=starts_after, + starts_before=starts_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Schedule]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def schedule_list_with_http_info( + self, + broadcasted: Optional[StrictInt] = None, + ends_after: Optional[datetime] = None, + ends_before: Optional[datetime] = None, + overbooked: Optional[StrictBool] = None, + position_status: Optional[StrictInt] = None, + starts_after: Optional[datetime] = None, + starts_before: Optional[datetime] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Schedule]]: + """schedule_list + :param broadcasted: :type broadcasted: int @@ -390,579 +692,1095 @@ def schedule_list_with_http_info(self, broadcasted : Optional[StrictInt] = None, :type starts_after: datetime :param starts_before: :type starts_before: datetime - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[Schedule], status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'broadcasted', - 'ends_after', - 'ends_before', - 'overbooked', - 'position_status', - 'starts_after', - 'starts_before' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._schedule_list_serialize( + broadcasted=broadcasted, + ends_after=ends_after, + ends_before=ends_before, + overbooked=overbooked, + position_status=position_status, + starts_after=starts_after, + starts_before=starts_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method schedule_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Schedule]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the path parameters - _path_params = {} - # process the query parameters - _query_params = [] - if _params.get('broadcasted') is not None: # noqa: E501 - _query_params.append(('broadcasted', _params['broadcasted'])) + @validate_call + def schedule_list_without_preload_content( + self, + broadcasted: Optional[StrictInt] = None, + ends_after: Optional[datetime] = None, + ends_before: Optional[datetime] = None, + overbooked: Optional[StrictBool] = None, + position_status: Optional[StrictInt] = None, + starts_after: Optional[datetime] = None, + starts_before: Optional[datetime] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """schedule_list - if _params.get('ends_after') is not None: # noqa: E501 - if isinstance(_params['ends_after'], datetime): - _query_params.append(('ends_after', _params['ends_after'].strftime(self.api_client.configuration.datetime_format))) - else: - _query_params.append(('ends_after', _params['ends_after'])) - if _params.get('ends_before') is not None: # noqa: E501 - if isinstance(_params['ends_before'], datetime): - _query_params.append(('ends_before', _params['ends_before'].strftime(self.api_client.configuration.datetime_format))) - else: - _query_params.append(('ends_before', _params['ends_before'])) + :param broadcasted: + :type broadcasted: int + :param ends_after: + :type ends_after: datetime + :param ends_before: + :type ends_before: datetime + :param overbooked: + :type overbooked: bool + :param position_status: + :type position_status: int + :param starts_after: + :type starts_after: datetime + :param starts_before: + :type starts_before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._schedule_list_serialize( + broadcasted=broadcasted, + ends_after=ends_after, + ends_before=ends_before, + overbooked=overbooked, + position_status=position_status, + starts_after=starts_after, + starts_before=starts_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('overbooked') is not None: # noqa: E501 - _query_params.append(('overbooked', _params['overbooked'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Schedule]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _schedule_list_serialize( + self, + broadcasted, + ends_after, + ends_before, + overbooked, + position_status, + starts_after, + starts_before, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('position_status') is not None: # noqa: E501 - _query_params.append(('position_status', _params['position_status'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None - if _params.get('starts_after') is not None: # noqa: E501 - if isinstance(_params['starts_after'], datetime): - _query_params.append(('starts_after', _params['starts_after'].strftime(self.api_client.configuration.datetime_format))) + # process the path parameters + # process the query parameters + if broadcasted is not None: + + _query_params.append(('broadcasted', broadcasted)) + + if ends_after is not None: + if isinstance(ends_after, datetime): + _query_params.append( + ( + 'ends_after', + ends_after.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) else: - _query_params.append(('starts_after', _params['starts_after'])) - - if _params.get('starts_before') is not None: # noqa: E501 - if isinstance(_params['starts_before'], datetime): - _query_params.append(('starts_before', _params['starts_before'].strftime(self.api_client.configuration.datetime_format))) + _query_params.append(('ends_after', ends_after)) + + if ends_before is not None: + if isinstance(ends_before, datetime): + _query_params.append( + ( + 'ends_before', + ends_before.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) else: - _query_params.append(('starts_before', _params['starts_before'])) - + _query_params.append(('ends_before', ends_before)) + + if overbooked is not None: + + _query_params.append(('overbooked', overbooked)) + + if position_status is not None: + + _query_params.append(('position_status', position_status)) + + if starts_after is not None: + if isinstance(starts_after, datetime): + _query_params.append( + ( + 'starts_after', + starts_after.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('starts_after', starts_after)) + + if starts_before is not None: + if isinstance(starts_before, datetime): + _query_params.append( + ( + 'starts_before', + starts_before.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('starts_before', starts_before)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[Schedule]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/schedule', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/schedule', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def schedule_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this schedule.")], patched_schedule : Optional[PatchedSchedule] = None, **kwargs) -> Schedule: # noqa: E501 - """schedule_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.schedule_partial_update(id, patched_schedule, async_req=True) - >>> result = thread.get() + @validate_call + def schedule_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this schedule.")], + patched_schedule: Optional[PatchedSchedule] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Schedule: + """schedule_partial_update + :param id: A unique integer value identifying this schedule. (required) :type id: int :param patched_schedule: :type patched_schedule: PatchedSchedule - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Schedule - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the schedule_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.schedule_partial_update_with_http_info(id, patched_schedule, **kwargs) # noqa: E501 - - @validate_arguments - def schedule_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this schedule.")], patched_schedule : Optional[PatchedSchedule] = None, **kwargs) -> ApiResponse: # noqa: E501 - """schedule_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.schedule_partial_update_with_http_info(id, patched_schedule, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._schedule_partial_update_serialize( + id=id, + patched_schedule=patched_schedule, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Schedule", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def schedule_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this schedule.")], + patched_schedule: Optional[PatchedSchedule] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Schedule]: + """schedule_partial_update + :param id: A unique integer value identifying this schedule. (required) :type id: int :param patched_schedule: :type patched_schedule: PatchedSchedule - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Schedule, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._schedule_partial_update_serialize( + id=id, + patched_schedule=patched_schedule, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Schedule", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'patched_schedule' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def schedule_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this schedule.")], + patched_schedule: Optional[PatchedSchedule] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """schedule_partial_update + + + :param id: A unique integer value identifying this schedule. (required) + :type id: int + :param patched_schedule: + :type patched_schedule: PatchedSchedule + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._schedule_partial_update_serialize( + id=id, + patched_schedule=patched_schedule, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method schedule_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Schedule", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _schedule_partial_update_serialize( + self, + id, + patched_schedule, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_schedule'] is not None: - _body_params = _params['patched_schedule'] + if patched_schedule is not None: + _body_params = patched_schedule + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Schedule", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/schedule/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/schedule/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def schedule_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this schedule.")], **kwargs) -> Schedule: # noqa: E501 - """schedule_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.schedule_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def schedule_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this schedule.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Schedule: + """schedule_retrieve + :param id: A unique integer value identifying this schedule. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Schedule - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the schedule_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.schedule_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def schedule_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this schedule.")], **kwargs) -> ApiResponse: # noqa: E501 - """schedule_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.schedule_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._schedule_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Schedule", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def schedule_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this schedule.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Schedule]: + """schedule_retrieve + :param id: A unique integer value identifying this schedule. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Schedule, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._schedule_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Schedule", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def schedule_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this schedule.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """schedule_retrieve + + + :param id: A unique integer value identifying this schedule. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._schedule_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method schedule_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Schedule", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _schedule_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "Schedule", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/schedule/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/schedule/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def schedule_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this schedule.")], schedule : Schedule, **kwargs) -> Schedule: # noqa: E501 - """schedule_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.schedule_update(id, schedule, async_req=True) - >>> result = thread.get() + @validate_call + def schedule_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this schedule.")], + schedule: Schedule, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Schedule: + """schedule_update + :param id: A unique integer value identifying this schedule. (required) :type id: int :param schedule: (required) :type schedule: Schedule - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Schedule - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the schedule_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.schedule_update_with_http_info(id, schedule, **kwargs) # noqa: E501 - - @validate_arguments - def schedule_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this schedule.")], schedule : Schedule, **kwargs) -> ApiResponse: # noqa: E501 - """schedule_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.schedule_update_with_http_info(id, schedule, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._schedule_update_serialize( + id=id, + schedule=schedule, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Schedule", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def schedule_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this schedule.")], + schedule: Schedule, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Schedule]: + """schedule_update + :param id: A unique integer value identifying this schedule. (required) :type id: int :param schedule: (required) :type schedule: Schedule - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Schedule, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._schedule_update_serialize( + id=id, + schedule=schedule, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Schedule", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'schedule' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def schedule_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this schedule.")], + schedule: Schedule, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """schedule_update + + + :param id: A unique integer value identifying this schedule. (required) + :type id: int + :param schedule: (required) + :type schedule: Schedule + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._schedule_update_serialize( + id=id, + schedule=schedule, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method schedule_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Schedule", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _schedule_update_serialize( + self, + id, + schedule, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['schedule'] is not None: - _body_params = _params['schedule'] + if schedule is not None: + _body_params = schedule + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Schedule", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/schedule/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/schedule/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/schema_api.py b/python-client/libretime_client/api/schema_api.py index 4103c6cd..c7cbb1d7 100644 --- a/python-client/libretime_client/api/schema_api.py +++ b/python-client/libretime_client/api/schema_api.py @@ -11,24 +11,17 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from pydantic import validate_arguments, ValidationError - -from pydantic import StrictStr - -from typing import Any, Dict, Optional - +from pydantic import StrictStr, field_validator +from typing import Optional -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class SchemaApi: @@ -43,150 +36,283 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def schema_retrieve(self, format : Optional[StrictStr] = None, lang : Optional[StrictStr] = None, **kwargs) -> Dict[str, object]: # noqa: E501 - """schema_retrieve # noqa: E501 - OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def schema_retrieve( + self, + format: Optional[StrictStr] = None, + lang: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dict[str, object]: + """schema_retrieve - >>> thread = api.schema_retrieve(format, lang, async_req=True) - >>> result = thread.get() + OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json :param format: :type format: str :param lang: :type lang: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Dict[str, object] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the schema_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.schema_retrieve_with_http_info(format, lang, **kwargs) # noqa: E501 - - @validate_arguments - def schema_retrieve_with_http_info(self, format : Optional[StrictStr] = None, lang : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 - """schema_retrieve # noqa: E501 - - OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.schema_retrieve_with_http_info(format, lang, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._schema_retrieve_serialize( + format=format, + lang=lang, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def schema_retrieve_with_http_info( + self, + format: Optional[StrictStr] = None, + lang: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dict[str, object]]: + """schema_retrieve + + OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json :param format: :type format: str :param lang: :type lang: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Dict[str, object], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._schema_retrieve_serialize( + format=format, + lang=lang, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'format', - 'lang' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def schema_retrieve_without_preload_content( + self, + format: Optional[StrictStr] = None, + lang: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """schema_retrieve + + OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json + + :param format: + :type format: str + :param lang: + :type lang: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._schema_retrieve_serialize( + format=format, + lang=lang, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method schema_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _schema_retrieve_serialize( + self, + format, + lang, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _host = None - # process the query parameters - _query_params = [] - if _params.get('format') is not None: # noqa: E501 - _query_params.append(('format', _params['format'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('lang') is not None: # noqa: E501 - _query_params.append(('lang', _params['lang'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if format is not None: + + _query_params.append(('format', format)) + + if lang is not None: + + _query_params.append(('lang', lang)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/vnd.oai.openapi', 'application/yaml', 'application/vnd.oai.openapi+json', 'application/json']) # noqa: E501 + [ + 'application/vnd.oai.openapi', + 'application/yaml', + 'application/vnd.oai.openapi+json', + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "Dict[str, object]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/schema', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/schema', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/service_registers_api.py b/python-client/libretime_client/api/service_registers_api.py index 306bdd0f..cec3cc75 100644 --- a/python-client/libretime_client/api/service_registers_api.py +++ b/python-client/libretime_client/api/service_registers_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr - -from typing import List, Optional +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_service_register import PatchedServiceRegister from libretime_client.models.service_register import ServiceRegister -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class ServiceRegistersApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def service_registers_create(self, service_register : ServiceRegister, **kwargs) -> ServiceRegister: # noqa: E501 - """service_registers_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def service_registers_create( + self, + service_register: ServiceRegister, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServiceRegister: + """service_registers_create - >>> thread = api.service_registers_create(service_register, async_req=True) - >>> result = thread.get() :param service_register: (required) :type service_register: ServiceRegister - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ServiceRegister - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the service_registers_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.service_registers_create_with_http_info(service_register, **kwargs) # noqa: E501 - - @validate_arguments - def service_registers_create_with_http_info(self, service_register : ServiceRegister, **kwargs) -> ApiResponse: # noqa: E501 - """service_registers_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.service_registers_create_with_http_info(service_register, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._service_registers_create_serialize( + service_register=service_register, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ServiceRegister", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def service_registers_create_with_http_info( + self, + service_register: ServiceRegister, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServiceRegister]: + """service_registers_create + :param service_register: (required) :type service_register: ServiceRegister - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ServiceRegister, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._service_registers_create_serialize( + service_register=service_register, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "ServiceRegister", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'service_register' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def service_registers_create_without_preload_content( + self, + service_register: ServiceRegister, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """service_registers_create + + + :param service_register: (required) + :type service_register: ServiceRegister + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._service_registers_create_serialize( + service_register=service_register, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method service_registers_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "ServiceRegister", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _service_registers_create_serialize( + self, + service_register, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['service_register'] is not None: - _body_params = _params['service_register'] + if service_register is not None: + _body_params = service_register + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "ServiceRegister", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/service-registers', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/service-registers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def service_registers_destroy(self, name : Annotated[StrictStr, Field(..., description="A unique value identifying this service register.")], **kwargs) -> None: # noqa: E501 - """service_registers_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.service_registers_destroy(name, async_req=True) - >>> result = thread.get() + @validate_call + def service_registers_destroy( + self, + name: Annotated[StrictStr, Field(description="A unique value identifying this service register.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """service_registers_destroy + :param name: A unique value identifying this service register. (required) :type name: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the service_registers_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.service_registers_destroy_with_http_info(name, **kwargs) # noqa: E501 - - @validate_arguments - def service_registers_destroy_with_http_info(self, name : Annotated[StrictStr, Field(..., description="A unique value identifying this service register.")], **kwargs) -> ApiResponse: # noqa: E501 - """service_registers_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.service_registers_destroy_with_http_info(name, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._service_registers_destroy_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def service_registers_destroy_with_http_info( + self, + name: Annotated[StrictStr, Field(description="A unique value identifying this service register.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """service_registers_destroy + :param name: A unique value identifying this service register. (required) :type name: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._service_registers_destroy_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'name' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def service_registers_destroy_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="A unique value identifying this service register.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """service_registers_destroy + + + :param name: A unique value identifying this service register. (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._service_registers_destroy_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method service_registers_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['name']: - _path_params['name'] = _params['name'] + def _service_registers_destroy_serialize( + self, + name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if name is not None: + _path_params['name'] = name # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/service-registers/{name}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/service-registers/{name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def service_registers_list(self, **kwargs) -> List[ServiceRegister]: # noqa: E501 - """service_registers_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.service_registers_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def service_registers_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ServiceRegister]: + """service_registers_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[ServiceRegister] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the service_registers_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.service_registers_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def service_registers_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """service_registers_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.service_registers_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._service_registers_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ServiceRegister]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def service_registers_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ServiceRegister]]: + """service_registers_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[ServiceRegister], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._service_registers_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ServiceRegister]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def service_registers_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """service_registers_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._service_registers_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method service_registers_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ServiceRegister]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _service_registers_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[ServiceRegister]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/service-registers', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/service-registers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def service_registers_partial_update(self, name : Annotated[StrictStr, Field(..., description="A unique value identifying this service register.")], patched_service_register : Optional[PatchedServiceRegister] = None, **kwargs) -> ServiceRegister: # noqa: E501 - """service_registers_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.service_registers_partial_update(name, patched_service_register, async_req=True) - >>> result = thread.get() + + @validate_call + def service_registers_partial_update( + self, + name: Annotated[StrictStr, Field(description="A unique value identifying this service register.")], + patched_service_register: Optional[PatchedServiceRegister] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServiceRegister: + """service_registers_partial_update + :param name: A unique value identifying this service register. (required) :type name: str :param patched_service_register: :type patched_service_register: PatchedServiceRegister - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ServiceRegister - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the service_registers_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.service_registers_partial_update_with_http_info(name, patched_service_register, **kwargs) # noqa: E501 - - @validate_arguments - def service_registers_partial_update_with_http_info(self, name : Annotated[StrictStr, Field(..., description="A unique value identifying this service register.")], patched_service_register : Optional[PatchedServiceRegister] = None, **kwargs) -> ApiResponse: # noqa: E501 - """service_registers_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.service_registers_partial_update_with_http_info(name, patched_service_register, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._service_registers_partial_update_serialize( + name=name, + patched_service_register=patched_service_register, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ServiceRegister", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def service_registers_partial_update_with_http_info( + self, + name: Annotated[StrictStr, Field(description="A unique value identifying this service register.")], + patched_service_register: Optional[PatchedServiceRegister] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServiceRegister]: + """service_registers_partial_update + :param name: A unique value identifying this service register. (required) :type name: str :param patched_service_register: :type patched_service_register: PatchedServiceRegister - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ServiceRegister, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._service_registers_partial_update_serialize( + name=name, + patched_service_register=patched_service_register, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ServiceRegister", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'name', - 'patched_service_register' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def service_registers_partial_update_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="A unique value identifying this service register.")], + patched_service_register: Optional[PatchedServiceRegister] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """service_registers_partial_update + + + :param name: A unique value identifying this service register. (required) + :type name: str + :param patched_service_register: + :type patched_service_register: PatchedServiceRegister + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._service_registers_partial_update_serialize( + name=name, + patched_service_register=patched_service_register, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method service_registers_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ServiceRegister", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['name']: - _path_params['name'] = _params['name'] + def _service_registers_partial_update_serialize( + self, + name, + patched_service_register, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if name is not None: + _path_params['name'] = name # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_service_register'] is not None: - _body_params = _params['patched_service_register'] + if patched_service_register is not None: + _body_params = patched_service_register + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ServiceRegister", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/service-registers/{name}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/service-registers/{name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def service_registers_retrieve(self, name : Annotated[StrictStr, Field(..., description="A unique value identifying this service register.")], **kwargs) -> ServiceRegister: # noqa: E501 - """service_registers_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.service_registers_retrieve(name, async_req=True) - >>> result = thread.get() + @validate_call + def service_registers_retrieve( + self, + name: Annotated[StrictStr, Field(description="A unique value identifying this service register.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServiceRegister: + """service_registers_retrieve + :param name: A unique value identifying this service register. (required) :type name: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ServiceRegister - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the service_registers_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.service_registers_retrieve_with_http_info(name, **kwargs) # noqa: E501 - - @validate_arguments - def service_registers_retrieve_with_http_info(self, name : Annotated[StrictStr, Field(..., description="A unique value identifying this service register.")], **kwargs) -> ApiResponse: # noqa: E501 - """service_registers_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.service_registers_retrieve_with_http_info(name, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._service_registers_retrieve_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ServiceRegister", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def service_registers_retrieve_with_http_info( + self, + name: Annotated[StrictStr, Field(description="A unique value identifying this service register.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServiceRegister]: + """service_registers_retrieve + :param name: A unique value identifying this service register. (required) :type name: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ServiceRegister, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._service_registers_retrieve_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ServiceRegister", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'name' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def service_registers_retrieve_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="A unique value identifying this service register.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """service_registers_retrieve + + + :param name: A unique value identifying this service register. (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._service_registers_retrieve_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method service_registers_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ServiceRegister", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['name']: - _path_params['name'] = _params['name'] + def _service_registers_retrieve_serialize( + self, + name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if name is not None: + _path_params['name'] = name # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "ServiceRegister", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/service-registers/{name}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/service-registers/{name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def service_registers_update(self, name : Annotated[StrictStr, Field(..., description="A unique value identifying this service register.")], service_register : ServiceRegister, **kwargs) -> ServiceRegister: # noqa: E501 - """service_registers_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.service_registers_update(name, service_register, async_req=True) - >>> result = thread.get() + + @validate_call + def service_registers_update( + self, + name: Annotated[StrictStr, Field(description="A unique value identifying this service register.")], + service_register: ServiceRegister, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServiceRegister: + """service_registers_update + :param name: A unique value identifying this service register. (required) :type name: str :param service_register: (required) :type service_register: ServiceRegister - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ServiceRegister - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the service_registers_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.service_registers_update_with_http_info(name, service_register, **kwargs) # noqa: E501 - - @validate_arguments - def service_registers_update_with_http_info(self, name : Annotated[StrictStr, Field(..., description="A unique value identifying this service register.")], service_register : ServiceRegister, **kwargs) -> ApiResponse: # noqa: E501 - """service_registers_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.service_registers_update_with_http_info(name, service_register, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._service_registers_update_serialize( + name=name, + service_register=service_register, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ServiceRegister", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def service_registers_update_with_http_info( + self, + name: Annotated[StrictStr, Field(description="A unique value identifying this service register.")], + service_register: ServiceRegister, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServiceRegister]: + """service_registers_update + :param name: A unique value identifying this service register. (required) :type name: str :param service_register: (required) :type service_register: ServiceRegister - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ServiceRegister, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._service_registers_update_serialize( + name=name, + service_register=service_register, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ServiceRegister", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'name', - 'service_register' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def service_registers_update_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="A unique value identifying this service register.")], + service_register: ServiceRegister, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """service_registers_update + + + :param name: A unique value identifying this service register. (required) + :type name: str + :param service_register: (required) + :type service_register: ServiceRegister + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._service_registers_update_serialize( + name=name, + service_register=service_register, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method service_registers_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ServiceRegister", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['name']: - _path_params['name'] = _params['name'] + def _service_registers_update_serialize( + self, + name, + service_register, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if name is not None: + _path_params['name'] = name # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['service_register'] is not None: - _body_params = _params['service_register'] + if service_register is not None: + _body_params = service_register + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ServiceRegister", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/service-registers/{name}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/service-registers/{name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/show_days_api.py b/python-client/libretime_client/api/show_days_api.py index 04ce5d2d..73b27cac 100644 --- a/python-client/libretime_client/api/show_days_api.py +++ b/python-client/libretime_client/api/show_days_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_show_days import PatchedShowDays from libretime_client.models.show_days import ShowDays -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class ShowDaysApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def show_days_create(self, show_days : ShowDays, **kwargs) -> ShowDays: # noqa: E501 - """show_days_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def show_days_create( + self, + show_days: ShowDays, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowDays: + """show_days_create - >>> thread = api.show_days_create(show_days, async_req=True) - >>> result = thread.get() :param show_days: (required) :type show_days: ShowDays - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowDays - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_days_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_days_create_with_http_info(show_days, **kwargs) # noqa: E501 - - @validate_arguments - def show_days_create_with_http_info(self, show_days : ShowDays, **kwargs) -> ApiResponse: # noqa: E501 - """show_days_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_days_create_with_http_info(show_days, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_days_create_serialize( + show_days=show_days, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ShowDays", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_days_create_with_http_info( + self, + show_days: ShowDays, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowDays]: + """show_days_create + :param show_days: (required) :type show_days: ShowDays - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowDays, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_days_create_serialize( + show_days=show_days, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "ShowDays", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'show_days' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_days_create_without_preload_content( + self, + show_days: ShowDays, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_days_create + + + :param show_days: (required) + :type show_days: ShowDays + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_days_create_serialize( + show_days=show_days, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_days_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "ShowDays", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _show_days_create_serialize( + self, + show_days, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['show_days'] is not None: - _body_params = _params['show_days'] + if show_days is not None: + _body_params = show_days + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "ShowDays", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-days', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/show-days', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def show_days_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show days.")], **kwargs) -> None: # noqa: E501 - """show_days_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_days_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def show_days_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show days.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """show_days_destroy + :param id: A unique integer value identifying this show days. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_days_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_days_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def show_days_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show days.")], **kwargs) -> ApiResponse: # noqa: E501 - """show_days_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_days_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_days_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_days_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show days.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """show_days_destroy + :param id: A unique integer value identifying this show days. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._show_days_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_days_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show days.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_days_destroy + + + :param id: A unique integer value identifying this show days. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_days_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_days_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_days_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/show-days/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/show-days/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def show_days_list(self, **kwargs) -> List[ShowDays]: # noqa: E501 - """show_days_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_days_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def show_days_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ShowDays]: + """show_days_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[ShowDays] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_days_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_days_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def show_days_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """show_days_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_days_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._show_days_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShowDays]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_days_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ShowDays]]: + """show_days_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[ShowDays], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._show_days_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShowDays]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def show_days_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_days_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_days_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_days_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShowDays]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _show_days_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[ShowDays]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-days', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/show-days', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def show_days_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show days.")], patched_show_days : Optional[PatchedShowDays] = None, **kwargs) -> ShowDays: # noqa: E501 - """show_days_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_days_partial_update(id, patched_show_days, async_req=True) - >>> result = thread.get() + + @validate_call + def show_days_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show days.")], + patched_show_days: Optional[PatchedShowDays] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowDays: + """show_days_partial_update + :param id: A unique integer value identifying this show days. (required) :type id: int :param patched_show_days: :type patched_show_days: PatchedShowDays - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowDays - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_days_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_days_partial_update_with_http_info(id, patched_show_days, **kwargs) # noqa: E501 - - @validate_arguments - def show_days_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show days.")], patched_show_days : Optional[PatchedShowDays] = None, **kwargs) -> ApiResponse: # noqa: E501 - """show_days_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_days_partial_update_with_http_info(id, patched_show_days, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_days_partial_update_serialize( + id=id, + patched_show_days=patched_show_days, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowDays", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_days_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show days.")], + patched_show_days: Optional[PatchedShowDays] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowDays]: + """show_days_partial_update + :param id: A unique integer value identifying this show days. (required) :type id: int :param patched_show_days: :type patched_show_days: PatchedShowDays - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowDays, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_days_partial_update_serialize( + id=id, + patched_show_days=patched_show_days, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowDays", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_show_days' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_days_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show days.")], + patched_show_days: Optional[PatchedShowDays] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_days_partial_update + + + :param id: A unique integer value identifying this show days. (required) + :type id: int + :param patched_show_days: + :type patched_show_days: PatchedShowDays + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_days_partial_update_serialize( + id=id, + patched_show_days=patched_show_days, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_days_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowDays", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_days_partial_update_serialize( + self, + id, + patched_show_days, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_show_days'] is not None: - _body_params = _params['patched_show_days'] + if patched_show_days is not None: + _body_params = patched_show_days + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ShowDays", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-days/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/show-days/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def show_days_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show days.")], **kwargs) -> ShowDays: # noqa: E501 - """show_days_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_days_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def show_days_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show days.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowDays: + """show_days_retrieve + :param id: A unique integer value identifying this show days. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowDays - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_days_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_days_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def show_days_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show days.")], **kwargs) -> ApiResponse: # noqa: E501 - """show_days_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_days_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_days_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowDays", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_days_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show days.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowDays]: + """show_days_retrieve + :param id: A unique integer value identifying this show days. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowDays, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_days_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowDays", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def show_days_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show days.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_days_retrieve + + + :param id: A unique integer value identifying this show days. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_days_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_days_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowDays", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_days_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "ShowDays", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-days/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/show-days/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def show_days_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show days.")], show_days : ShowDays, **kwargs) -> ShowDays: # noqa: E501 - """show_days_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_days_update(id, show_days, async_req=True) - >>> result = thread.get() + + @validate_call + def show_days_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show days.")], + show_days: ShowDays, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowDays: + """show_days_update + :param id: A unique integer value identifying this show days. (required) :type id: int :param show_days: (required) :type show_days: ShowDays - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowDays - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_days_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_days_update_with_http_info(id, show_days, **kwargs) # noqa: E501 - - @validate_arguments - def show_days_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show days.")], show_days : ShowDays, **kwargs) -> ApiResponse: # noqa: E501 - """show_days_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_days_update_with_http_info(id, show_days, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_days_update_serialize( + id=id, + show_days=show_days, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowDays", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_days_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show days.")], + show_days: ShowDays, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowDays]: + """show_days_update + :param id: A unique integer value identifying this show days. (required) :type id: int :param show_days: (required) :type show_days: ShowDays - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowDays, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_days_update_serialize( + id=id, + show_days=show_days, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowDays", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'show_days' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_days_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show days.")], + show_days: ShowDays, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_days_update + + + :param id: A unique integer value identifying this show days. (required) + :type id: int + :param show_days: (required) + :type show_days: ShowDays + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_days_update_serialize( + id=id, + show_days=show_days, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_days_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowDays", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_days_update_serialize( + self, + id, + show_days, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['show_days'] is not None: - _body_params = _params['show_days'] + if show_days is not None: + _body_params = show_days + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ShowDays", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-days/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/show-days/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/show_hosts_api.py b/python-client/libretime_client/api/show_hosts_api.py index df7d4860..e54a9520 100644 --- a/python-client/libretime_client/api/show_hosts_api.py +++ b/python-client/libretime_client/api/show_hosts_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_show_host import PatchedShowHost from libretime_client.models.show_host import ShowHost -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class ShowHostsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def show_hosts_create(self, show_host : ShowHost, **kwargs) -> ShowHost: # noqa: E501 - """show_hosts_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def show_hosts_create( + self, + show_host: ShowHost, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowHost: + """show_hosts_create - >>> thread = api.show_hosts_create(show_host, async_req=True) - >>> result = thread.get() :param show_host: (required) :type show_host: ShowHost - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowHost - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_hosts_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_hosts_create_with_http_info(show_host, **kwargs) # noqa: E501 - - @validate_arguments - def show_hosts_create_with_http_info(self, show_host : ShowHost, **kwargs) -> ApiResponse: # noqa: E501 - """show_hosts_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_hosts_create_with_http_info(show_host, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_hosts_create_serialize( + show_host=show_host, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ShowHost", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_hosts_create_with_http_info( + self, + show_host: ShowHost, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowHost]: + """show_hosts_create + :param show_host: (required) :type show_host: ShowHost - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowHost, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_hosts_create_serialize( + show_host=show_host, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "ShowHost", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'show_host' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_hosts_create_without_preload_content( + self, + show_host: ShowHost, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_hosts_create + + + :param show_host: (required) + :type show_host: ShowHost + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_hosts_create_serialize( + show_host=show_host, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_hosts_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "ShowHost", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _show_hosts_create_serialize( + self, + show_host, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['show_host'] is not None: - _body_params = _params['show_host'] + if show_host is not None: + _body_params = show_host + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "ShowHost", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-hosts', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/show-hosts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def show_hosts_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show host.")], **kwargs) -> None: # noqa: E501 - """show_hosts_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_hosts_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def show_hosts_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show host.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """show_hosts_destroy + :param id: A unique integer value identifying this show host. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_hosts_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_hosts_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def show_hosts_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show host.")], **kwargs) -> ApiResponse: # noqa: E501 - """show_hosts_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_hosts_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_hosts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_hosts_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show host.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """show_hosts_destroy + :param id: A unique integer value identifying this show host. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._show_hosts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_hosts_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show host.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_hosts_destroy + + + :param id: A unique integer value identifying this show host. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_hosts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_hosts_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_hosts_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/show-hosts/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/show-hosts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def show_hosts_list(self, **kwargs) -> List[ShowHost]: # noqa: E501 - """show_hosts_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_hosts_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def show_hosts_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ShowHost]: + """show_hosts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[ShowHost] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_hosts_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_hosts_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def show_hosts_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """show_hosts_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_hosts_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._show_hosts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShowHost]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_hosts_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ShowHost]]: + """show_hosts_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[ShowHost], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._show_hosts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShowHost]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def show_hosts_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_hosts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_hosts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_hosts_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShowHost]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _show_hosts_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[ShowHost]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-hosts', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/show-hosts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def show_hosts_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show host.")], patched_show_host : Optional[PatchedShowHost] = None, **kwargs) -> ShowHost: # noqa: E501 - """show_hosts_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_hosts_partial_update(id, patched_show_host, async_req=True) - >>> result = thread.get() + + @validate_call + def show_hosts_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show host.")], + patched_show_host: Optional[PatchedShowHost] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowHost: + """show_hosts_partial_update + :param id: A unique integer value identifying this show host. (required) :type id: int :param patched_show_host: :type patched_show_host: PatchedShowHost - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowHost - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_hosts_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_hosts_partial_update_with_http_info(id, patched_show_host, **kwargs) # noqa: E501 - - @validate_arguments - def show_hosts_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show host.")], patched_show_host : Optional[PatchedShowHost] = None, **kwargs) -> ApiResponse: # noqa: E501 - """show_hosts_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_hosts_partial_update_with_http_info(id, patched_show_host, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_hosts_partial_update_serialize( + id=id, + patched_show_host=patched_show_host, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowHost", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_hosts_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show host.")], + patched_show_host: Optional[PatchedShowHost] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowHost]: + """show_hosts_partial_update + :param id: A unique integer value identifying this show host. (required) :type id: int :param patched_show_host: :type patched_show_host: PatchedShowHost - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowHost, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_hosts_partial_update_serialize( + id=id, + patched_show_host=patched_show_host, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowHost", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_show_host' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_hosts_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show host.")], + patched_show_host: Optional[PatchedShowHost] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_hosts_partial_update + + + :param id: A unique integer value identifying this show host. (required) + :type id: int + :param patched_show_host: + :type patched_show_host: PatchedShowHost + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_hosts_partial_update_serialize( + id=id, + patched_show_host=patched_show_host, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_hosts_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowHost", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_hosts_partial_update_serialize( + self, + id, + patched_show_host, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_show_host'] is not None: - _body_params = _params['patched_show_host'] + if patched_show_host is not None: + _body_params = patched_show_host + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ShowHost", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-hosts/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/show-hosts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def show_hosts_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show host.")], **kwargs) -> ShowHost: # noqa: E501 - """show_hosts_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_hosts_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def show_hosts_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show host.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowHost: + """show_hosts_retrieve + :param id: A unique integer value identifying this show host. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowHost - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_hosts_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_hosts_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def show_hosts_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show host.")], **kwargs) -> ApiResponse: # noqa: E501 - """show_hosts_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_hosts_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_hosts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowHost", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_hosts_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show host.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowHost]: + """show_hosts_retrieve + :param id: A unique integer value identifying this show host. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowHost, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_hosts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowHost", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def show_hosts_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show host.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_hosts_retrieve + + + :param id: A unique integer value identifying this show host. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_hosts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_hosts_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowHost", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_hosts_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "ShowHost", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-hosts/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/show-hosts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def show_hosts_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show host.")], show_host : ShowHost, **kwargs) -> ShowHost: # noqa: E501 - """show_hosts_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_hosts_update(id, show_host, async_req=True) - >>> result = thread.get() + + @validate_call + def show_hosts_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show host.")], + show_host: ShowHost, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowHost: + """show_hosts_update + :param id: A unique integer value identifying this show host. (required) :type id: int :param show_host: (required) :type show_host: ShowHost - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowHost - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_hosts_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_hosts_update_with_http_info(id, show_host, **kwargs) # noqa: E501 - - @validate_arguments - def show_hosts_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show host.")], show_host : ShowHost, **kwargs) -> ApiResponse: # noqa: E501 - """show_hosts_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_hosts_update_with_http_info(id, show_host, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_hosts_update_serialize( + id=id, + show_host=show_host, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowHost", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_hosts_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show host.")], + show_host: ShowHost, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowHost]: + """show_hosts_update + :param id: A unique integer value identifying this show host. (required) :type id: int :param show_host: (required) :type show_host: ShowHost - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowHost, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_hosts_update_serialize( + id=id, + show_host=show_host, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowHost", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'show_host' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_hosts_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show host.")], + show_host: ShowHost, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_hosts_update + + + :param id: A unique integer value identifying this show host. (required) + :type id: int + :param show_host: (required) + :type show_host: ShowHost + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_hosts_update_serialize( + id=id, + show_host=show_host, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_hosts_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowHost", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_hosts_update_serialize( + self, + id, + show_host, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['show_host'] is not None: - _body_params = _params['show_host'] + if show_host is not None: + _body_params = show_host + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ShowHost", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-hosts/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/show-hosts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/show_instances_api.py b/python-client/libretime_client/api/show_instances_api.py index e00a4281..da197347 100644 --- a/python-client/libretime_client/api/show_instances_api.py +++ b/python-client/libretime_client/api/show_instances_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_show_instance import PatchedShowInstance from libretime_client.models.show_instance import ShowInstance -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class ShowInstancesApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def show_instances_create(self, show_instance : ShowInstance, **kwargs) -> ShowInstance: # noqa: E501 - """show_instances_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def show_instances_create( + self, + show_instance: ShowInstance, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowInstance: + """show_instances_create - >>> thread = api.show_instances_create(show_instance, async_req=True) - >>> result = thread.get() :param show_instance: (required) :type show_instance: ShowInstance - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowInstance - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_instances_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_instances_create_with_http_info(show_instance, **kwargs) # noqa: E501 - - @validate_arguments - def show_instances_create_with_http_info(self, show_instance : ShowInstance, **kwargs) -> ApiResponse: # noqa: E501 - """show_instances_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_instances_create_with_http_info(show_instance, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_instances_create_serialize( + show_instance=show_instance, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ShowInstance", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_instances_create_with_http_info( + self, + show_instance: ShowInstance, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowInstance]: + """show_instances_create + :param show_instance: (required) :type show_instance: ShowInstance - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowInstance, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_instances_create_serialize( + show_instance=show_instance, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "ShowInstance", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'show_instance' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_instances_create_without_preload_content( + self, + show_instance: ShowInstance, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_instances_create + + + :param show_instance: (required) + :type show_instance: ShowInstance + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_instances_create_serialize( + show_instance=show_instance, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_instances_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "ShowInstance", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _show_instances_create_serialize( + self, + show_instance, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['show_instance'] is not None: - _body_params = _params['show_instance'] + if show_instance is not None: + _body_params = show_instance + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "ShowInstance", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-instances', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/show-instances', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def show_instances_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show instance.")], **kwargs) -> None: # noqa: E501 - """show_instances_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_instances_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def show_instances_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show instance.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """show_instances_destroy + :param id: A unique integer value identifying this show instance. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_instances_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_instances_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def show_instances_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show instance.")], **kwargs) -> ApiResponse: # noqa: E501 - """show_instances_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_instances_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_instances_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_instances_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show instance.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """show_instances_destroy + :param id: A unique integer value identifying this show instance. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._show_instances_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_instances_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show instance.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_instances_destroy + + + :param id: A unique integer value identifying this show instance. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_instances_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_instances_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_instances_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/show-instances/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/show-instances/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def show_instances_list(self, **kwargs) -> List[ShowInstance]: # noqa: E501 - """show_instances_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_instances_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def show_instances_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ShowInstance]: + """show_instances_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[ShowInstance] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_instances_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_instances_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def show_instances_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """show_instances_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_instances_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._show_instances_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShowInstance]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_instances_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ShowInstance]]: + """show_instances_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[ShowInstance], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._show_instances_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShowInstance]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def show_instances_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_instances_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_instances_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_instances_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShowInstance]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _show_instances_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[ShowInstance]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-instances', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/show-instances', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def show_instances_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show instance.")], patched_show_instance : Optional[PatchedShowInstance] = None, **kwargs) -> ShowInstance: # noqa: E501 - """show_instances_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_instances_partial_update(id, patched_show_instance, async_req=True) - >>> result = thread.get() + + @validate_call + def show_instances_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show instance.")], + patched_show_instance: Optional[PatchedShowInstance] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowInstance: + """show_instances_partial_update + :param id: A unique integer value identifying this show instance. (required) :type id: int :param patched_show_instance: :type patched_show_instance: PatchedShowInstance - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowInstance - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_instances_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_instances_partial_update_with_http_info(id, patched_show_instance, **kwargs) # noqa: E501 - - @validate_arguments - def show_instances_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show instance.")], patched_show_instance : Optional[PatchedShowInstance] = None, **kwargs) -> ApiResponse: # noqa: E501 - """show_instances_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_instances_partial_update_with_http_info(id, patched_show_instance, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_instances_partial_update_serialize( + id=id, + patched_show_instance=patched_show_instance, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowInstance", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_instances_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show instance.")], + patched_show_instance: Optional[PatchedShowInstance] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowInstance]: + """show_instances_partial_update + :param id: A unique integer value identifying this show instance. (required) :type id: int :param patched_show_instance: :type patched_show_instance: PatchedShowInstance - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowInstance, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_instances_partial_update_serialize( + id=id, + patched_show_instance=patched_show_instance, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowInstance", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_show_instance' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_instances_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show instance.")], + patched_show_instance: Optional[PatchedShowInstance] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_instances_partial_update + + + :param id: A unique integer value identifying this show instance. (required) + :type id: int + :param patched_show_instance: + :type patched_show_instance: PatchedShowInstance + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_instances_partial_update_serialize( + id=id, + patched_show_instance=patched_show_instance, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_instances_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowInstance", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_instances_partial_update_serialize( + self, + id, + patched_show_instance, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_show_instance'] is not None: - _body_params = _params['patched_show_instance'] + if patched_show_instance is not None: + _body_params = patched_show_instance + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ShowInstance", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-instances/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/show-instances/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def show_instances_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show instance.")], **kwargs) -> ShowInstance: # noqa: E501 - """show_instances_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_instances_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def show_instances_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show instance.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowInstance: + """show_instances_retrieve + :param id: A unique integer value identifying this show instance. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowInstance - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_instances_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_instances_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def show_instances_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show instance.")], **kwargs) -> ApiResponse: # noqa: E501 - """show_instances_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_instances_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_instances_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowInstance", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_instances_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show instance.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowInstance]: + """show_instances_retrieve + :param id: A unique integer value identifying this show instance. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowInstance, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_instances_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowInstance", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def show_instances_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show instance.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_instances_retrieve + + + :param id: A unique integer value identifying this show instance. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_instances_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_instances_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowInstance", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_instances_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "ShowInstance", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-instances/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/show-instances/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def show_instances_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show instance.")], show_instance : ShowInstance, **kwargs) -> ShowInstance: # noqa: E501 - """show_instances_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_instances_update(id, show_instance, async_req=True) - >>> result = thread.get() + + @validate_call + def show_instances_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show instance.")], + show_instance: ShowInstance, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowInstance: + """show_instances_update + :param id: A unique integer value identifying this show instance. (required) :type id: int :param show_instance: (required) :type show_instance: ShowInstance - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowInstance - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_instances_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_instances_update_with_http_info(id, show_instance, **kwargs) # noqa: E501 - - @validate_arguments - def show_instances_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show instance.")], show_instance : ShowInstance, **kwargs) -> ApiResponse: # noqa: E501 - """show_instances_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_instances_update_with_http_info(id, show_instance, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_instances_update_serialize( + id=id, + show_instance=show_instance, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowInstance", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_instances_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show instance.")], + show_instance: ShowInstance, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowInstance]: + """show_instances_update + :param id: A unique integer value identifying this show instance. (required) :type id: int :param show_instance: (required) :type show_instance: ShowInstance - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowInstance, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_instances_update_serialize( + id=id, + show_instance=show_instance, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowInstance", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'show_instance' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_instances_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show instance.")], + show_instance: ShowInstance, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_instances_update + + + :param id: A unique integer value identifying this show instance. (required) + :type id: int + :param show_instance: (required) + :type show_instance: ShowInstance + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_instances_update_serialize( + id=id, + show_instance=show_instance, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_instances_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowInstance", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_instances_update_serialize( + self, + id, + show_instance, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['show_instance'] is not None: - _body_params = _params['show_instance'] + if show_instance is not None: + _body_params = show_instance + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ShowInstance", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-instances/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/show-instances/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/show_rebroadcasts_api.py b/python-client/libretime_client/api/show_rebroadcasts_api.py index 5b66bbdc..b09de1a3 100644 --- a/python-client/libretime_client/api/show_rebroadcasts_api.py +++ b/python-client/libretime_client/api/show_rebroadcasts_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_show_rebroadcast import PatchedShowRebroadcast from libretime_client.models.show_rebroadcast import ShowRebroadcast -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class ShowRebroadcastsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def show_rebroadcasts_create(self, show_rebroadcast : ShowRebroadcast, **kwargs) -> ShowRebroadcast: # noqa: E501 - """show_rebroadcasts_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def show_rebroadcasts_create( + self, + show_rebroadcast: ShowRebroadcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowRebroadcast: + """show_rebroadcasts_create - >>> thread = api.show_rebroadcasts_create(show_rebroadcast, async_req=True) - >>> result = thread.get() :param show_rebroadcast: (required) :type show_rebroadcast: ShowRebroadcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowRebroadcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_rebroadcasts_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_rebroadcasts_create_with_http_info(show_rebroadcast, **kwargs) # noqa: E501 - - @validate_arguments - def show_rebroadcasts_create_with_http_info(self, show_rebroadcast : ShowRebroadcast, **kwargs) -> ApiResponse: # noqa: E501 - """show_rebroadcasts_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_rebroadcasts_create_with_http_info(show_rebroadcast, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_rebroadcasts_create_serialize( + show_rebroadcast=show_rebroadcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ShowRebroadcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_rebroadcasts_create_with_http_info( + self, + show_rebroadcast: ShowRebroadcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowRebroadcast]: + """show_rebroadcasts_create + :param show_rebroadcast: (required) :type show_rebroadcast: ShowRebroadcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowRebroadcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_rebroadcasts_create_serialize( + show_rebroadcast=show_rebroadcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "ShowRebroadcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'show_rebroadcast' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_rebroadcasts_create_without_preload_content( + self, + show_rebroadcast: ShowRebroadcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_rebroadcasts_create + + + :param show_rebroadcast: (required) + :type show_rebroadcast: ShowRebroadcast + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_rebroadcasts_create_serialize( + show_rebroadcast=show_rebroadcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_rebroadcasts_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "ShowRebroadcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _show_rebroadcasts_create_serialize( + self, + show_rebroadcast, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['show_rebroadcast'] is not None: - _body_params = _params['show_rebroadcast'] + if show_rebroadcast is not None: + _body_params = show_rebroadcast + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "ShowRebroadcast", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-rebroadcasts', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/show-rebroadcasts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def show_rebroadcasts_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show rebroadcast.")], **kwargs) -> None: # noqa: E501 - """show_rebroadcasts_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_rebroadcasts_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def show_rebroadcasts_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show rebroadcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """show_rebroadcasts_destroy + :param id: A unique integer value identifying this show rebroadcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_rebroadcasts_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_rebroadcasts_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def show_rebroadcasts_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show rebroadcast.")], **kwargs) -> ApiResponse: # noqa: E501 - """show_rebroadcasts_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_rebroadcasts_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_rebroadcasts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_rebroadcasts_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show rebroadcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """show_rebroadcasts_destroy + :param id: A unique integer value identifying this show rebroadcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._show_rebroadcasts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_rebroadcasts_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show rebroadcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_rebroadcasts_destroy + + + :param id: A unique integer value identifying this show rebroadcast. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_rebroadcasts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_rebroadcasts_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_rebroadcasts_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/show-rebroadcasts/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/show-rebroadcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def show_rebroadcasts_list(self, **kwargs) -> List[ShowRebroadcast]: # noqa: E501 - """show_rebroadcasts_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_rebroadcasts_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def show_rebroadcasts_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ShowRebroadcast]: + """show_rebroadcasts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[ShowRebroadcast] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_rebroadcasts_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_rebroadcasts_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def show_rebroadcasts_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """show_rebroadcasts_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_rebroadcasts_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._show_rebroadcasts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShowRebroadcast]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_rebroadcasts_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ShowRebroadcast]]: + """show_rebroadcasts_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[ShowRebroadcast], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._show_rebroadcasts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShowRebroadcast]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def show_rebroadcasts_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_rebroadcasts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_rebroadcasts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_rebroadcasts_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ShowRebroadcast]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _show_rebroadcasts_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[ShowRebroadcast]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-rebroadcasts', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/show-rebroadcasts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def show_rebroadcasts_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show rebroadcast.")], patched_show_rebroadcast : Optional[PatchedShowRebroadcast] = None, **kwargs) -> ShowRebroadcast: # noqa: E501 - """show_rebroadcasts_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_rebroadcasts_partial_update(id, patched_show_rebroadcast, async_req=True) - >>> result = thread.get() + + @validate_call + def show_rebroadcasts_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show rebroadcast.")], + patched_show_rebroadcast: Optional[PatchedShowRebroadcast] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowRebroadcast: + """show_rebroadcasts_partial_update + :param id: A unique integer value identifying this show rebroadcast. (required) :type id: int :param patched_show_rebroadcast: :type patched_show_rebroadcast: PatchedShowRebroadcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowRebroadcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_rebroadcasts_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_rebroadcasts_partial_update_with_http_info(id, patched_show_rebroadcast, **kwargs) # noqa: E501 - - @validate_arguments - def show_rebroadcasts_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show rebroadcast.")], patched_show_rebroadcast : Optional[PatchedShowRebroadcast] = None, **kwargs) -> ApiResponse: # noqa: E501 - """show_rebroadcasts_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_rebroadcasts_partial_update_with_http_info(id, patched_show_rebroadcast, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_rebroadcasts_partial_update_serialize( + id=id, + patched_show_rebroadcast=patched_show_rebroadcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowRebroadcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_rebroadcasts_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show rebroadcast.")], + patched_show_rebroadcast: Optional[PatchedShowRebroadcast] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowRebroadcast]: + """show_rebroadcasts_partial_update + :param id: A unique integer value identifying this show rebroadcast. (required) :type id: int :param patched_show_rebroadcast: :type patched_show_rebroadcast: PatchedShowRebroadcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowRebroadcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_rebroadcasts_partial_update_serialize( + id=id, + patched_show_rebroadcast=patched_show_rebroadcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowRebroadcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_show_rebroadcast' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_rebroadcasts_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show rebroadcast.")], + patched_show_rebroadcast: Optional[PatchedShowRebroadcast] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_rebroadcasts_partial_update + + + :param id: A unique integer value identifying this show rebroadcast. (required) + :type id: int + :param patched_show_rebroadcast: + :type patched_show_rebroadcast: PatchedShowRebroadcast + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_rebroadcasts_partial_update_serialize( + id=id, + patched_show_rebroadcast=patched_show_rebroadcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_rebroadcasts_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowRebroadcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_rebroadcasts_partial_update_serialize( + self, + id, + patched_show_rebroadcast, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_show_rebroadcast'] is not None: - _body_params = _params['patched_show_rebroadcast'] + if patched_show_rebroadcast is not None: + _body_params = patched_show_rebroadcast + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ShowRebroadcast", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-rebroadcasts/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/show-rebroadcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def show_rebroadcasts_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show rebroadcast.")], **kwargs) -> ShowRebroadcast: # noqa: E501 - """show_rebroadcasts_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_rebroadcasts_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def show_rebroadcasts_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show rebroadcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowRebroadcast: + """show_rebroadcasts_retrieve + :param id: A unique integer value identifying this show rebroadcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowRebroadcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_rebroadcasts_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_rebroadcasts_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def show_rebroadcasts_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show rebroadcast.")], **kwargs) -> ApiResponse: # noqa: E501 - """show_rebroadcasts_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_rebroadcasts_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_rebroadcasts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowRebroadcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_rebroadcasts_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show rebroadcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowRebroadcast]: + """show_rebroadcasts_retrieve + :param id: A unique integer value identifying this show rebroadcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowRebroadcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_rebroadcasts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowRebroadcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def show_rebroadcasts_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show rebroadcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_rebroadcasts_retrieve + + + :param id: A unique integer value identifying this show rebroadcast. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_rebroadcasts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_rebroadcasts_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowRebroadcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_rebroadcasts_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "ShowRebroadcast", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-rebroadcasts/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/show-rebroadcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def show_rebroadcasts_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show rebroadcast.")], show_rebroadcast : ShowRebroadcast, **kwargs) -> ShowRebroadcast: # noqa: E501 - """show_rebroadcasts_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.show_rebroadcasts_update(id, show_rebroadcast, async_req=True) - >>> result = thread.get() + + @validate_call + def show_rebroadcasts_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show rebroadcast.")], + show_rebroadcast: ShowRebroadcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ShowRebroadcast: + """show_rebroadcasts_update + :param id: A unique integer value identifying this show rebroadcast. (required) :type id: int :param show_rebroadcast: (required) :type show_rebroadcast: ShowRebroadcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ShowRebroadcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the show_rebroadcasts_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.show_rebroadcasts_update_with_http_info(id, show_rebroadcast, **kwargs) # noqa: E501 - - @validate_arguments - def show_rebroadcasts_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show rebroadcast.")], show_rebroadcast : ShowRebroadcast, **kwargs) -> ApiResponse: # noqa: E501 - """show_rebroadcasts_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.show_rebroadcasts_update_with_http_info(id, show_rebroadcast, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._show_rebroadcasts_update_serialize( + id=id, + show_rebroadcast=show_rebroadcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowRebroadcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def show_rebroadcasts_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show rebroadcast.")], + show_rebroadcast: ShowRebroadcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ShowRebroadcast]: + """show_rebroadcasts_update + :param id: A unique integer value identifying this show rebroadcast. (required) :type id: int :param show_rebroadcast: (required) :type show_rebroadcast: ShowRebroadcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ShowRebroadcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._show_rebroadcasts_update_serialize( + id=id, + show_rebroadcast=show_rebroadcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowRebroadcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'show_rebroadcast' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def show_rebroadcasts_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show rebroadcast.")], + show_rebroadcast: ShowRebroadcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """show_rebroadcasts_update + + + :param id: A unique integer value identifying this show rebroadcast. (required) + :type id: int + :param show_rebroadcast: (required) + :type show_rebroadcast: ShowRebroadcast + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._show_rebroadcasts_update_serialize( + id=id, + show_rebroadcast=show_rebroadcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method show_rebroadcasts_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ShowRebroadcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _show_rebroadcasts_update_serialize( + self, + id, + show_rebroadcast, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['show_rebroadcast'] is not None: - _body_params = _params['show_rebroadcast'] + if show_rebroadcast is not None: + _body_params = show_rebroadcast + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ShowRebroadcast", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/show-rebroadcasts/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/show-rebroadcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/shows_api.py b/python-client/libretime_client/api/shows_api.py index ca5b8e70..e6771637 100644 --- a/python-client/libretime_client/api/shows_api.py +++ b/python-client/libretime_client/api/shows_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_show import PatchedShow from libretime_client.models.show import Show -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class ShowsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def shows_create(self, show : Show, **kwargs) -> Show: # noqa: E501 - """shows_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def shows_create( + self, + show: Show, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Show: + """shows_create - >>> thread = api.shows_create(show, async_req=True) - >>> result = thread.get() :param show: (required) :type show: Show - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Show - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the shows_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.shows_create_with_http_info(show, **kwargs) # noqa: E501 - - @validate_arguments - def shows_create_with_http_info(self, show : Show, **kwargs) -> ApiResponse: # noqa: E501 - """shows_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.shows_create_with_http_info(show, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._shows_create_serialize( + show=show, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Show", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def shows_create_with_http_info( + self, + show: Show, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Show]: + """shows_create + :param show: (required) :type show: Show - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Show, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._shows_create_serialize( + show=show, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "Show", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'show' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def shows_create_without_preload_content( + self, + show: Show, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """shows_create + + + :param show: (required) + :type show: Show + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._shows_create_serialize( + show=show, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method shows_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Show", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _shows_create_serialize( + self, + show, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['show'] is not None: - _body_params = _params['show'] + if show is not None: + _body_params = show + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "Show", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/shows', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/shows', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def shows_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show.")], **kwargs) -> None: # noqa: E501 - """shows_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.shows_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def shows_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """shows_destroy + :param id: A unique integer value identifying this show. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the shows_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.shows_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def shows_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show.")], **kwargs) -> ApiResponse: # noqa: E501 - """shows_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.shows_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._shows_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def shows_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """shows_destroy + :param id: A unique integer value identifying this show. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._shows_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def shows_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """shows_destroy + + + :param id: A unique integer value identifying this show. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._shows_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method shows_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _shows_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/shows/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/shows/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def shows_list(self, **kwargs) -> List[Show]: # noqa: E501 - """shows_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.shows_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def shows_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Show]: + """shows_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[Show] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the shows_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.shows_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def shows_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """shows_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.shows_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._shows_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Show]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def shows_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Show]]: + """shows_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[Show], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._shows_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Show]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def shows_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """shows_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._shows_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method shows_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Show]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _shows_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[Show]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/shows', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/shows', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def shows_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show.")], patched_show : Optional[PatchedShow] = None, **kwargs) -> Show: # noqa: E501 - """shows_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.shows_partial_update(id, patched_show, async_req=True) - >>> result = thread.get() + + @validate_call + def shows_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show.")], + patched_show: Optional[PatchedShow] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Show: + """shows_partial_update + :param id: A unique integer value identifying this show. (required) :type id: int :param patched_show: :type patched_show: PatchedShow - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Show - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the shows_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.shows_partial_update_with_http_info(id, patched_show, **kwargs) # noqa: E501 - - @validate_arguments - def shows_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show.")], patched_show : Optional[PatchedShow] = None, **kwargs) -> ApiResponse: # noqa: E501 - """shows_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.shows_partial_update_with_http_info(id, patched_show, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._shows_partial_update_serialize( + id=id, + patched_show=patched_show, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Show", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def shows_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show.")], + patched_show: Optional[PatchedShow] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Show]: + """shows_partial_update + :param id: A unique integer value identifying this show. (required) :type id: int :param patched_show: :type patched_show: PatchedShow - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Show, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._shows_partial_update_serialize( + id=id, + patched_show=patched_show, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Show", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_show' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def shows_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show.")], + patched_show: Optional[PatchedShow] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """shows_partial_update + + + :param id: A unique integer value identifying this show. (required) + :type id: int + :param patched_show: + :type patched_show: PatchedShow + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._shows_partial_update_serialize( + id=id, + patched_show=patched_show, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method shows_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Show", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _shows_partial_update_serialize( + self, + id, + patched_show, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_show'] is not None: - _body_params = _params['patched_show'] + if patched_show is not None: + _body_params = patched_show + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Show", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/shows/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/shows/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def shows_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show.")], **kwargs) -> Show: # noqa: E501 - """shows_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.shows_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def shows_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Show: + """shows_retrieve + :param id: A unique integer value identifying this show. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Show - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the shows_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.shows_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def shows_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show.")], **kwargs) -> ApiResponse: # noqa: E501 - """shows_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.shows_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._shows_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Show", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def shows_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Show]: + """shows_retrieve + :param id: A unique integer value identifying this show. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Show, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._shows_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Show", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def shows_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """shows_retrieve + + + :param id: A unique integer value identifying this show. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._shows_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method shows_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Show", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _shows_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "Show", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/shows/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/shows/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def shows_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show.")], show : Show, **kwargs) -> Show: # noqa: E501 - """shows_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.shows_update(id, show, async_req=True) - >>> result = thread.get() + + @validate_call + def shows_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show.")], + show: Show, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Show: + """shows_update + :param id: A unique integer value identifying this show. (required) :type id: int :param show: (required) :type show: Show - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Show - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the shows_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.shows_update_with_http_info(id, show, **kwargs) # noqa: E501 - - @validate_arguments - def shows_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this show.")], show : Show, **kwargs) -> ApiResponse: # noqa: E501 - """shows_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.shows_update_with_http_info(id, show, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._shows_update_serialize( + id=id, + show=show, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Show", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def shows_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show.")], + show: Show, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Show]: + """shows_update + :param id: A unique integer value identifying this show. (required) :type id: int :param show: (required) :type show: Show - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Show, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._shows_update_serialize( + id=id, + show=show, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Show", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'show' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def shows_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this show.")], + show: Show, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """shows_update + + + :param id: A unique integer value identifying this show. (required) + :type id: int + :param show: (required) + :type show: Show + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._shows_update_serialize( + id=id, + show=show, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method shows_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Show", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _shows_update_serialize( + self, + id, + show, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['show'] is not None: - _body_params = _params['show'] + if show is not None: + _body_params = show + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Show", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/shows/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/shows/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/smart_block_contents_api.py b/python-client/libretime_client/api/smart_block_contents_api.py index d4c91800..e924b84a 100644 --- a/python-client/libretime_client/api/smart_block_contents_api.py +++ b/python-client/libretime_client/api/smart_block_contents_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_smart_block_content import PatchedSmartBlockContent from libretime_client.models.smart_block_content import SmartBlockContent -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class SmartBlockContentsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def smart_block_contents_create(self, smart_block_content : SmartBlockContent, **kwargs) -> SmartBlockContent: # noqa: E501 - """smart_block_contents_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def smart_block_contents_create( + self, + smart_block_content: SmartBlockContent, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SmartBlockContent: + """smart_block_contents_create - >>> thread = api.smart_block_contents_create(smart_block_content, async_req=True) - >>> result = thread.get() :param smart_block_content: (required) :type smart_block_content: SmartBlockContent - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SmartBlockContent - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_block_contents_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_block_contents_create_with_http_info(smart_block_content, **kwargs) # noqa: E501 - - @validate_arguments - def smart_block_contents_create_with_http_info(self, smart_block_content : SmartBlockContent, **kwargs) -> ApiResponse: # noqa: E501 - """smart_block_contents_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_block_contents_create_with_http_info(smart_block_content, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_block_contents_create_serialize( + smart_block_content=smart_block_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SmartBlockContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_block_contents_create_with_http_info( + self, + smart_block_content: SmartBlockContent, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SmartBlockContent]: + """smart_block_contents_create + :param smart_block_content: (required) :type smart_block_content: SmartBlockContent - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SmartBlockContent, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._smart_block_contents_create_serialize( + smart_block_content=smart_block_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "SmartBlockContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'smart_block_content' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def smart_block_contents_create_without_preload_content( + self, + smart_block_content: SmartBlockContent, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_block_contents_create + + + :param smart_block_content: (required) + :type smart_block_content: SmartBlockContent + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_block_contents_create_serialize( + smart_block_content=smart_block_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_block_contents_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "SmartBlockContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _smart_block_contents_create_serialize( + self, + smart_block_content, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['smart_block_content'] is not None: - _body_params = _params['smart_block_content'] + if smart_block_content is not None: + _body_params = smart_block_content + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "SmartBlockContent", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-block-contents', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/smart-block-contents', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def smart_block_contents_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block content.")], **kwargs) -> None: # noqa: E501 - """smart_block_contents_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_block_contents_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def smart_block_contents_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block content.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """smart_block_contents_destroy + :param id: A unique integer value identifying this smart block content. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_block_contents_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_block_contents_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def smart_block_contents_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block content.")], **kwargs) -> ApiResponse: # noqa: E501 - """smart_block_contents_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_block_contents_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_block_contents_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_block_contents_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block content.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """smart_block_contents_destroy + :param id: A unique integer value identifying this smart block content. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._smart_block_contents_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def smart_block_contents_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block content.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_block_contents_destroy + + + :param id: A unique integer value identifying this smart block content. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_block_contents_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_block_contents_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _smart_block_contents_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/smart-block-contents/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/smart-block-contents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def smart_block_contents_list(self, **kwargs) -> List[SmartBlockContent]: # noqa: E501 - """smart_block_contents_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_block_contents_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def smart_block_contents_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[SmartBlockContent]: + """smart_block_contents_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[SmartBlockContent] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_block_contents_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_block_contents_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def smart_block_contents_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """smart_block_contents_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_block_contents_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._smart_block_contents_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SmartBlockContent]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_block_contents_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[SmartBlockContent]]: + """smart_block_contents_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[SmartBlockContent], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._smart_block_contents_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SmartBlockContent]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def smart_block_contents_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_block_contents_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_block_contents_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_block_contents_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SmartBlockContent]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _smart_block_contents_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[SmartBlockContent]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-block-contents', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/smart-block-contents', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def smart_block_contents_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block content.")], patched_smart_block_content : Optional[PatchedSmartBlockContent] = None, **kwargs) -> SmartBlockContent: # noqa: E501 - """smart_block_contents_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_block_contents_partial_update(id, patched_smart_block_content, async_req=True) - >>> result = thread.get() + + @validate_call + def smart_block_contents_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block content.")], + patched_smart_block_content: Optional[PatchedSmartBlockContent] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SmartBlockContent: + """smart_block_contents_partial_update + :param id: A unique integer value identifying this smart block content. (required) :type id: int :param patched_smart_block_content: :type patched_smart_block_content: PatchedSmartBlockContent - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SmartBlockContent - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_block_contents_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_block_contents_partial_update_with_http_info(id, patched_smart_block_content, **kwargs) # noqa: E501 - - @validate_arguments - def smart_block_contents_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block content.")], patched_smart_block_content : Optional[PatchedSmartBlockContent] = None, **kwargs) -> ApiResponse: # noqa: E501 - """smart_block_contents_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_block_contents_partial_update_with_http_info(id, patched_smart_block_content, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_block_contents_partial_update_serialize( + id=id, + patched_smart_block_content=patched_smart_block_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_block_contents_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block content.")], + patched_smart_block_content: Optional[PatchedSmartBlockContent] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SmartBlockContent]: + """smart_block_contents_partial_update + :param id: A unique integer value identifying this smart block content. (required) :type id: int :param patched_smart_block_content: :type patched_smart_block_content: PatchedSmartBlockContent - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SmartBlockContent, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._smart_block_contents_partial_update_serialize( + id=id, + patched_smart_block_content=patched_smart_block_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_smart_block_content' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def smart_block_contents_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block content.")], + patched_smart_block_content: Optional[PatchedSmartBlockContent] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_block_contents_partial_update + + + :param id: A unique integer value identifying this smart block content. (required) + :type id: int + :param patched_smart_block_content: + :type patched_smart_block_content: PatchedSmartBlockContent + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_block_contents_partial_update_serialize( + id=id, + patched_smart_block_content=patched_smart_block_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_block_contents_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _smart_block_contents_partial_update_serialize( + self, + id, + patched_smart_block_content, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_smart_block_content'] is not None: - _body_params = _params['patched_smart_block_content'] + if patched_smart_block_content is not None: + _body_params = patched_smart_block_content + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "SmartBlockContent", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-block-contents/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/smart-block-contents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def smart_block_contents_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block content.")], **kwargs) -> SmartBlockContent: # noqa: E501 - """smart_block_contents_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_block_contents_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def smart_block_contents_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block content.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SmartBlockContent: + """smart_block_contents_retrieve + :param id: A unique integer value identifying this smart block content. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SmartBlockContent - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_block_contents_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_block_contents_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def smart_block_contents_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block content.")], **kwargs) -> ApiResponse: # noqa: E501 - """smart_block_contents_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_block_contents_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_block_contents_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_block_contents_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block content.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SmartBlockContent]: + """smart_block_contents_retrieve + :param id: A unique integer value identifying this smart block content. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SmartBlockContent, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._smart_block_contents_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def smart_block_contents_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block content.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_block_contents_retrieve + + + :param id: A unique integer value identifying this smart block content. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_block_contents_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_block_contents_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _smart_block_contents_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "SmartBlockContent", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-block-contents/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/smart-block-contents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def smart_block_contents_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block content.")], smart_block_content : SmartBlockContent, **kwargs) -> SmartBlockContent: # noqa: E501 - """smart_block_contents_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_block_contents_update(id, smart_block_content, async_req=True) - >>> result = thread.get() + + @validate_call + def smart_block_contents_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block content.")], + smart_block_content: SmartBlockContent, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SmartBlockContent: + """smart_block_contents_update + :param id: A unique integer value identifying this smart block content. (required) :type id: int :param smart_block_content: (required) :type smart_block_content: SmartBlockContent - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SmartBlockContent - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_block_contents_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_block_contents_update_with_http_info(id, smart_block_content, **kwargs) # noqa: E501 - - @validate_arguments - def smart_block_contents_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block content.")], smart_block_content : SmartBlockContent, **kwargs) -> ApiResponse: # noqa: E501 - """smart_block_contents_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_block_contents_update_with_http_info(id, smart_block_content, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_block_contents_update_serialize( + id=id, + smart_block_content=smart_block_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_block_contents_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block content.")], + smart_block_content: SmartBlockContent, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SmartBlockContent]: + """smart_block_contents_update + :param id: A unique integer value identifying this smart block content. (required) :type id: int :param smart_block_content: (required) :type smart_block_content: SmartBlockContent - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SmartBlockContent, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._smart_block_contents_update_serialize( + id=id, + smart_block_content=smart_block_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'smart_block_content' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def smart_block_contents_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block content.")], + smart_block_content: SmartBlockContent, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_block_contents_update + + + :param id: A unique integer value identifying this smart block content. (required) + :type id: int + :param smart_block_content: (required) + :type smart_block_content: SmartBlockContent + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_block_contents_update_serialize( + id=id, + smart_block_content=smart_block_content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_block_contents_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockContent", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _smart_block_contents_update_serialize( + self, + id, + smart_block_content, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['smart_block_content'] is not None: - _body_params = _params['smart_block_content'] + if smart_block_content is not None: + _body_params = smart_block_content + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "SmartBlockContent", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-block-contents/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/smart-block-contents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/smart_block_criteria_api.py b/python-client/libretime_client/api/smart_block_criteria_api.py index 3b3544cf..3b2bfc1f 100644 --- a/python-client/libretime_client/api/smart_block_criteria_api.py +++ b/python-client/libretime_client/api/smart_block_criteria_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_smart_block_criteria import PatchedSmartBlockCriteria from libretime_client.models.smart_block_criteria import SmartBlockCriteria -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class SmartBlockCriteriaApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def smart_block_criteria_create(self, smart_block_criteria : SmartBlockCriteria, **kwargs) -> SmartBlockCriteria: # noqa: E501 - """smart_block_criteria_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def smart_block_criteria_create( + self, + smart_block_criteria: SmartBlockCriteria, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SmartBlockCriteria: + """smart_block_criteria_create - >>> thread = api.smart_block_criteria_create(smart_block_criteria, async_req=True) - >>> result = thread.get() :param smart_block_criteria: (required) :type smart_block_criteria: SmartBlockCriteria - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SmartBlockCriteria - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_block_criteria_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_block_criteria_create_with_http_info(smart_block_criteria, **kwargs) # noqa: E501 - - @validate_arguments - def smart_block_criteria_create_with_http_info(self, smart_block_criteria : SmartBlockCriteria, **kwargs) -> ApiResponse: # noqa: E501 - """smart_block_criteria_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_block_criteria_create_with_http_info(smart_block_criteria, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_block_criteria_create_serialize( + smart_block_criteria=smart_block_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SmartBlockCriteria", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_block_criteria_create_with_http_info( + self, + smart_block_criteria: SmartBlockCriteria, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SmartBlockCriteria]: + """smart_block_criteria_create + :param smart_block_criteria: (required) :type smart_block_criteria: SmartBlockCriteria - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SmartBlockCriteria, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._smart_block_criteria_create_serialize( + smart_block_criteria=smart_block_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "SmartBlockCriteria", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'smart_block_criteria' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def smart_block_criteria_create_without_preload_content( + self, + smart_block_criteria: SmartBlockCriteria, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_block_criteria_create + + + :param smart_block_criteria: (required) + :type smart_block_criteria: SmartBlockCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_block_criteria_create_serialize( + smart_block_criteria=smart_block_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_block_criteria_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "SmartBlockCriteria", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _smart_block_criteria_create_serialize( + self, + smart_block_criteria, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['smart_block_criteria'] is not None: - _body_params = _params['smart_block_criteria'] + if smart_block_criteria is not None: + _body_params = smart_block_criteria + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "SmartBlockCriteria", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-block-criteria', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/smart-block-criteria', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def smart_block_criteria_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block criteria.")], **kwargs) -> None: # noqa: E501 - """smart_block_criteria_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_block_criteria_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def smart_block_criteria_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block criteria.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """smart_block_criteria_destroy + :param id: A unique integer value identifying this smart block criteria. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_block_criteria_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_block_criteria_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def smart_block_criteria_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block criteria.")], **kwargs) -> ApiResponse: # noqa: E501 - """smart_block_criteria_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_block_criteria_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_block_criteria_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_block_criteria_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block criteria.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """smart_block_criteria_destroy + :param id: A unique integer value identifying this smart block criteria. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._smart_block_criteria_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def smart_block_criteria_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block criteria.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_block_criteria_destroy + + + :param id: A unique integer value identifying this smart block criteria. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_block_criteria_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_block_criteria_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _smart_block_criteria_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/smart-block-criteria/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/smart-block-criteria/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def smart_block_criteria_list(self, **kwargs) -> List[SmartBlockCriteria]: # noqa: E501 - """smart_block_criteria_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_block_criteria_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def smart_block_criteria_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[SmartBlockCriteria]: + """smart_block_criteria_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[SmartBlockCriteria] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_block_criteria_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_block_criteria_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def smart_block_criteria_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """smart_block_criteria_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_block_criteria_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._smart_block_criteria_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SmartBlockCriteria]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_block_criteria_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[SmartBlockCriteria]]: + """smart_block_criteria_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[SmartBlockCriteria], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._smart_block_criteria_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SmartBlockCriteria]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def smart_block_criteria_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_block_criteria_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_block_criteria_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_block_criteria_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SmartBlockCriteria]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _smart_block_criteria_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[SmartBlockCriteria]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-block-criteria', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/smart-block-criteria', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def smart_block_criteria_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block criteria.")], patched_smart_block_criteria : Optional[PatchedSmartBlockCriteria] = None, **kwargs) -> SmartBlockCriteria: # noqa: E501 - """smart_block_criteria_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_block_criteria_partial_update(id, patched_smart_block_criteria, async_req=True) - >>> result = thread.get() + + @validate_call + def smart_block_criteria_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block criteria.")], + patched_smart_block_criteria: Optional[PatchedSmartBlockCriteria] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SmartBlockCriteria: + """smart_block_criteria_partial_update + :param id: A unique integer value identifying this smart block criteria. (required) :type id: int :param patched_smart_block_criteria: :type patched_smart_block_criteria: PatchedSmartBlockCriteria - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SmartBlockCriteria - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_block_criteria_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_block_criteria_partial_update_with_http_info(id, patched_smart_block_criteria, **kwargs) # noqa: E501 - - @validate_arguments - def smart_block_criteria_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block criteria.")], patched_smart_block_criteria : Optional[PatchedSmartBlockCriteria] = None, **kwargs) -> ApiResponse: # noqa: E501 - """smart_block_criteria_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_block_criteria_partial_update_with_http_info(id, patched_smart_block_criteria, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_block_criteria_partial_update_serialize( + id=id, + patched_smart_block_criteria=patched_smart_block_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockCriteria", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_block_criteria_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block criteria.")], + patched_smart_block_criteria: Optional[PatchedSmartBlockCriteria] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SmartBlockCriteria]: + """smart_block_criteria_partial_update + :param id: A unique integer value identifying this smart block criteria. (required) :type id: int :param patched_smart_block_criteria: :type patched_smart_block_criteria: PatchedSmartBlockCriteria - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SmartBlockCriteria, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._smart_block_criteria_partial_update_serialize( + id=id, + patched_smart_block_criteria=patched_smart_block_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockCriteria", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_smart_block_criteria' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def smart_block_criteria_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block criteria.")], + patched_smart_block_criteria: Optional[PatchedSmartBlockCriteria] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_block_criteria_partial_update + + + :param id: A unique integer value identifying this smart block criteria. (required) + :type id: int + :param patched_smart_block_criteria: + :type patched_smart_block_criteria: PatchedSmartBlockCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_block_criteria_partial_update_serialize( + id=id, + patched_smart_block_criteria=patched_smart_block_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_block_criteria_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockCriteria", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _smart_block_criteria_partial_update_serialize( + self, + id, + patched_smart_block_criteria, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_smart_block_criteria'] is not None: - _body_params = _params['patched_smart_block_criteria'] + if patched_smart_block_criteria is not None: + _body_params = patched_smart_block_criteria + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "SmartBlockCriteria", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-block-criteria/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/smart-block-criteria/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def smart_block_criteria_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block criteria.")], **kwargs) -> SmartBlockCriteria: # noqa: E501 - """smart_block_criteria_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_block_criteria_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def smart_block_criteria_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block criteria.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SmartBlockCriteria: + """smart_block_criteria_retrieve + :param id: A unique integer value identifying this smart block criteria. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SmartBlockCriteria - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_block_criteria_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_block_criteria_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def smart_block_criteria_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block criteria.")], **kwargs) -> ApiResponse: # noqa: E501 - """smart_block_criteria_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_block_criteria_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_block_criteria_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockCriteria", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_block_criteria_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block criteria.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SmartBlockCriteria]: + """smart_block_criteria_retrieve + :param id: A unique integer value identifying this smart block criteria. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SmartBlockCriteria, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._smart_block_criteria_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockCriteria", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def smart_block_criteria_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block criteria.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_block_criteria_retrieve + + + :param id: A unique integer value identifying this smart block criteria. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_block_criteria_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_block_criteria_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockCriteria", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _smart_block_criteria_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "SmartBlockCriteria", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-block-criteria/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/smart-block-criteria/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def smart_block_criteria_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block criteria.")], smart_block_criteria : SmartBlockCriteria, **kwargs) -> SmartBlockCriteria: # noqa: E501 - """smart_block_criteria_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_block_criteria_update(id, smart_block_criteria, async_req=True) - >>> result = thread.get() + + @validate_call + def smart_block_criteria_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block criteria.")], + smart_block_criteria: SmartBlockCriteria, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SmartBlockCriteria: + """smart_block_criteria_update + :param id: A unique integer value identifying this smart block criteria. (required) :type id: int :param smart_block_criteria: (required) :type smart_block_criteria: SmartBlockCriteria - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SmartBlockCriteria - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_block_criteria_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_block_criteria_update_with_http_info(id, smart_block_criteria, **kwargs) # noqa: E501 - - @validate_arguments - def smart_block_criteria_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block criteria.")], smart_block_criteria : SmartBlockCriteria, **kwargs) -> ApiResponse: # noqa: E501 - """smart_block_criteria_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_block_criteria_update_with_http_info(id, smart_block_criteria, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_block_criteria_update_serialize( + id=id, + smart_block_criteria=smart_block_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockCriteria", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_block_criteria_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block criteria.")], + smart_block_criteria: SmartBlockCriteria, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SmartBlockCriteria]: + """smart_block_criteria_update + :param id: A unique integer value identifying this smart block criteria. (required) :type id: int :param smart_block_criteria: (required) :type smart_block_criteria: SmartBlockCriteria - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SmartBlockCriteria, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._smart_block_criteria_update_serialize( + id=id, + smart_block_criteria=smart_block_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockCriteria", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'smart_block_criteria' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def smart_block_criteria_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block criteria.")], + smart_block_criteria: SmartBlockCriteria, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_block_criteria_update + + + :param id: A unique integer value identifying this smart block criteria. (required) + :type id: int + :param smart_block_criteria: (required) + :type smart_block_criteria: SmartBlockCriteria + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_block_criteria_update_serialize( + id=id, + smart_block_criteria=smart_block_criteria, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_block_criteria_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlockCriteria", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _smart_block_criteria_update_serialize( + self, + id, + smart_block_criteria, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['smart_block_criteria'] is not None: - _body_params = _params['smart_block_criteria'] + if smart_block_criteria is not None: + _body_params = smart_block_criteria + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "SmartBlockCriteria", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-block-criteria/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/smart-block-criteria/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/smart_blocks_api.py b/python-client/libretime_client/api/smart_blocks_api.py index 4ec64b3b..9af00309 100644 --- a/python-client/libretime_client/api/smart_blocks_api.py +++ b/python-client/libretime_client/api/smart_blocks_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_smart_block import PatchedSmartBlock from libretime_client.models.smart_block import SmartBlock -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class SmartBlocksApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def smart_blocks_create(self, smart_block : SmartBlock, **kwargs) -> SmartBlock: # noqa: E501 - """smart_blocks_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def smart_blocks_create( + self, + smart_block: SmartBlock, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SmartBlock: + """smart_blocks_create - >>> thread = api.smart_blocks_create(smart_block, async_req=True) - >>> result = thread.get() :param smart_block: (required) :type smart_block: SmartBlock - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SmartBlock - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_blocks_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_blocks_create_with_http_info(smart_block, **kwargs) # noqa: E501 - - @validate_arguments - def smart_blocks_create_with_http_info(self, smart_block : SmartBlock, **kwargs) -> ApiResponse: # noqa: E501 - """smart_blocks_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_blocks_create_with_http_info(smart_block, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_blocks_create_serialize( + smart_block=smart_block, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SmartBlock", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_blocks_create_with_http_info( + self, + smart_block: SmartBlock, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SmartBlock]: + """smart_blocks_create + :param smart_block: (required) :type smart_block: SmartBlock - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SmartBlock, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._smart_blocks_create_serialize( + smart_block=smart_block, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "SmartBlock", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'smart_block' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def smart_blocks_create_without_preload_content( + self, + smart_block: SmartBlock, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_blocks_create + + + :param smart_block: (required) + :type smart_block: SmartBlock + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_blocks_create_serialize( + smart_block=smart_block, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_blocks_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "SmartBlock", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _smart_blocks_create_serialize( + self, + smart_block, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['smart_block'] is not None: - _body_params = _params['smart_block'] + if smart_block is not None: + _body_params = smart_block + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "SmartBlock", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-blocks', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/smart-blocks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def smart_blocks_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block.")], **kwargs) -> None: # noqa: E501 - """smart_blocks_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_blocks_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def smart_blocks_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """smart_blocks_destroy + :param id: A unique integer value identifying this smart block. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_blocks_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_blocks_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def smart_blocks_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block.")], **kwargs) -> ApiResponse: # noqa: E501 - """smart_blocks_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_blocks_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_blocks_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_blocks_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """smart_blocks_destroy + :param id: A unique integer value identifying this smart block. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._smart_blocks_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def smart_blocks_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_blocks_destroy + + + :param id: A unique integer value identifying this smart block. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_blocks_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_blocks_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _smart_blocks_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/smart-blocks/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/smart-blocks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def smart_blocks_list(self, **kwargs) -> List[SmartBlock]: # noqa: E501 - """smart_blocks_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_blocks_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def smart_blocks_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[SmartBlock]: + """smart_blocks_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[SmartBlock] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_blocks_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_blocks_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def smart_blocks_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """smart_blocks_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_blocks_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._smart_blocks_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SmartBlock]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_blocks_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[SmartBlock]]: + """smart_blocks_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[SmartBlock], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._smart_blocks_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SmartBlock]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def smart_blocks_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_blocks_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_blocks_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_blocks_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SmartBlock]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _smart_blocks_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[SmartBlock]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-blocks', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/smart-blocks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def smart_blocks_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block.")], patched_smart_block : Optional[PatchedSmartBlock] = None, **kwargs) -> SmartBlock: # noqa: E501 - """smart_blocks_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_blocks_partial_update(id, patched_smart_block, async_req=True) - >>> result = thread.get() + + @validate_call + def smart_blocks_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block.")], + patched_smart_block: Optional[PatchedSmartBlock] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SmartBlock: + """smart_blocks_partial_update + :param id: A unique integer value identifying this smart block. (required) :type id: int :param patched_smart_block: :type patched_smart_block: PatchedSmartBlock - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SmartBlock - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_blocks_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_blocks_partial_update_with_http_info(id, patched_smart_block, **kwargs) # noqa: E501 - - @validate_arguments - def smart_blocks_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block.")], patched_smart_block : Optional[PatchedSmartBlock] = None, **kwargs) -> ApiResponse: # noqa: E501 - """smart_blocks_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_blocks_partial_update_with_http_info(id, patched_smart_block, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_blocks_partial_update_serialize( + id=id, + patched_smart_block=patched_smart_block, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlock", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_blocks_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block.")], + patched_smart_block: Optional[PatchedSmartBlock] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SmartBlock]: + """smart_blocks_partial_update + :param id: A unique integer value identifying this smart block. (required) :type id: int :param patched_smart_block: :type patched_smart_block: PatchedSmartBlock - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SmartBlock, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._smart_blocks_partial_update_serialize( + id=id, + patched_smart_block=patched_smart_block, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlock", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_smart_block' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def smart_blocks_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block.")], + patched_smart_block: Optional[PatchedSmartBlock] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_blocks_partial_update + + + :param id: A unique integer value identifying this smart block. (required) + :type id: int + :param patched_smart_block: + :type patched_smart_block: PatchedSmartBlock + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_blocks_partial_update_serialize( + id=id, + patched_smart_block=patched_smart_block, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_blocks_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlock", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _smart_blocks_partial_update_serialize( + self, + id, + patched_smart_block, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_smart_block'] is not None: - _body_params = _params['patched_smart_block'] + if patched_smart_block is not None: + _body_params = patched_smart_block + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "SmartBlock", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-blocks/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/smart-blocks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def smart_blocks_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block.")], **kwargs) -> SmartBlock: # noqa: E501 - """smart_blocks_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_blocks_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def smart_blocks_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SmartBlock: + """smart_blocks_retrieve + :param id: A unique integer value identifying this smart block. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SmartBlock - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_blocks_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_blocks_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def smart_blocks_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block.")], **kwargs) -> ApiResponse: # noqa: E501 - """smart_blocks_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_blocks_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_blocks_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlock", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_blocks_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SmartBlock]: + """smart_blocks_retrieve + :param id: A unique integer value identifying this smart block. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SmartBlock, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._smart_blocks_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlock", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def smart_blocks_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_blocks_retrieve + + + :param id: A unique integer value identifying this smart block. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_blocks_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_blocks_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlock", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _smart_blocks_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "SmartBlock", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-blocks/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/smart-blocks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def smart_blocks_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block.")], smart_block : SmartBlock, **kwargs) -> SmartBlock: # noqa: E501 - """smart_blocks_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.smart_blocks_update(id, smart_block, async_req=True) - >>> result = thread.get() + + @validate_call + def smart_blocks_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block.")], + smart_block: SmartBlock, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SmartBlock: + """smart_blocks_update + :param id: A unique integer value identifying this smart block. (required) :type id: int :param smart_block: (required) :type smart_block: SmartBlock - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SmartBlock - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the smart_blocks_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.smart_blocks_update_with_http_info(id, smart_block, **kwargs) # noqa: E501 - - @validate_arguments - def smart_blocks_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this smart block.")], smart_block : SmartBlock, **kwargs) -> ApiResponse: # noqa: E501 - """smart_blocks_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.smart_blocks_update_with_http_info(id, smart_block, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._smart_blocks_update_serialize( + id=id, + smart_block=smart_block, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlock", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def smart_blocks_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block.")], + smart_block: SmartBlock, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SmartBlock]: + """smart_blocks_update + :param id: A unique integer value identifying this smart block. (required) :type id: int :param smart_block: (required) :type smart_block: SmartBlock - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SmartBlock, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._smart_blocks_update_serialize( + id=id, + smart_block=smart_block, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlock", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'smart_block' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def smart_blocks_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this smart block.")], + smart_block: SmartBlock, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """smart_blocks_update + + + :param id: A unique integer value identifying this smart block. (required) + :type id: int + :param smart_block: (required) + :type smart_block: SmartBlock + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._smart_blocks_update_serialize( + id=id, + smart_block=smart_block, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method smart_blocks_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SmartBlock", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _smart_blocks_update_serialize( + self, + id, + smart_block, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['smart_block'] is not None: - _body_params = _params['smart_block'] + if smart_block is not None: + _body_params = smart_block + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "SmartBlock", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/smart-blocks/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/smart-blocks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/station_podcasts_api.py b/python-client/libretime_client/api/station_podcasts_api.py index 207ca119..79322c08 100644 --- a/python-client/libretime_client/api/station_podcasts_api.py +++ b/python-client/libretime_client/api/station_podcasts_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_station_podcast import PatchedStationPodcast from libretime_client.models.station_podcast import StationPodcast -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class StationPodcastsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def station_podcasts_create(self, station_podcast : StationPodcast, **kwargs) -> StationPodcast: # noqa: E501 - """station_podcasts_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def station_podcasts_create( + self, + station_podcast: StationPodcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StationPodcast: + """station_podcasts_create - >>> thread = api.station_podcasts_create(station_podcast, async_req=True) - >>> result = thread.get() :param station_podcast: (required) :type station_podcast: StationPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StationPodcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the station_podcasts_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.station_podcasts_create_with_http_info(station_podcast, **kwargs) # noqa: E501 - - @validate_arguments - def station_podcasts_create_with_http_info(self, station_podcast : StationPodcast, **kwargs) -> ApiResponse: # noqa: E501 - """station_podcasts_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.station_podcasts_create_with_http_info(station_podcast, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._station_podcasts_create_serialize( + station_podcast=station_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "StationPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def station_podcasts_create_with_http_info( + self, + station_podcast: StationPodcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StationPodcast]: + """station_podcasts_create + :param station_podcast: (required) :type station_podcast: StationPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StationPodcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._station_podcasts_create_serialize( + station_podcast=station_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "StationPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'station_podcast' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def station_podcasts_create_without_preload_content( + self, + station_podcast: StationPodcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """station_podcasts_create + + + :param station_podcast: (required) + :type station_podcast: StationPodcast + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._station_podcasts_create_serialize( + station_podcast=station_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method station_podcasts_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "StationPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _station_podcasts_create_serialize( + self, + station_podcast, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['station_podcast'] is not None: - _body_params = _params['station_podcast'] + if station_podcast is not None: + _body_params = station_podcast + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "StationPodcast", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/station-podcasts', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/station-podcasts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def station_podcasts_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this station podcast.")], **kwargs) -> None: # noqa: E501 - """station_podcasts_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.station_podcasts_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def station_podcasts_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this station podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """station_podcasts_destroy + :param id: A unique integer value identifying this station podcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the station_podcasts_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.station_podcasts_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def station_podcasts_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this station podcast.")], **kwargs) -> ApiResponse: # noqa: E501 - """station_podcasts_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.station_podcasts_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._station_podcasts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def station_podcasts_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this station podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """station_podcasts_destroy + :param id: A unique integer value identifying this station podcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._station_podcasts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def station_podcasts_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this station podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """station_podcasts_destroy + + + :param id: A unique integer value identifying this station podcast. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._station_podcasts_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method station_podcasts_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _station_podcasts_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/station-podcasts/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/station-podcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def station_podcasts_list(self, **kwargs) -> List[StationPodcast]: # noqa: E501 - """station_podcasts_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.station_podcasts_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def station_podcasts_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[StationPodcast]: + """station_podcasts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[StationPodcast] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the station_podcasts_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.station_podcasts_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def station_podcasts_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """station_podcasts_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.station_podcasts_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._station_podcasts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[StationPodcast]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def station_podcasts_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[StationPodcast]]: + """station_podcasts_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[StationPodcast], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._station_podcasts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[StationPodcast]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def station_podcasts_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """station_podcasts_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._station_podcasts_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method station_podcasts_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[StationPodcast]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _station_podcasts_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[StationPodcast]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/station-podcasts', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/station-podcasts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def station_podcasts_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this station podcast.")], patched_station_podcast : Optional[PatchedStationPodcast] = None, **kwargs) -> StationPodcast: # noqa: E501 - """station_podcasts_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.station_podcasts_partial_update(id, patched_station_podcast, async_req=True) - >>> result = thread.get() + + @validate_call + def station_podcasts_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this station podcast.")], + patched_station_podcast: Optional[PatchedStationPodcast] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StationPodcast: + """station_podcasts_partial_update + :param id: A unique integer value identifying this station podcast. (required) :type id: int :param patched_station_podcast: :type patched_station_podcast: PatchedStationPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StationPodcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the station_podcasts_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.station_podcasts_partial_update_with_http_info(id, patched_station_podcast, **kwargs) # noqa: E501 - - @validate_arguments - def station_podcasts_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this station podcast.")], patched_station_podcast : Optional[PatchedStationPodcast] = None, **kwargs) -> ApiResponse: # noqa: E501 - """station_podcasts_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.station_podcasts_partial_update_with_http_info(id, patched_station_podcast, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._station_podcasts_partial_update_serialize( + id=id, + patched_station_podcast=patched_station_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StationPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def station_podcasts_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this station podcast.")], + patched_station_podcast: Optional[PatchedStationPodcast] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StationPodcast]: + """station_podcasts_partial_update + :param id: A unique integer value identifying this station podcast. (required) :type id: int :param patched_station_podcast: :type patched_station_podcast: PatchedStationPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StationPodcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._station_podcasts_partial_update_serialize( + id=id, + patched_station_podcast=patched_station_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "StationPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_station_podcast' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def station_podcasts_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this station podcast.")], + patched_station_podcast: Optional[PatchedStationPodcast] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """station_podcasts_partial_update + + + :param id: A unique integer value identifying this station podcast. (required) + :type id: int + :param patched_station_podcast: + :type patched_station_podcast: PatchedStationPodcast + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._station_podcasts_partial_update_serialize( + id=id, + patched_station_podcast=patched_station_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method station_podcasts_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StationPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _station_podcasts_partial_update_serialize( + self, + id, + patched_station_podcast, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_station_podcast'] is not None: - _body_params = _params['patched_station_podcast'] + if patched_station_podcast is not None: + _body_params = patched_station_podcast + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "StationPodcast", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/station-podcasts/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/station-podcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def station_podcasts_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this station podcast.")], **kwargs) -> StationPodcast: # noqa: E501 - """station_podcasts_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.station_podcasts_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def station_podcasts_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this station podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StationPodcast: + """station_podcasts_retrieve + :param id: A unique integer value identifying this station podcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StationPodcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the station_podcasts_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.station_podcasts_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def station_podcasts_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this station podcast.")], **kwargs) -> ApiResponse: # noqa: E501 - """station_podcasts_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.station_podcasts_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._station_podcasts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StationPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def station_podcasts_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this station podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StationPodcast]: + """station_podcasts_retrieve + :param id: A unique integer value identifying this station podcast. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StationPodcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._station_podcasts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StationPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def station_podcasts_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this station podcast.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """station_podcasts_retrieve + + + :param id: A unique integer value identifying this station podcast. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._station_podcasts_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method station_podcasts_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StationPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _station_podcasts_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "StationPodcast", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/station-podcasts/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/station-podcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def station_podcasts_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this station podcast.")], station_podcast : StationPodcast, **kwargs) -> StationPodcast: # noqa: E501 - """station_podcasts_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.station_podcasts_update(id, station_podcast, async_req=True) - >>> result = thread.get() + + @validate_call + def station_podcasts_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this station podcast.")], + station_podcast: StationPodcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StationPodcast: + """station_podcasts_update + :param id: A unique integer value identifying this station podcast. (required) :type id: int :param station_podcast: (required) :type station_podcast: StationPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StationPodcast - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the station_podcasts_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.station_podcasts_update_with_http_info(id, station_podcast, **kwargs) # noqa: E501 - - @validate_arguments - def station_podcasts_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this station podcast.")], station_podcast : StationPodcast, **kwargs) -> ApiResponse: # noqa: E501 - """station_podcasts_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.station_podcasts_update_with_http_info(id, station_podcast, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._station_podcasts_update_serialize( + id=id, + station_podcast=station_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StationPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def station_podcasts_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this station podcast.")], + station_podcast: StationPodcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StationPodcast]: + """station_podcasts_update + :param id: A unique integer value identifying this station podcast. (required) :type id: int :param station_podcast: (required) :type station_podcast: StationPodcast - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StationPodcast, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._station_podcasts_update_serialize( + id=id, + station_podcast=station_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "StationPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'station_podcast' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def station_podcasts_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this station podcast.")], + station_podcast: StationPodcast, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """station_podcasts_update + + + :param id: A unique integer value identifying this station podcast. (required) + :type id: int + :param station_podcast: (required) + :type station_podcast: StationPodcast + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._station_podcasts_update_serialize( + id=id, + station_podcast=station_podcast, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method station_podcasts_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StationPodcast", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _station_podcasts_update_serialize( + self, + id, + station_podcast, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['station_podcast'] is not None: - _body_params = _params['station_podcast'] + if station_podcast is not None: + _body_params = station_podcast + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "StationPodcast", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/station-podcasts/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/station-podcasts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/stream_api.py b/python-client/libretime_client/api/stream_api.py index 9b4d2791..ea4d022e 100644 --- a/python-client/libretime_client/api/stream_api.py +++ b/python-client/libretime_client/api/stream_api.py @@ -11,22 +11,17 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated from libretime_client.models.stream_preferences import StreamPreferences from libretime_client.models.stream_state import StreamState -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class StreamApi: @@ -41,262 +36,484 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def stream_preferences_retrieve(self, **kwargs) -> StreamPreferences: # noqa: E501 - """stream_preferences_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def stream_preferences_retrieve( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StreamPreferences: + """stream_preferences_retrieve - >>> thread = api.stream_preferences_retrieve(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StreamPreferences - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the stream_preferences_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.stream_preferences_retrieve_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def stream_preferences_retrieve_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """stream_preferences_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.stream_preferences_retrieve_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._stream_preferences_retrieve_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StreamPreferences", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def stream_preferences_retrieve_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StreamPreferences]: + """stream_preferences_retrieve + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StreamPreferences, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._stream_preferences_retrieve_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "StreamPreferences", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def stream_preferences_retrieve_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """stream_preferences_retrieve + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stream_preferences_retrieve_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method stream_preferences_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StreamPreferences", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _stream_preferences_retrieve_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "StreamPreferences", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/stream/preferences', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/stream/preferences', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def stream_state_retrieve(self, **kwargs) -> StreamState: # noqa: E501 - """stream_state_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.stream_state_retrieve(async_req=True) - >>> result = thread.get() + @validate_call + def stream_state_retrieve( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StreamState: + """stream_state_retrieve + - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StreamState - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the stream_state_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.stream_state_retrieve_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def stream_state_retrieve_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """stream_state_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.stream_state_retrieve_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._stream_state_retrieve_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StreamState", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def stream_state_retrieve_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StreamState]: + """stream_state_retrieve + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StreamState, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._stream_state_retrieve_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "StreamState", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def stream_state_retrieve_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """stream_state_retrieve + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stream_state_retrieve_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method stream_state_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StreamState", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _stream_state_retrieve_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "StreamState", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/stream/state', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/stream/state', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/third_party_track_references_api.py b/python-client/libretime_client/api/third_party_track_references_api.py index 6fb72b4d..0bdb59ba 100644 --- a/python-client/libretime_client/api/third_party_track_references_api.py +++ b/python-client/libretime_client/api/third_party_track_references_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_third_party_track_reference import PatchedThirdPartyTrackReference from libretime_client.models.third_party_track_reference import ThirdPartyTrackReference -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class ThirdPartyTrackReferencesApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def third_party_track_references_create(self, third_party_track_reference : ThirdPartyTrackReference, **kwargs) -> ThirdPartyTrackReference: # noqa: E501 - """third_party_track_references_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def third_party_track_references_create( + self, + third_party_track_reference: ThirdPartyTrackReference, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ThirdPartyTrackReference: + """third_party_track_references_create - >>> thread = api.third_party_track_references_create(third_party_track_reference, async_req=True) - >>> result = thread.get() :param third_party_track_reference: (required) :type third_party_track_reference: ThirdPartyTrackReference - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ThirdPartyTrackReference - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the third_party_track_references_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.third_party_track_references_create_with_http_info(third_party_track_reference, **kwargs) # noqa: E501 - - @validate_arguments - def third_party_track_references_create_with_http_info(self, third_party_track_reference : ThirdPartyTrackReference, **kwargs) -> ApiResponse: # noqa: E501 - """third_party_track_references_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.third_party_track_references_create_with_http_info(third_party_track_reference, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._third_party_track_references_create_serialize( + third_party_track_reference=third_party_track_reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ThirdPartyTrackReference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def third_party_track_references_create_with_http_info( + self, + third_party_track_reference: ThirdPartyTrackReference, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ThirdPartyTrackReference]: + """third_party_track_references_create + :param third_party_track_reference: (required) :type third_party_track_reference: ThirdPartyTrackReference - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ThirdPartyTrackReference, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._third_party_track_references_create_serialize( + third_party_track_reference=third_party_track_reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "ThirdPartyTrackReference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'third_party_track_reference' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def third_party_track_references_create_without_preload_content( + self, + third_party_track_reference: ThirdPartyTrackReference, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """third_party_track_references_create + + + :param third_party_track_reference: (required) + :type third_party_track_reference: ThirdPartyTrackReference + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._third_party_track_references_create_serialize( + third_party_track_reference=third_party_track_reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method third_party_track_references_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "ThirdPartyTrackReference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _third_party_track_references_create_serialize( + self, + third_party_track_reference, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['third_party_track_reference'] is not None: - _body_params = _params['third_party_track_reference'] + if third_party_track_reference is not None: + _body_params = third_party_track_reference + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "ThirdPartyTrackReference", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/third-party-track-references', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/third-party-track-references', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def third_party_track_references_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this third party track reference.")], **kwargs) -> None: # noqa: E501 - """third_party_track_references_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.third_party_track_references_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def third_party_track_references_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this third party track reference.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """third_party_track_references_destroy + :param id: A unique integer value identifying this third party track reference. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the third_party_track_references_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.third_party_track_references_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def third_party_track_references_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this third party track reference.")], **kwargs) -> ApiResponse: # noqa: E501 - """third_party_track_references_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.third_party_track_references_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._third_party_track_references_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def third_party_track_references_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this third party track reference.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """third_party_track_references_destroy + :param id: A unique integer value identifying this third party track reference. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._third_party_track_references_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def third_party_track_references_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this third party track reference.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """third_party_track_references_destroy + + + :param id: A unique integer value identifying this third party track reference. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._third_party_track_references_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method third_party_track_references_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _third_party_track_references_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/third-party-track-references/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/third-party-track-references/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def third_party_track_references_list(self, **kwargs) -> List[ThirdPartyTrackReference]: # noqa: E501 - """third_party_track_references_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.third_party_track_references_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def third_party_track_references_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ThirdPartyTrackReference]: + """third_party_track_references_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[ThirdPartyTrackReference] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the third_party_track_references_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.third_party_track_references_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def third_party_track_references_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """third_party_track_references_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.third_party_track_references_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._third_party_track_references_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ThirdPartyTrackReference]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def third_party_track_references_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ThirdPartyTrackReference]]: + """third_party_track_references_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[ThirdPartyTrackReference], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._third_party_track_references_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ThirdPartyTrackReference]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def third_party_track_references_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """third_party_track_references_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._third_party_track_references_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method third_party_track_references_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ThirdPartyTrackReference]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _third_party_track_references_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[ThirdPartyTrackReference]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/third-party-track-references', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/third-party-track-references', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def third_party_track_references_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this third party track reference.")], patched_third_party_track_reference : Optional[PatchedThirdPartyTrackReference] = None, **kwargs) -> ThirdPartyTrackReference: # noqa: E501 - """third_party_track_references_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.third_party_track_references_partial_update(id, patched_third_party_track_reference, async_req=True) - >>> result = thread.get() + + @validate_call + def third_party_track_references_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this third party track reference.")], + patched_third_party_track_reference: Optional[PatchedThirdPartyTrackReference] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ThirdPartyTrackReference: + """third_party_track_references_partial_update + :param id: A unique integer value identifying this third party track reference. (required) :type id: int :param patched_third_party_track_reference: :type patched_third_party_track_reference: PatchedThirdPartyTrackReference - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ThirdPartyTrackReference - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the third_party_track_references_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.third_party_track_references_partial_update_with_http_info(id, patched_third_party_track_reference, **kwargs) # noqa: E501 - - @validate_arguments - def third_party_track_references_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this third party track reference.")], patched_third_party_track_reference : Optional[PatchedThirdPartyTrackReference] = None, **kwargs) -> ApiResponse: # noqa: E501 - """third_party_track_references_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.third_party_track_references_partial_update_with_http_info(id, patched_third_party_track_reference, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._third_party_track_references_partial_update_serialize( + id=id, + patched_third_party_track_reference=patched_third_party_track_reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ThirdPartyTrackReference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def third_party_track_references_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this third party track reference.")], + patched_third_party_track_reference: Optional[PatchedThirdPartyTrackReference] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ThirdPartyTrackReference]: + """third_party_track_references_partial_update + :param id: A unique integer value identifying this third party track reference. (required) :type id: int :param patched_third_party_track_reference: :type patched_third_party_track_reference: PatchedThirdPartyTrackReference - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ThirdPartyTrackReference, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._third_party_track_references_partial_update_serialize( + id=id, + patched_third_party_track_reference=patched_third_party_track_reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ThirdPartyTrackReference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_third_party_track_reference' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def third_party_track_references_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this third party track reference.")], + patched_third_party_track_reference: Optional[PatchedThirdPartyTrackReference] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """third_party_track_references_partial_update + + + :param id: A unique integer value identifying this third party track reference. (required) + :type id: int + :param patched_third_party_track_reference: + :type patched_third_party_track_reference: PatchedThirdPartyTrackReference + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._third_party_track_references_partial_update_serialize( + id=id, + patched_third_party_track_reference=patched_third_party_track_reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method third_party_track_references_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ThirdPartyTrackReference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _third_party_track_references_partial_update_serialize( + self, + id, + patched_third_party_track_reference, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_third_party_track_reference'] is not None: - _body_params = _params['patched_third_party_track_reference'] + if patched_third_party_track_reference is not None: + _body_params = patched_third_party_track_reference + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ThirdPartyTrackReference", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/third-party-track-references/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/third-party-track-references/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def third_party_track_references_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this third party track reference.")], **kwargs) -> ThirdPartyTrackReference: # noqa: E501 - """third_party_track_references_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.third_party_track_references_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def third_party_track_references_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this third party track reference.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ThirdPartyTrackReference: + """third_party_track_references_retrieve + :param id: A unique integer value identifying this third party track reference. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ThirdPartyTrackReference - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the third_party_track_references_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.third_party_track_references_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def third_party_track_references_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this third party track reference.")], **kwargs) -> ApiResponse: # noqa: E501 - """third_party_track_references_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.third_party_track_references_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._third_party_track_references_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ThirdPartyTrackReference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def third_party_track_references_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this third party track reference.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ThirdPartyTrackReference]: + """third_party_track_references_retrieve + :param id: A unique integer value identifying this third party track reference. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ThirdPartyTrackReference, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._third_party_track_references_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ThirdPartyTrackReference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def third_party_track_references_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this third party track reference.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """third_party_track_references_retrieve + + + :param id: A unique integer value identifying this third party track reference. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._third_party_track_references_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method third_party_track_references_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ThirdPartyTrackReference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _third_party_track_references_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "ThirdPartyTrackReference", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/third-party-track-references/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/third-party-track-references/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def third_party_track_references_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this third party track reference.")], third_party_track_reference : ThirdPartyTrackReference, **kwargs) -> ThirdPartyTrackReference: # noqa: E501 - """third_party_track_references_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.third_party_track_references_update(id, third_party_track_reference, async_req=True) - >>> result = thread.get() + + @validate_call + def third_party_track_references_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this third party track reference.")], + third_party_track_reference: ThirdPartyTrackReference, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ThirdPartyTrackReference: + """third_party_track_references_update + :param id: A unique integer value identifying this third party track reference. (required) :type id: int :param third_party_track_reference: (required) :type third_party_track_reference: ThirdPartyTrackReference - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ThirdPartyTrackReference - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the third_party_track_references_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.third_party_track_references_update_with_http_info(id, third_party_track_reference, **kwargs) # noqa: E501 - - @validate_arguments - def third_party_track_references_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this third party track reference.")], third_party_track_reference : ThirdPartyTrackReference, **kwargs) -> ApiResponse: # noqa: E501 - """third_party_track_references_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.third_party_track_references_update_with_http_info(id, third_party_track_reference, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._third_party_track_references_update_serialize( + id=id, + third_party_track_reference=third_party_track_reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ThirdPartyTrackReference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def third_party_track_references_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this third party track reference.")], + third_party_track_reference: ThirdPartyTrackReference, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ThirdPartyTrackReference]: + """third_party_track_references_update + :param id: A unique integer value identifying this third party track reference. (required) :type id: int :param third_party_track_reference: (required) :type third_party_track_reference: ThirdPartyTrackReference - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ThirdPartyTrackReference, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._third_party_track_references_update_serialize( + id=id, + third_party_track_reference=third_party_track_reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ThirdPartyTrackReference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'third_party_track_reference' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def third_party_track_references_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this third party track reference.")], + third_party_track_reference: ThirdPartyTrackReference, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """third_party_track_references_update + + + :param id: A unique integer value identifying this third party track reference. (required) + :type id: int + :param third_party_track_reference: (required) + :type third_party_track_reference: ThirdPartyTrackReference + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._third_party_track_references_update_serialize( + id=id, + third_party_track_reference=third_party_track_reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method third_party_track_references_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ThirdPartyTrackReference", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _third_party_track_references_update_serialize( + self, + id, + third_party_track_reference, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['third_party_track_reference'] is not None: - _body_params = _params['third_party_track_reference'] + if third_party_track_reference is not None: + _body_params = third_party_track_reference + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "ThirdPartyTrackReference", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/third-party-track-references/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/third-party-track-references/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/timestamps_api.py b/python-client/libretime_client/api/timestamps_api.py index 266b3664..b297ebe0 100644 --- a/python-client/libretime_client/api/timestamps_api.py +++ b/python-client/libretime_client/api/timestamps_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_timestamp import PatchedTimestamp from libretime_client.models.timestamp import Timestamp -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class TimestampsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def timestamps_create(self, timestamp : Timestamp, **kwargs) -> Timestamp: # noqa: E501 - """timestamps_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def timestamps_create( + self, + timestamp: Timestamp, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Timestamp: + """timestamps_create - >>> thread = api.timestamps_create(timestamp, async_req=True) - >>> result = thread.get() :param timestamp: (required) :type timestamp: Timestamp - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Timestamp - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the timestamps_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.timestamps_create_with_http_info(timestamp, **kwargs) # noqa: E501 - - @validate_arguments - def timestamps_create_with_http_info(self, timestamp : Timestamp, **kwargs) -> ApiResponse: # noqa: E501 - """timestamps_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.timestamps_create_with_http_info(timestamp, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._timestamps_create_serialize( + timestamp=timestamp, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Timestamp", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def timestamps_create_with_http_info( + self, + timestamp: Timestamp, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Timestamp]: + """timestamps_create + :param timestamp: (required) :type timestamp: Timestamp - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Timestamp, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._timestamps_create_serialize( + timestamp=timestamp, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "Timestamp", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'timestamp' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def timestamps_create_without_preload_content( + self, + timestamp: Timestamp, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """timestamps_create + + + :param timestamp: (required) + :type timestamp: Timestamp + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._timestamps_create_serialize( + timestamp=timestamp, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method timestamps_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Timestamp", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _timestamps_create_serialize( + self, + timestamp, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['timestamp'] is not None: - _body_params = _params['timestamp'] + if timestamp is not None: + _body_params = timestamp + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "Timestamp", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/timestamps', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/timestamps', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def timestamps_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this timestamp.")], **kwargs) -> None: # noqa: E501 - """timestamps_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.timestamps_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def timestamps_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this timestamp.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """timestamps_destroy + :param id: A unique integer value identifying this timestamp. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the timestamps_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.timestamps_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def timestamps_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this timestamp.")], **kwargs) -> ApiResponse: # noqa: E501 - """timestamps_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.timestamps_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._timestamps_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def timestamps_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this timestamp.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """timestamps_destroy + :param id: A unique integer value identifying this timestamp. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._timestamps_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def timestamps_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this timestamp.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """timestamps_destroy + + + :param id: A unique integer value identifying this timestamp. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._timestamps_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method timestamps_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _timestamps_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/timestamps/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/timestamps/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def timestamps_list(self, **kwargs) -> List[Timestamp]: # noqa: E501 - """timestamps_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.timestamps_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def timestamps_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Timestamp]: + """timestamps_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[Timestamp] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the timestamps_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.timestamps_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def timestamps_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """timestamps_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.timestamps_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._timestamps_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Timestamp]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def timestamps_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Timestamp]]: + """timestamps_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[Timestamp], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._timestamps_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Timestamp]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def timestamps_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """timestamps_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._timestamps_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method timestamps_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Timestamp]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _timestamps_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[Timestamp]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/timestamps', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/timestamps', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def timestamps_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this timestamp.")], patched_timestamp : Optional[PatchedTimestamp] = None, **kwargs) -> Timestamp: # noqa: E501 - """timestamps_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.timestamps_partial_update(id, patched_timestamp, async_req=True) - >>> result = thread.get() + + @validate_call + def timestamps_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this timestamp.")], + patched_timestamp: Optional[PatchedTimestamp] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Timestamp: + """timestamps_partial_update + :param id: A unique integer value identifying this timestamp. (required) :type id: int :param patched_timestamp: :type patched_timestamp: PatchedTimestamp - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Timestamp - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the timestamps_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.timestamps_partial_update_with_http_info(id, patched_timestamp, **kwargs) # noqa: E501 - - @validate_arguments - def timestamps_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this timestamp.")], patched_timestamp : Optional[PatchedTimestamp] = None, **kwargs) -> ApiResponse: # noqa: E501 - """timestamps_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.timestamps_partial_update_with_http_info(id, patched_timestamp, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._timestamps_partial_update_serialize( + id=id, + patched_timestamp=patched_timestamp, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Timestamp", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def timestamps_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this timestamp.")], + patched_timestamp: Optional[PatchedTimestamp] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Timestamp]: + """timestamps_partial_update + :param id: A unique integer value identifying this timestamp. (required) :type id: int :param patched_timestamp: :type patched_timestamp: PatchedTimestamp - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Timestamp, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._timestamps_partial_update_serialize( + id=id, + patched_timestamp=patched_timestamp, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Timestamp", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_timestamp' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def timestamps_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this timestamp.")], + patched_timestamp: Optional[PatchedTimestamp] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """timestamps_partial_update + + + :param id: A unique integer value identifying this timestamp. (required) + :type id: int + :param patched_timestamp: + :type patched_timestamp: PatchedTimestamp + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._timestamps_partial_update_serialize( + id=id, + patched_timestamp=patched_timestamp, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method timestamps_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Timestamp", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _timestamps_partial_update_serialize( + self, + id, + patched_timestamp, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_timestamp'] is not None: - _body_params = _params['patched_timestamp'] + if patched_timestamp is not None: + _body_params = patched_timestamp + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Timestamp", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/timestamps/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/timestamps/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def timestamps_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this timestamp.")], **kwargs) -> Timestamp: # noqa: E501 - """timestamps_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.timestamps_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def timestamps_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this timestamp.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Timestamp: + """timestamps_retrieve + :param id: A unique integer value identifying this timestamp. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Timestamp - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the timestamps_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.timestamps_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def timestamps_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this timestamp.")], **kwargs) -> ApiResponse: # noqa: E501 - """timestamps_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.timestamps_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._timestamps_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Timestamp", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def timestamps_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this timestamp.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Timestamp]: + """timestamps_retrieve + :param id: A unique integer value identifying this timestamp. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Timestamp, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._timestamps_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Timestamp", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def timestamps_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this timestamp.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """timestamps_retrieve + + + :param id: A unique integer value identifying this timestamp. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._timestamps_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method timestamps_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Timestamp", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _timestamps_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "Timestamp", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/timestamps/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/timestamps/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def timestamps_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this timestamp.")], timestamp : Timestamp, **kwargs) -> Timestamp: # noqa: E501 - """timestamps_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.timestamps_update(id, timestamp, async_req=True) - >>> result = thread.get() + + @validate_call + def timestamps_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this timestamp.")], + timestamp: Timestamp, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Timestamp: + """timestamps_update + :param id: A unique integer value identifying this timestamp. (required) :type id: int :param timestamp: (required) :type timestamp: Timestamp - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Timestamp - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the timestamps_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.timestamps_update_with_http_info(id, timestamp, **kwargs) # noqa: E501 - - @validate_arguments - def timestamps_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this timestamp.")], timestamp : Timestamp, **kwargs) -> ApiResponse: # noqa: E501 - """timestamps_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.timestamps_update_with_http_info(id, timestamp, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._timestamps_update_serialize( + id=id, + timestamp=timestamp, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Timestamp", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def timestamps_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this timestamp.")], + timestamp: Timestamp, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Timestamp]: + """timestamps_update + :param id: A unique integer value identifying this timestamp. (required) :type id: int :param timestamp: (required) :type timestamp: Timestamp - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Timestamp, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._timestamps_update_serialize( + id=id, + timestamp=timestamp, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Timestamp", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'timestamp' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def timestamps_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this timestamp.")], + timestamp: Timestamp, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """timestamps_update + + + :param id: A unique integer value identifying this timestamp. (required) + :type id: int + :param timestamp: (required) + :type timestamp: Timestamp + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._timestamps_update_serialize( + id=id, + timestamp=timestamp, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method timestamps_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Timestamp", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _timestamps_update_serialize( + self, + id, + timestamp, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['timestamp'] is not None: - _body_params = _params['timestamp'] + if timestamp is not None: + _body_params = timestamp + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Timestamp", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/timestamps/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/timestamps/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/user_tokens_api.py b/python-client/libretime_client/api/user_tokens_api.py index 8a37cf40..b9430516 100644 --- a/python-client/libretime_client/api/user_tokens_api.py +++ b/python-client/libretime_client/api/user_tokens_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_user_token import PatchedUserToken from libretime_client.models.user_token import UserToken -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class UserTokensApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def user_tokens_create(self, user_token : UserToken, **kwargs) -> UserToken: # noqa: E501 - """user_tokens_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def user_tokens_create( + self, + user_token: UserToken, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserToken: + """user_tokens_create - >>> thread = api.user_tokens_create(user_token, async_req=True) - >>> result = thread.get() :param user_token: (required) :type user_token: UserToken - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UserToken - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the user_tokens_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.user_tokens_create_with_http_info(user_token, **kwargs) # noqa: E501 - - @validate_arguments - def user_tokens_create_with_http_info(self, user_token : UserToken, **kwargs) -> ApiResponse: # noqa: E501 - """user_tokens_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.user_tokens_create_with_http_info(user_token, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._user_tokens_create_serialize( + user_token=user_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "UserToken", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def user_tokens_create_with_http_info( + self, + user_token: UserToken, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserToken]: + """user_tokens_create + :param user_token: (required) :type user_token: UserToken - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UserToken, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._user_tokens_create_serialize( + user_token=user_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "UserToken", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'user_token' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def user_tokens_create_without_preload_content( + self, + user_token: UserToken, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """user_tokens_create + + + :param user_token: (required) + :type user_token: UserToken + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._user_tokens_create_serialize( + user_token=user_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method user_tokens_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "UserToken", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _user_tokens_create_serialize( + self, + user_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['user_token'] is not None: - _body_params = _params['user_token'] + if user_token is not None: + _body_params = user_token + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "UserToken", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/user-tokens', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/user-tokens', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def user_tokens_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user token.")], **kwargs) -> None: # noqa: E501 - """user_tokens_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.user_tokens_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def user_tokens_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user token.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """user_tokens_destroy + :param id: A unique integer value identifying this user token. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the user_tokens_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.user_tokens_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def user_tokens_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user token.")], **kwargs) -> ApiResponse: # noqa: E501 - """user_tokens_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.user_tokens_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._user_tokens_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def user_tokens_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user token.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """user_tokens_destroy + :param id: A unique integer value identifying this user token. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._user_tokens_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def user_tokens_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user token.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """user_tokens_destroy + + + :param id: A unique integer value identifying this user token. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._user_tokens_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method user_tokens_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _user_tokens_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/user-tokens/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/user-tokens/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def user_tokens_list(self, **kwargs) -> List[UserToken]: # noqa: E501 - """user_tokens_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.user_tokens_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def user_tokens_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[UserToken]: + """user_tokens_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[UserToken] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the user_tokens_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.user_tokens_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def user_tokens_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """user_tokens_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.user_tokens_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._user_tokens_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserToken]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def user_tokens_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[UserToken]]: + """user_tokens_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[UserToken], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._user_tokens_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserToken]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def user_tokens_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """user_tokens_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._user_tokens_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method user_tokens_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserToken]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _user_tokens_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[UserToken]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/user-tokens', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/user-tokens', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def user_tokens_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user token.")], patched_user_token : Optional[PatchedUserToken] = None, **kwargs) -> UserToken: # noqa: E501 - """user_tokens_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.user_tokens_partial_update(id, patched_user_token, async_req=True) - >>> result = thread.get() + + @validate_call + def user_tokens_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user token.")], + patched_user_token: Optional[PatchedUserToken] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserToken: + """user_tokens_partial_update + :param id: A unique integer value identifying this user token. (required) :type id: int :param patched_user_token: :type patched_user_token: PatchedUserToken - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UserToken - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the user_tokens_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.user_tokens_partial_update_with_http_info(id, patched_user_token, **kwargs) # noqa: E501 - - @validate_arguments - def user_tokens_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user token.")], patched_user_token : Optional[PatchedUserToken] = None, **kwargs) -> ApiResponse: # noqa: E501 - """user_tokens_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.user_tokens_partial_update_with_http_info(id, patched_user_token, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._user_tokens_partial_update_serialize( + id=id, + patched_user_token=patched_user_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserToken", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def user_tokens_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user token.")], + patched_user_token: Optional[PatchedUserToken] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserToken]: + """user_tokens_partial_update + :param id: A unique integer value identifying this user token. (required) :type id: int :param patched_user_token: :type patched_user_token: PatchedUserToken - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UserToken, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._user_tokens_partial_update_serialize( + id=id, + patched_user_token=patched_user_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserToken", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_user_token' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def user_tokens_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user token.")], + patched_user_token: Optional[PatchedUserToken] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """user_tokens_partial_update + + + :param id: A unique integer value identifying this user token. (required) + :type id: int + :param patched_user_token: + :type patched_user_token: PatchedUserToken + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._user_tokens_partial_update_serialize( + id=id, + patched_user_token=patched_user_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method user_tokens_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserToken", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _user_tokens_partial_update_serialize( + self, + id, + patched_user_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_user_token'] is not None: - _body_params = _params['patched_user_token'] + if patched_user_token is not None: + _body_params = patched_user_token + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "UserToken", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/user-tokens/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/user-tokens/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def user_tokens_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user token.")], **kwargs) -> UserToken: # noqa: E501 - """user_tokens_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.user_tokens_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def user_tokens_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user token.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserToken: + """user_tokens_retrieve + :param id: A unique integer value identifying this user token. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UserToken - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the user_tokens_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.user_tokens_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def user_tokens_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user token.")], **kwargs) -> ApiResponse: # noqa: E501 - """user_tokens_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.user_tokens_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._user_tokens_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserToken", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def user_tokens_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user token.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserToken]: + """user_tokens_retrieve + :param id: A unique integer value identifying this user token. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UserToken, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._user_tokens_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserToken", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def user_tokens_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user token.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """user_tokens_retrieve + + + :param id: A unique integer value identifying this user token. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._user_tokens_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method user_tokens_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserToken", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _user_tokens_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "UserToken", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/user-tokens/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/user-tokens/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def user_tokens_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user token.")], user_token : UserToken, **kwargs) -> UserToken: # noqa: E501 - """user_tokens_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.user_tokens_update(id, user_token, async_req=True) - >>> result = thread.get() + + @validate_call + def user_tokens_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user token.")], + user_token: UserToken, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserToken: + """user_tokens_update + :param id: A unique integer value identifying this user token. (required) :type id: int :param user_token: (required) :type user_token: UserToken - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UserToken - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the user_tokens_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.user_tokens_update_with_http_info(id, user_token, **kwargs) # noqa: E501 - - @validate_arguments - def user_tokens_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user token.")], user_token : UserToken, **kwargs) -> ApiResponse: # noqa: E501 - """user_tokens_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.user_tokens_update_with_http_info(id, user_token, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._user_tokens_update_serialize( + id=id, + user_token=user_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserToken", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def user_tokens_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user token.")], + user_token: UserToken, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserToken]: + """user_tokens_update + :param id: A unique integer value identifying this user token. (required) :type id: int :param user_token: (required) :type user_token: UserToken - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UserToken, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._user_tokens_update_serialize( + id=id, + user_token=user_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserToken", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'user_token' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def user_tokens_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user token.")], + user_token: UserToken, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """user_tokens_update + + + :param id: A unique integer value identifying this user token. (required) + :type id: int + :param user_token: (required) + :type user_token: UserToken + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._user_tokens_update_serialize( + id=id, + user_token=user_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method user_tokens_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserToken", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _user_tokens_update_serialize( + self, + id, + user_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['user_token'] is not None: - _body_params = _params['user_token'] + if user_token is not None: + _body_params = user_token + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "UserToken", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/user-tokens/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/user-tokens/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/users_api.py b/python-client/libretime_client/api/users_api.py index a9907451..f9033b28 100644 --- a/python-client/libretime_client/api/users_api.py +++ b/python-client/libretime_client/api/users_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_user import PatchedUser from libretime_client.models.user import User -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class UsersApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def users_create(self, user : User, **kwargs) -> User: # noqa: E501 - """users_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def users_create( + self, + user: User, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """users_create - >>> thread = api.users_create(user, async_req=True) - >>> result = thread.get() :param user: (required) :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: User - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the users_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.users_create_with_http_info(user, **kwargs) # noqa: E501 - - @validate_arguments - def users_create_with_http_info(self, user : User, **kwargs) -> ApiResponse: # noqa: E501 - """users_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.users_create_with_http_info(user, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._users_create_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def users_create_with_http_info( + self, + user: User, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """users_create + :param user: (required) :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._users_create_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'user' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def users_create_without_preload_content( + self, + user: User, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """users_create + + + :param user: (required) + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._users_create_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method users_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _users_create_serialize( + self, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['user'] is not None: - _body_params = _params['user'] + if user is not None: + _body_params = user + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "User", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/users', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def users_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user.")], **kwargs) -> None: # noqa: E501 - """users_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.users_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def users_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """users_destroy + :param id: A unique integer value identifying this user. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the users_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.users_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def users_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user.")], **kwargs) -> ApiResponse: # noqa: E501 - """users_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.users_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._users_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def users_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """users_destroy + :param id: A unique integer value identifying this user. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._users_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def users_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """users_destroy + + + :param id: A unique integer value identifying this user. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._users_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method users_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _users_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/users/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/users/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def users_list(self, **kwargs) -> List[User]: # noqa: E501 - """users_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.users_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def users_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[User]: + """users_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[User] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the users_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.users_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def users_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """users_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.users_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._users_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[User]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def users_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[User]]: + """users_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[User], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._users_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[User]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def users_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """users_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._users_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method users_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[User]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _users_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[User]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/users', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def users_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user.")], patched_user : Optional[PatchedUser] = None, **kwargs) -> User: # noqa: E501 - """users_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.users_partial_update(id, patched_user, async_req=True) - >>> result = thread.get() + + @validate_call + def users_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user.")], + patched_user: Optional[PatchedUser] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """users_partial_update + :param id: A unique integer value identifying this user. (required) :type id: int :param patched_user: :type patched_user: PatchedUser - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: User - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the users_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.users_partial_update_with_http_info(id, patched_user, **kwargs) # noqa: E501 - - @validate_arguments - def users_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user.")], patched_user : Optional[PatchedUser] = None, **kwargs) -> ApiResponse: # noqa: E501 - """users_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.users_partial_update_with_http_info(id, patched_user, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._users_partial_update_serialize( + id=id, + patched_user=patched_user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def users_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user.")], + patched_user: Optional[PatchedUser] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """users_partial_update + :param id: A unique integer value identifying this user. (required) :type id: int :param patched_user: :type patched_user: PatchedUser - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._users_partial_update_serialize( + id=id, + patched_user=patched_user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_user' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def users_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user.")], + patched_user: Optional[PatchedUser] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """users_partial_update + + + :param id: A unique integer value identifying this user. (required) + :type id: int + :param patched_user: + :type patched_user: PatchedUser + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._users_partial_update_serialize( + id=id, + patched_user=patched_user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method users_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _users_partial_update_serialize( + self, + id, + patched_user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_user'] is not None: - _body_params = _params['patched_user'] + if patched_user is not None: + _body_params = patched_user + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "User", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/users/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/users/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def users_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user.")], **kwargs) -> User: # noqa: E501 - """users_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.users_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def users_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """users_retrieve + :param id: A unique integer value identifying this user. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: User - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the users_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.users_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def users_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user.")], **kwargs) -> ApiResponse: # noqa: E501 - """users_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.users_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._users_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def users_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """users_retrieve + :param id: A unique integer value identifying this user. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._users_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def users_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """users_retrieve + + + :param id: A unique integer value identifying this user. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._users_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method users_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _users_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "User", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/users/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/users/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def users_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user.")], user : User, **kwargs) -> User: # noqa: E501 - """users_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.users_update(id, user, async_req=True) - >>> result = thread.get() + + @validate_call + def users_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user.")], + user: User, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """users_update + :param id: A unique integer value identifying this user. (required) :type id: int :param user: (required) :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: User - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the users_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.users_update_with_http_info(id, user, **kwargs) # noqa: E501 - - @validate_arguments - def users_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this user.")], user : User, **kwargs) -> ApiResponse: # noqa: E501 - """users_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.users_update_with_http_info(id, user, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._users_update_serialize( + id=id, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def users_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user.")], + user: User, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """users_update + :param id: A unique integer value identifying this user. (required) :type id: int :param user: (required) :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._users_update_serialize( + id=id, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'user' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def users_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this user.")], + user: User, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """users_update + + + :param id: A unique integer value identifying this user. (required) + :type id: int + :param user: (required) + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._users_update_serialize( + id=id, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method users_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _users_update_serialize( + self, + id, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['user'] is not None: - _body_params = _params['user'] + if user is not None: + _body_params = user + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "User", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/users/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/users/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/version_api.py b/python-client/libretime_client/api/version_api.py index 5d3befb9..fe1ee036 100644 --- a/python-client/libretime_client/api/version_api.py +++ b/python-client/libretime_client/api/version_api.py @@ -11,21 +11,16 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated from libretime_client.models.version import Version -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class VersionApi: @@ -40,132 +35,243 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def version_retrieve(self, **kwargs) -> Version: # noqa: E501 - """version_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def version_retrieve( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Version: + """version_retrieve - >>> thread = api.version_retrieve(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Version - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the version_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.version_retrieve_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def version_retrieve_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """version_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.version_retrieve_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._version_retrieve_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Version", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def version_retrieve_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Version]: + """version_retrieve + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Version, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._version_retrieve_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "Version", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def version_retrieve_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """version_retrieve + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._version_retrieve_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Version", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method version_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _version_retrieve_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "Version", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/version', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/version', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/webstream_metadata_api.py b/python-client/libretime_client/api/webstream_metadata_api.py index d1d87d40..ae6b4c0d 100644 --- a/python-client/libretime_client/api/webstream_metadata_api.py +++ b/python-client/libretime_client/api/webstream_metadata_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_webstream_metadata import PatchedWebstreamMetadata from libretime_client.models.webstream_metadata import WebstreamMetadata -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class WebstreamMetadataApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def webstream_metadata_create(self, webstream_metadata : WebstreamMetadata, **kwargs) -> WebstreamMetadata: # noqa: E501 - """webstream_metadata_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def webstream_metadata_create( + self, + webstream_metadata: WebstreamMetadata, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebstreamMetadata: + """webstream_metadata_create - >>> thread = api.webstream_metadata_create(webstream_metadata, async_req=True) - >>> result = thread.get() :param webstream_metadata: (required) :type webstream_metadata: WebstreamMetadata - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: WebstreamMetadata - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the webstream_metadata_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.webstream_metadata_create_with_http_info(webstream_metadata, **kwargs) # noqa: E501 - - @validate_arguments - def webstream_metadata_create_with_http_info(self, webstream_metadata : WebstreamMetadata, **kwargs) -> ApiResponse: # noqa: E501 - """webstream_metadata_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.webstream_metadata_create_with_http_info(webstream_metadata, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._webstream_metadata_create_serialize( + webstream_metadata=webstream_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebstreamMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def webstream_metadata_create_with_http_info( + self, + webstream_metadata: WebstreamMetadata, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebstreamMetadata]: + """webstream_metadata_create + :param webstream_metadata: (required) :type webstream_metadata: WebstreamMetadata - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(WebstreamMetadata, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._webstream_metadata_create_serialize( + webstream_metadata=webstream_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebstreamMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'webstream_metadata' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def webstream_metadata_create_without_preload_content( + self, + webstream_metadata: WebstreamMetadata, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """webstream_metadata_create + + + :param webstream_metadata: (required) + :type webstream_metadata: WebstreamMetadata + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webstream_metadata_create_serialize( + webstream_metadata=webstream_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method webstream_metadata_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebstreamMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _webstream_metadata_create_serialize( + self, + webstream_metadata, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['webstream_metadata'] is not None: - _body_params = _params['webstream_metadata'] + if webstream_metadata is not None: + _body_params = webstream_metadata + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "WebstreamMetadata", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/webstream-metadata', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/webstream-metadata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def webstream_metadata_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream metadata.")], **kwargs) -> None: # noqa: E501 - """webstream_metadata_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.webstream_metadata_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def webstream_metadata_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream metadata.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """webstream_metadata_destroy + :param id: A unique integer value identifying this webstream metadata. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the webstream_metadata_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.webstream_metadata_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def webstream_metadata_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream metadata.")], **kwargs) -> ApiResponse: # noqa: E501 - """webstream_metadata_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.webstream_metadata_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._webstream_metadata_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def webstream_metadata_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream metadata.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """webstream_metadata_destroy + :param id: A unique integer value identifying this webstream metadata. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._webstream_metadata_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def webstream_metadata_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream metadata.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """webstream_metadata_destroy + + + :param id: A unique integer value identifying this webstream metadata. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webstream_metadata_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method webstream_metadata_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _webstream_metadata_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/webstream-metadata/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/webstream-metadata/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def webstream_metadata_list(self, **kwargs) -> List[WebstreamMetadata]: # noqa: E501 - """webstream_metadata_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.webstream_metadata_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def webstream_metadata_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[WebstreamMetadata]: + """webstream_metadata_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[WebstreamMetadata] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the webstream_metadata_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.webstream_metadata_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def webstream_metadata_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """webstream_metadata_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.webstream_metadata_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._webstream_metadata_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[WebstreamMetadata]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def webstream_metadata_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[WebstreamMetadata]]: + """webstream_metadata_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[WebstreamMetadata], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._webstream_metadata_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[WebstreamMetadata]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def webstream_metadata_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """webstream_metadata_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webstream_metadata_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method webstream_metadata_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[WebstreamMetadata]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _webstream_metadata_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[WebstreamMetadata]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/webstream-metadata', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/webstream-metadata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def webstream_metadata_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream metadata.")], patched_webstream_metadata : Optional[PatchedWebstreamMetadata] = None, **kwargs) -> WebstreamMetadata: # noqa: E501 - """webstream_metadata_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.webstream_metadata_partial_update(id, patched_webstream_metadata, async_req=True) - >>> result = thread.get() + + @validate_call + def webstream_metadata_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream metadata.")], + patched_webstream_metadata: Optional[PatchedWebstreamMetadata] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebstreamMetadata: + """webstream_metadata_partial_update + :param id: A unique integer value identifying this webstream metadata. (required) :type id: int :param patched_webstream_metadata: :type patched_webstream_metadata: PatchedWebstreamMetadata - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: WebstreamMetadata - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the webstream_metadata_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.webstream_metadata_partial_update_with_http_info(id, patched_webstream_metadata, **kwargs) # noqa: E501 - - @validate_arguments - def webstream_metadata_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream metadata.")], patched_webstream_metadata : Optional[PatchedWebstreamMetadata] = None, **kwargs) -> ApiResponse: # noqa: E501 - """webstream_metadata_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.webstream_metadata_partial_update_with_http_info(id, patched_webstream_metadata, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._webstream_metadata_partial_update_serialize( + id=id, + patched_webstream_metadata=patched_webstream_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebstreamMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def webstream_metadata_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream metadata.")], + patched_webstream_metadata: Optional[PatchedWebstreamMetadata] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebstreamMetadata]: + """webstream_metadata_partial_update + :param id: A unique integer value identifying this webstream metadata. (required) :type id: int :param patched_webstream_metadata: :type patched_webstream_metadata: PatchedWebstreamMetadata - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(WebstreamMetadata, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._webstream_metadata_partial_update_serialize( + id=id, + patched_webstream_metadata=patched_webstream_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebstreamMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_webstream_metadata' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def webstream_metadata_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream metadata.")], + patched_webstream_metadata: Optional[PatchedWebstreamMetadata] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """webstream_metadata_partial_update + + + :param id: A unique integer value identifying this webstream metadata. (required) + :type id: int + :param patched_webstream_metadata: + :type patched_webstream_metadata: PatchedWebstreamMetadata + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webstream_metadata_partial_update_serialize( + id=id, + patched_webstream_metadata=patched_webstream_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method webstream_metadata_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebstreamMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _webstream_metadata_partial_update_serialize( + self, + id, + patched_webstream_metadata, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_webstream_metadata'] is not None: - _body_params = _params['patched_webstream_metadata'] + if patched_webstream_metadata is not None: + _body_params = patched_webstream_metadata + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "WebstreamMetadata", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/webstream-metadata/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/webstream-metadata/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def webstream_metadata_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream metadata.")], **kwargs) -> WebstreamMetadata: # noqa: E501 - """webstream_metadata_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.webstream_metadata_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def webstream_metadata_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream metadata.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebstreamMetadata: + """webstream_metadata_retrieve + :param id: A unique integer value identifying this webstream metadata. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: WebstreamMetadata - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the webstream_metadata_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.webstream_metadata_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def webstream_metadata_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream metadata.")], **kwargs) -> ApiResponse: # noqa: E501 - """webstream_metadata_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.webstream_metadata_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._webstream_metadata_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebstreamMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def webstream_metadata_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream metadata.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebstreamMetadata]: + """webstream_metadata_retrieve + :param id: A unique integer value identifying this webstream metadata. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(WebstreamMetadata, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._webstream_metadata_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebstreamMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def webstream_metadata_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream metadata.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """webstream_metadata_retrieve + + + :param id: A unique integer value identifying this webstream metadata. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webstream_metadata_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method webstream_metadata_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebstreamMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _webstream_metadata_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "WebstreamMetadata", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/webstream-metadata/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/webstream-metadata/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def webstream_metadata_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream metadata.")], webstream_metadata : WebstreamMetadata, **kwargs) -> WebstreamMetadata: # noqa: E501 - """webstream_metadata_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.webstream_metadata_update(id, webstream_metadata, async_req=True) - >>> result = thread.get() + + @validate_call + def webstream_metadata_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream metadata.")], + webstream_metadata: WebstreamMetadata, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebstreamMetadata: + """webstream_metadata_update + :param id: A unique integer value identifying this webstream metadata. (required) :type id: int :param webstream_metadata: (required) :type webstream_metadata: WebstreamMetadata - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: WebstreamMetadata - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the webstream_metadata_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.webstream_metadata_update_with_http_info(id, webstream_metadata, **kwargs) # noqa: E501 - - @validate_arguments - def webstream_metadata_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream metadata.")], webstream_metadata : WebstreamMetadata, **kwargs) -> ApiResponse: # noqa: E501 - """webstream_metadata_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.webstream_metadata_update_with_http_info(id, webstream_metadata, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._webstream_metadata_update_serialize( + id=id, + webstream_metadata=webstream_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebstreamMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def webstream_metadata_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream metadata.")], + webstream_metadata: WebstreamMetadata, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebstreamMetadata]: + """webstream_metadata_update + :param id: A unique integer value identifying this webstream metadata. (required) :type id: int :param webstream_metadata: (required) :type webstream_metadata: WebstreamMetadata - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(WebstreamMetadata, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._webstream_metadata_update_serialize( + id=id, + webstream_metadata=webstream_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebstreamMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'webstream_metadata' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def webstream_metadata_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream metadata.")], + webstream_metadata: WebstreamMetadata, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """webstream_metadata_update + + + :param id: A unique integer value identifying this webstream metadata. (required) + :type id: int + :param webstream_metadata: (required) + :type webstream_metadata: WebstreamMetadata + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webstream_metadata_update_serialize( + id=id, + webstream_metadata=webstream_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method webstream_metadata_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebstreamMetadata", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _webstream_metadata_update_serialize( + self, + id, + webstream_metadata, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['webstream_metadata'] is not None: - _body_params = _params['webstream_metadata'] + if webstream_metadata is not None: + _body_params = webstream_metadata + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "WebstreamMetadata", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/webstream-metadata/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/webstream-metadata/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api/webstreams_api.py b/python-client/libretime_client/api/webstreams_api.py index 9fbfd5e2..1ecaca13 100644 --- a/python-client/libretime_client/api/webstreams_api.py +++ b/python-client/libretime_client/api/webstreams_api.py @@ -11,27 +11,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt - -from typing import List, Optional +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated from libretime_client.models.patched_webstream import PatchedWebstream from libretime_client.models.webstream import Webstream -from libretime_client.api_client import ApiClient +from libretime_client.api_client import ApiClient, RequestSerialized from libretime_client.api_response import ApiResponse -from libretime_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from libretime_client.rest import RESTResponseType class WebstreamsApi: @@ -46,853 +39,1592 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def webstreams_create(self, webstream : Webstream, **kwargs) -> Webstream: # noqa: E501 - """webstreams_create # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def webstreams_create( + self, + webstream: Webstream, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Webstream: + """webstreams_create - >>> thread = api.webstreams_create(webstream, async_req=True) - >>> result = thread.get() :param webstream: (required) :type webstream: Webstream - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Webstream - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the webstreams_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.webstreams_create_with_http_info(webstream, **kwargs) # noqa: E501 - - @validate_arguments - def webstreams_create_with_http_info(self, webstream : Webstream, **kwargs) -> ApiResponse: # noqa: E501 - """webstreams_create # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.webstreams_create_with_http_info(webstream, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._webstreams_create_serialize( + webstream=webstream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Webstream", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def webstreams_create_with_http_info( + self, + webstream: Webstream, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Webstream]: + """webstreams_create + :param webstream: (required) :type webstream: Webstream - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Webstream, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._webstreams_create_serialize( + webstream=webstream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "Webstream", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'webstream' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def webstreams_create_without_preload_content( + self, + webstream: Webstream, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """webstreams_create + + + :param webstream: (required) + :type webstream: Webstream + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webstreams_create_serialize( + webstream=webstream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method webstreams_create" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Webstream", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _webstreams_create_serialize( + self, + webstream, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['webstream'] is not None: - _body_params = _params['webstream'] + if webstream is not None: + _body_params = webstream + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '201': "Webstream", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/webstreams', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/webstreams', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def webstreams_destroy(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream.")], **kwargs) -> None: # noqa: E501 - """webstreams_destroy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.webstreams_destroy(id, async_req=True) - >>> result = thread.get() + @validate_call + def webstreams_destroy( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """webstreams_destroy + :param id: A unique integer value identifying this webstream. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the webstreams_destroy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.webstreams_destroy_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def webstreams_destroy_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream.")], **kwargs) -> ApiResponse: # noqa: E501 - """webstreams_destroy # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.webstreams_destroy_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._webstreams_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def webstreams_destroy_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """webstreams_destroy + :param id: A unique integer value identifying this webstream. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._webstreams_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def webstreams_destroy_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """webstreams_destroy + + + :param id: A unique integer value identifying this webstream. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webstreams_destroy_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method webstreams_destroy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _webstreams_destroy_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v2/webstreams/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/webstreams/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def webstreams_list(self, **kwargs) -> List[Webstream]: # noqa: E501 - """webstreams_list # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.webstreams_list(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def webstreams_list( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Webstream]: + """webstreams_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[Webstream] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the webstreams_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.webstreams_list_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def webstreams_list_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """webstreams_list # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.webstreams_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._webstreams_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Webstream]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def webstreams_list_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Webstream]]: + """webstreams_list + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[Webstream], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._webstreams_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Webstream]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def webstreams_list_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """webstreams_list + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webstreams_list_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method webstreams_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Webstream]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _webstreams_list_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "List[Webstream]", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/webstreams', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/webstreams', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def webstreams_partial_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream.")], patched_webstream : Optional[PatchedWebstream] = None, **kwargs) -> Webstream: # noqa: E501 - """webstreams_partial_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.webstreams_partial_update(id, patched_webstream, async_req=True) - >>> result = thread.get() + + @validate_call + def webstreams_partial_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream.")], + patched_webstream: Optional[PatchedWebstream] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Webstream: + """webstreams_partial_update + :param id: A unique integer value identifying this webstream. (required) :type id: int :param patched_webstream: :type patched_webstream: PatchedWebstream - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Webstream - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the webstreams_partial_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.webstreams_partial_update_with_http_info(id, patched_webstream, **kwargs) # noqa: E501 - - @validate_arguments - def webstreams_partial_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream.")], patched_webstream : Optional[PatchedWebstream] = None, **kwargs) -> ApiResponse: # noqa: E501 - """webstreams_partial_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.webstreams_partial_update_with_http_info(id, patched_webstream, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._webstreams_partial_update_serialize( + id=id, + patched_webstream=patched_webstream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Webstream", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def webstreams_partial_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream.")], + patched_webstream: Optional[PatchedWebstream] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Webstream]: + """webstreams_partial_update + :param id: A unique integer value identifying this webstream. (required) :type id: int :param patched_webstream: :type patched_webstream: PatchedWebstream - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Webstream, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._webstreams_partial_update_serialize( + id=id, + patched_webstream=patched_webstream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Webstream", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'patched_webstream' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def webstreams_partial_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream.")], + patched_webstream: Optional[PatchedWebstream] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """webstreams_partial_update + + + :param id: A unique integer value identifying this webstream. (required) + :type id: int + :param patched_webstream: + :type patched_webstream: PatchedWebstream + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webstreams_partial_update_serialize( + id=id, + patched_webstream=patched_webstream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method webstreams_partial_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Webstream", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _webstreams_partial_update_serialize( + self, + id, + patched_webstream, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_webstream'] is not None: - _body_params = _params['patched_webstream'] + if patched_webstream is not None: + _body_params = patched_webstream + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Webstream", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/webstreams/{id}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v2/webstreams/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def webstreams_retrieve(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream.")], **kwargs) -> Webstream: # noqa: E501 - """webstreams_retrieve # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.webstreams_retrieve(id, async_req=True) - >>> result = thread.get() + @validate_call + def webstreams_retrieve( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Webstream: + """webstreams_retrieve + :param id: A unique integer value identifying this webstream. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Webstream - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the webstreams_retrieve_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.webstreams_retrieve_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def webstreams_retrieve_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream.")], **kwargs) -> ApiResponse: # noqa: E501 - """webstreams_retrieve # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.webstreams_retrieve_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._webstreams_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Webstream", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def webstreams_retrieve_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Webstream]: + """webstreams_retrieve + :param id: A unique integer value identifying this webstream. (required) :type id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Webstream, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._webstreams_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Webstream", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def webstreams_retrieve_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """webstreams_retrieve + + + :param id: A unique integer value identifying this webstream. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webstreams_retrieve_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method webstreams_retrieve" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Webstream", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _webstreams_retrieve_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - _response_types_map = { - '200': "Webstream", - } + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/webstreams/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/webstreams/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def webstreams_update(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream.")], webstream : Webstream, **kwargs) -> Webstream: # noqa: E501 - """webstreams_update # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.webstreams_update(id, webstream, async_req=True) - >>> result = thread.get() + + @validate_call + def webstreams_update( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream.")], + webstream: Webstream, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Webstream: + """webstreams_update + :param id: A unique integer value identifying this webstream. (required) :type id: int :param webstream: (required) :type webstream: Webstream - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Webstream - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the webstreams_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.webstreams_update_with_http_info(id, webstream, **kwargs) # noqa: E501 - - @validate_arguments - def webstreams_update_with_http_info(self, id : Annotated[StrictInt, Field(..., description="A unique integer value identifying this webstream.")], webstream : Webstream, **kwargs) -> ApiResponse: # noqa: E501 - """webstreams_update # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.webstreams_update_with_http_info(id, webstream, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._webstreams_update_serialize( + id=id, + webstream=webstream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Webstream", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def webstreams_update_with_http_info( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream.")], + webstream: Webstream, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Webstream]: + """webstreams_update + :param id: A unique integer value identifying this webstream. (required) :type id: int :param webstream: (required) :type webstream: Webstream - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Webstream, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._webstreams_update_serialize( + id=id, + webstream=webstream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Webstream", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'webstream' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def webstreams_update_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="A unique integer value identifying this webstream.")], + webstream: Webstream, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """webstreams_update + + + :param id: A unique integer value identifying this webstream. (required) + :type id: int + :param webstream: (required) + :type webstream: Webstream + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webstreams_update_serialize( + id=id, + webstream=webstream, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method webstreams_update" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Webstream", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _webstreams_update_serialize( + self, + id, + webstream, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['webstream'] is not None: - _body_params = _params['webstream'] + if webstream is not None: + _body_params = webstream + # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basicAuth', 'cookieAuth'] # noqa: E501 - - _response_types_map = { - '200': "Webstream", - } + _auth_settings: List[str] = [ + 'basicAuth', + 'cookieAuth' + ] - return self.api_client.call_api( - '/api/v2/webstreams/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/v2/webstreams/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-client/libretime_client/api_client.py b/python-client/libretime_client/api_client.py index f108dd03..111cc37f 100644 --- a/python-client/libretime_client/api_client.py +++ b/python-client/libretime_client/api_client.py @@ -12,24 +12,33 @@ """ # noqa: E501 -import atexit import datetime from dateutil.parser import parse +from enum import Enum import json import mimetypes -from multiprocessing.pool import ThreadPool import os import re import tempfile from urllib.parse import quote +from typing import Tuple, Optional, List, Dict from libretime_client.configuration import Configuration -from libretime_client.api_response import ApiResponse +from libretime_client.api_response import ApiResponse, T as ApiResponseT import libretime_client.models from libretime_client import rest -from libretime_client.exceptions import ApiValueError, ApiException - +from libretime_client.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] class ApiClient: """Generic API client for OpenAPI client library builds. @@ -45,8 +54,6 @@ class ApiClient: the API. :param cookie: a cookie to include in the header when making calls to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ PRIMITIVE_TYPES = (float, bool, bytes, str, int) @@ -62,13 +69,17 @@ class ApiClient: } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1) -> None: + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -83,25 +94,7 @@ def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + pass @property def user_agent(self): @@ -142,13 +135,42 @@ def set_default(cls, default): """ cls._default = default - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_types_map=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -159,14 +181,17 @@ def __call_api( header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -178,15 +203,22 @@ def __call_api( if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) post_params.extend(self.files_parameters(files)) # auth setting self.update_params_for_auth( - header_params, query_params, auth_settings, - resource_path, method, body, - request_auth=_request_auth) + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: @@ -202,59 +234,99 @@ def __call_api( # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) - url_query = self.parameters_to_url_query(query_params, - collection_formats) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) url += "?" + url_query + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + try: # perform request and return response - response_data = self.request( + response_data = self.rest_client.request( method, url, - query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + except ApiException as e: - if e.body: - e.body = e.body.decode('utf-8') raise e - self.last_response = response_data - - return_data = None # assuming derialization is not needed - # data needs deserialization or returns HTTP data (deserialized) only - if _preload_content or _return_http_data_only: - response_type = response_types_map.get(str(response_data.status), None) - if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: - # if not found, look for '1XX', '2XX', etc. - response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) - - if response_type == "bytearray": - response_data.data = response_data.data - else: - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) - - # deserialize response data - if response_type == "bytearray": - return_data = response_data.data - elif response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return return_data - else: - return ApiResponse(status_code = response_data.status, - data = return_data, - headers = response_data.getheaders(), - raw_data = response_data.data) + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) def sanitize_for_serialization(self, obj): """Builds a JSON POST object. @@ -275,15 +347,17 @@ def sanitize_for_serialization(self, obj): elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() - if isinstance(obj, dict): + elif isinstance(obj, dict): obj_dict = obj else: # Convert model obj to dict except @@ -293,10 +367,12 @@ def sanitize_for_serialization(self, obj): # model definition for request. obj_dict = obj.to_dict() - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } - def deserialize(self, response, response_type): + def deserialize(self, response_text, response_type): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. @@ -305,16 +381,12 @@ def deserialize(self, response, response_type): :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) # fetch data from response object try: - data = json.loads(response.data) + data = json.loads(response_text) except ValueError: - data = response.data + data = response_text return self.__deserialize(data, response_type) @@ -331,12 +403,16 @@ def __deserialize(self, data, klass): if isinstance(klass, str): if klass.startswith('List['): - sub_kls = re.match(r'List\[(.*)]', klass).group(1) + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('Dict['): - sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2) + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} @@ -354,138 +430,11 @@ def __deserialize(self, data, klass): return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: return self.__deserialize_model(data, klass) - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_types_map=None, auth_settings=None, - async_req=None, _return_http_data_only=None, - collection_formats=None, _preload_content=True, - _request_timeout=None, _host=None, _request_auth=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_token: dict, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_types_map, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _request_auth) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_types_map, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _request_auth)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.get_request(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.head_request(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.options_request(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - elif method == "POST": - return self.rest_client.post_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.put_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.patch_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.delete_request(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -493,10 +442,10 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -523,21 +472,21 @@ def parameters_to_url_query(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: URL query string (e.g. a=Hello%20World&b=123) """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance(v, (int, float)): - v = str(v) + for k, v in params.items() if isinstance(params, dict) else params: if isinstance(v, bool): v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) if isinstance(v, dict): v = json.dumps(v) if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': - new_params.extend((k, value) for value in v) + new_params.extend((k, str(value)) for value in v) else: if collection_format == 'ssv': delimiter = ' ' @@ -548,11 +497,12 @@ def parameters_to_url_query(self, params, collection_formats): else: # csv is the default delimiter = ',' new_params.append( - (k, delimiter.join(quote(str(value)) for value in v))) + (k, delimiter.join(quote(str(value)) for value in v)) + ) else: new_params.append((k, quote(str(v)))) - return "&".join(["=".join(item) for item in new_params]) + return "&".join(["=".join(map(str, item)) for item in new_params]) def files_parameters(self, files=None): """Builds form parameters. @@ -571,21 +521,24 @@ def files_parameters(self, files=None): with open(n, 'rb') as f: filename = os.path.basename(f.name) filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) params.append( - tuple([k, tuple([filename, filedata, mimetype])])) + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None for accept in accepts: if re.search('json', accept, re.IGNORECASE): @@ -608,9 +561,16 @@ def select_header_content_type(self, content_types): return content_types[0] - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, - request_auth=None): + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -627,21 +587,36 @@ def update_params_for_auth(self, headers, queries, auth_settings, return if request_auth: - self._apply_auth_params(headers, queries, - resource_path, method, body, - request_auth) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params(headers, queries, - resource_path, method, body, - auth_setting) - - def _apply_auth_params(self, headers, queries, - resource_path, method, body, - auth_setting): + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: """Updates the request parameters based on a single auth_setting :param headers: Header parameters dict to be updated. @@ -670,6 +645,9 @@ def __deserialize_file(self, response): Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. + handle file downloading + save response body into a tmp file and return the instance + :param response: RESTResponse. :return: file path. """ @@ -679,8 +657,12 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: @@ -747,6 +729,24 @@ def __deserialize_datetime(self, string): ) ) + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + def __deserialize_model(self, data, klass): """Deserializes list or dict to model. diff --git a/python-client/libretime_client/api_response.py b/python-client/libretime_client/api_response.py index a0b62b95..9bc7c11f 100644 --- a/python-client/libretime_client/api_response.py +++ b/python-client/libretime_client/api_response.py @@ -1,25 +1,21 @@ """API response object.""" from __future__ import annotations -from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel -class ApiResponse: +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): """ API response object """ - status_code: Optional[StrictInt] = Field(None, description="HTTP status code") - headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers") - data: Optional[Any] = Field(None, description="Deserialized data given the data type") - raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)") + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") - def __init__(self, - status_code=None, - headers=None, - data=None, - raw_data=None) -> None: - self.status_code = status_code - self.headers = headers - self.data = data - self.raw_data = raw_data + model_config = { + "arbitrary_types_allowed": True + } diff --git a/python-client/libretime_client/configuration.py b/python-client/libretime_client/configuration.py index 8120e00d..02029a08 100644 --- a/python-client/libretime_client/configuration.py +++ b/python-client/libretime_client/configuration.py @@ -14,8 +14,10 @@ import copy import logging +from logging import FileHandler import multiprocessing import sys +from typing import Optional import urllib3 import http.client as httplib @@ -151,7 +153,7 @@ def __init__(self, host=None, self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None @@ -191,7 +193,7 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ self.proxy_headers = None diff --git a/python-client/libretime_client/exceptions.py b/python-client/libretime_client/exceptions.py index 918fdc58..9b6c188f 100644 --- a/python-client/libretime_client/exceptions.py +++ b/python-client/libretime_client/exceptions.py @@ -11,6 +11,8 @@ Do not edit the class manually. """ # noqa: E501 +from typing import Any, Optional +from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -101,17 +103,56 @@ def __init__(self, msg, path_to_item=None) -> None: class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None) -> None: + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" @@ -121,38 +162,30 @@ def __str__(self): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message + class BadRequestException(ApiException): + pass - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(BadRequestException, self).__init__(status, reason, http_resp) class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(NotFoundException, self).__init__(status, reason, http_resp) + pass class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(UnauthorizedException, self).__init__(status, reason, http_resp) + pass class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(ForbiddenException, self).__init__(status, reason, http_resp) + pass class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(ServiceException, self).__init__(status, reason, http_resp) + pass def render_path(path_to_item): diff --git a/python-client/libretime_client/models/blank_enum.py b/python-client/libretime_client/models/blank_enum.py index 39ce6ecb..5be723a2 100644 --- a/python-client/libretime_client/models/blank_enum.py +++ b/python-client/libretime_client/models/blank_enum.py @@ -12,13 +12,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class BlankEnum(str, Enum): @@ -32,8 +29,8 @@ class BlankEnum(str, Enum): EMPTY = '' @classmethod - def from_json(cls, json_str: str) -> BlankEnum: + def from_json(cls, json_str: str) -> Self: """Create an instance of BlankEnum from a JSON string""" - return BlankEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python-client/libretime_client/models/celery_task.py b/python-client/libretime_client/models/celery_task.py index 883e2c32..53993895 100644 --- a/python-client/libretime_client/models/celery_task.py +++ b/python-client/libretime_client/models/celery_task.py @@ -18,68 +18,87 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class CeleryTask(BaseModel): """ CeleryTask - """ - id: StrictInt = Field(...) - task_id: constr(strict=True, max_length=256) = Field(...) - name: Optional[constr(strict=True, max_length=256)] = None + """ # noqa: E501 + id: StrictInt + task_id: Annotated[str, Field(strict=True, max_length=256)] + name: Optional[Annotated[str, Field(strict=True, max_length=256)]] = None dispatch_time: Optional[datetime] = None - status: constr(strict=True, max_length=256) = Field(...) - track_reference: StrictInt = Field(...) - __properties = ["id", "task_id", "name", "dispatch_time", "status", "track_reference"] + status: Annotated[str, Field(strict=True, max_length=256)] + track_reference: StrictInt + __properties: ClassVar[List[str]] = ["id", "task_id", "name", "dispatch_time", "status", "track_reference"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CeleryTask: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CeleryTask from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if dispatch_time (nullable) is None - # and __fields_set__ contains the field - if self.dispatch_time is None and "dispatch_time" in self.__fields_set__: + # and model_fields_set contains the field + if self.dispatch_time is None and "dispatch_time" in self.model_fields_set: _dict['dispatch_time'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> CeleryTask: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CeleryTask from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CeleryTask.parse_obj(obj) + return cls.model_validate(obj) - _obj = CeleryTask.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "task_id": obj.get("task_id"), "name": obj.get("name"), diff --git a/python-client/libretime_client/models/file.py b/python-client/libretime_client/models/file.py index 1b6f3367..17e588e4 100644 --- a/python-client/libretime_client/models/file.py +++ b/python-client/libretime_client/models/file.py @@ -18,82 +18,85 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conint, constr, validator +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from libretime_client.models.file_import_status_enum import FileImportStatusEnum +from typing import Optional, Set +from typing_extensions import Self class File(BaseModel): """ File - """ - id: StrictInt = Field(...) + """ # noqa: E501 + id: StrictInt import_status: Optional[FileImportStatusEnum] = None filepath: Optional[StrictStr] = None - size: conint(strict=True, le=2147483647, ge=-2147483648) = Field(...) + size: Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)] exists: Optional[StrictBool] = None - mime: constr(strict=True, max_length=255) = Field(...) - md5: Optional[constr(strict=True, max_length=32)] = None + mime: Annotated[str, Field(strict=True, max_length=255)] + md5: Optional[Annotated[str, Field(strict=True, max_length=32)]] = None hidden: Optional[StrictBool] = None - accessed: conint(strict=True, le=2147483647, ge=-2147483648) = Field(...) + accessed: Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)] scheduled: Optional[StrictBool] = None part_of_list: Optional[StrictBool] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None last_played_at: Optional[datetime] = None - bit_rate: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - sample_rate: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - format: Optional[constr(strict=True, max_length=128)] = None - channels: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + bit_rate: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + sample_rate: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + format: Optional[Annotated[str, Field(strict=True, max_length=128)]] = None + channels: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None length: Optional[StrictStr] = None - bpm: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - replay_gain: Optional[constr(strict=True)] = None + bpm: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + replay_gain: Optional[Annotated[str, Field(strict=True)]] = None cue_in: Optional[StrictStr] = None cue_out: Optional[StrictStr] = None - name: constr(strict=True, max_length=255) = Field(...) - description: Optional[constr(strict=True, max_length=512)] = None - artwork: Optional[constr(strict=True, max_length=512)] = None - artist_name: Optional[constr(strict=True, max_length=512)] = None - artist_url: Optional[constr(strict=True, max_length=512)] = None - original_artist: Optional[constr(strict=True, max_length=512)] = None - album_title: Optional[constr(strict=True, max_length=512)] = None - track_title: Optional[constr(strict=True, max_length=512)] = None - genre: Optional[constr(strict=True, max_length=64)] = None - mood: Optional[constr(strict=True, max_length=64)] = None - var_date: Optional[constr(strict=True, max_length=16)] = Field(None, alias="date") - track_number: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - disc_number: Optional[constr(strict=True, max_length=8)] = None + name: Annotated[str, Field(strict=True, max_length=255)] + description: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + artwork: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + artist_name: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + artist_url: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + original_artist: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + album_title: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + track_title: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + genre: Optional[Annotated[str, Field(strict=True, max_length=64)]] = None + mood: Optional[Annotated[str, Field(strict=True, max_length=64)]] = None + var_date: Optional[Annotated[str, Field(strict=True, max_length=16)]] = Field(default=None, alias="date") + track_number: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + disc_number: Optional[Annotated[str, Field(strict=True, max_length=8)]] = None comment: Optional[StrictStr] = None - language: Optional[constr(strict=True, max_length=512)] = None - label: Optional[constr(strict=True, max_length=512)] = None - copyright: Optional[constr(strict=True, max_length=512)] = None - composer: Optional[constr(strict=True, max_length=512)] = None - conductor: Optional[constr(strict=True, max_length=512)] = None - orchestra: Optional[constr(strict=True, max_length=512)] = None - encoder: Optional[constr(strict=True, max_length=64)] = None - encoded_by: Optional[constr(strict=True, max_length=255)] = None - isrc: Optional[constr(strict=True, max_length=512)] = None + language: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + label: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + copyright: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + composer: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + conductor: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + orchestra: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + encoder: Optional[Annotated[str, Field(strict=True, max_length=64)]] = None + encoded_by: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + isrc: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None lyrics: Optional[StrictStr] = None - lyricist: Optional[constr(strict=True, max_length=512)] = None - original_lyricist: Optional[constr(strict=True, max_length=512)] = None - subject: Optional[constr(strict=True, max_length=512)] = None - contributor: Optional[constr(strict=True, max_length=512)] = None - rating: Optional[constr(strict=True, max_length=8)] = None - url: Optional[constr(strict=True, max_length=1024)] = None - info_url: Optional[constr(strict=True, max_length=512)] = None - audio_source_url: Optional[constr(strict=True, max_length=512)] = None - buy_this_url: Optional[constr(strict=True, max_length=512)] = None - catalog_number: Optional[constr(strict=True, max_length=512)] = None - radio_station_name: Optional[constr(strict=True, max_length=512)] = None - radio_station_url: Optional[constr(strict=True, max_length=512)] = None - report_datetime: Optional[constr(strict=True, max_length=32)] = None - report_location: Optional[constr(strict=True, max_length=512)] = None - report_organization: Optional[constr(strict=True, max_length=512)] = None + lyricist: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + original_lyricist: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + subject: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + contributor: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + rating: Optional[Annotated[str, Field(strict=True, max_length=8)]] = None + url: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None + info_url: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + audio_source_url: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + buy_this_url: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + catalog_number: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + radio_station_name: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + radio_station_url: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + report_datetime: Optional[Annotated[str, Field(strict=True, max_length=32)]] = None + report_location: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + report_organization: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None library: Optional[StrictInt] = None owner: Optional[StrictInt] = None edited_by: Optional[StrictInt] = None - __properties = ["id", "import_status", "filepath", "size", "exists", "mime", "md5", "hidden", "accessed", "scheduled", "part_of_list", "created_at", "updated_at", "last_played_at", "bit_rate", "sample_rate", "format", "channels", "length", "bpm", "replay_gain", "cue_in", "cue_out", "name", "description", "artwork", "artist_name", "artist_url", "original_artist", "album_title", "track_title", "genre", "mood", "date", "track_number", "disc_number", "comment", "language", "label", "copyright", "composer", "conductor", "orchestra", "encoder", "encoded_by", "isrc", "lyrics", "lyricist", "original_lyricist", "subject", "contributor", "rating", "url", "info_url", "audio_source_url", "buy_this_url", "catalog_number", "radio_station_name", "radio_station_url", "report_datetime", "report_location", "report_organization", "library", "owner", "edited_by"] + __properties: ClassVar[List[str]] = ["id", "import_status", "filepath", "size", "exists", "mime", "md5", "hidden", "accessed", "scheduled", "part_of_list", "created_at", "updated_at", "last_played_at", "bit_rate", "sample_rate", "format", "channels", "length", "bpm", "replay_gain", "cue_in", "cue_out", "name", "description", "artwork", "artist_name", "artist_url", "original_artist", "album_title", "track_title", "genre", "mood", "date", "track_number", "disc_number", "comment", "language", "label", "copyright", "composer", "conductor", "orchestra", "encoder", "encoded_by", "isrc", "lyrics", "lyricist", "original_lyricist", "subject", "contributor", "rating", "url", "info_url", "audio_source_url", "buy_this_url", "catalog_number", "radio_station_name", "radio_station_url", "report_datetime", "report_location", "report_organization", "library", "owner", "edited_by"] - @validator('replay_gain') + @field_validator('replay_gain') def replay_gain_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: @@ -103,338 +106,354 @@ def replay_gain_validate_regular_expression(cls, value): raise ValueError(r"must validate the regular expression /^-?\d{0,6}(?:\.\d{0,2})?$/") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> File: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of File from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if filepath (nullable) is None - # and __fields_set__ contains the field - if self.filepath is None and "filepath" in self.__fields_set__: + # and model_fields_set contains the field + if self.filepath is None and "filepath" in self.model_fields_set: _dict['filepath'] = None # set to None if exists (nullable) is None - # and __fields_set__ contains the field - if self.exists is None and "exists" in self.__fields_set__: + # and model_fields_set contains the field + if self.exists is None and "exists" in self.model_fields_set: _dict['exists'] = None # set to None if md5 (nullable) is None - # and __fields_set__ contains the field - if self.md5 is None and "md5" in self.__fields_set__: + # and model_fields_set contains the field + if self.md5 is None and "md5" in self.model_fields_set: _dict['md5'] = None # set to None if hidden (nullable) is None - # and __fields_set__ contains the field - if self.hidden is None and "hidden" in self.__fields_set__: + # and model_fields_set contains the field + if self.hidden is None and "hidden" in self.model_fields_set: _dict['hidden'] = None # set to None if scheduled (nullable) is None - # and __fields_set__ contains the field - if self.scheduled is None and "scheduled" in self.__fields_set__: + # and model_fields_set contains the field + if self.scheduled is None and "scheduled" in self.model_fields_set: _dict['scheduled'] = None # set to None if part_of_list (nullable) is None - # and __fields_set__ contains the field - if self.part_of_list is None and "part_of_list" in self.__fields_set__: + # and model_fields_set contains the field + if self.part_of_list is None and "part_of_list" in self.model_fields_set: _dict['part_of_list'] = None # set to None if created_at (nullable) is None - # and __fields_set__ contains the field - if self.created_at is None and "created_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: _dict['created_at'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if last_played_at (nullable) is None - # and __fields_set__ contains the field - if self.last_played_at is None and "last_played_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.last_played_at is None and "last_played_at" in self.model_fields_set: _dict['last_played_at'] = None # set to None if bit_rate (nullable) is None - # and __fields_set__ contains the field - if self.bit_rate is None and "bit_rate" in self.__fields_set__: + # and model_fields_set contains the field + if self.bit_rate is None and "bit_rate" in self.model_fields_set: _dict['bit_rate'] = None # set to None if sample_rate (nullable) is None - # and __fields_set__ contains the field - if self.sample_rate is None and "sample_rate" in self.__fields_set__: + # and model_fields_set contains the field + if self.sample_rate is None and "sample_rate" in self.model_fields_set: _dict['sample_rate'] = None # set to None if format (nullable) is None - # and __fields_set__ contains the field - if self.format is None and "format" in self.__fields_set__: + # and model_fields_set contains the field + if self.format is None and "format" in self.model_fields_set: _dict['format'] = None # set to None if channels (nullable) is None - # and __fields_set__ contains the field - if self.channels is None and "channels" in self.__fields_set__: + # and model_fields_set contains the field + if self.channels is None and "channels" in self.model_fields_set: _dict['channels'] = None # set to None if length (nullable) is None - # and __fields_set__ contains the field - if self.length is None and "length" in self.__fields_set__: + # and model_fields_set contains the field + if self.length is None and "length" in self.model_fields_set: _dict['length'] = None # set to None if bpm (nullable) is None - # and __fields_set__ contains the field - if self.bpm is None and "bpm" in self.__fields_set__: + # and model_fields_set contains the field + if self.bpm is None and "bpm" in self.model_fields_set: _dict['bpm'] = None # set to None if replay_gain (nullable) is None - # and __fields_set__ contains the field - if self.replay_gain is None and "replay_gain" in self.__fields_set__: + # and model_fields_set contains the field + if self.replay_gain is None and "replay_gain" in self.model_fields_set: _dict['replay_gain'] = None # set to None if cue_in (nullable) is None - # and __fields_set__ contains the field - if self.cue_in is None and "cue_in" in self.__fields_set__: + # and model_fields_set contains the field + if self.cue_in is None and "cue_in" in self.model_fields_set: _dict['cue_in'] = None # set to None if cue_out (nullable) is None - # and __fields_set__ contains the field - if self.cue_out is None and "cue_out" in self.__fields_set__: + # and model_fields_set contains the field + if self.cue_out is None and "cue_out" in self.model_fields_set: _dict['cue_out'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if artwork (nullable) is None - # and __fields_set__ contains the field - if self.artwork is None and "artwork" in self.__fields_set__: + # and model_fields_set contains the field + if self.artwork is None and "artwork" in self.model_fields_set: _dict['artwork'] = None # set to None if artist_name (nullable) is None - # and __fields_set__ contains the field - if self.artist_name is None and "artist_name" in self.__fields_set__: + # and model_fields_set contains the field + if self.artist_name is None and "artist_name" in self.model_fields_set: _dict['artist_name'] = None # set to None if artist_url (nullable) is None - # and __fields_set__ contains the field - if self.artist_url is None and "artist_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.artist_url is None and "artist_url" in self.model_fields_set: _dict['artist_url'] = None # set to None if original_artist (nullable) is None - # and __fields_set__ contains the field - if self.original_artist is None and "original_artist" in self.__fields_set__: + # and model_fields_set contains the field + if self.original_artist is None and "original_artist" in self.model_fields_set: _dict['original_artist'] = None # set to None if album_title (nullable) is None - # and __fields_set__ contains the field - if self.album_title is None and "album_title" in self.__fields_set__: + # and model_fields_set contains the field + if self.album_title is None and "album_title" in self.model_fields_set: _dict['album_title'] = None # set to None if track_title (nullable) is None - # and __fields_set__ contains the field - if self.track_title is None and "track_title" in self.__fields_set__: + # and model_fields_set contains the field + if self.track_title is None and "track_title" in self.model_fields_set: _dict['track_title'] = None # set to None if genre (nullable) is None - # and __fields_set__ contains the field - if self.genre is None and "genre" in self.__fields_set__: + # and model_fields_set contains the field + if self.genre is None and "genre" in self.model_fields_set: _dict['genre'] = None # set to None if mood (nullable) is None - # and __fields_set__ contains the field - if self.mood is None and "mood" in self.__fields_set__: + # and model_fields_set contains the field + if self.mood is None and "mood" in self.model_fields_set: _dict['mood'] = None # set to None if var_date (nullable) is None - # and __fields_set__ contains the field - if self.var_date is None and "var_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.var_date is None and "var_date" in self.model_fields_set: _dict['date'] = None # set to None if track_number (nullable) is None - # and __fields_set__ contains the field - if self.track_number is None and "track_number" in self.__fields_set__: + # and model_fields_set contains the field + if self.track_number is None and "track_number" in self.model_fields_set: _dict['track_number'] = None # set to None if disc_number (nullable) is None - # and __fields_set__ contains the field - if self.disc_number is None and "disc_number" in self.__fields_set__: + # and model_fields_set contains the field + if self.disc_number is None and "disc_number" in self.model_fields_set: _dict['disc_number'] = None # set to None if comment (nullable) is None - # and __fields_set__ contains the field - if self.comment is None and "comment" in self.__fields_set__: + # and model_fields_set contains the field + if self.comment is None and "comment" in self.model_fields_set: _dict['comment'] = None # set to None if language (nullable) is None - # and __fields_set__ contains the field - if self.language is None and "language" in self.__fields_set__: + # and model_fields_set contains the field + if self.language is None and "language" in self.model_fields_set: _dict['language'] = None # set to None if label (nullable) is None - # and __fields_set__ contains the field - if self.label is None and "label" in self.__fields_set__: + # and model_fields_set contains the field + if self.label is None and "label" in self.model_fields_set: _dict['label'] = None # set to None if copyright (nullable) is None - # and __fields_set__ contains the field - if self.copyright is None and "copyright" in self.__fields_set__: + # and model_fields_set contains the field + if self.copyright is None and "copyright" in self.model_fields_set: _dict['copyright'] = None # set to None if composer (nullable) is None - # and __fields_set__ contains the field - if self.composer is None and "composer" in self.__fields_set__: + # and model_fields_set contains the field + if self.composer is None and "composer" in self.model_fields_set: _dict['composer'] = None # set to None if conductor (nullable) is None - # and __fields_set__ contains the field - if self.conductor is None and "conductor" in self.__fields_set__: + # and model_fields_set contains the field + if self.conductor is None and "conductor" in self.model_fields_set: _dict['conductor'] = None # set to None if orchestra (nullable) is None - # and __fields_set__ contains the field - if self.orchestra is None and "orchestra" in self.__fields_set__: + # and model_fields_set contains the field + if self.orchestra is None and "orchestra" in self.model_fields_set: _dict['orchestra'] = None # set to None if encoder (nullable) is None - # and __fields_set__ contains the field - if self.encoder is None and "encoder" in self.__fields_set__: + # and model_fields_set contains the field + if self.encoder is None and "encoder" in self.model_fields_set: _dict['encoder'] = None # set to None if encoded_by (nullable) is None - # and __fields_set__ contains the field - if self.encoded_by is None and "encoded_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.encoded_by is None and "encoded_by" in self.model_fields_set: _dict['encoded_by'] = None # set to None if isrc (nullable) is None - # and __fields_set__ contains the field - if self.isrc is None and "isrc" in self.__fields_set__: + # and model_fields_set contains the field + if self.isrc is None and "isrc" in self.model_fields_set: _dict['isrc'] = None # set to None if lyrics (nullable) is None - # and __fields_set__ contains the field - if self.lyrics is None and "lyrics" in self.__fields_set__: + # and model_fields_set contains the field + if self.lyrics is None and "lyrics" in self.model_fields_set: _dict['lyrics'] = None # set to None if lyricist (nullable) is None - # and __fields_set__ contains the field - if self.lyricist is None and "lyricist" in self.__fields_set__: + # and model_fields_set contains the field + if self.lyricist is None and "lyricist" in self.model_fields_set: _dict['lyricist'] = None # set to None if original_lyricist (nullable) is None - # and __fields_set__ contains the field - if self.original_lyricist is None and "original_lyricist" in self.__fields_set__: + # and model_fields_set contains the field + if self.original_lyricist is None and "original_lyricist" in self.model_fields_set: _dict['original_lyricist'] = None # set to None if subject (nullable) is None - # and __fields_set__ contains the field - if self.subject is None and "subject" in self.__fields_set__: + # and model_fields_set contains the field + if self.subject is None and "subject" in self.model_fields_set: _dict['subject'] = None # set to None if contributor (nullable) is None - # and __fields_set__ contains the field - if self.contributor is None and "contributor" in self.__fields_set__: + # and model_fields_set contains the field + if self.contributor is None and "contributor" in self.model_fields_set: _dict['contributor'] = None # set to None if rating (nullable) is None - # and __fields_set__ contains the field - if self.rating is None and "rating" in self.__fields_set__: + # and model_fields_set contains the field + if self.rating is None and "rating" in self.model_fields_set: _dict['rating'] = None # set to None if url (nullable) is None - # and __fields_set__ contains the field - if self.url is None and "url" in self.__fields_set__: + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: _dict['url'] = None # set to None if info_url (nullable) is None - # and __fields_set__ contains the field - if self.info_url is None and "info_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.info_url is None and "info_url" in self.model_fields_set: _dict['info_url'] = None # set to None if audio_source_url (nullable) is None - # and __fields_set__ contains the field - if self.audio_source_url is None and "audio_source_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.audio_source_url is None and "audio_source_url" in self.model_fields_set: _dict['audio_source_url'] = None # set to None if buy_this_url (nullable) is None - # and __fields_set__ contains the field - if self.buy_this_url is None and "buy_this_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.buy_this_url is None and "buy_this_url" in self.model_fields_set: _dict['buy_this_url'] = None # set to None if catalog_number (nullable) is None - # and __fields_set__ contains the field - if self.catalog_number is None and "catalog_number" in self.__fields_set__: + # and model_fields_set contains the field + if self.catalog_number is None and "catalog_number" in self.model_fields_set: _dict['catalog_number'] = None # set to None if radio_station_name (nullable) is None - # and __fields_set__ contains the field - if self.radio_station_name is None and "radio_station_name" in self.__fields_set__: + # and model_fields_set contains the field + if self.radio_station_name is None and "radio_station_name" in self.model_fields_set: _dict['radio_station_name'] = None # set to None if radio_station_url (nullable) is None - # and __fields_set__ contains the field - if self.radio_station_url is None and "radio_station_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.radio_station_url is None and "radio_station_url" in self.model_fields_set: _dict['radio_station_url'] = None # set to None if report_datetime (nullable) is None - # and __fields_set__ contains the field - if self.report_datetime is None and "report_datetime" in self.__fields_set__: + # and model_fields_set contains the field + if self.report_datetime is None and "report_datetime" in self.model_fields_set: _dict['report_datetime'] = None # set to None if report_location (nullable) is None - # and __fields_set__ contains the field - if self.report_location is None and "report_location" in self.__fields_set__: + # and model_fields_set contains the field + if self.report_location is None and "report_location" in self.model_fields_set: _dict['report_location'] = None # set to None if report_organization (nullable) is None - # and __fields_set__ contains the field - if self.report_organization is None and "report_organization" in self.__fields_set__: + # and model_fields_set contains the field + if self.report_organization is None and "report_organization" in self.model_fields_set: _dict['report_organization'] = None # set to None if library (nullable) is None - # and __fields_set__ contains the field - if self.library is None and "library" in self.__fields_set__: + # and model_fields_set contains the field + if self.library is None and "library" in self.model_fields_set: _dict['library'] = None # set to None if owner (nullable) is None - # and __fields_set__ contains the field - if self.owner is None and "owner" in self.__fields_set__: + # and model_fields_set contains the field + if self.owner is None and "owner" in self.model_fields_set: _dict['owner'] = None # set to None if edited_by (nullable) is None - # and __fields_set__ contains the field - if self.edited_by is None and "edited_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.edited_by is None and "edited_by" in self.model_fields_set: _dict['edited_by'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> File: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of File from a dict""" if obj is None: return None if not isinstance(obj, dict): - return File.parse_obj(obj) + return cls.model_validate(obj) - _obj = File.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "import_status": obj.get("import_status"), "filepath": obj.get("filepath"), @@ -468,7 +487,7 @@ def from_dict(cls, obj: dict) -> File: "track_title": obj.get("track_title"), "genre": obj.get("genre"), "mood": obj.get("mood"), - "var_date": obj.get("date"), + "date": obj.get("date"), "track_number": obj.get("track_number"), "disc_number": obj.get("disc_number"), "comment": obj.get("comment"), diff --git a/python-client/libretime_client/models/file_import_status_enum.py b/python-client/libretime_client/models/file_import_status_enum.py index cbec2d83..0295ab89 100644 --- a/python-client/libretime_client/models/file_import_status_enum.py +++ b/python-client/libretime_client/models/file_import_status_enum.py @@ -12,13 +12,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class FileImportStatusEnum(int, Enum): @@ -34,8 +31,8 @@ class FileImportStatusEnum(int, Enum): NUMBER_2 = 2 @classmethod - def from_json(cls, json_str: str) -> FileImportStatusEnum: + def from_json(cls, json_str: str) -> Self: """Create an instance of FileImportStatusEnum from a JSON string""" - return FileImportStatusEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python-client/libretime_client/models/imported_podcast.py b/python-client/libretime_client/models/imported_podcast.py index 0833a18b..6b8a90bf 100644 --- a/python-client/libretime_client/models/imported_podcast.py +++ b/python-client/libretime_client/models/imported_podcast.py @@ -18,62 +18,80 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt +from pydantic import BaseModel, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ImportedPodcast(BaseModel): """ ImportedPodcast - """ - id: StrictInt = Field(...) - override_album: StrictBool = Field(...) - auto_ingest: StrictBool = Field(...) + """ # noqa: E501 + id: StrictInt + override_album: StrictBool + auto_ingest: StrictBool auto_ingested_at: Optional[datetime] = None - podcast: StrictInt = Field(...) - __properties = ["id", "override_album", "auto_ingest", "auto_ingested_at", "podcast"] + podcast: StrictInt + __properties: ClassVar[List[str]] = ["id", "override_album", "auto_ingest", "auto_ingested_at", "podcast"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ImportedPodcast: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ImportedPodcast from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if auto_ingested_at (nullable) is None - # and __fields_set__ contains the field - if self.auto_ingested_at is None and "auto_ingested_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.auto_ingested_at is None and "auto_ingested_at" in self.model_fields_set: _dict['auto_ingested_at'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ImportedPodcast: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ImportedPodcast from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ImportedPodcast.parse_obj(obj) + return cls.model_validate(obj) - _obj = ImportedPodcast.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "override_album": obj.get("override_album"), "auto_ingest": obj.get("auto_ingest"), diff --git a/python-client/libretime_client/models/info.py b/python-client/libretime_client/models/info.py index 7bf6d989..aefd7fa2 100644 --- a/python-client/libretime_client/models/info.py +++ b/python-client/libretime_client/models/info.py @@ -17,54 +17,71 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class Info(BaseModel): """ Info - """ - station_name: StrictStr = Field(...) - __properties = ["station_name"] + """ # noqa: E501 + station_name: StrictStr + __properties: ClassVar[List[str]] = ["station_name"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Info: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Info from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "station_name", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "station_name", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Info: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Info from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Info.parse_obj(obj) + return cls.model_validate(obj) - _obj = Info.parse_obj({ + _obj = cls.model_validate({ "station_name": obj.get("station_name") }) return _obj diff --git a/python-client/libretime_client/models/library.py b/python-client/libretime_client/models/library.py index 7db18d38..d5c88d6a 100644 --- a/python-client/libretime_client/models/library.py +++ b/python-client/libretime_client/models/library.py @@ -17,69 +17,87 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, constr +from pydantic import BaseModel, Field, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Library(BaseModel): """ Library - """ - id: StrictInt = Field(...) - name: Optional[constr(strict=True, max_length=255)] = None - code: constr(strict=True, max_length=16) = Field(...) - description: Optional[constr(strict=True, max_length=255)] = None + """ # noqa: E501 + id: StrictInt + name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + code: Annotated[str, Field(strict=True, max_length=16)] + description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None enabled: Optional[StrictBool] = None analyze_cue_points: Optional[StrictBool] = None - __properties = ["id", "name", "code", "description", "enabled", "analyze_cue_points"] + __properties: ClassVar[List[str]] = ["id", "name", "code", "description", "enabled", "analyze_cue_points"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Library: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Library from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Library: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Library from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Library.parse_obj(obj) + return cls.model_validate(obj) - _obj = Library.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "name": obj.get("name"), "code": obj.get("code"), diff --git a/python-client/libretime_client/models/listener_count.py b/python-client/libretime_client/models/listener_count.py index 45ac8198..ef43f42a 100644 --- a/python-client/libretime_client/models/listener_count.py +++ b/python-client/libretime_client/models/listener_count.py @@ -17,57 +17,75 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictInt, conint +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class ListenerCount(BaseModel): """ ListenerCount - """ - id: StrictInt = Field(...) - listener_count: conint(strict=True, le=2147483647, ge=-2147483648) = Field(...) - timestamp: StrictInt = Field(...) - mount_name: StrictInt = Field(...) - __properties = ["id", "listener_count", "timestamp", "mount_name"] + """ # noqa: E501 + id: StrictInt + listener_count: Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)] + timestamp: StrictInt + mount_name: StrictInt + __properties: ClassVar[List[str]] = ["id", "listener_count", "timestamp", "mount_name"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ListenerCount: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ListenerCount from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ListenerCount: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ListenerCount from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ListenerCount.parse_obj(obj) + return cls.model_validate(obj) - _obj = ListenerCount.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "listener_count": obj.get("listener_count"), "timestamp": obj.get("timestamp"), diff --git a/python-client/libretime_client/models/live_log.py b/python-client/libretime_client/models/live_log.py index 758e3613..9eede8ea 100644 --- a/python-client/libretime_client/models/live_log.py +++ b/python-client/libretime_client/models/live_log.py @@ -18,61 +18,80 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class LiveLog(BaseModel): """ LiveLog - """ - id: StrictInt = Field(...) - state: constr(strict=True, max_length=32) = Field(...) - start_time: datetime = Field(...) + """ # noqa: E501 + id: StrictInt + state: Annotated[str, Field(strict=True, max_length=32)] + start_time: datetime end_time: Optional[datetime] = None - __properties = ["id", "state", "start_time", "end_time"] + __properties: ClassVar[List[str]] = ["id", "state", "start_time", "end_time"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> LiveLog: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LiveLog from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if end_time (nullable) is None - # and __fields_set__ contains the field - if self.end_time is None and "end_time" in self.__fields_set__: + # and model_fields_set contains the field + if self.end_time is None and "end_time" in self.model_fields_set: _dict['end_time'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> LiveLog: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LiveLog from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LiveLog.parse_obj(obj) + return cls.model_validate(obj) - _obj = LiveLog.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "state": obj.get("state"), "start_time": obj.get("start_time"), diff --git a/python-client/libretime_client/models/login_attempt.py b/python-client/libretime_client/models/login_attempt.py index 265a6666..e7d54449 100644 --- a/python-client/libretime_client/models/login_attempt.py +++ b/python-client/libretime_client/models/login_attempt.py @@ -17,59 +17,76 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, conint, constr +from pydantic import BaseModel, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class LoginAttempt(BaseModel): """ LoginAttempt - """ - ip: constr(strict=True, max_length=32) = Field(...) - attempts: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - __properties = ["ip", "attempts"] + """ # noqa: E501 + ip: Annotated[str, Field(strict=True, max_length=32)] + attempts: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + __properties: ClassVar[List[str]] = ["ip", "attempts"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> LoginAttempt: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LoginAttempt from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if attempts (nullable) is None - # and __fields_set__ contains the field - if self.attempts is None and "attempts" in self.__fields_set__: + # and model_fields_set contains the field + if self.attempts is None and "attempts" in self.model_fields_set: _dict['attempts'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> LoginAttempt: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LoginAttempt from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LoginAttempt.parse_obj(obj) + return cls.model_validate(obj) - _obj = LoginAttempt.parse_obj({ + _obj = cls.model_validate({ "ip": obj.get("ip"), "attempts": obj.get("attempts") }) diff --git a/python-client/libretime_client/models/mount_name.py b/python-client/libretime_client/models/mount_name.py index 698ebeee..ec27c6bf 100644 --- a/python-client/libretime_client/models/mount_name.py +++ b/python-client/libretime_client/models/mount_name.py @@ -17,55 +17,73 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class MountName(BaseModel): """ MountName - """ - id: StrictInt = Field(...) - mount_name: constr(strict=True, max_length=1024) = Field(...) - __properties = ["id", "mount_name"] + """ # noqa: E501 + id: StrictInt + mount_name: Annotated[str, Field(strict=True, max_length=1024)] + __properties: ClassVar[List[str]] = ["id", "mount_name"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> MountName: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MountName from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> MountName: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MountName from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MountName.parse_obj(obj) + return cls.model_validate(obj) - _obj = MountName.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "mount_name": obj.get("mount_name") }) diff --git a/python-client/libretime_client/models/null_enum.py b/python-client/libretime_client/models/null_enum.py index d6e385ae..f7aa4bf0 100644 --- a/python-client/libretime_client/models/null_enum.py +++ b/python-client/libretime_client/models/null_enum.py @@ -12,13 +12,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class NullEnum(str, Enum): @@ -32,8 +29,8 @@ class NullEnum(str, Enum): NULL = 'null' @classmethod - def from_json(cls, json_str: str) -> NullEnum: + def from_json(cls, json_str: str) -> Self: """Create an instance of NullEnum from a JSON string""" - return NullEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python-client/libretime_client/models/patched_celery_task.py b/python-client/libretime_client/models/patched_celery_task.py index cb105341..19912504 100644 --- a/python-client/libretime_client/models/patched_celery_task.py +++ b/python-client/libretime_client/models/patched_celery_task.py @@ -18,68 +18,87 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedCeleryTask(BaseModel): """ PatchedCeleryTask - """ + """ # noqa: E501 id: Optional[StrictInt] = None - task_id: Optional[constr(strict=True, max_length=256)] = None - name: Optional[constr(strict=True, max_length=256)] = None + task_id: Optional[Annotated[str, Field(strict=True, max_length=256)]] = None + name: Optional[Annotated[str, Field(strict=True, max_length=256)]] = None dispatch_time: Optional[datetime] = None - status: Optional[constr(strict=True, max_length=256)] = None + status: Optional[Annotated[str, Field(strict=True, max_length=256)]] = None track_reference: Optional[StrictInt] = None - __properties = ["id", "task_id", "name", "dispatch_time", "status", "track_reference"] + __properties: ClassVar[List[str]] = ["id", "task_id", "name", "dispatch_time", "status", "track_reference"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedCeleryTask: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedCeleryTask from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if dispatch_time (nullable) is None - # and __fields_set__ contains the field - if self.dispatch_time is None and "dispatch_time" in self.__fields_set__: + # and model_fields_set contains the field + if self.dispatch_time is None and "dispatch_time" in self.model_fields_set: _dict['dispatch_time'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedCeleryTask: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedCeleryTask from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedCeleryTask.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedCeleryTask.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "task_id": obj.get("task_id"), "name": obj.get("name"), diff --git a/python-client/libretime_client/models/patched_file.py b/python-client/libretime_client/models/patched_file.py index e65826a7..bc062a03 100644 --- a/python-client/libretime_client/models/patched_file.py +++ b/python-client/libretime_client/models/patched_file.py @@ -18,82 +18,85 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conint, constr, validator +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from libretime_client.models.file_import_status_enum import FileImportStatusEnum +from typing import Optional, Set +from typing_extensions import Self class PatchedFile(BaseModel): """ PatchedFile - """ + """ # noqa: E501 id: Optional[StrictInt] = None import_status: Optional[FileImportStatusEnum] = None filepath: Optional[StrictStr] = None - size: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + size: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None exists: Optional[StrictBool] = None - mime: Optional[constr(strict=True, max_length=255)] = None - md5: Optional[constr(strict=True, max_length=32)] = None + mime: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + md5: Optional[Annotated[str, Field(strict=True, max_length=32)]] = None hidden: Optional[StrictBool] = None - accessed: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + accessed: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None scheduled: Optional[StrictBool] = None part_of_list: Optional[StrictBool] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None last_played_at: Optional[datetime] = None - bit_rate: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - sample_rate: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - format: Optional[constr(strict=True, max_length=128)] = None - channels: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + bit_rate: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + sample_rate: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + format: Optional[Annotated[str, Field(strict=True, max_length=128)]] = None + channels: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None length: Optional[StrictStr] = None - bpm: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - replay_gain: Optional[constr(strict=True)] = None + bpm: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + replay_gain: Optional[Annotated[str, Field(strict=True)]] = None cue_in: Optional[StrictStr] = None cue_out: Optional[StrictStr] = None - name: Optional[constr(strict=True, max_length=255)] = None - description: Optional[constr(strict=True, max_length=512)] = None - artwork: Optional[constr(strict=True, max_length=512)] = None - artist_name: Optional[constr(strict=True, max_length=512)] = None - artist_url: Optional[constr(strict=True, max_length=512)] = None - original_artist: Optional[constr(strict=True, max_length=512)] = None - album_title: Optional[constr(strict=True, max_length=512)] = None - track_title: Optional[constr(strict=True, max_length=512)] = None - genre: Optional[constr(strict=True, max_length=64)] = None - mood: Optional[constr(strict=True, max_length=64)] = None - var_date: Optional[constr(strict=True, max_length=16)] = Field(None, alias="date") - track_number: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - disc_number: Optional[constr(strict=True, max_length=8)] = None + name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + description: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + artwork: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + artist_name: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + artist_url: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + original_artist: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + album_title: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + track_title: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + genre: Optional[Annotated[str, Field(strict=True, max_length=64)]] = None + mood: Optional[Annotated[str, Field(strict=True, max_length=64)]] = None + var_date: Optional[Annotated[str, Field(strict=True, max_length=16)]] = Field(default=None, alias="date") + track_number: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + disc_number: Optional[Annotated[str, Field(strict=True, max_length=8)]] = None comment: Optional[StrictStr] = None - language: Optional[constr(strict=True, max_length=512)] = None - label: Optional[constr(strict=True, max_length=512)] = None - copyright: Optional[constr(strict=True, max_length=512)] = None - composer: Optional[constr(strict=True, max_length=512)] = None - conductor: Optional[constr(strict=True, max_length=512)] = None - orchestra: Optional[constr(strict=True, max_length=512)] = None - encoder: Optional[constr(strict=True, max_length=64)] = None - encoded_by: Optional[constr(strict=True, max_length=255)] = None - isrc: Optional[constr(strict=True, max_length=512)] = None + language: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + label: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + copyright: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + composer: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + conductor: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + orchestra: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + encoder: Optional[Annotated[str, Field(strict=True, max_length=64)]] = None + encoded_by: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + isrc: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None lyrics: Optional[StrictStr] = None - lyricist: Optional[constr(strict=True, max_length=512)] = None - original_lyricist: Optional[constr(strict=True, max_length=512)] = None - subject: Optional[constr(strict=True, max_length=512)] = None - contributor: Optional[constr(strict=True, max_length=512)] = None - rating: Optional[constr(strict=True, max_length=8)] = None - url: Optional[constr(strict=True, max_length=1024)] = None - info_url: Optional[constr(strict=True, max_length=512)] = None - audio_source_url: Optional[constr(strict=True, max_length=512)] = None - buy_this_url: Optional[constr(strict=True, max_length=512)] = None - catalog_number: Optional[constr(strict=True, max_length=512)] = None - radio_station_name: Optional[constr(strict=True, max_length=512)] = None - radio_station_url: Optional[constr(strict=True, max_length=512)] = None - report_datetime: Optional[constr(strict=True, max_length=32)] = None - report_location: Optional[constr(strict=True, max_length=512)] = None - report_organization: Optional[constr(strict=True, max_length=512)] = None + lyricist: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + original_lyricist: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + subject: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + contributor: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + rating: Optional[Annotated[str, Field(strict=True, max_length=8)]] = None + url: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None + info_url: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + audio_source_url: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + buy_this_url: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + catalog_number: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + radio_station_name: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + radio_station_url: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + report_datetime: Optional[Annotated[str, Field(strict=True, max_length=32)]] = None + report_location: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + report_organization: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None library: Optional[StrictInt] = None owner: Optional[StrictInt] = None edited_by: Optional[StrictInt] = None - __properties = ["id", "import_status", "filepath", "size", "exists", "mime", "md5", "hidden", "accessed", "scheduled", "part_of_list", "created_at", "updated_at", "last_played_at", "bit_rate", "sample_rate", "format", "channels", "length", "bpm", "replay_gain", "cue_in", "cue_out", "name", "description", "artwork", "artist_name", "artist_url", "original_artist", "album_title", "track_title", "genre", "mood", "date", "track_number", "disc_number", "comment", "language", "label", "copyright", "composer", "conductor", "orchestra", "encoder", "encoded_by", "isrc", "lyrics", "lyricist", "original_lyricist", "subject", "contributor", "rating", "url", "info_url", "audio_source_url", "buy_this_url", "catalog_number", "radio_station_name", "radio_station_url", "report_datetime", "report_location", "report_organization", "library", "owner", "edited_by"] + __properties: ClassVar[List[str]] = ["id", "import_status", "filepath", "size", "exists", "mime", "md5", "hidden", "accessed", "scheduled", "part_of_list", "created_at", "updated_at", "last_played_at", "bit_rate", "sample_rate", "format", "channels", "length", "bpm", "replay_gain", "cue_in", "cue_out", "name", "description", "artwork", "artist_name", "artist_url", "original_artist", "album_title", "track_title", "genre", "mood", "date", "track_number", "disc_number", "comment", "language", "label", "copyright", "composer", "conductor", "orchestra", "encoder", "encoded_by", "isrc", "lyrics", "lyricist", "original_lyricist", "subject", "contributor", "rating", "url", "info_url", "audio_source_url", "buy_this_url", "catalog_number", "radio_station_name", "radio_station_url", "report_datetime", "report_location", "report_organization", "library", "owner", "edited_by"] - @validator('replay_gain') + @field_validator('replay_gain') def replay_gain_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: @@ -103,338 +106,354 @@ def replay_gain_validate_regular_expression(cls, value): raise ValueError(r"must validate the regular expression /^-?\d{0,6}(?:\.\d{0,2})?$/") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedFile: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedFile from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if filepath (nullable) is None - # and __fields_set__ contains the field - if self.filepath is None and "filepath" in self.__fields_set__: + # and model_fields_set contains the field + if self.filepath is None and "filepath" in self.model_fields_set: _dict['filepath'] = None # set to None if exists (nullable) is None - # and __fields_set__ contains the field - if self.exists is None and "exists" in self.__fields_set__: + # and model_fields_set contains the field + if self.exists is None and "exists" in self.model_fields_set: _dict['exists'] = None # set to None if md5 (nullable) is None - # and __fields_set__ contains the field - if self.md5 is None and "md5" in self.__fields_set__: + # and model_fields_set contains the field + if self.md5 is None and "md5" in self.model_fields_set: _dict['md5'] = None # set to None if hidden (nullable) is None - # and __fields_set__ contains the field - if self.hidden is None and "hidden" in self.__fields_set__: + # and model_fields_set contains the field + if self.hidden is None and "hidden" in self.model_fields_set: _dict['hidden'] = None # set to None if scheduled (nullable) is None - # and __fields_set__ contains the field - if self.scheduled is None and "scheduled" in self.__fields_set__: + # and model_fields_set contains the field + if self.scheduled is None and "scheduled" in self.model_fields_set: _dict['scheduled'] = None # set to None if part_of_list (nullable) is None - # and __fields_set__ contains the field - if self.part_of_list is None and "part_of_list" in self.__fields_set__: + # and model_fields_set contains the field + if self.part_of_list is None and "part_of_list" in self.model_fields_set: _dict['part_of_list'] = None # set to None if created_at (nullable) is None - # and __fields_set__ contains the field - if self.created_at is None and "created_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: _dict['created_at'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if last_played_at (nullable) is None - # and __fields_set__ contains the field - if self.last_played_at is None and "last_played_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.last_played_at is None and "last_played_at" in self.model_fields_set: _dict['last_played_at'] = None # set to None if bit_rate (nullable) is None - # and __fields_set__ contains the field - if self.bit_rate is None and "bit_rate" in self.__fields_set__: + # and model_fields_set contains the field + if self.bit_rate is None and "bit_rate" in self.model_fields_set: _dict['bit_rate'] = None # set to None if sample_rate (nullable) is None - # and __fields_set__ contains the field - if self.sample_rate is None and "sample_rate" in self.__fields_set__: + # and model_fields_set contains the field + if self.sample_rate is None and "sample_rate" in self.model_fields_set: _dict['sample_rate'] = None # set to None if format (nullable) is None - # and __fields_set__ contains the field - if self.format is None and "format" in self.__fields_set__: + # and model_fields_set contains the field + if self.format is None and "format" in self.model_fields_set: _dict['format'] = None # set to None if channels (nullable) is None - # and __fields_set__ contains the field - if self.channels is None and "channels" in self.__fields_set__: + # and model_fields_set contains the field + if self.channels is None and "channels" in self.model_fields_set: _dict['channels'] = None # set to None if length (nullable) is None - # and __fields_set__ contains the field - if self.length is None and "length" in self.__fields_set__: + # and model_fields_set contains the field + if self.length is None and "length" in self.model_fields_set: _dict['length'] = None # set to None if bpm (nullable) is None - # and __fields_set__ contains the field - if self.bpm is None and "bpm" in self.__fields_set__: + # and model_fields_set contains the field + if self.bpm is None and "bpm" in self.model_fields_set: _dict['bpm'] = None # set to None if replay_gain (nullable) is None - # and __fields_set__ contains the field - if self.replay_gain is None and "replay_gain" in self.__fields_set__: + # and model_fields_set contains the field + if self.replay_gain is None and "replay_gain" in self.model_fields_set: _dict['replay_gain'] = None # set to None if cue_in (nullable) is None - # and __fields_set__ contains the field - if self.cue_in is None and "cue_in" in self.__fields_set__: + # and model_fields_set contains the field + if self.cue_in is None and "cue_in" in self.model_fields_set: _dict['cue_in'] = None # set to None if cue_out (nullable) is None - # and __fields_set__ contains the field - if self.cue_out is None and "cue_out" in self.__fields_set__: + # and model_fields_set contains the field + if self.cue_out is None and "cue_out" in self.model_fields_set: _dict['cue_out'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if artwork (nullable) is None - # and __fields_set__ contains the field - if self.artwork is None and "artwork" in self.__fields_set__: + # and model_fields_set contains the field + if self.artwork is None and "artwork" in self.model_fields_set: _dict['artwork'] = None # set to None if artist_name (nullable) is None - # and __fields_set__ contains the field - if self.artist_name is None and "artist_name" in self.__fields_set__: + # and model_fields_set contains the field + if self.artist_name is None and "artist_name" in self.model_fields_set: _dict['artist_name'] = None # set to None if artist_url (nullable) is None - # and __fields_set__ contains the field - if self.artist_url is None and "artist_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.artist_url is None and "artist_url" in self.model_fields_set: _dict['artist_url'] = None # set to None if original_artist (nullable) is None - # and __fields_set__ contains the field - if self.original_artist is None and "original_artist" in self.__fields_set__: + # and model_fields_set contains the field + if self.original_artist is None and "original_artist" in self.model_fields_set: _dict['original_artist'] = None # set to None if album_title (nullable) is None - # and __fields_set__ contains the field - if self.album_title is None and "album_title" in self.__fields_set__: + # and model_fields_set contains the field + if self.album_title is None and "album_title" in self.model_fields_set: _dict['album_title'] = None # set to None if track_title (nullable) is None - # and __fields_set__ contains the field - if self.track_title is None and "track_title" in self.__fields_set__: + # and model_fields_set contains the field + if self.track_title is None and "track_title" in self.model_fields_set: _dict['track_title'] = None # set to None if genre (nullable) is None - # and __fields_set__ contains the field - if self.genre is None and "genre" in self.__fields_set__: + # and model_fields_set contains the field + if self.genre is None and "genre" in self.model_fields_set: _dict['genre'] = None # set to None if mood (nullable) is None - # and __fields_set__ contains the field - if self.mood is None and "mood" in self.__fields_set__: + # and model_fields_set contains the field + if self.mood is None and "mood" in self.model_fields_set: _dict['mood'] = None # set to None if var_date (nullable) is None - # and __fields_set__ contains the field - if self.var_date is None and "var_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.var_date is None and "var_date" in self.model_fields_set: _dict['date'] = None # set to None if track_number (nullable) is None - # and __fields_set__ contains the field - if self.track_number is None and "track_number" in self.__fields_set__: + # and model_fields_set contains the field + if self.track_number is None and "track_number" in self.model_fields_set: _dict['track_number'] = None # set to None if disc_number (nullable) is None - # and __fields_set__ contains the field - if self.disc_number is None and "disc_number" in self.__fields_set__: + # and model_fields_set contains the field + if self.disc_number is None and "disc_number" in self.model_fields_set: _dict['disc_number'] = None # set to None if comment (nullable) is None - # and __fields_set__ contains the field - if self.comment is None and "comment" in self.__fields_set__: + # and model_fields_set contains the field + if self.comment is None and "comment" in self.model_fields_set: _dict['comment'] = None # set to None if language (nullable) is None - # and __fields_set__ contains the field - if self.language is None and "language" in self.__fields_set__: + # and model_fields_set contains the field + if self.language is None and "language" in self.model_fields_set: _dict['language'] = None # set to None if label (nullable) is None - # and __fields_set__ contains the field - if self.label is None and "label" in self.__fields_set__: + # and model_fields_set contains the field + if self.label is None and "label" in self.model_fields_set: _dict['label'] = None # set to None if copyright (nullable) is None - # and __fields_set__ contains the field - if self.copyright is None and "copyright" in self.__fields_set__: + # and model_fields_set contains the field + if self.copyright is None and "copyright" in self.model_fields_set: _dict['copyright'] = None # set to None if composer (nullable) is None - # and __fields_set__ contains the field - if self.composer is None and "composer" in self.__fields_set__: + # and model_fields_set contains the field + if self.composer is None and "composer" in self.model_fields_set: _dict['composer'] = None # set to None if conductor (nullable) is None - # and __fields_set__ contains the field - if self.conductor is None and "conductor" in self.__fields_set__: + # and model_fields_set contains the field + if self.conductor is None and "conductor" in self.model_fields_set: _dict['conductor'] = None # set to None if orchestra (nullable) is None - # and __fields_set__ contains the field - if self.orchestra is None and "orchestra" in self.__fields_set__: + # and model_fields_set contains the field + if self.orchestra is None and "orchestra" in self.model_fields_set: _dict['orchestra'] = None # set to None if encoder (nullable) is None - # and __fields_set__ contains the field - if self.encoder is None and "encoder" in self.__fields_set__: + # and model_fields_set contains the field + if self.encoder is None and "encoder" in self.model_fields_set: _dict['encoder'] = None # set to None if encoded_by (nullable) is None - # and __fields_set__ contains the field - if self.encoded_by is None and "encoded_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.encoded_by is None and "encoded_by" in self.model_fields_set: _dict['encoded_by'] = None # set to None if isrc (nullable) is None - # and __fields_set__ contains the field - if self.isrc is None and "isrc" in self.__fields_set__: + # and model_fields_set contains the field + if self.isrc is None and "isrc" in self.model_fields_set: _dict['isrc'] = None # set to None if lyrics (nullable) is None - # and __fields_set__ contains the field - if self.lyrics is None and "lyrics" in self.__fields_set__: + # and model_fields_set contains the field + if self.lyrics is None and "lyrics" in self.model_fields_set: _dict['lyrics'] = None # set to None if lyricist (nullable) is None - # and __fields_set__ contains the field - if self.lyricist is None and "lyricist" in self.__fields_set__: + # and model_fields_set contains the field + if self.lyricist is None and "lyricist" in self.model_fields_set: _dict['lyricist'] = None # set to None if original_lyricist (nullable) is None - # and __fields_set__ contains the field - if self.original_lyricist is None and "original_lyricist" in self.__fields_set__: + # and model_fields_set contains the field + if self.original_lyricist is None and "original_lyricist" in self.model_fields_set: _dict['original_lyricist'] = None # set to None if subject (nullable) is None - # and __fields_set__ contains the field - if self.subject is None and "subject" in self.__fields_set__: + # and model_fields_set contains the field + if self.subject is None and "subject" in self.model_fields_set: _dict['subject'] = None # set to None if contributor (nullable) is None - # and __fields_set__ contains the field - if self.contributor is None and "contributor" in self.__fields_set__: + # and model_fields_set contains the field + if self.contributor is None and "contributor" in self.model_fields_set: _dict['contributor'] = None # set to None if rating (nullable) is None - # and __fields_set__ contains the field - if self.rating is None and "rating" in self.__fields_set__: + # and model_fields_set contains the field + if self.rating is None and "rating" in self.model_fields_set: _dict['rating'] = None # set to None if url (nullable) is None - # and __fields_set__ contains the field - if self.url is None and "url" in self.__fields_set__: + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: _dict['url'] = None # set to None if info_url (nullable) is None - # and __fields_set__ contains the field - if self.info_url is None and "info_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.info_url is None and "info_url" in self.model_fields_set: _dict['info_url'] = None # set to None if audio_source_url (nullable) is None - # and __fields_set__ contains the field - if self.audio_source_url is None and "audio_source_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.audio_source_url is None and "audio_source_url" in self.model_fields_set: _dict['audio_source_url'] = None # set to None if buy_this_url (nullable) is None - # and __fields_set__ contains the field - if self.buy_this_url is None and "buy_this_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.buy_this_url is None and "buy_this_url" in self.model_fields_set: _dict['buy_this_url'] = None # set to None if catalog_number (nullable) is None - # and __fields_set__ contains the field - if self.catalog_number is None and "catalog_number" in self.__fields_set__: + # and model_fields_set contains the field + if self.catalog_number is None and "catalog_number" in self.model_fields_set: _dict['catalog_number'] = None # set to None if radio_station_name (nullable) is None - # and __fields_set__ contains the field - if self.radio_station_name is None and "radio_station_name" in self.__fields_set__: + # and model_fields_set contains the field + if self.radio_station_name is None and "radio_station_name" in self.model_fields_set: _dict['radio_station_name'] = None # set to None if radio_station_url (nullable) is None - # and __fields_set__ contains the field - if self.radio_station_url is None and "radio_station_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.radio_station_url is None and "radio_station_url" in self.model_fields_set: _dict['radio_station_url'] = None # set to None if report_datetime (nullable) is None - # and __fields_set__ contains the field - if self.report_datetime is None and "report_datetime" in self.__fields_set__: + # and model_fields_set contains the field + if self.report_datetime is None and "report_datetime" in self.model_fields_set: _dict['report_datetime'] = None # set to None if report_location (nullable) is None - # and __fields_set__ contains the field - if self.report_location is None and "report_location" in self.__fields_set__: + # and model_fields_set contains the field + if self.report_location is None and "report_location" in self.model_fields_set: _dict['report_location'] = None # set to None if report_organization (nullable) is None - # and __fields_set__ contains the field - if self.report_organization is None and "report_organization" in self.__fields_set__: + # and model_fields_set contains the field + if self.report_organization is None and "report_organization" in self.model_fields_set: _dict['report_organization'] = None # set to None if library (nullable) is None - # and __fields_set__ contains the field - if self.library is None and "library" in self.__fields_set__: + # and model_fields_set contains the field + if self.library is None and "library" in self.model_fields_set: _dict['library'] = None # set to None if owner (nullable) is None - # and __fields_set__ contains the field - if self.owner is None and "owner" in self.__fields_set__: + # and model_fields_set contains the field + if self.owner is None and "owner" in self.model_fields_set: _dict['owner'] = None # set to None if edited_by (nullable) is None - # and __fields_set__ contains the field - if self.edited_by is None and "edited_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.edited_by is None and "edited_by" in self.model_fields_set: _dict['edited_by'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedFile: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedFile from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedFile.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedFile.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "import_status": obj.get("import_status"), "filepath": obj.get("filepath"), @@ -468,7 +487,7 @@ def from_dict(cls, obj: dict) -> PatchedFile: "track_title": obj.get("track_title"), "genre": obj.get("genre"), "mood": obj.get("mood"), - "var_date": obj.get("date"), + "date": obj.get("date"), "track_number": obj.get("track_number"), "disc_number": obj.get("disc_number"), "comment": obj.get("comment"), diff --git a/python-client/libretime_client/models/patched_imported_podcast.py b/python-client/libretime_client/models/patched_imported_podcast.py index 221267ef..cc743d95 100644 --- a/python-client/libretime_client/models/patched_imported_podcast.py +++ b/python-client/libretime_client/models/patched_imported_podcast.py @@ -18,62 +18,80 @@ import json from datetime import datetime -from typing import Optional from pydantic import BaseModel, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class PatchedImportedPodcast(BaseModel): """ PatchedImportedPodcast - """ + """ # noqa: E501 id: Optional[StrictInt] = None override_album: Optional[StrictBool] = None auto_ingest: Optional[StrictBool] = None auto_ingested_at: Optional[datetime] = None podcast: Optional[StrictInt] = None - __properties = ["id", "override_album", "auto_ingest", "auto_ingested_at", "podcast"] + __properties: ClassVar[List[str]] = ["id", "override_album", "auto_ingest", "auto_ingested_at", "podcast"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedImportedPodcast: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedImportedPodcast from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if auto_ingested_at (nullable) is None - # and __fields_set__ contains the field - if self.auto_ingested_at is None and "auto_ingested_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.auto_ingested_at is None and "auto_ingested_at" in self.model_fields_set: _dict['auto_ingested_at'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedImportedPodcast: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedImportedPodcast from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedImportedPodcast.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedImportedPodcast.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "override_album": obj.get("override_album"), "auto_ingest": obj.get("auto_ingest"), diff --git a/python-client/libretime_client/models/patched_library.py b/python-client/libretime_client/models/patched_library.py index bafa11e0..d162bd2a 100644 --- a/python-client/libretime_client/models/patched_library.py +++ b/python-client/libretime_client/models/patched_library.py @@ -17,69 +17,87 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictBool, StrictInt, constr +from pydantic import BaseModel, Field, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedLibrary(BaseModel): """ PatchedLibrary - """ + """ # noqa: E501 id: Optional[StrictInt] = None - name: Optional[constr(strict=True, max_length=255)] = None - code: Optional[constr(strict=True, max_length=16)] = None - description: Optional[constr(strict=True, max_length=255)] = None + name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + code: Optional[Annotated[str, Field(strict=True, max_length=16)]] = None + description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None enabled: Optional[StrictBool] = None analyze_cue_points: Optional[StrictBool] = None - __properties = ["id", "name", "code", "description", "enabled", "analyze_cue_points"] + __properties: ClassVar[List[str]] = ["id", "name", "code", "description", "enabled", "analyze_cue_points"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedLibrary: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedLibrary from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedLibrary: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedLibrary from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedLibrary.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedLibrary.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "name": obj.get("name"), "code": obj.get("code"), diff --git a/python-client/libretime_client/models/patched_listener_count.py b/python-client/libretime_client/models/patched_listener_count.py index 142a16fa..eea09c41 100644 --- a/python-client/libretime_client/models/patched_listener_count.py +++ b/python-client/libretime_client/models/patched_listener_count.py @@ -17,57 +17,75 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictInt, conint +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedListenerCount(BaseModel): """ PatchedListenerCount - """ + """ # noqa: E501 id: Optional[StrictInt] = None - listener_count: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + listener_count: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None timestamp: Optional[StrictInt] = None mount_name: Optional[StrictInt] = None - __properties = ["id", "listener_count", "timestamp", "mount_name"] + __properties: ClassVar[List[str]] = ["id", "listener_count", "timestamp", "mount_name"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedListenerCount: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedListenerCount from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedListenerCount: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedListenerCount from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedListenerCount.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedListenerCount.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "listener_count": obj.get("listener_count"), "timestamp": obj.get("timestamp"), diff --git a/python-client/libretime_client/models/patched_live_log.py b/python-client/libretime_client/models/patched_live_log.py index eb227c4d..3a5ba653 100644 --- a/python-client/libretime_client/models/patched_live_log.py +++ b/python-client/libretime_client/models/patched_live_log.py @@ -18,61 +18,80 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedLiveLog(BaseModel): """ PatchedLiveLog - """ + """ # noqa: E501 id: Optional[StrictInt] = None - state: Optional[constr(strict=True, max_length=32)] = None + state: Optional[Annotated[str, Field(strict=True, max_length=32)]] = None start_time: Optional[datetime] = None end_time: Optional[datetime] = None - __properties = ["id", "state", "start_time", "end_time"] + __properties: ClassVar[List[str]] = ["id", "state", "start_time", "end_time"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedLiveLog: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedLiveLog from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if end_time (nullable) is None - # and __fields_set__ contains the field - if self.end_time is None and "end_time" in self.__fields_set__: + # and model_fields_set contains the field + if self.end_time is None and "end_time" in self.model_fields_set: _dict['end_time'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedLiveLog: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedLiveLog from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedLiveLog.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedLiveLog.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "state": obj.get("state"), "start_time": obj.get("start_time"), diff --git a/python-client/libretime_client/models/patched_login_attempt.py b/python-client/libretime_client/models/patched_login_attempt.py index ae402afb..d45d179d 100644 --- a/python-client/libretime_client/models/patched_login_attempt.py +++ b/python-client/libretime_client/models/patched_login_attempt.py @@ -17,59 +17,76 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, conint, constr +from pydantic import BaseModel, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedLoginAttempt(BaseModel): """ PatchedLoginAttempt - """ - ip: Optional[constr(strict=True, max_length=32)] = None - attempts: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - __properties = ["ip", "attempts"] + """ # noqa: E501 + ip: Optional[Annotated[str, Field(strict=True, max_length=32)]] = None + attempts: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + __properties: ClassVar[List[str]] = ["ip", "attempts"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedLoginAttempt: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedLoginAttempt from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if attempts (nullable) is None - # and __fields_set__ contains the field - if self.attempts is None and "attempts" in self.__fields_set__: + # and model_fields_set contains the field + if self.attempts is None and "attempts" in self.model_fields_set: _dict['attempts'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedLoginAttempt: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedLoginAttempt from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedLoginAttempt.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedLoginAttempt.parse_obj({ + _obj = cls.model_validate({ "ip": obj.get("ip"), "attempts": obj.get("attempts") }) diff --git a/python-client/libretime_client/models/patched_mount_name.py b/python-client/libretime_client/models/patched_mount_name.py index e71f5e41..1df72abd 100644 --- a/python-client/libretime_client/models/patched_mount_name.py +++ b/python-client/libretime_client/models/patched_mount_name.py @@ -17,55 +17,73 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedMountName(BaseModel): """ PatchedMountName - """ + """ # noqa: E501 id: Optional[StrictInt] = None - mount_name: Optional[constr(strict=True, max_length=1024)] = None - __properties = ["id", "mount_name"] + mount_name: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None + __properties: ClassVar[List[str]] = ["id", "mount_name"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedMountName: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedMountName from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedMountName: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedMountName from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedMountName.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedMountName.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "mount_name": obj.get("mount_name") }) diff --git a/python-client/libretime_client/models/patched_playlist.py b/python-client/libretime_client/models/patched_playlist.py index fbaefb3d..64f16062 100644 --- a/python-client/libretime_client/models/patched_playlist.py +++ b/python-client/libretime_client/models/patched_playlist.py @@ -18,84 +18,103 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedPlaylist(BaseModel): """ PatchedPlaylist - """ + """ # noqa: E501 id: Optional[StrictInt] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None - name: Optional[constr(strict=True, max_length=255)] = None - description: Optional[constr(strict=True, max_length=512)] = None + name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + description: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None length: Optional[StrictStr] = None owner: Optional[StrictInt] = None - __properties = ["id", "created_at", "updated_at", "name", "description", "length", "owner"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "name", "description", "length", "owner"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedPlaylist: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedPlaylist from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if created_at (nullable) is None - # and __fields_set__ contains the field - if self.created_at is None and "created_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: _dict['created_at'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if length (nullable) is None - # and __fields_set__ contains the field - if self.length is None and "length" in self.__fields_set__: + # and model_fields_set contains the field + if self.length is None and "length" in self.model_fields_set: _dict['length'] = None # set to None if owner (nullable) is None - # and __fields_set__ contains the field - if self.owner is None and "owner" in self.__fields_set__: + # and model_fields_set contains the field + if self.owner is None and "owner" in self.model_fields_set: _dict['owner'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedPlaylist: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedPlaylist from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedPlaylist.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedPlaylist.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/python-client/libretime_client/models/patched_playlist_content.py b/python-client/libretime_client/models/patched_playlist_content.py index f0da66c9..a2097218 100644 --- a/python-client/libretime_client/models/patched_playlist_content.py +++ b/python-client/libretime_client/models/patched_playlist_content.py @@ -17,18 +17,20 @@ import re # noqa: F401 import json - -from typing import Optional, Union -from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr, conint +from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from libretime_client.models.playlist_content_kind_enum import PlaylistContentKindEnum +from typing import Optional, Set +from typing_extensions import Self class PatchedPlaylistContent(BaseModel): """ PatchedPlaylistContent - """ + """ # noqa: E501 id: Optional[StrictInt] = None kind: Optional[PlaylistContentKindEnum] = None - position: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + position: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None offset: Optional[Union[StrictFloat, StrictInt]] = None length: Optional[StrictStr] = None cue_in: Optional[StrictStr] = None @@ -39,95 +41,111 @@ class PatchedPlaylistContent(BaseModel): file: Optional[StrictInt] = None stream: Optional[StrictInt] = None block: Optional[StrictInt] = None - __properties = ["id", "kind", "position", "offset", "length", "cue_in", "cue_out", "fade_in", "fade_out", "playlist", "file", "stream", "block"] + __properties: ClassVar[List[str]] = ["id", "kind", "position", "offset", "length", "cue_in", "cue_out", "fade_in", "fade_out", "playlist", "file", "stream", "block"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedPlaylistContent: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedPlaylistContent from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if position (nullable) is None - # and __fields_set__ contains the field - if self.position is None and "position" in self.__fields_set__: + # and model_fields_set contains the field + if self.position is None and "position" in self.model_fields_set: _dict['position'] = None # set to None if length (nullable) is None - # and __fields_set__ contains the field - if self.length is None and "length" in self.__fields_set__: + # and model_fields_set contains the field + if self.length is None and "length" in self.model_fields_set: _dict['length'] = None # set to None if cue_in (nullable) is None - # and __fields_set__ contains the field - if self.cue_in is None and "cue_in" in self.__fields_set__: + # and model_fields_set contains the field + if self.cue_in is None and "cue_in" in self.model_fields_set: _dict['cue_in'] = None # set to None if cue_out (nullable) is None - # and __fields_set__ contains the field - if self.cue_out is None and "cue_out" in self.__fields_set__: + # and model_fields_set contains the field + if self.cue_out is None and "cue_out" in self.model_fields_set: _dict['cue_out'] = None # set to None if fade_in (nullable) is None - # and __fields_set__ contains the field - if self.fade_in is None and "fade_in" in self.__fields_set__: + # and model_fields_set contains the field + if self.fade_in is None and "fade_in" in self.model_fields_set: _dict['fade_in'] = None # set to None if fade_out (nullable) is None - # and __fields_set__ contains the field - if self.fade_out is None and "fade_out" in self.__fields_set__: + # and model_fields_set contains the field + if self.fade_out is None and "fade_out" in self.model_fields_set: _dict['fade_out'] = None # set to None if playlist (nullable) is None - # and __fields_set__ contains the field - if self.playlist is None and "playlist" in self.__fields_set__: + # and model_fields_set contains the field + if self.playlist is None and "playlist" in self.model_fields_set: _dict['playlist'] = None # set to None if file (nullable) is None - # and __fields_set__ contains the field - if self.file is None and "file" in self.__fields_set__: + # and model_fields_set contains the field + if self.file is None and "file" in self.model_fields_set: _dict['file'] = None # set to None if stream (nullable) is None - # and __fields_set__ contains the field - if self.stream is None and "stream" in self.__fields_set__: + # and model_fields_set contains the field + if self.stream is None and "stream" in self.model_fields_set: _dict['stream'] = None # set to None if block (nullable) is None - # and __fields_set__ contains the field - if self.block is None and "block" in self.__fields_set__: + # and model_fields_set contains the field + if self.block is None and "block" in self.model_fields_set: _dict['block'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedPlaylistContent: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedPlaylistContent from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedPlaylistContent.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedPlaylistContent.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "kind": obj.get("kind"), "position": obj.get("position"), diff --git a/python-client/libretime_client/models/patched_playout_history.py b/python-client/libretime_client/models/patched_playout_history.py index cb0124bb..1a556f29 100644 --- a/python-client/libretime_client/models/patched_playout_history.py +++ b/python-client/libretime_client/models/patched_playout_history.py @@ -18,72 +18,90 @@ import json from datetime import datetime -from typing import Optional from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class PatchedPlayoutHistory(BaseModel): """ PatchedPlayoutHistory - """ + """ # noqa: E501 id: Optional[StrictInt] = None starts: Optional[datetime] = None ends: Optional[datetime] = None file: Optional[StrictInt] = None instance: Optional[StrictInt] = None - __properties = ["id", "starts", "ends", "file", "instance"] + __properties: ClassVar[List[str]] = ["id", "starts", "ends", "file", "instance"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedPlayoutHistory: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedPlayoutHistory from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if ends (nullable) is None - # and __fields_set__ contains the field - if self.ends is None and "ends" in self.__fields_set__: + # and model_fields_set contains the field + if self.ends is None and "ends" in self.model_fields_set: _dict['ends'] = None # set to None if file (nullable) is None - # and __fields_set__ contains the field - if self.file is None and "file" in self.__fields_set__: + # and model_fields_set contains the field + if self.file is None and "file" in self.model_fields_set: _dict['file'] = None # set to None if instance (nullable) is None - # and __fields_set__ contains the field - if self.instance is None and "instance" in self.__fields_set__: + # and model_fields_set contains the field + if self.instance is None and "instance" in self.model_fields_set: _dict['instance'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedPlayoutHistory: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedPlayoutHistory from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedPlayoutHistory.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedPlayoutHistory.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "starts": obj.get("starts"), "ends": obj.get("ends"), diff --git a/python-client/libretime_client/models/patched_playout_history_metadata.py b/python-client/libretime_client/models/patched_playout_history_metadata.py index be4454e0..c275044a 100644 --- a/python-client/libretime_client/models/patched_playout_history_metadata.py +++ b/python-client/libretime_client/models/patched_playout_history_metadata.py @@ -17,57 +17,75 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedPlayoutHistoryMetadata(BaseModel): """ PatchedPlayoutHistoryMetadata - """ + """ # noqa: E501 id: Optional[StrictInt] = None - key: Optional[constr(strict=True, max_length=128)] = None - value: Optional[constr(strict=True, max_length=128)] = None + key: Optional[Annotated[str, Field(strict=True, max_length=128)]] = None + value: Optional[Annotated[str, Field(strict=True, max_length=128)]] = None history: Optional[StrictInt] = None - __properties = ["id", "key", "value", "history"] + __properties: ClassVar[List[str]] = ["id", "key", "value", "history"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedPlayoutHistoryMetadata: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedPlayoutHistoryMetadata from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedPlayoutHistoryMetadata: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedPlayoutHistoryMetadata from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedPlayoutHistoryMetadata.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedPlayoutHistoryMetadata.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "key": obj.get("key"), "value": obj.get("value"), diff --git a/python-client/libretime_client/models/patched_playout_history_template.py b/python-client/libretime_client/models/patched_playout_history_template.py index 8ec7e201..2f87b5b2 100644 --- a/python-client/libretime_client/models/patched_playout_history_template.py +++ b/python-client/libretime_client/models/patched_playout_history_template.py @@ -17,56 +17,74 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedPlayoutHistoryTemplate(BaseModel): """ PatchedPlayoutHistoryTemplate - """ + """ # noqa: E501 id: Optional[StrictInt] = None - name: Optional[constr(strict=True, max_length=128)] = None - type: Optional[constr(strict=True, max_length=35)] = None - __properties = ["id", "name", "type"] + name: Optional[Annotated[str, Field(strict=True, max_length=128)]] = None + type: Optional[Annotated[str, Field(strict=True, max_length=35)]] = None + __properties: ClassVar[List[str]] = ["id", "name", "type"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedPlayoutHistoryTemplate: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedPlayoutHistoryTemplate from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedPlayoutHistoryTemplate: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedPlayoutHistoryTemplate from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedPlayoutHistoryTemplate.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedPlayoutHistoryTemplate.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "name": obj.get("name"), "type": obj.get("type") diff --git a/python-client/libretime_client/models/patched_playout_history_template_field.py b/python-client/libretime_client/models/patched_playout_history_template_field.py index 9be0f758..6446ff35 100644 --- a/python-client/libretime_client/models/patched_playout_history_template_field.py +++ b/python-client/libretime_client/models/patched_playout_history_template_field.py @@ -17,60 +17,78 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictBool, StrictInt, conint, constr +from pydantic import BaseModel, Field, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedPlayoutHistoryTemplateField(BaseModel): """ PatchedPlayoutHistoryTemplateField - """ + """ # noqa: E501 id: Optional[StrictInt] = None - name: Optional[constr(strict=True, max_length=128)] = None - label: Optional[constr(strict=True, max_length=128)] = None - type: Optional[constr(strict=True, max_length=128)] = None + name: Optional[Annotated[str, Field(strict=True, max_length=128)]] = None + label: Optional[Annotated[str, Field(strict=True, max_length=128)]] = None + type: Optional[Annotated[str, Field(strict=True, max_length=128)]] = None is_file_md: Optional[StrictBool] = None - position: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + position: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None template: Optional[StrictInt] = None - __properties = ["id", "name", "label", "type", "is_file_md", "position", "template"] + __properties: ClassVar[List[str]] = ["id", "name", "label", "type", "is_file_md", "position", "template"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedPlayoutHistoryTemplateField: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedPlayoutHistoryTemplateField from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedPlayoutHistoryTemplateField: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedPlayoutHistoryTemplateField from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedPlayoutHistoryTemplateField.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedPlayoutHistoryTemplateField.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "name": obj.get("name"), "label": obj.get("label"), diff --git a/python-client/libretime_client/models/patched_podcast.py b/python-client/libretime_client/models/patched_podcast.py index b435d21c..c7ddcc7c 100644 --- a/python-client/libretime_client/models/patched_podcast.py +++ b/python-client/libretime_client/models/patched_podcast.py @@ -17,128 +17,146 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedPodcast(BaseModel): """ PatchedPodcast - """ + """ # noqa: E501 id: Optional[StrictInt] = None - url: Optional[constr(strict=True, max_length=4096)] = None - title: Optional[constr(strict=True, max_length=4096)] = None - creator: Optional[constr(strict=True, max_length=4096)] = None - description: Optional[constr(strict=True, max_length=4096)] = None - language: Optional[constr(strict=True, max_length=4096)] = None - copyright: Optional[constr(strict=True, max_length=4096)] = None - link: Optional[constr(strict=True, max_length=4096)] = None - itunes_author: Optional[constr(strict=True, max_length=4096)] = None - itunes_keywords: Optional[constr(strict=True, max_length=4096)] = None - itunes_summary: Optional[constr(strict=True, max_length=4096)] = None - itunes_subtitle: Optional[constr(strict=True, max_length=4096)] = None - itunes_category: Optional[constr(strict=True, max_length=4096)] = None - itunes_explicit: Optional[constr(strict=True, max_length=4096)] = None + url: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + title: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + creator: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + description: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + language: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + copyright: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + link: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + itunes_author: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + itunes_keywords: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + itunes_summary: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + itunes_subtitle: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + itunes_category: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + itunes_explicit: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None owner: Optional[StrictInt] = None - __properties = ["id", "url", "title", "creator", "description", "language", "copyright", "link", "itunes_author", "itunes_keywords", "itunes_summary", "itunes_subtitle", "itunes_category", "itunes_explicit", "owner"] + __properties: ClassVar[List[str]] = ["id", "url", "title", "creator", "description", "language", "copyright", "link", "itunes_author", "itunes_keywords", "itunes_summary", "itunes_subtitle", "itunes_category", "itunes_explicit", "owner"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedPodcast: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedPodcast from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if creator (nullable) is None - # and __fields_set__ contains the field - if self.creator is None and "creator" in self.__fields_set__: + # and model_fields_set contains the field + if self.creator is None and "creator" in self.model_fields_set: _dict['creator'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if language (nullable) is None - # and __fields_set__ contains the field - if self.language is None and "language" in self.__fields_set__: + # and model_fields_set contains the field + if self.language is None and "language" in self.model_fields_set: _dict['language'] = None # set to None if copyright (nullable) is None - # and __fields_set__ contains the field - if self.copyright is None and "copyright" in self.__fields_set__: + # and model_fields_set contains the field + if self.copyright is None and "copyright" in self.model_fields_set: _dict['copyright'] = None # set to None if link (nullable) is None - # and __fields_set__ contains the field - if self.link is None and "link" in self.__fields_set__: + # and model_fields_set contains the field + if self.link is None and "link" in self.model_fields_set: _dict['link'] = None # set to None if itunes_author (nullable) is None - # and __fields_set__ contains the field - if self.itunes_author is None and "itunes_author" in self.__fields_set__: + # and model_fields_set contains the field + if self.itunes_author is None and "itunes_author" in self.model_fields_set: _dict['itunes_author'] = None # set to None if itunes_keywords (nullable) is None - # and __fields_set__ contains the field - if self.itunes_keywords is None and "itunes_keywords" in self.__fields_set__: + # and model_fields_set contains the field + if self.itunes_keywords is None and "itunes_keywords" in self.model_fields_set: _dict['itunes_keywords'] = None # set to None if itunes_summary (nullable) is None - # and __fields_set__ contains the field - if self.itunes_summary is None and "itunes_summary" in self.__fields_set__: + # and model_fields_set contains the field + if self.itunes_summary is None and "itunes_summary" in self.model_fields_set: _dict['itunes_summary'] = None # set to None if itunes_subtitle (nullable) is None - # and __fields_set__ contains the field - if self.itunes_subtitle is None and "itunes_subtitle" in self.__fields_set__: + # and model_fields_set contains the field + if self.itunes_subtitle is None and "itunes_subtitle" in self.model_fields_set: _dict['itunes_subtitle'] = None # set to None if itunes_category (nullable) is None - # and __fields_set__ contains the field - if self.itunes_category is None and "itunes_category" in self.__fields_set__: + # and model_fields_set contains the field + if self.itunes_category is None and "itunes_category" in self.model_fields_set: _dict['itunes_category'] = None # set to None if itunes_explicit (nullable) is None - # and __fields_set__ contains the field - if self.itunes_explicit is None and "itunes_explicit" in self.__fields_set__: + # and model_fields_set contains the field + if self.itunes_explicit is None and "itunes_explicit" in self.model_fields_set: _dict['itunes_explicit'] = None # set to None if owner (nullable) is None - # and __fields_set__ contains the field - if self.owner is None and "owner" in self.__fields_set__: + # and model_fields_set contains the field + if self.owner is None and "owner" in self.model_fields_set: _dict['owner'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedPodcast: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedPodcast from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedPodcast.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedPodcast.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "url": obj.get("url"), "title": obj.get("title"), diff --git a/python-client/libretime_client/models/patched_podcast_episode.py b/python-client/libretime_client/models/patched_podcast_episode.py index 8690079d..3aef2fa5 100644 --- a/python-client/libretime_client/models/patched_podcast_episode.py +++ b/python-client/libretime_client/models/patched_podcast_episode.py @@ -18,65 +18,84 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedPodcastEpisode(BaseModel): """ PatchedPodcastEpisode - """ + """ # noqa: E501 id: Optional[StrictInt] = None published_at: Optional[datetime] = None - download_url: Optional[constr(strict=True, max_length=4096)] = None - episode_guid: Optional[constr(strict=True, max_length=4096)] = None - episode_title: Optional[constr(strict=True, max_length=4096)] = None + download_url: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + episode_guid: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + episode_title: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None episode_description: Optional[StrictStr] = None podcast: Optional[StrictInt] = None file: Optional[StrictInt] = None - __properties = ["id", "published_at", "download_url", "episode_guid", "episode_title", "episode_description", "podcast", "file"] + __properties: ClassVar[List[str]] = ["id", "published_at", "download_url", "episode_guid", "episode_title", "episode_description", "podcast", "file"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedPodcastEpisode: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedPodcastEpisode from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if file (nullable) is None - # and __fields_set__ contains the field - if self.file is None and "file" in self.__fields_set__: + # and model_fields_set contains the field + if self.file is None and "file" in self.model_fields_set: _dict['file'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedPodcastEpisode: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedPodcastEpisode from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedPodcastEpisode.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedPodcastEpisode.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "published_at": obj.get("published_at"), "download_url": obj.get("download_url"), diff --git a/python-client/libretime_client/models/patched_preference.py b/python-client/libretime_client/models/patched_preference.py index 01a62519..c1e462d7 100644 --- a/python-client/libretime_client/models/patched_preference.py +++ b/python-client/libretime_client/models/patched_preference.py @@ -17,72 +17,90 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedPreference(BaseModel): """ PatchedPreference - """ + """ # noqa: E501 id: Optional[StrictInt] = None - key: Optional[constr(strict=True, max_length=255)] = None + key: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None value: Optional[StrictStr] = None user: Optional[StrictInt] = None - __properties = ["id", "key", "value", "user"] + __properties: ClassVar[List[str]] = ["id", "key", "value", "user"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedPreference: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedPreference from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if key (nullable) is None - # and __fields_set__ contains the field - if self.key is None and "key" in self.__fields_set__: + # and model_fields_set contains the field + if self.key is None and "key" in self.model_fields_set: _dict['key'] = None # set to None if value (nullable) is None - # and __fields_set__ contains the field - if self.value is None and "value" in self.__fields_set__: + # and model_fields_set contains the field + if self.value is None and "value" in self.model_fields_set: _dict['value'] = None # set to None if user (nullable) is None - # and __fields_set__ contains the field - if self.user is None and "user" in self.__fields_set__: + # and model_fields_set contains the field + if self.user is None and "user" in self.model_fields_set: _dict['user'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedPreference: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedPreference from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedPreference.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedPreference.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "key": obj.get("key"), "value": obj.get("value"), diff --git a/python-client/libretime_client/models/patched_schedule.py b/python-client/libretime_client/models/patched_schedule.py index 2decff33..a3027bfe 100644 --- a/python-client/libretime_client/models/patched_schedule.py +++ b/python-client/libretime_client/models/patched_schedule.py @@ -18,14 +18,17 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, conint +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from libretime_client.models.position_status_enum import PositionStatusEnum +from typing import Optional, Set +from typing_extensions import Self class PatchedSchedule(BaseModel): """ PatchedSchedule - """ + """ # noqa: E501 id: Optional[StrictInt] = None cue_out: Optional[StrictStr] = None ends_at: Optional[datetime] = None @@ -34,84 +37,102 @@ class PatchedSchedule(BaseModel): fade_in: Optional[StrictStr] = None fade_out: Optional[StrictStr] = None cue_in: Optional[StrictStr] = None - position: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + position: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None position_status: Optional[PositionStatusEnum] = None - broadcasted: Optional[conint(strict=True, le=32767, ge=-32768)] = None + broadcasted: Optional[Annotated[int, Field(le=32767, strict=True, ge=-32768)]] = None played: Optional[StrictBool] = None instance: Optional[StrictInt] = None file: Optional[StrictInt] = None stream: Optional[StrictInt] = None - __properties = ["id", "cue_out", "ends_at", "starts_at", "length", "fade_in", "fade_out", "cue_in", "position", "position_status", "broadcasted", "played", "instance", "file", "stream"] + __properties: ClassVar[List[str]] = ["id", "cue_out", "ends_at", "starts_at", "length", "fade_in", "fade_out", "cue_in", "position", "position_status", "broadcasted", "played", "instance", "file", "stream"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedSchedule: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedSchedule from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "cue_out", - "ends_at", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "cue_out", + "ends_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if length (nullable) is None - # and __fields_set__ contains the field - if self.length is None and "length" in self.__fields_set__: + # and model_fields_set contains the field + if self.length is None and "length" in self.model_fields_set: _dict['length'] = None # set to None if fade_in (nullable) is None - # and __fields_set__ contains the field - if self.fade_in is None and "fade_in" in self.__fields_set__: + # and model_fields_set contains the field + if self.fade_in is None and "fade_in" in self.model_fields_set: _dict['fade_in'] = None # set to None if fade_out (nullable) is None - # and __fields_set__ contains the field - if self.fade_out is None and "fade_out" in self.__fields_set__: + # and model_fields_set contains the field + if self.fade_out is None and "fade_out" in self.model_fields_set: _dict['fade_out'] = None # set to None if played (nullable) is None - # and __fields_set__ contains the field - if self.played is None and "played" in self.__fields_set__: + # and model_fields_set contains the field + if self.played is None and "played" in self.model_fields_set: _dict['played'] = None # set to None if file (nullable) is None - # and __fields_set__ contains the field - if self.file is None and "file" in self.__fields_set__: + # and model_fields_set contains the field + if self.file is None and "file" in self.model_fields_set: _dict['file'] = None # set to None if stream (nullable) is None - # and __fields_set__ contains the field - if self.stream is None and "stream" in self.__fields_set__: + # and model_fields_set contains the field + if self.stream is None and "stream" in self.model_fields_set: _dict['stream'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedSchedule: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedSchedule from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedSchedule.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedSchedule.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "cue_out": obj.get("cue_out"), "ends_at": obj.get("ends_at"), diff --git a/python-client/libretime_client/models/patched_service_register.py b/python-client/libretime_client/models/patched_service_register.py index d8ace603..1c0ee994 100644 --- a/python-client/libretime_client/models/patched_service_register.py +++ b/python-client/libretime_client/models/patched_service_register.py @@ -17,54 +17,71 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, constr +from pydantic import BaseModel, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedServiceRegister(BaseModel): """ PatchedServiceRegister - """ - name: Optional[constr(strict=True, max_length=32)] = None - ip: Optional[constr(strict=True, max_length=45)] = None - __properties = ["name", "ip"] + """ # noqa: E501 + name: Optional[Annotated[str, Field(strict=True, max_length=32)]] = None + ip: Optional[Annotated[str, Field(strict=True, max_length=45)]] = None + __properties: ClassVar[List[str]] = ["name", "ip"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedServiceRegister: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedServiceRegister from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedServiceRegister: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedServiceRegister from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedServiceRegister.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedServiceRegister.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "ip": obj.get("ip") }) diff --git a/python-client/libretime_client/models/patched_show.py b/python-client/libretime_client/models/patched_show.py index b616f3de..dd00304c 100644 --- a/python-client/libretime_client/models/patched_show.py +++ b/python-client/libretime_client/models/patched_show.py @@ -17,103 +17,122 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictBool, StrictInt, constr +from pydantic import BaseModel, Field, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedShow(BaseModel): """ PatchedShow - """ + """ # noqa: E501 id: Optional[StrictInt] = None - name: Optional[constr(strict=True, max_length=255)] = None - description: Optional[constr(strict=True, max_length=8192)] = None - genre: Optional[constr(strict=True, max_length=255)] = None - url: Optional[constr(strict=True, max_length=255)] = None - image: Optional[constr(strict=True, max_length=255)] = None - foreground_color: Optional[constr(strict=True, max_length=6)] = None - background_color: Optional[constr(strict=True, max_length=6)] = None + name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + description: Optional[Annotated[str, Field(strict=True, max_length=8192)]] = None + genre: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + url: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + image: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + foreground_color: Optional[Annotated[str, Field(strict=True, max_length=6)]] = None + background_color: Optional[Annotated[str, Field(strict=True, max_length=6)]] = None live_enabled: Optional[StrictBool] = None linked: Optional[StrictBool] = None linkable: Optional[StrictBool] = None auto_playlist: Optional[StrictInt] = None auto_playlist_enabled: Optional[StrictBool] = None auto_playlist_repeat: Optional[StrictBool] = None - __properties = ["id", "name", "description", "genre", "url", "image", "foreground_color", "background_color", "live_enabled", "linked", "linkable", "auto_playlist", "auto_playlist_enabled", "auto_playlist_repeat"] + __properties: ClassVar[List[str]] = ["id", "name", "description", "genre", "url", "image", "foreground_color", "background_color", "live_enabled", "linked", "linkable", "auto_playlist", "auto_playlist_enabled", "auto_playlist_repeat"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedShow: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedShow from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "live_enabled", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "live_enabled", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if genre (nullable) is None - # and __fields_set__ contains the field - if self.genre is None and "genre" in self.__fields_set__: + # and model_fields_set contains the field + if self.genre is None and "genre" in self.model_fields_set: _dict['genre'] = None # set to None if url (nullable) is None - # and __fields_set__ contains the field - if self.url is None and "url" in self.__fields_set__: + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: _dict['url'] = None # set to None if image (nullable) is None - # and __fields_set__ contains the field - if self.image is None and "image" in self.__fields_set__: + # and model_fields_set contains the field + if self.image is None and "image" in self.model_fields_set: _dict['image'] = None # set to None if foreground_color (nullable) is None - # and __fields_set__ contains the field - if self.foreground_color is None and "foreground_color" in self.__fields_set__: + # and model_fields_set contains the field + if self.foreground_color is None and "foreground_color" in self.model_fields_set: _dict['foreground_color'] = None # set to None if background_color (nullable) is None - # and __fields_set__ contains the field - if self.background_color is None and "background_color" in self.__fields_set__: + # and model_fields_set contains the field + if self.background_color is None and "background_color" in self.model_fields_set: _dict['background_color'] = None # set to None if auto_playlist (nullable) is None - # and __fields_set__ contains the field - if self.auto_playlist is None and "auto_playlist" in self.__fields_set__: + # and model_fields_set contains the field + if self.auto_playlist is None and "auto_playlist" in self.model_fields_set: _dict['auto_playlist'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedShow: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedShow from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedShow.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedShow.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "name": obj.get("name"), "description": obj.get("description"), diff --git a/python-client/libretime_client/models/patched_show_days.py b/python-client/libretime_client/models/patched_show_days.py index 5a8ed2a8..c067236a 100644 --- a/python-client/libretime_client/models/patched_show_days.py +++ b/python-client/libretime_client/models/patched_show_days.py @@ -18,86 +18,105 @@ import json from datetime import date -from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from libretime_client.models.record_enabled_enum import RecordEnabledEnum from libretime_client.models.repeat_kind_enum import RepeatKindEnum from libretime_client.models.week_day_enum import WeekDayEnum +from typing import Optional, Set +from typing_extensions import Self class PatchedShowDays(BaseModel): """ PatchedShowDays - """ + """ # noqa: E501 id: Optional[StrictInt] = None first_show_on: Optional[date] = None last_show_on: Optional[date] = None start_time: Optional[StrictStr] = None - timezone: Optional[constr(strict=True, max_length=1024)] = None - duration: Optional[constr(strict=True, max_length=1024)] = None + timezone: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None + duration: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None record_enabled: Optional[RecordEnabledEnum] = None week_day: Optional[WeekDayEnum] = None repeat_kind: Optional[RepeatKindEnum] = None repeat_next_on: Optional[date] = None show: Optional[StrictInt] = None - __properties = ["id", "first_show_on", "last_show_on", "start_time", "timezone", "duration", "record_enabled", "week_day", "repeat_kind", "repeat_next_on", "show"] + __properties: ClassVar[List[str]] = ["id", "first_show_on", "last_show_on", "start_time", "timezone", "duration", "record_enabled", "week_day", "repeat_kind", "repeat_next_on", "show"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedShowDays: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedShowDays from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if last_show_on (nullable) is None - # and __fields_set__ contains the field - if self.last_show_on is None and "last_show_on" in self.__fields_set__: + # and model_fields_set contains the field + if self.last_show_on is None and "last_show_on" in self.model_fields_set: _dict['last_show_on'] = None # set to None if record_enabled (nullable) is None - # and __fields_set__ contains the field - if self.record_enabled is None and "record_enabled" in self.__fields_set__: + # and model_fields_set contains the field + if self.record_enabled is None and "record_enabled" in self.model_fields_set: _dict['record_enabled'] = None # set to None if week_day (nullable) is None - # and __fields_set__ contains the field - if self.week_day is None and "week_day" in self.__fields_set__: + # and model_fields_set contains the field + if self.week_day is None and "week_day" in self.model_fields_set: _dict['week_day'] = None # set to None if repeat_next_on (nullable) is None - # and __fields_set__ contains the field - if self.repeat_next_on is None and "repeat_next_on" in self.__fields_set__: + # and model_fields_set contains the field + if self.repeat_next_on is None and "repeat_next_on" in self.model_fields_set: _dict['repeat_next_on'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedShowDays: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedShowDays from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedShowDays.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedShowDays.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "first_show_on": obj.get("first_show_on"), "last_show_on": obj.get("last_show_on"), diff --git a/python-client/libretime_client/models/patched_show_host.py b/python-client/libretime_client/models/patched_show_host.py index 50561c10..b6a9f2fe 100644 --- a/python-client/libretime_client/models/patched_show_host.py +++ b/python-client/libretime_client/models/patched_show_host.py @@ -17,56 +17,73 @@ import re # noqa: F401 import json - -from typing import Optional from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class PatchedShowHost(BaseModel): """ PatchedShowHost - """ + """ # noqa: E501 id: Optional[StrictInt] = None show: Optional[StrictInt] = None user: Optional[StrictInt] = None - __properties = ["id", "show", "user"] + __properties: ClassVar[List[str]] = ["id", "show", "user"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedShowHost: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedShowHost from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedShowHost: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedShowHost from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedShowHost.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedShowHost.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "show": obj.get("show"), "user": obj.get("user") diff --git a/python-client/libretime_client/models/patched_show_instance.py b/python-client/libretime_client/models/patched_show_instance.py index 5cb3744e..7665d8f9 100644 --- a/python-client/libretime_client/models/patched_show_instance.py +++ b/python-client/libretime_client/models/patched_show_instance.py @@ -18,102 +18,121 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, conint, constr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from libretime_client.models.record_enabled_enum import RecordEnabledEnum +from typing import Optional, Set +from typing_extensions import Self class PatchedShowInstance(BaseModel): """ PatchedShowInstance - """ + """ # noqa: E501 id: Optional[StrictInt] = None created_at: Optional[datetime] = None starts_at: Optional[datetime] = None ends_at: Optional[datetime] = None filled_time: Optional[StrictStr] = None last_scheduled_at: Optional[datetime] = None - description: Optional[constr(strict=True, max_length=8192)] = None + description: Optional[Annotated[str, Field(strict=True, max_length=8192)]] = None modified: Optional[StrictBool] = None - rebroadcast: Optional[conint(strict=True, le=32767, ge=-32768)] = None + rebroadcast: Optional[Annotated[int, Field(le=32767, strict=True, ge=-32768)]] = None auto_playlist_built: Optional[StrictBool] = None record_enabled: Optional[RecordEnabledEnum] = None show: Optional[StrictInt] = None instance: Optional[StrictInt] = None record_file: Optional[StrictInt] = None - __properties = ["id", "created_at", "starts_at", "ends_at", "filled_time", "last_scheduled_at", "description", "modified", "rebroadcast", "auto_playlist_built", "record_enabled", "show", "instance", "record_file"] + __properties: ClassVar[List[str]] = ["id", "created_at", "starts_at", "ends_at", "filled_time", "last_scheduled_at", "description", "modified", "rebroadcast", "auto_playlist_built", "record_enabled", "show", "instance", "record_file"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedShowInstance: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedShowInstance from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if filled_time (nullable) is None - # and __fields_set__ contains the field - if self.filled_time is None and "filled_time" in self.__fields_set__: + # and model_fields_set contains the field + if self.filled_time is None and "filled_time" in self.model_fields_set: _dict['filled_time'] = None # set to None if last_scheduled_at (nullable) is None - # and __fields_set__ contains the field - if self.last_scheduled_at is None and "last_scheduled_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.last_scheduled_at is None and "last_scheduled_at" in self.model_fields_set: _dict['last_scheduled_at'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if rebroadcast (nullable) is None - # and __fields_set__ contains the field - if self.rebroadcast is None and "rebroadcast" in self.__fields_set__: + # and model_fields_set contains the field + if self.rebroadcast is None and "rebroadcast" in self.model_fields_set: _dict['rebroadcast'] = None # set to None if record_enabled (nullable) is None - # and __fields_set__ contains the field - if self.record_enabled is None and "record_enabled" in self.__fields_set__: + # and model_fields_set contains the field + if self.record_enabled is None and "record_enabled" in self.model_fields_set: _dict['record_enabled'] = None # set to None if instance (nullable) is None - # and __fields_set__ contains the field - if self.instance is None and "instance" in self.__fields_set__: + # and model_fields_set contains the field + if self.instance is None and "instance" in self.model_fields_set: _dict['instance'] = None # set to None if record_file (nullable) is None - # and __fields_set__ contains the field - if self.record_file is None and "record_file" in self.__fields_set__: + # and model_fields_set contains the field + if self.record_file is None and "record_file" in self.model_fields_set: _dict['record_file'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedShowInstance: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedShowInstance from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedShowInstance.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedShowInstance.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "starts_at": obj.get("starts_at"), diff --git a/python-client/libretime_client/models/patched_show_rebroadcast.py b/python-client/libretime_client/models/patched_show_rebroadcast.py index e9a8feb4..b56fa040 100644 --- a/python-client/libretime_client/models/patched_show_rebroadcast.py +++ b/python-client/libretime_client/models/patched_show_rebroadcast.py @@ -17,57 +17,75 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedShowRebroadcast(BaseModel): """ PatchedShowRebroadcast - """ + """ # noqa: E501 id: Optional[StrictInt] = None - day_offset: Optional[constr(strict=True, max_length=1024)] = None + day_offset: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None start_time: Optional[StrictStr] = None show: Optional[StrictInt] = None - __properties = ["id", "day_offset", "start_time", "show"] + __properties: ClassVar[List[str]] = ["id", "day_offset", "start_time", "show"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedShowRebroadcast: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedShowRebroadcast from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedShowRebroadcast: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedShowRebroadcast from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedShowRebroadcast.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedShowRebroadcast.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "day_offset": obj.get("day_offset"), "start_time": obj.get("start_time"), diff --git a/python-client/libretime_client/models/patched_smart_block.py b/python-client/libretime_client/models/patched_smart_block.py index 3030ce95..4412e3f8 100644 --- a/python-client/libretime_client/models/patched_smart_block.py +++ b/python-client/libretime_client/models/patched_smart_block.py @@ -18,101 +18,120 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from libretime_client.models.patched_smart_block_kind import PatchedSmartBlockKind +from typing import Optional, Set +from typing_extensions import Self class PatchedSmartBlock(BaseModel): """ PatchedSmartBlock - """ + """ # noqa: E501 id: Optional[StrictInt] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None - name: Optional[constr(strict=True, max_length=255)] = None - description: Optional[constr(strict=True, max_length=512)] = None + name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + description: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None length: Optional[StrictStr] = None kind: Optional[PatchedSmartBlockKind] = None owner: Optional[StrictInt] = None - __properties = ["id", "created_at", "updated_at", "name", "description", "length", "kind", "owner"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "name", "description", "length", "kind", "owner"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedSmartBlock: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedSmartBlock from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of kind if self.kind: _dict['kind'] = self.kind.to_dict() # set to None if created_at (nullable) is None - # and __fields_set__ contains the field - if self.created_at is None and "created_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: _dict['created_at'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if length (nullable) is None - # and __fields_set__ contains the field - if self.length is None and "length" in self.__fields_set__: + # and model_fields_set contains the field + if self.length is None and "length" in self.model_fields_set: _dict['length'] = None # set to None if kind (nullable) is None - # and __fields_set__ contains the field - if self.kind is None and "kind" in self.__fields_set__: + # and model_fields_set contains the field + if self.kind is None and "kind" in self.model_fields_set: _dict['kind'] = None # set to None if owner (nullable) is None - # and __fields_set__ contains the field - if self.owner is None and "owner" in self.__fields_set__: + # and model_fields_set contains the field + if self.owner is None and "owner" in self.model_fields_set: _dict['owner'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedSmartBlock: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedSmartBlock from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedSmartBlock.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedSmartBlock.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), "name": obj.get("name"), "description": obj.get("description"), "length": obj.get("length"), - "kind": PatchedSmartBlockKind.from_dict(obj.get("kind")) if obj.get("kind") is not None else None, + "kind": PatchedSmartBlockKind.from_dict(obj["kind"]) if obj.get("kind") is not None else None, "owner": obj.get("owner") }) return _obj diff --git a/python-client/libretime_client/models/patched_smart_block_content.py b/python-client/libretime_client/models/patched_smart_block_content.py index ad1b1ca8..4aca4496 100644 --- a/python-client/libretime_client/models/patched_smart_block_content.py +++ b/python-client/libretime_client/models/patched_smart_block_content.py @@ -17,16 +17,18 @@ import re # noqa: F401 import json - -from typing import Optional, Union -from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr, conint +from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedSmartBlockContent(BaseModel): """ PatchedSmartBlockContent - """ + """ # noqa: E501 id: Optional[StrictInt] = None - position: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + position: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None offset: Optional[Union[StrictFloat, StrictInt]] = None length: Optional[StrictStr] = None cue_in: Optional[StrictStr] = None @@ -35,85 +37,101 @@ class PatchedSmartBlockContent(BaseModel): fade_out: Optional[StrictStr] = None block: Optional[StrictInt] = None file: Optional[StrictInt] = None - __properties = ["id", "position", "offset", "length", "cue_in", "cue_out", "fade_in", "fade_out", "block", "file"] + __properties: ClassVar[List[str]] = ["id", "position", "offset", "length", "cue_in", "cue_out", "fade_in", "fade_out", "block", "file"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedSmartBlockContent: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedSmartBlockContent from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if position (nullable) is None - # and __fields_set__ contains the field - if self.position is None and "position" in self.__fields_set__: + # and model_fields_set contains the field + if self.position is None and "position" in self.model_fields_set: _dict['position'] = None # set to None if length (nullable) is None - # and __fields_set__ contains the field - if self.length is None and "length" in self.__fields_set__: + # and model_fields_set contains the field + if self.length is None and "length" in self.model_fields_set: _dict['length'] = None # set to None if cue_in (nullable) is None - # and __fields_set__ contains the field - if self.cue_in is None and "cue_in" in self.__fields_set__: + # and model_fields_set contains the field + if self.cue_in is None and "cue_in" in self.model_fields_set: _dict['cue_in'] = None # set to None if cue_out (nullable) is None - # and __fields_set__ contains the field - if self.cue_out is None and "cue_out" in self.__fields_set__: + # and model_fields_set contains the field + if self.cue_out is None and "cue_out" in self.model_fields_set: _dict['cue_out'] = None # set to None if fade_in (nullable) is None - # and __fields_set__ contains the field - if self.fade_in is None and "fade_in" in self.__fields_set__: + # and model_fields_set contains the field + if self.fade_in is None and "fade_in" in self.model_fields_set: _dict['fade_in'] = None # set to None if fade_out (nullable) is None - # and __fields_set__ contains the field - if self.fade_out is None and "fade_out" in self.__fields_set__: + # and model_fields_set contains the field + if self.fade_out is None and "fade_out" in self.model_fields_set: _dict['fade_out'] = None # set to None if block (nullable) is None - # and __fields_set__ contains the field - if self.block is None and "block" in self.__fields_set__: + # and model_fields_set contains the field + if self.block is None and "block" in self.model_fields_set: _dict['block'] = None # set to None if file (nullable) is None - # and __fields_set__ contains the field - if self.file is None and "file" in self.__fields_set__: + # and model_fields_set contains the field + if self.file is None and "file" in self.model_fields_set: _dict['file'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedSmartBlockContent: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedSmartBlockContent from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedSmartBlockContent.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedSmartBlockContent.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "position": obj.get("position"), "offset": obj.get("offset"), diff --git a/python-client/libretime_client/models/patched_smart_block_criteria.py b/python-client/libretime_client/models/patched_smart_block_criteria.py index 336777e4..e0d49169 100644 --- a/python-client/libretime_client/models/patched_smart_block_criteria.py +++ b/python-client/libretime_client/models/patched_smart_block_criteria.py @@ -17,70 +17,88 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictInt, conint, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedSmartBlockCriteria(BaseModel): """ PatchedSmartBlockCriteria - """ + """ # noqa: E501 id: Optional[StrictInt] = None - group: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - criteria: Optional[constr(strict=True, max_length=32)] = None - condition: Optional[constr(strict=True, max_length=16)] = None - value: Optional[constr(strict=True, max_length=512)] = None - extra: Optional[constr(strict=True, max_length=512)] = None + group: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + criteria: Optional[Annotated[str, Field(strict=True, max_length=32)]] = None + condition: Optional[Annotated[str, Field(strict=True, max_length=16)]] = None + value: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + extra: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None block: Optional[StrictInt] = None - __properties = ["id", "group", "criteria", "condition", "value", "extra", "block"] + __properties: ClassVar[List[str]] = ["id", "group", "criteria", "condition", "value", "extra", "block"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedSmartBlockCriteria: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedSmartBlockCriteria from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if group (nullable) is None - # and __fields_set__ contains the field - if self.group is None and "group" in self.__fields_set__: + # and model_fields_set contains the field + if self.group is None and "group" in self.model_fields_set: _dict['group'] = None # set to None if extra (nullable) is None - # and __fields_set__ contains the field - if self.extra is None and "extra" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra is None and "extra" in self.model_fields_set: _dict['extra'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedSmartBlockCriteria: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedSmartBlockCriteria from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedSmartBlockCriteria.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedSmartBlockCriteria.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "group": obj.get("group"), "criteria": obj.get("criteria"), diff --git a/python-client/libretime_client/models/patched_smart_block_kind.py b/python-client/libretime_client/models/patched_smart_block_kind.py index 647364a3..d83dcd02 100644 --- a/python-client/libretime_client/models/patched_smart_block_kind.py +++ b/python-client/libretime_client/models/patched_smart_block_kind.py @@ -13,17 +13,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from libretime_client.models.blank_enum import BlankEnum from libretime_client.models.smart_block_kind_enum import SmartBlockKindEnum -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self PATCHEDSMARTBLOCKKIND_ONE_OF_SCHEMAS = ["BlankEnum", "SmartBlockKindEnum"] @@ -35,14 +33,14 @@ class PatchedSmartBlockKind(BaseModel): oneof_schema_1_validator: Optional[SmartBlockKindEnum] = None # data type: BlankEnum oneof_schema_2_validator: Optional[BlankEnum] = None - if TYPE_CHECKING: - actual_instance: Union[BlankEnum, SmartBlockKindEnum] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(PATCHEDSMARTBLOCKKIND_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[BlankEnum, SmartBlockKindEnum]] = None + one_of_schemas: List[str] = Field(default=Literal["BlankEnum", "SmartBlockKindEnum"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - validate_assignment = True def __init__(self, *args, **kwargs) -> None: if args: @@ -54,12 +52,12 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): if v is None: return v - instance = PatchedSmartBlockKind.construct() + instance = PatchedSmartBlockKind.model_construct() error_messages = [] match = 0 # validate data type: SmartBlockKindEnum @@ -82,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> PatchedSmartBlockKind: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> PatchedSmartBlockKind: + def from_json(cls, json_str: Optional[str]) -> Self: """Returns the object represented by the json string""" - instance = PatchedSmartBlockKind.construct() + instance = cls.model_construct() if json_str is None: return instance @@ -122,19 +120,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], BlankEnum, SmartBlockKindEnum]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -142,6 +138,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python-client/libretime_client/models/patched_station_podcast.py b/python-client/libretime_client/models/patched_station_podcast.py index 7c8aeafa..f25b0024 100644 --- a/python-client/libretime_client/models/patched_station_podcast.py +++ b/python-client/libretime_client/models/patched_station_podcast.py @@ -17,55 +17,72 @@ import re # noqa: F401 import json - -from typing import Optional from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class PatchedStationPodcast(BaseModel): """ PatchedStationPodcast - """ + """ # noqa: E501 id: Optional[StrictInt] = None podcast: Optional[StrictInt] = None - __properties = ["id", "podcast"] + __properties: ClassVar[List[str]] = ["id", "podcast"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedStationPodcast: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedStationPodcast from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedStationPodcast: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedStationPodcast from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedStationPodcast.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedStationPodcast.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "podcast": obj.get("podcast") }) diff --git a/python-client/libretime_client/models/patched_third_party_track_reference.py b/python-client/libretime_client/models/patched_third_party_track_reference.py index d714239a..9c6aec5e 100644 --- a/python-client/libretime_client/models/patched_third_party_track_reference.py +++ b/python-client/libretime_client/models/patched_third_party_track_reference.py @@ -18,78 +18,97 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedThirdPartyTrackReference(BaseModel): """ PatchedThirdPartyTrackReference - """ + """ # noqa: E501 id: Optional[StrictInt] = None - service: Optional[constr(strict=True, max_length=256)] = None - foreign_id: Optional[constr(strict=True, max_length=256)] = None + service: Optional[Annotated[str, Field(strict=True, max_length=256)]] = None + foreign_id: Optional[Annotated[str, Field(strict=True, max_length=256)]] = None upload_time: Optional[datetime] = None - status: Optional[constr(strict=True, max_length=256)] = None + status: Optional[Annotated[str, Field(strict=True, max_length=256)]] = None file: Optional[StrictInt] = None - __properties = ["id", "service", "foreign_id", "upload_time", "status", "file"] + __properties: ClassVar[List[str]] = ["id", "service", "foreign_id", "upload_time", "status", "file"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedThirdPartyTrackReference: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedThirdPartyTrackReference from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if foreign_id (nullable) is None - # and __fields_set__ contains the field - if self.foreign_id is None and "foreign_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.foreign_id is None and "foreign_id" in self.model_fields_set: _dict['foreign_id'] = None # set to None if upload_time (nullable) is None - # and __fields_set__ contains the field - if self.upload_time is None and "upload_time" in self.__fields_set__: + # and model_fields_set contains the field + if self.upload_time is None and "upload_time" in self.model_fields_set: _dict['upload_time'] = None # set to None if status (nullable) is None - # and __fields_set__ contains the field - if self.status is None and "status" in self.__fields_set__: + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: _dict['status'] = None # set to None if file (nullable) is None - # and __fields_set__ contains the field - if self.file is None and "file" in self.__fields_set__: + # and model_fields_set contains the field + if self.file is None and "file" in self.model_fields_set: _dict['file'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedThirdPartyTrackReference: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedThirdPartyTrackReference from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedThirdPartyTrackReference.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedThirdPartyTrackReference.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "service": obj.get("service"), "foreign_id": obj.get("foreign_id"), diff --git a/python-client/libretime_client/models/patched_timestamp.py b/python-client/libretime_client/models/patched_timestamp.py index 3dbea27c..166236f2 100644 --- a/python-client/libretime_client/models/patched_timestamp.py +++ b/python-client/libretime_client/models/patched_timestamp.py @@ -18,54 +18,72 @@ import json from datetime import datetime -from typing import Optional from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class PatchedTimestamp(BaseModel): """ PatchedTimestamp - """ + """ # noqa: E501 id: Optional[StrictInt] = None timestamp: Optional[datetime] = None - __properties = ["id", "timestamp"] + __properties: ClassVar[List[str]] = ["id", "timestamp"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedTimestamp: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedTimestamp from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedTimestamp: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedTimestamp from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedTimestamp.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedTimestamp.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "timestamp": obj.get("timestamp") }) diff --git a/python-client/libretime_client/models/patched_user.py b/python-client/libretime_client/models/patched_user.py index 0c9f5e70..11cbf0f7 100644 --- a/python-client/libretime_client/models/patched_user.py +++ b/python-client/libretime_client/models/patched_user.py @@ -18,100 +18,119 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictInt, conint, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from libretime_client.models.role_enum import RoleEnum +from typing import Optional, Set +from typing_extensions import Self class PatchedUser(BaseModel): """ PatchedUser - """ + """ # noqa: E501 id: Optional[StrictInt] = None role: Optional[RoleEnum] = None - username: Optional[constr(strict=True, max_length=255)] = None - email: Optional[constr(strict=True, max_length=1024)] = None - first_name: Optional[constr(strict=True, max_length=255)] = None - last_name: Optional[constr(strict=True, max_length=255)] = None - login_attempts: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + username: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + email: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None + first_name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + last_name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + login_attempts: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None last_login: Optional[datetime] = None last_failed_login: Optional[datetime] = None - skype: Optional[constr(strict=True, max_length=1024)] = None - jabber: Optional[constr(strict=True, max_length=1024)] = None - phone: Optional[constr(strict=True, max_length=1024)] = None - __properties = ["id", "role", "username", "email", "first_name", "last_name", "login_attempts", "last_login", "last_failed_login", "skype", "jabber", "phone"] + skype: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None + jabber: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None + phone: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None + __properties: ClassVar[List[str]] = ["id", "role", "username", "email", "first_name", "last_name", "login_attempts", "last_login", "last_failed_login", "skype", "jabber", "phone"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedUser: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedUser from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if email (nullable) is None - # and __fields_set__ contains the field - if self.email is None and "email" in self.__fields_set__: + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: _dict['email'] = None # set to None if login_attempts (nullable) is None - # and __fields_set__ contains the field - if self.login_attempts is None and "login_attempts" in self.__fields_set__: + # and model_fields_set contains the field + if self.login_attempts is None and "login_attempts" in self.model_fields_set: _dict['login_attempts'] = None # set to None if last_login (nullable) is None - # and __fields_set__ contains the field - if self.last_login is None and "last_login" in self.__fields_set__: + # and model_fields_set contains the field + if self.last_login is None and "last_login" in self.model_fields_set: _dict['last_login'] = None # set to None if last_failed_login (nullable) is None - # and __fields_set__ contains the field - if self.last_failed_login is None and "last_failed_login" in self.__fields_set__: + # and model_fields_set contains the field + if self.last_failed_login is None and "last_failed_login" in self.model_fields_set: _dict['last_failed_login'] = None # set to None if skype (nullable) is None - # and __fields_set__ contains the field - if self.skype is None and "skype" in self.__fields_set__: + # and model_fields_set contains the field + if self.skype is None and "skype" in self.model_fields_set: _dict['skype'] = None # set to None if jabber (nullable) is None - # and __fields_set__ contains the field - if self.jabber is None and "jabber" in self.__fields_set__: + # and model_fields_set contains the field + if self.jabber is None and "jabber" in self.model_fields_set: _dict['jabber'] = None # set to None if phone (nullable) is None - # and __fields_set__ contains the field - if self.phone is None and "phone" in self.__fields_set__: + # and model_fields_set contains the field + if self.phone is None and "phone" in self.model_fields_set: _dict['phone'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedUser: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedUser from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedUser.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedUser.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "role": obj.get("role"), "username": obj.get("username"), diff --git a/python-client/libretime_client/models/patched_user_token.py b/python-client/libretime_client/models/patched_user_token.py index e3fc6559..1c123f73 100644 --- a/python-client/libretime_client/models/patched_user_token.py +++ b/python-client/libretime_client/models/patched_user_token.py @@ -18,57 +18,76 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedUserToken(BaseModel): """ PatchedUserToken - """ + """ # noqa: E501 id: Optional[StrictInt] = None - action: Optional[constr(strict=True, max_length=255)] = None - token: Optional[constr(strict=True, max_length=40)] = None + action: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + token: Optional[Annotated[str, Field(strict=True, max_length=40)]] = None created: Optional[datetime] = None user: Optional[StrictInt] = None - __properties = ["id", "action", "token", "created", "user"] + __properties: ClassVar[List[str]] = ["id", "action", "token", "created", "user"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedUserToken: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedUserToken from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedUserToken: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedUserToken from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedUserToken.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedUserToken.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "action": obj.get("action"), "token": obj.get("token"), diff --git a/python-client/libretime_client/models/patched_webstream.py b/python-client/libretime_client/models/patched_webstream.py index f96727fb..82fa26e2 100644 --- a/python-client/libretime_client/models/patched_webstream.py +++ b/python-client/libretime_client/models/patched_webstream.py @@ -18,77 +18,96 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedWebstream(BaseModel): """ PatchedWebstream - """ + """ # noqa: E501 id: Optional[StrictInt] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None last_played_at: Optional[datetime] = None - name: Optional[constr(strict=True, max_length=255)] = None - description: Optional[constr(strict=True, max_length=255)] = None - url: Optional[constr(strict=True, max_length=512)] = None + name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + url: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None length: Optional[StrictStr] = None - mime: Optional[constr(strict=True, max_length=1024)] = None + mime: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None owner: Optional[StrictInt] = None - __properties = ["id", "created_at", "updated_at", "last_played_at", "name", "description", "url", "length", "mime", "owner"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "last_played_at", "name", "description", "url", "length", "mime", "owner"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedWebstream: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedWebstream from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if last_played_at (nullable) is None - # and __fields_set__ contains the field - if self.last_played_at is None and "last_played_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.last_played_at is None and "last_played_at" in self.model_fields_set: _dict['last_played_at'] = None # set to None if mime (nullable) is None - # and __fields_set__ contains the field - if self.mime is None and "mime" in self.__fields_set__: + # and model_fields_set contains the field + if self.mime is None and "mime" in self.model_fields_set: _dict['mime'] = None # set to None if owner (nullable) is None - # and __fields_set__ contains the field - if self.owner is None and "owner" in self.__fields_set__: + # and model_fields_set contains the field + if self.owner is None and "owner" in self.model_fields_set: _dict['owner'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedWebstream: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedWebstream from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedWebstream.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedWebstream.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/python-client/libretime_client/models/patched_webstream_metadata.py b/python-client/libretime_client/models/patched_webstream_metadata.py index f931deab..43001ab8 100644 --- a/python-client/libretime_client/models/patched_webstream_metadata.py +++ b/python-client/libretime_client/models/patched_webstream_metadata.py @@ -18,56 +18,75 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PatchedWebstreamMetadata(BaseModel): """ PatchedWebstreamMetadata - """ + """ # noqa: E501 id: Optional[StrictInt] = None starts_at: Optional[datetime] = None - data: Optional[constr(strict=True, max_length=1024)] = None + data: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None schedule: Optional[StrictInt] = None - __properties = ["id", "starts_at", "data", "schedule"] + __properties: ClassVar[List[str]] = ["id", "starts_at", "data", "schedule"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedWebstreamMetadata: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedWebstreamMetadata from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedWebstreamMetadata: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedWebstreamMetadata from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedWebstreamMetadata.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedWebstreamMetadata.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "starts_at": obj.get("starts_at"), "data": obj.get("data"), diff --git a/python-client/libretime_client/models/playlist.py b/python-client/libretime_client/models/playlist.py index 640d5fa5..5eb3a63a 100644 --- a/python-client/libretime_client/models/playlist.py +++ b/python-client/libretime_client/models/playlist.py @@ -18,84 +18,103 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Playlist(BaseModel): """ Playlist - """ - id: StrictInt = Field(...) + """ # noqa: E501 + id: StrictInt created_at: Optional[datetime] = None updated_at: Optional[datetime] = None - name: constr(strict=True, max_length=255) = Field(...) - description: Optional[constr(strict=True, max_length=512)] = None + name: Annotated[str, Field(strict=True, max_length=255)] + description: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None length: Optional[StrictStr] = None owner: Optional[StrictInt] = None - __properties = ["id", "created_at", "updated_at", "name", "description", "length", "owner"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "name", "description", "length", "owner"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Playlist: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Playlist from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if created_at (nullable) is None - # and __fields_set__ contains the field - if self.created_at is None and "created_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: _dict['created_at'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if length (nullable) is None - # and __fields_set__ contains the field - if self.length is None and "length" in self.__fields_set__: + # and model_fields_set contains the field + if self.length is None and "length" in self.model_fields_set: _dict['length'] = None # set to None if owner (nullable) is None - # and __fields_set__ contains the field - if self.owner is None and "owner" in self.__fields_set__: + # and model_fields_set contains the field + if self.owner is None and "owner" in self.model_fields_set: _dict['owner'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Playlist: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Playlist from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Playlist.parse_obj(obj) + return cls.model_validate(obj) - _obj = Playlist.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/python-client/libretime_client/models/playlist_content.py b/python-client/libretime_client/models/playlist_content.py index e6fff805..7a46acf0 100644 --- a/python-client/libretime_client/models/playlist_content.py +++ b/python-client/libretime_client/models/playlist_content.py @@ -17,19 +17,21 @@ import re # noqa: F401 import json - -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conint +from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from libretime_client.models.playlist_content_kind_enum import PlaylistContentKindEnum +from typing import Optional, Set +from typing_extensions import Self class PlaylistContent(BaseModel): """ PlaylistContent - """ - id: StrictInt = Field(...) - kind: PlaylistContentKindEnum = Field(...) - position: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - offset: Union[StrictFloat, StrictInt] = Field(...) + """ # noqa: E501 + id: StrictInt + kind: PlaylistContentKindEnum + position: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + offset: Union[StrictFloat, StrictInt] length: Optional[StrictStr] = None cue_in: Optional[StrictStr] = None cue_out: Optional[StrictStr] = None @@ -39,95 +41,111 @@ class PlaylistContent(BaseModel): file: Optional[StrictInt] = None stream: Optional[StrictInt] = None block: Optional[StrictInt] = None - __properties = ["id", "kind", "position", "offset", "length", "cue_in", "cue_out", "fade_in", "fade_out", "playlist", "file", "stream", "block"] + __properties: ClassVar[List[str]] = ["id", "kind", "position", "offset", "length", "cue_in", "cue_out", "fade_in", "fade_out", "playlist", "file", "stream", "block"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PlaylistContent: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PlaylistContent from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if position (nullable) is None - # and __fields_set__ contains the field - if self.position is None and "position" in self.__fields_set__: + # and model_fields_set contains the field + if self.position is None and "position" in self.model_fields_set: _dict['position'] = None # set to None if length (nullable) is None - # and __fields_set__ contains the field - if self.length is None and "length" in self.__fields_set__: + # and model_fields_set contains the field + if self.length is None and "length" in self.model_fields_set: _dict['length'] = None # set to None if cue_in (nullable) is None - # and __fields_set__ contains the field - if self.cue_in is None and "cue_in" in self.__fields_set__: + # and model_fields_set contains the field + if self.cue_in is None and "cue_in" in self.model_fields_set: _dict['cue_in'] = None # set to None if cue_out (nullable) is None - # and __fields_set__ contains the field - if self.cue_out is None and "cue_out" in self.__fields_set__: + # and model_fields_set contains the field + if self.cue_out is None and "cue_out" in self.model_fields_set: _dict['cue_out'] = None # set to None if fade_in (nullable) is None - # and __fields_set__ contains the field - if self.fade_in is None and "fade_in" in self.__fields_set__: + # and model_fields_set contains the field + if self.fade_in is None and "fade_in" in self.model_fields_set: _dict['fade_in'] = None # set to None if fade_out (nullable) is None - # and __fields_set__ contains the field - if self.fade_out is None and "fade_out" in self.__fields_set__: + # and model_fields_set contains the field + if self.fade_out is None and "fade_out" in self.model_fields_set: _dict['fade_out'] = None # set to None if playlist (nullable) is None - # and __fields_set__ contains the field - if self.playlist is None and "playlist" in self.__fields_set__: + # and model_fields_set contains the field + if self.playlist is None and "playlist" in self.model_fields_set: _dict['playlist'] = None # set to None if file (nullable) is None - # and __fields_set__ contains the field - if self.file is None and "file" in self.__fields_set__: + # and model_fields_set contains the field + if self.file is None and "file" in self.model_fields_set: _dict['file'] = None # set to None if stream (nullable) is None - # and __fields_set__ contains the field - if self.stream is None and "stream" in self.__fields_set__: + # and model_fields_set contains the field + if self.stream is None and "stream" in self.model_fields_set: _dict['stream'] = None # set to None if block (nullable) is None - # and __fields_set__ contains the field - if self.block is None and "block" in self.__fields_set__: + # and model_fields_set contains the field + if self.block is None and "block" in self.model_fields_set: _dict['block'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PlaylistContent: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PlaylistContent from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PlaylistContent.parse_obj(obj) + return cls.model_validate(obj) - _obj = PlaylistContent.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "kind": obj.get("kind"), "position": obj.get("position"), diff --git a/python-client/libretime_client/models/playlist_content_kind_enum.py b/python-client/libretime_client/models/playlist_content_kind_enum.py index a85e1120..9d4dccb8 100644 --- a/python-client/libretime_client/models/playlist_content_kind_enum.py +++ b/python-client/libretime_client/models/playlist_content_kind_enum.py @@ -12,13 +12,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class PlaylistContentKindEnum(int, Enum): @@ -34,8 +31,8 @@ class PlaylistContentKindEnum(int, Enum): NUMBER_2 = 2 @classmethod - def from_json(cls, json_str: str) -> PlaylistContentKindEnum: + def from_json(cls, json_str: str) -> Self: """Create an instance of PlaylistContentKindEnum from a JSON string""" - return PlaylistContentKindEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python-client/libretime_client/models/playout_history.py b/python-client/libretime_client/models/playout_history.py index 13895121..afaa9bd0 100644 --- a/python-client/libretime_client/models/playout_history.py +++ b/python-client/libretime_client/models/playout_history.py @@ -18,72 +18,90 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictInt +from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class PlayoutHistory(BaseModel): """ PlayoutHistory - """ - id: StrictInt = Field(...) - starts: datetime = Field(...) + """ # noqa: E501 + id: StrictInt + starts: datetime ends: Optional[datetime] = None file: Optional[StrictInt] = None instance: Optional[StrictInt] = None - __properties = ["id", "starts", "ends", "file", "instance"] + __properties: ClassVar[List[str]] = ["id", "starts", "ends", "file", "instance"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PlayoutHistory: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PlayoutHistory from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if ends (nullable) is None - # and __fields_set__ contains the field - if self.ends is None and "ends" in self.__fields_set__: + # and model_fields_set contains the field + if self.ends is None and "ends" in self.model_fields_set: _dict['ends'] = None # set to None if file (nullable) is None - # and __fields_set__ contains the field - if self.file is None and "file" in self.__fields_set__: + # and model_fields_set contains the field + if self.file is None and "file" in self.model_fields_set: _dict['file'] = None # set to None if instance (nullable) is None - # and __fields_set__ contains the field - if self.instance is None and "instance" in self.__fields_set__: + # and model_fields_set contains the field + if self.instance is None and "instance" in self.model_fields_set: _dict['instance'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PlayoutHistory: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PlayoutHistory from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PlayoutHistory.parse_obj(obj) + return cls.model_validate(obj) - _obj = PlayoutHistory.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "starts": obj.get("starts"), "ends": obj.get("ends"), diff --git a/python-client/libretime_client/models/playout_history_metadata.py b/python-client/libretime_client/models/playout_history_metadata.py index 44e0b0c5..623091a4 100644 --- a/python-client/libretime_client/models/playout_history_metadata.py +++ b/python-client/libretime_client/models/playout_history_metadata.py @@ -17,57 +17,75 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PlayoutHistoryMetadata(BaseModel): """ PlayoutHistoryMetadata - """ - id: StrictInt = Field(...) - key: constr(strict=True, max_length=128) = Field(...) - value: constr(strict=True, max_length=128) = Field(...) - history: StrictInt = Field(...) - __properties = ["id", "key", "value", "history"] + """ # noqa: E501 + id: StrictInt + key: Annotated[str, Field(strict=True, max_length=128)] + value: Annotated[str, Field(strict=True, max_length=128)] + history: StrictInt + __properties: ClassVar[List[str]] = ["id", "key", "value", "history"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PlayoutHistoryMetadata: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PlayoutHistoryMetadata from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PlayoutHistoryMetadata: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PlayoutHistoryMetadata from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PlayoutHistoryMetadata.parse_obj(obj) + return cls.model_validate(obj) - _obj = PlayoutHistoryMetadata.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "key": obj.get("key"), "value": obj.get("value"), diff --git a/python-client/libretime_client/models/playout_history_template.py b/python-client/libretime_client/models/playout_history_template.py index 7af0a03b..835ca62e 100644 --- a/python-client/libretime_client/models/playout_history_template.py +++ b/python-client/libretime_client/models/playout_history_template.py @@ -17,56 +17,74 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PlayoutHistoryTemplate(BaseModel): """ PlayoutHistoryTemplate - """ - id: StrictInt = Field(...) - name: constr(strict=True, max_length=128) = Field(...) - type: constr(strict=True, max_length=35) = Field(...) - __properties = ["id", "name", "type"] + """ # noqa: E501 + id: StrictInt + name: Annotated[str, Field(strict=True, max_length=128)] + type: Annotated[str, Field(strict=True, max_length=35)] + __properties: ClassVar[List[str]] = ["id", "name", "type"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PlayoutHistoryTemplate: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PlayoutHistoryTemplate from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PlayoutHistoryTemplate: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PlayoutHistoryTemplate from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PlayoutHistoryTemplate.parse_obj(obj) + return cls.model_validate(obj) - _obj = PlayoutHistoryTemplate.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "name": obj.get("name"), "type": obj.get("type") diff --git a/python-client/libretime_client/models/playout_history_template_field.py b/python-client/libretime_client/models/playout_history_template_field.py index 0e05bce1..a116be18 100644 --- a/python-client/libretime_client/models/playout_history_template_field.py +++ b/python-client/libretime_client/models/playout_history_template_field.py @@ -17,60 +17,78 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictBool, StrictInt, conint, constr +from pydantic import BaseModel, Field, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PlayoutHistoryTemplateField(BaseModel): """ PlayoutHistoryTemplateField - """ - id: StrictInt = Field(...) - name: constr(strict=True, max_length=128) = Field(...) - label: constr(strict=True, max_length=128) = Field(...) - type: constr(strict=True, max_length=128) = Field(...) - is_file_md: StrictBool = Field(...) - position: conint(strict=True, le=2147483647, ge=-2147483648) = Field(...) - template: StrictInt = Field(...) - __properties = ["id", "name", "label", "type", "is_file_md", "position", "template"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + id: StrictInt + name: Annotated[str, Field(strict=True, max_length=128)] + label: Annotated[str, Field(strict=True, max_length=128)] + type: Annotated[str, Field(strict=True, max_length=128)] + is_file_md: StrictBool + position: Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)] + template: StrictInt + __properties: ClassVar[List[str]] = ["id", "name", "label", "type", "is_file_md", "position", "template"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PlayoutHistoryTemplateField: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PlayoutHistoryTemplateField from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PlayoutHistoryTemplateField: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PlayoutHistoryTemplateField from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PlayoutHistoryTemplateField.parse_obj(obj) + return cls.model_validate(obj) - _obj = PlayoutHistoryTemplateField.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "name": obj.get("name"), "label": obj.get("label"), diff --git a/python-client/libretime_client/models/podcast.py b/python-client/libretime_client/models/podcast.py index ac74b7cb..d6906983 100644 --- a/python-client/libretime_client/models/podcast.py +++ b/python-client/libretime_client/models/podcast.py @@ -17,128 +17,146 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Podcast(BaseModel): """ Podcast - """ - id: StrictInt = Field(...) - url: constr(strict=True, max_length=4096) = Field(...) - title: constr(strict=True, max_length=4096) = Field(...) - creator: Optional[constr(strict=True, max_length=4096)] = None - description: Optional[constr(strict=True, max_length=4096)] = None - language: Optional[constr(strict=True, max_length=4096)] = None - copyright: Optional[constr(strict=True, max_length=4096)] = None - link: Optional[constr(strict=True, max_length=4096)] = None - itunes_author: Optional[constr(strict=True, max_length=4096)] = None - itunes_keywords: Optional[constr(strict=True, max_length=4096)] = None - itunes_summary: Optional[constr(strict=True, max_length=4096)] = None - itunes_subtitle: Optional[constr(strict=True, max_length=4096)] = None - itunes_category: Optional[constr(strict=True, max_length=4096)] = None - itunes_explicit: Optional[constr(strict=True, max_length=4096)] = None + """ # noqa: E501 + id: StrictInt + url: Annotated[str, Field(strict=True, max_length=4096)] + title: Annotated[str, Field(strict=True, max_length=4096)] + creator: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + description: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + language: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + copyright: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + link: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + itunes_author: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + itunes_keywords: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + itunes_summary: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + itunes_subtitle: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + itunes_category: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None + itunes_explicit: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = None owner: Optional[StrictInt] = None - __properties = ["id", "url", "title", "creator", "description", "language", "copyright", "link", "itunes_author", "itunes_keywords", "itunes_summary", "itunes_subtitle", "itunes_category", "itunes_explicit", "owner"] + __properties: ClassVar[List[str]] = ["id", "url", "title", "creator", "description", "language", "copyright", "link", "itunes_author", "itunes_keywords", "itunes_summary", "itunes_subtitle", "itunes_category", "itunes_explicit", "owner"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Podcast: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Podcast from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if creator (nullable) is None - # and __fields_set__ contains the field - if self.creator is None and "creator" in self.__fields_set__: + # and model_fields_set contains the field + if self.creator is None and "creator" in self.model_fields_set: _dict['creator'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if language (nullable) is None - # and __fields_set__ contains the field - if self.language is None and "language" in self.__fields_set__: + # and model_fields_set contains the field + if self.language is None and "language" in self.model_fields_set: _dict['language'] = None # set to None if copyright (nullable) is None - # and __fields_set__ contains the field - if self.copyright is None and "copyright" in self.__fields_set__: + # and model_fields_set contains the field + if self.copyright is None and "copyright" in self.model_fields_set: _dict['copyright'] = None # set to None if link (nullable) is None - # and __fields_set__ contains the field - if self.link is None and "link" in self.__fields_set__: + # and model_fields_set contains the field + if self.link is None and "link" in self.model_fields_set: _dict['link'] = None # set to None if itunes_author (nullable) is None - # and __fields_set__ contains the field - if self.itunes_author is None and "itunes_author" in self.__fields_set__: + # and model_fields_set contains the field + if self.itunes_author is None and "itunes_author" in self.model_fields_set: _dict['itunes_author'] = None # set to None if itunes_keywords (nullable) is None - # and __fields_set__ contains the field - if self.itunes_keywords is None and "itunes_keywords" in self.__fields_set__: + # and model_fields_set contains the field + if self.itunes_keywords is None and "itunes_keywords" in self.model_fields_set: _dict['itunes_keywords'] = None # set to None if itunes_summary (nullable) is None - # and __fields_set__ contains the field - if self.itunes_summary is None and "itunes_summary" in self.__fields_set__: + # and model_fields_set contains the field + if self.itunes_summary is None and "itunes_summary" in self.model_fields_set: _dict['itunes_summary'] = None # set to None if itunes_subtitle (nullable) is None - # and __fields_set__ contains the field - if self.itunes_subtitle is None and "itunes_subtitle" in self.__fields_set__: + # and model_fields_set contains the field + if self.itunes_subtitle is None and "itunes_subtitle" in self.model_fields_set: _dict['itunes_subtitle'] = None # set to None if itunes_category (nullable) is None - # and __fields_set__ contains the field - if self.itunes_category is None and "itunes_category" in self.__fields_set__: + # and model_fields_set contains the field + if self.itunes_category is None and "itunes_category" in self.model_fields_set: _dict['itunes_category'] = None # set to None if itunes_explicit (nullable) is None - # and __fields_set__ contains the field - if self.itunes_explicit is None and "itunes_explicit" in self.__fields_set__: + # and model_fields_set contains the field + if self.itunes_explicit is None and "itunes_explicit" in self.model_fields_set: _dict['itunes_explicit'] = None # set to None if owner (nullable) is None - # and __fields_set__ contains the field - if self.owner is None and "owner" in self.__fields_set__: + # and model_fields_set contains the field + if self.owner is None and "owner" in self.model_fields_set: _dict['owner'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Podcast: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Podcast from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Podcast.parse_obj(obj) + return cls.model_validate(obj) - _obj = Podcast.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "url": obj.get("url"), "title": obj.get("title"), diff --git a/python-client/libretime_client/models/podcast_episode.py b/python-client/libretime_client/models/podcast_episode.py index 7f126dcc..36f257ec 100644 --- a/python-client/libretime_client/models/podcast_episode.py +++ b/python-client/libretime_client/models/podcast_episode.py @@ -18,65 +18,84 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PodcastEpisode(BaseModel): """ PodcastEpisode - """ - id: StrictInt = Field(...) - published_at: datetime = Field(...) - download_url: constr(strict=True, max_length=4096) = Field(...) - episode_guid: constr(strict=True, max_length=4096) = Field(...) - episode_title: constr(strict=True, max_length=4096) = Field(...) - episode_description: StrictStr = Field(...) - podcast: StrictInt = Field(...) + """ # noqa: E501 + id: StrictInt + published_at: datetime + download_url: Annotated[str, Field(strict=True, max_length=4096)] + episode_guid: Annotated[str, Field(strict=True, max_length=4096)] + episode_title: Annotated[str, Field(strict=True, max_length=4096)] + episode_description: StrictStr + podcast: StrictInt file: Optional[StrictInt] = None - __properties = ["id", "published_at", "download_url", "episode_guid", "episode_title", "episode_description", "podcast", "file"] + __properties: ClassVar[List[str]] = ["id", "published_at", "download_url", "episode_guid", "episode_title", "episode_description", "podcast", "file"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PodcastEpisode: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PodcastEpisode from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if file (nullable) is None - # and __fields_set__ contains the field - if self.file is None and "file" in self.__fields_set__: + # and model_fields_set contains the field + if self.file is None and "file" in self.model_fields_set: _dict['file'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PodcastEpisode: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PodcastEpisode from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PodcastEpisode.parse_obj(obj) + return cls.model_validate(obj) - _obj = PodcastEpisode.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "published_at": obj.get("published_at"), "download_url": obj.get("download_url"), diff --git a/python-client/libretime_client/models/position_status_enum.py b/python-client/libretime_client/models/position_status_enum.py index 0d617ac5..4104efff 100644 --- a/python-client/libretime_client/models/position_status_enum.py +++ b/python-client/libretime_client/models/position_status_enum.py @@ -12,13 +12,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class PositionStatusEnum(int, Enum): @@ -35,8 +32,8 @@ class PositionStatusEnum(int, Enum): NUMBER_2 = 2 @classmethod - def from_json(cls, json_str: str) -> PositionStatusEnum: + def from_json(cls, json_str: str) -> Self: """Create an instance of PositionStatusEnum from a JSON string""" - return PositionStatusEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python-client/libretime_client/models/preference.py b/python-client/libretime_client/models/preference.py index 7b750bea..107dacdf 100644 --- a/python-client/libretime_client/models/preference.py +++ b/python-client/libretime_client/models/preference.py @@ -17,72 +17,90 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Preference(BaseModel): """ Preference - """ - id: StrictInt = Field(...) - key: Optional[constr(strict=True, max_length=255)] = Field(...) + """ # noqa: E501 + id: StrictInt + key: Optional[Annotated[str, Field(strict=True, max_length=255)]] value: Optional[StrictStr] = None - user: Optional[StrictInt] = Field(...) - __properties = ["id", "key", "value", "user"] + user: Optional[StrictInt] + __properties: ClassVar[List[str]] = ["id", "key", "value", "user"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Preference: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Preference from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if key (nullable) is None - # and __fields_set__ contains the field - if self.key is None and "key" in self.__fields_set__: + # and model_fields_set contains the field + if self.key is None and "key" in self.model_fields_set: _dict['key'] = None # set to None if value (nullable) is None - # and __fields_set__ contains the field - if self.value is None and "value" in self.__fields_set__: + # and model_fields_set contains the field + if self.value is None and "value" in self.model_fields_set: _dict['value'] = None # set to None if user (nullable) is None - # and __fields_set__ contains the field - if self.user is None and "user" in self.__fields_set__: + # and model_fields_set contains the field + if self.user is None and "user" in self.model_fields_set: _dict['user'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Preference: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Preference from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Preference.parse_obj(obj) + return cls.model_validate(obj) - _obj = Preference.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "key": obj.get("key"), "value": obj.get("value"), diff --git a/python-client/libretime_client/models/record_enabled_enum.py b/python-client/libretime_client/models/record_enabled_enum.py index b09b1841..e3d0dccf 100644 --- a/python-client/libretime_client/models/record_enabled_enum.py +++ b/python-client/libretime_client/models/record_enabled_enum.py @@ -12,13 +12,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class RecordEnabledEnum(int, Enum): @@ -33,8 +30,8 @@ class RecordEnabledEnum(int, Enum): NUMBER_1 = 1 @classmethod - def from_json(cls, json_str: str) -> RecordEnabledEnum: + def from_json(cls, json_str: str) -> Self: """Create an instance of RecordEnabledEnum from a JSON string""" - return RecordEnabledEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python-client/libretime_client/models/repeat_kind_enum.py b/python-client/libretime_client/models/repeat_kind_enum.py index e7a00631..3ea701f0 100644 --- a/python-client/libretime_client/models/repeat_kind_enum.py +++ b/python-client/libretime_client/models/repeat_kind_enum.py @@ -12,13 +12,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class RepeatKindEnum(int, Enum): @@ -36,8 +33,8 @@ class RepeatKindEnum(int, Enum): NUMBER_2 = 2 @classmethod - def from_json(cls, json_str: str) -> RepeatKindEnum: + def from_json(cls, json_str: str) -> Self: """Create an instance of RepeatKindEnum from a JSON string""" - return RepeatKindEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python-client/libretime_client/models/role_enum.py b/python-client/libretime_client/models/role_enum.py index ca41b64a..51681842 100644 --- a/python-client/libretime_client/models/role_enum.py +++ b/python-client/libretime_client/models/role_enum.py @@ -12,13 +12,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class RoleEnum(str, Enum): @@ -35,8 +32,8 @@ class RoleEnum(str, Enum): A = 'A' @classmethod - def from_json(cls, json_str: str) -> RoleEnum: + def from_json(cls, json_str: str) -> Self: """Create an instance of RoleEnum from a JSON string""" - return RoleEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python-client/libretime_client/models/schedule.py b/python-client/libretime_client/models/schedule.py index 640160f1..c8b06c04 100644 --- a/python-client/libretime_client/models/schedule.py +++ b/python-client/libretime_client/models/schedule.py @@ -18,100 +18,121 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conint +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from libretime_client.models.position_status_enum import PositionStatusEnum +from typing import Optional, Set +from typing_extensions import Self class Schedule(BaseModel): """ Schedule - """ - id: StrictInt = Field(...) - cue_out: StrictStr = Field(...) - ends_at: datetime = Field(...) - starts_at: datetime = Field(...) + """ # noqa: E501 + id: StrictInt + cue_out: StrictStr + ends_at: datetime + starts_at: datetime length: Optional[StrictStr] = None fade_in: Optional[StrictStr] = None fade_out: Optional[StrictStr] = None - cue_in: StrictStr = Field(...) - position: conint(strict=True, le=2147483647, ge=-2147483648) = Field(...) + cue_in: StrictStr + position: Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)] position_status: Optional[PositionStatusEnum] = None - broadcasted: conint(strict=True, le=32767, ge=-32768) = Field(...) + broadcasted: Annotated[int, Field(le=32767, strict=True, ge=-32768)] played: Optional[StrictBool] = None - instance: StrictInt = Field(...) + instance: StrictInt file: Optional[StrictInt] = None stream: Optional[StrictInt] = None - __properties = ["id", "cue_out", "ends_at", "starts_at", "length", "fade_in", "fade_out", "cue_in", "position", "position_status", "broadcasted", "played", "instance", "file", "stream"] + __properties: ClassVar[List[str]] = ["id", "cue_out", "ends_at", "starts_at", "length", "fade_in", "fade_out", "cue_in", "position", "position_status", "broadcasted", "played", "instance", "file", "stream"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Schedule: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Schedule from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "cue_out", - "ends_at", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "cue_out", + "ends_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if length (nullable) is None - # and __fields_set__ contains the field - if self.length is None and "length" in self.__fields_set__: + # and model_fields_set contains the field + if self.length is None and "length" in self.model_fields_set: _dict['length'] = None # set to None if fade_in (nullable) is None - # and __fields_set__ contains the field - if self.fade_in is None and "fade_in" in self.__fields_set__: + # and model_fields_set contains the field + if self.fade_in is None and "fade_in" in self.model_fields_set: _dict['fade_in'] = None # set to None if fade_out (nullable) is None - # and __fields_set__ contains the field - if self.fade_out is None and "fade_out" in self.__fields_set__: + # and model_fields_set contains the field + if self.fade_out is None and "fade_out" in self.model_fields_set: _dict['fade_out'] = None # set to None if played (nullable) is None - # and __fields_set__ contains the field - if self.played is None and "played" in self.__fields_set__: + # and model_fields_set contains the field + if self.played is None and "played" in self.model_fields_set: _dict['played'] = None # set to None if file (nullable) is None - # and __fields_set__ contains the field - if self.file is None and "file" in self.__fields_set__: + # and model_fields_set contains the field + if self.file is None and "file" in self.model_fields_set: _dict['file'] = None # set to None if stream (nullable) is None - # and __fields_set__ contains the field - if self.stream is None and "stream" in self.__fields_set__: + # and model_fields_set contains the field + if self.stream is None and "stream" in self.model_fields_set: _dict['stream'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Schedule: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Schedule from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Schedule.parse_obj(obj) + return cls.model_validate(obj) - _obj = Schedule.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "cue_out": obj.get("cue_out"), "ends_at": obj.get("ends_at"), diff --git a/python-client/libretime_client/models/service_register.py b/python-client/libretime_client/models/service_register.py index 9f339d95..dc57b2c6 100644 --- a/python-client/libretime_client/models/service_register.py +++ b/python-client/libretime_client/models/service_register.py @@ -17,54 +17,71 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class ServiceRegister(BaseModel): """ ServiceRegister - """ - name: constr(strict=True, max_length=32) = Field(...) - ip: constr(strict=True, max_length=45) = Field(...) - __properties = ["name", "ip"] + """ # noqa: E501 + name: Annotated[str, Field(strict=True, max_length=32)] + ip: Annotated[str, Field(strict=True, max_length=45)] + __properties: ClassVar[List[str]] = ["name", "ip"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ServiceRegister: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ServiceRegister from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ServiceRegister: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ServiceRegister from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ServiceRegister.parse_obj(obj) + return cls.model_validate(obj) - _obj = ServiceRegister.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "ip": obj.get("ip") }) diff --git a/python-client/libretime_client/models/show.py b/python-client/libretime_client/models/show.py index 3a07ee84..35229358 100644 --- a/python-client/libretime_client/models/show.py +++ b/python-client/libretime_client/models/show.py @@ -17,103 +17,122 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, constr +from pydantic import BaseModel, Field, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Show(BaseModel): """ Show - """ - id: StrictInt = Field(...) - name: constr(strict=True, max_length=255) = Field(...) - description: Optional[constr(strict=True, max_length=8192)] = None - genre: Optional[constr(strict=True, max_length=255)] = None - url: Optional[constr(strict=True, max_length=255)] = None - image: Optional[constr(strict=True, max_length=255)] = None - foreground_color: Optional[constr(strict=True, max_length=6)] = None - background_color: Optional[constr(strict=True, max_length=6)] = None - live_enabled: StrictBool = Field(...) - linked: StrictBool = Field(...) - linkable: StrictBool = Field(...) + """ # noqa: E501 + id: StrictInt + name: Annotated[str, Field(strict=True, max_length=255)] + description: Optional[Annotated[str, Field(strict=True, max_length=8192)]] = None + genre: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + url: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + image: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + foreground_color: Optional[Annotated[str, Field(strict=True, max_length=6)]] = None + background_color: Optional[Annotated[str, Field(strict=True, max_length=6)]] = None + live_enabled: StrictBool + linked: StrictBool + linkable: StrictBool auto_playlist: Optional[StrictInt] = None - auto_playlist_enabled: StrictBool = Field(...) - auto_playlist_repeat: StrictBool = Field(...) - __properties = ["id", "name", "description", "genre", "url", "image", "foreground_color", "background_color", "live_enabled", "linked", "linkable", "auto_playlist", "auto_playlist_enabled", "auto_playlist_repeat"] + auto_playlist_enabled: StrictBool + auto_playlist_repeat: StrictBool + __properties: ClassVar[List[str]] = ["id", "name", "description", "genre", "url", "image", "foreground_color", "background_color", "live_enabled", "linked", "linkable", "auto_playlist", "auto_playlist_enabled", "auto_playlist_repeat"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Show: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Show from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "live_enabled", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "live_enabled", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if genre (nullable) is None - # and __fields_set__ contains the field - if self.genre is None and "genre" in self.__fields_set__: + # and model_fields_set contains the field + if self.genre is None and "genre" in self.model_fields_set: _dict['genre'] = None # set to None if url (nullable) is None - # and __fields_set__ contains the field - if self.url is None and "url" in self.__fields_set__: + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: _dict['url'] = None # set to None if image (nullable) is None - # and __fields_set__ contains the field - if self.image is None and "image" in self.__fields_set__: + # and model_fields_set contains the field + if self.image is None and "image" in self.model_fields_set: _dict['image'] = None # set to None if foreground_color (nullable) is None - # and __fields_set__ contains the field - if self.foreground_color is None and "foreground_color" in self.__fields_set__: + # and model_fields_set contains the field + if self.foreground_color is None and "foreground_color" in self.model_fields_set: _dict['foreground_color'] = None # set to None if background_color (nullable) is None - # and __fields_set__ contains the field - if self.background_color is None and "background_color" in self.__fields_set__: + # and model_fields_set contains the field + if self.background_color is None and "background_color" in self.model_fields_set: _dict['background_color'] = None # set to None if auto_playlist (nullable) is None - # and __fields_set__ contains the field - if self.auto_playlist is None and "auto_playlist" in self.__fields_set__: + # and model_fields_set contains the field + if self.auto_playlist is None and "auto_playlist" in self.model_fields_set: _dict['auto_playlist'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Show: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Show from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Show.parse_obj(obj) + return cls.model_validate(obj) - _obj = Show.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "name": obj.get("name"), "description": obj.get("description"), diff --git a/python-client/libretime_client/models/show_days.py b/python-client/libretime_client/models/show_days.py index 083aae08..bde5ba33 100644 --- a/python-client/libretime_client/models/show_days.py +++ b/python-client/libretime_client/models/show_days.py @@ -18,86 +18,105 @@ import json from datetime import date -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from libretime_client.models.record_enabled_enum import RecordEnabledEnum from libretime_client.models.repeat_kind_enum import RepeatKindEnum from libretime_client.models.week_day_enum import WeekDayEnum +from typing import Optional, Set +from typing_extensions import Self class ShowDays(BaseModel): """ ShowDays - """ - id: StrictInt = Field(...) - first_show_on: date = Field(...) + """ # noqa: E501 + id: StrictInt + first_show_on: date last_show_on: Optional[date] = None - start_time: StrictStr = Field(...) - timezone: constr(strict=True, max_length=1024) = Field(...) - duration: constr(strict=True, max_length=1024) = Field(...) + start_time: StrictStr + timezone: Annotated[str, Field(strict=True, max_length=1024)] + duration: Annotated[str, Field(strict=True, max_length=1024)] record_enabled: Optional[RecordEnabledEnum] = None week_day: Optional[WeekDayEnum] = None - repeat_kind: RepeatKindEnum = Field(...) + repeat_kind: RepeatKindEnum repeat_next_on: Optional[date] = None - show: StrictInt = Field(...) - __properties = ["id", "first_show_on", "last_show_on", "start_time", "timezone", "duration", "record_enabled", "week_day", "repeat_kind", "repeat_next_on", "show"] + show: StrictInt + __properties: ClassVar[List[str]] = ["id", "first_show_on", "last_show_on", "start_time", "timezone", "duration", "record_enabled", "week_day", "repeat_kind", "repeat_next_on", "show"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ShowDays: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ShowDays from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if last_show_on (nullable) is None - # and __fields_set__ contains the field - if self.last_show_on is None and "last_show_on" in self.__fields_set__: + # and model_fields_set contains the field + if self.last_show_on is None and "last_show_on" in self.model_fields_set: _dict['last_show_on'] = None # set to None if record_enabled (nullable) is None - # and __fields_set__ contains the field - if self.record_enabled is None and "record_enabled" in self.__fields_set__: + # and model_fields_set contains the field + if self.record_enabled is None and "record_enabled" in self.model_fields_set: _dict['record_enabled'] = None # set to None if week_day (nullable) is None - # and __fields_set__ contains the field - if self.week_day is None and "week_day" in self.__fields_set__: + # and model_fields_set contains the field + if self.week_day is None and "week_day" in self.model_fields_set: _dict['week_day'] = None # set to None if repeat_next_on (nullable) is None - # and __fields_set__ contains the field - if self.repeat_next_on is None and "repeat_next_on" in self.__fields_set__: + # and model_fields_set contains the field + if self.repeat_next_on is None and "repeat_next_on" in self.model_fields_set: _dict['repeat_next_on'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ShowDays: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ShowDays from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ShowDays.parse_obj(obj) + return cls.model_validate(obj) - _obj = ShowDays.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "first_show_on": obj.get("first_show_on"), "last_show_on": obj.get("last_show_on"), diff --git a/python-client/libretime_client/models/show_host.py b/python-client/libretime_client/models/show_host.py index a00e68c1..51fbf813 100644 --- a/python-client/libretime_client/models/show_host.py +++ b/python-client/libretime_client/models/show_host.py @@ -17,56 +17,73 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictInt +from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ShowHost(BaseModel): """ ShowHost - """ - id: StrictInt = Field(...) - show: StrictInt = Field(...) - user: StrictInt = Field(...) - __properties = ["id", "show", "user"] + """ # noqa: E501 + id: StrictInt + show: StrictInt + user: StrictInt + __properties: ClassVar[List[str]] = ["id", "show", "user"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ShowHost: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ShowHost from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ShowHost: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ShowHost from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ShowHost.parse_obj(obj) + return cls.model_validate(obj) - _obj = ShowHost.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "show": obj.get("show"), "user": obj.get("user") diff --git a/python-client/libretime_client/models/show_instance.py b/python-client/libretime_client/models/show_instance.py index 23f701b6..62933cc9 100644 --- a/python-client/libretime_client/models/show_instance.py +++ b/python-client/libretime_client/models/show_instance.py @@ -18,102 +18,121 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conint, constr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from libretime_client.models.record_enabled_enum import RecordEnabledEnum +from typing import Optional, Set +from typing_extensions import Self class ShowInstance(BaseModel): """ ShowInstance - """ - id: StrictInt = Field(...) - created_at: datetime = Field(...) - starts_at: datetime = Field(...) - ends_at: datetime = Field(...) + """ # noqa: E501 + id: StrictInt + created_at: datetime + starts_at: datetime + ends_at: datetime filled_time: Optional[StrictStr] = None last_scheduled_at: Optional[datetime] = None - description: Optional[constr(strict=True, max_length=8192)] = None - modified: StrictBool = Field(...) - rebroadcast: Optional[conint(strict=True, le=32767, ge=-32768)] = None - auto_playlist_built: StrictBool = Field(...) + description: Optional[Annotated[str, Field(strict=True, max_length=8192)]] = None + modified: StrictBool + rebroadcast: Optional[Annotated[int, Field(le=32767, strict=True, ge=-32768)]] = None + auto_playlist_built: StrictBool record_enabled: Optional[RecordEnabledEnum] = None - show: StrictInt = Field(...) + show: StrictInt instance: Optional[StrictInt] = None record_file: Optional[StrictInt] = None - __properties = ["id", "created_at", "starts_at", "ends_at", "filled_time", "last_scheduled_at", "description", "modified", "rebroadcast", "auto_playlist_built", "record_enabled", "show", "instance", "record_file"] + __properties: ClassVar[List[str]] = ["id", "created_at", "starts_at", "ends_at", "filled_time", "last_scheduled_at", "description", "modified", "rebroadcast", "auto_playlist_built", "record_enabled", "show", "instance", "record_file"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ShowInstance: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ShowInstance from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if filled_time (nullable) is None - # and __fields_set__ contains the field - if self.filled_time is None and "filled_time" in self.__fields_set__: + # and model_fields_set contains the field + if self.filled_time is None and "filled_time" in self.model_fields_set: _dict['filled_time'] = None # set to None if last_scheduled_at (nullable) is None - # and __fields_set__ contains the field - if self.last_scheduled_at is None and "last_scheduled_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.last_scheduled_at is None and "last_scheduled_at" in self.model_fields_set: _dict['last_scheduled_at'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if rebroadcast (nullable) is None - # and __fields_set__ contains the field - if self.rebroadcast is None and "rebroadcast" in self.__fields_set__: + # and model_fields_set contains the field + if self.rebroadcast is None and "rebroadcast" in self.model_fields_set: _dict['rebroadcast'] = None # set to None if record_enabled (nullable) is None - # and __fields_set__ contains the field - if self.record_enabled is None and "record_enabled" in self.__fields_set__: + # and model_fields_set contains the field + if self.record_enabled is None and "record_enabled" in self.model_fields_set: _dict['record_enabled'] = None # set to None if instance (nullable) is None - # and __fields_set__ contains the field - if self.instance is None and "instance" in self.__fields_set__: + # and model_fields_set contains the field + if self.instance is None and "instance" in self.model_fields_set: _dict['instance'] = None # set to None if record_file (nullable) is None - # and __fields_set__ contains the field - if self.record_file is None and "record_file" in self.__fields_set__: + # and model_fields_set contains the field + if self.record_file is None and "record_file" in self.model_fields_set: _dict['record_file'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ShowInstance: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ShowInstance from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ShowInstance.parse_obj(obj) + return cls.model_validate(obj) - _obj = ShowInstance.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "starts_at": obj.get("starts_at"), diff --git a/python-client/libretime_client/models/show_rebroadcast.py b/python-client/libretime_client/models/show_rebroadcast.py index 48a8d642..79b56532 100644 --- a/python-client/libretime_client/models/show_rebroadcast.py +++ b/python-client/libretime_client/models/show_rebroadcast.py @@ -17,57 +17,75 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class ShowRebroadcast(BaseModel): """ ShowRebroadcast - """ - id: StrictInt = Field(...) - day_offset: constr(strict=True, max_length=1024) = Field(...) - start_time: StrictStr = Field(...) - show: StrictInt = Field(...) - __properties = ["id", "day_offset", "start_time", "show"] + """ # noqa: E501 + id: StrictInt + day_offset: Annotated[str, Field(strict=True, max_length=1024)] + start_time: StrictStr + show: StrictInt + __properties: ClassVar[List[str]] = ["id", "day_offset", "start_time", "show"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ShowRebroadcast: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ShowRebroadcast from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ShowRebroadcast: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ShowRebroadcast from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ShowRebroadcast.parse_obj(obj) + return cls.model_validate(obj) - _obj = ShowRebroadcast.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "day_offset": obj.get("day_offset"), "start_time": obj.get("start_time"), diff --git a/python-client/libretime_client/models/smart_block.py b/python-client/libretime_client/models/smart_block.py index 21544c4f..18b72fa8 100644 --- a/python-client/libretime_client/models/smart_block.py +++ b/python-client/libretime_client/models/smart_block.py @@ -18,101 +18,120 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from libretime_client.models.patched_smart_block_kind import PatchedSmartBlockKind +from typing import Optional, Set +from typing_extensions import Self class SmartBlock(BaseModel): """ SmartBlock - """ - id: StrictInt = Field(...) + """ # noqa: E501 + id: StrictInt created_at: Optional[datetime] = None updated_at: Optional[datetime] = None - name: constr(strict=True, max_length=255) = Field(...) - description: Optional[constr(strict=True, max_length=512)] = None + name: Annotated[str, Field(strict=True, max_length=255)] + description: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None length: Optional[StrictStr] = None kind: Optional[PatchedSmartBlockKind] = None owner: Optional[StrictInt] = None - __properties = ["id", "created_at", "updated_at", "name", "description", "length", "kind", "owner"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "name", "description", "length", "kind", "owner"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> SmartBlock: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SmartBlock from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of kind if self.kind: _dict['kind'] = self.kind.to_dict() # set to None if created_at (nullable) is None - # and __fields_set__ contains the field - if self.created_at is None and "created_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: _dict['created_at'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if length (nullable) is None - # and __fields_set__ contains the field - if self.length is None and "length" in self.__fields_set__: + # and model_fields_set contains the field + if self.length is None and "length" in self.model_fields_set: _dict['length'] = None # set to None if kind (nullable) is None - # and __fields_set__ contains the field - if self.kind is None and "kind" in self.__fields_set__: + # and model_fields_set contains the field + if self.kind is None and "kind" in self.model_fields_set: _dict['kind'] = None # set to None if owner (nullable) is None - # and __fields_set__ contains the field - if self.owner is None and "owner" in self.__fields_set__: + # and model_fields_set contains the field + if self.owner is None and "owner" in self.model_fields_set: _dict['owner'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> SmartBlock: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SmartBlock from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SmartBlock.parse_obj(obj) + return cls.model_validate(obj) - _obj = SmartBlock.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), "name": obj.get("name"), "description": obj.get("description"), "length": obj.get("length"), - "kind": PatchedSmartBlockKind.from_dict(obj.get("kind")) if obj.get("kind") is not None else None, + "kind": PatchedSmartBlockKind.from_dict(obj["kind"]) if obj.get("kind") is not None else None, "owner": obj.get("owner") }) return _obj diff --git a/python-client/libretime_client/models/smart_block_content.py b/python-client/libretime_client/models/smart_block_content.py index fff9ac49..4450e269 100644 --- a/python-client/libretime_client/models/smart_block_content.py +++ b/python-client/libretime_client/models/smart_block_content.py @@ -17,17 +17,19 @@ import re # noqa: F401 import json - -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conint +from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class SmartBlockContent(BaseModel): """ SmartBlockContent - """ - id: StrictInt = Field(...) - position: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - offset: Union[StrictFloat, StrictInt] = Field(...) + """ # noqa: E501 + id: StrictInt + position: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + offset: Union[StrictFloat, StrictInt] length: Optional[StrictStr] = None cue_in: Optional[StrictStr] = None cue_out: Optional[StrictStr] = None @@ -35,85 +37,101 @@ class SmartBlockContent(BaseModel): fade_out: Optional[StrictStr] = None block: Optional[StrictInt] = None file: Optional[StrictInt] = None - __properties = ["id", "position", "offset", "length", "cue_in", "cue_out", "fade_in", "fade_out", "block", "file"] + __properties: ClassVar[List[str]] = ["id", "position", "offset", "length", "cue_in", "cue_out", "fade_in", "fade_out", "block", "file"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> SmartBlockContent: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SmartBlockContent from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if position (nullable) is None - # and __fields_set__ contains the field - if self.position is None and "position" in self.__fields_set__: + # and model_fields_set contains the field + if self.position is None and "position" in self.model_fields_set: _dict['position'] = None # set to None if length (nullable) is None - # and __fields_set__ contains the field - if self.length is None and "length" in self.__fields_set__: + # and model_fields_set contains the field + if self.length is None and "length" in self.model_fields_set: _dict['length'] = None # set to None if cue_in (nullable) is None - # and __fields_set__ contains the field - if self.cue_in is None and "cue_in" in self.__fields_set__: + # and model_fields_set contains the field + if self.cue_in is None and "cue_in" in self.model_fields_set: _dict['cue_in'] = None # set to None if cue_out (nullable) is None - # and __fields_set__ contains the field - if self.cue_out is None and "cue_out" in self.__fields_set__: + # and model_fields_set contains the field + if self.cue_out is None and "cue_out" in self.model_fields_set: _dict['cue_out'] = None # set to None if fade_in (nullable) is None - # and __fields_set__ contains the field - if self.fade_in is None and "fade_in" in self.__fields_set__: + # and model_fields_set contains the field + if self.fade_in is None and "fade_in" in self.model_fields_set: _dict['fade_in'] = None # set to None if fade_out (nullable) is None - # and __fields_set__ contains the field - if self.fade_out is None and "fade_out" in self.__fields_set__: + # and model_fields_set contains the field + if self.fade_out is None and "fade_out" in self.model_fields_set: _dict['fade_out'] = None # set to None if block (nullable) is None - # and __fields_set__ contains the field - if self.block is None and "block" in self.__fields_set__: + # and model_fields_set contains the field + if self.block is None and "block" in self.model_fields_set: _dict['block'] = None # set to None if file (nullable) is None - # and __fields_set__ contains the field - if self.file is None and "file" in self.__fields_set__: + # and model_fields_set contains the field + if self.file is None and "file" in self.model_fields_set: _dict['file'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> SmartBlockContent: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SmartBlockContent from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SmartBlockContent.parse_obj(obj) + return cls.model_validate(obj) - _obj = SmartBlockContent.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "position": obj.get("position"), "offset": obj.get("offset"), diff --git a/python-client/libretime_client/models/smart_block_criteria.py b/python-client/libretime_client/models/smart_block_criteria.py index e64c486d..20f8a319 100644 --- a/python-client/libretime_client/models/smart_block_criteria.py +++ b/python-client/libretime_client/models/smart_block_criteria.py @@ -17,70 +17,88 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, conint, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class SmartBlockCriteria(BaseModel): """ SmartBlockCriteria - """ - id: StrictInt = Field(...) - group: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None - criteria: constr(strict=True, max_length=32) = Field(...) - condition: constr(strict=True, max_length=16) = Field(...) - value: constr(strict=True, max_length=512) = Field(...) - extra: Optional[constr(strict=True, max_length=512)] = None - block: StrictInt = Field(...) - __properties = ["id", "group", "criteria", "condition", "value", "extra", "block"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + id: StrictInt + group: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None + criteria: Annotated[str, Field(strict=True, max_length=32)] + condition: Annotated[str, Field(strict=True, max_length=16)] + value: Annotated[str, Field(strict=True, max_length=512)] + extra: Optional[Annotated[str, Field(strict=True, max_length=512)]] = None + block: StrictInt + __properties: ClassVar[List[str]] = ["id", "group", "criteria", "condition", "value", "extra", "block"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> SmartBlockCriteria: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SmartBlockCriteria from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if group (nullable) is None - # and __fields_set__ contains the field - if self.group is None and "group" in self.__fields_set__: + # and model_fields_set contains the field + if self.group is None and "group" in self.model_fields_set: _dict['group'] = None # set to None if extra (nullable) is None - # and __fields_set__ contains the field - if self.extra is None and "extra" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra is None and "extra" in self.model_fields_set: _dict['extra'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> SmartBlockCriteria: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SmartBlockCriteria from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SmartBlockCriteria.parse_obj(obj) + return cls.model_validate(obj) - _obj = SmartBlockCriteria.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "group": obj.get("group"), "criteria": obj.get("criteria"), diff --git a/python-client/libretime_client/models/smart_block_kind_enum.py b/python-client/libretime_client/models/smart_block_kind_enum.py index 85fa844c..1b36ab55 100644 --- a/python-client/libretime_client/models/smart_block_kind_enum.py +++ b/python-client/libretime_client/models/smart_block_kind_enum.py @@ -12,13 +12,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class SmartBlockKindEnum(str, Enum): @@ -33,8 +30,8 @@ class SmartBlockKindEnum(str, Enum): DYNAMIC = 'dynamic' @classmethod - def from_json(cls, json_str: str) -> SmartBlockKindEnum: + def from_json(cls, json_str: str) -> Self: """Create an instance of SmartBlockKindEnum from a JSON string""" - return SmartBlockKindEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python-client/libretime_client/models/station_podcast.py b/python-client/libretime_client/models/station_podcast.py index ad840459..fd741365 100644 --- a/python-client/libretime_client/models/station_podcast.py +++ b/python-client/libretime_client/models/station_podcast.py @@ -17,55 +17,72 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictInt +from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class StationPodcast(BaseModel): """ StationPodcast - """ - id: StrictInt = Field(...) - podcast: StrictInt = Field(...) - __properties = ["id", "podcast"] + """ # noqa: E501 + id: StrictInt + podcast: StrictInt + __properties: ClassVar[List[str]] = ["id", "podcast"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StationPodcast: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StationPodcast from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> StationPodcast: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StationPodcast from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StationPodcast.parse_obj(obj) + return cls.model_validate(obj) - _obj = StationPodcast.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "podcast": obj.get("podcast") }) diff --git a/python-client/libretime_client/models/stream_preferences.py b/python-client/libretime_client/models/stream_preferences.py index 82741df8..fe9881b6 100644 --- a/python-client/libretime_client/models/stream_preferences.py +++ b/python-client/libretime_client/models/stream_preferences.py @@ -17,58 +17,77 @@ import re # noqa: F401 import json - -from typing import Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self class StreamPreferences(BaseModel): """ StreamPreferences - """ - input_fade_transition: Union[StrictFloat, StrictInt] = Field(...) - message_format: StrictInt = Field(...) - message_offline: StrictStr = Field(...) - __properties = ["input_fade_transition", "message_format", "message_offline"] + """ # noqa: E501 + input_fade_transition: Union[StrictFloat, StrictInt] + message_format: StrictInt + message_offline: StrictStr + __properties: ClassVar[List[str]] = ["input_fade_transition", "message_format", "message_offline"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StreamPreferences: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StreamPreferences from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "input_fade_transition", - "message_format", - "message_offline", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "input_fade_transition", + "message_format", + "message_offline", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> StreamPreferences: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StreamPreferences from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StreamPreferences.parse_obj(obj) + return cls.model_validate(obj) - _obj = StreamPreferences.parse_obj({ + _obj = cls.model_validate({ "input_fade_transition": obj.get("input_fade_transition"), "message_format": obj.get("message_format"), "message_offline": obj.get("message_offline") diff --git a/python-client/libretime_client/models/stream_state.py b/python-client/libretime_client/models/stream_state.py index ec29d59b..24ee8c85 100644 --- a/python-client/libretime_client/models/stream_state.py +++ b/python-client/libretime_client/models/stream_state.py @@ -17,62 +17,83 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictBool +from pydantic import BaseModel, StrictBool +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class StreamState(BaseModel): """ StreamState - """ - input_main_connected: StrictBool = Field(...) - input_main_streaming: StrictBool = Field(...) - input_show_connected: StrictBool = Field(...) - input_show_streaming: StrictBool = Field(...) - schedule_streaming: StrictBool = Field(...) - __properties = ["input_main_connected", "input_main_streaming", "input_show_connected", "input_show_streaming", "schedule_streaming"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + input_main_connected: StrictBool + input_main_streaming: StrictBool + input_show_connected: StrictBool + input_show_streaming: StrictBool + schedule_streaming: StrictBool + __properties: ClassVar[List[str]] = ["input_main_connected", "input_main_streaming", "input_show_connected", "input_show_streaming", "schedule_streaming"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StreamState: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StreamState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "input_main_connected", - "input_main_streaming", - "input_show_connected", - "input_show_streaming", - "schedule_streaming", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "input_main_connected", + "input_main_streaming", + "input_show_connected", + "input_show_streaming", + "schedule_streaming", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> StreamState: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StreamState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StreamState.parse_obj(obj) + return cls.model_validate(obj) - _obj = StreamState.parse_obj({ + _obj = cls.model_validate({ "input_main_connected": obj.get("input_main_connected"), "input_main_streaming": obj.get("input_main_streaming"), "input_show_connected": obj.get("input_show_connected"), diff --git a/python-client/libretime_client/models/third_party_track_reference.py b/python-client/libretime_client/models/third_party_track_reference.py index 3b5b9ab0..17edbcc0 100644 --- a/python-client/libretime_client/models/third_party_track_reference.py +++ b/python-client/libretime_client/models/third_party_track_reference.py @@ -18,78 +18,97 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class ThirdPartyTrackReference(BaseModel): """ ThirdPartyTrackReference - """ - id: StrictInt = Field(...) - service: constr(strict=True, max_length=256) = Field(...) - foreign_id: Optional[constr(strict=True, max_length=256)] = None + """ # noqa: E501 + id: StrictInt + service: Annotated[str, Field(strict=True, max_length=256)] + foreign_id: Optional[Annotated[str, Field(strict=True, max_length=256)]] = None upload_time: Optional[datetime] = None - status: Optional[constr(strict=True, max_length=256)] = None + status: Optional[Annotated[str, Field(strict=True, max_length=256)]] = None file: Optional[StrictInt] = None - __properties = ["id", "service", "foreign_id", "upload_time", "status", "file"] + __properties: ClassVar[List[str]] = ["id", "service", "foreign_id", "upload_time", "status", "file"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ThirdPartyTrackReference: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ThirdPartyTrackReference from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if foreign_id (nullable) is None - # and __fields_set__ contains the field - if self.foreign_id is None and "foreign_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.foreign_id is None and "foreign_id" in self.model_fields_set: _dict['foreign_id'] = None # set to None if upload_time (nullable) is None - # and __fields_set__ contains the field - if self.upload_time is None and "upload_time" in self.__fields_set__: + # and model_fields_set contains the field + if self.upload_time is None and "upload_time" in self.model_fields_set: _dict['upload_time'] = None # set to None if status (nullable) is None - # and __fields_set__ contains the field - if self.status is None and "status" in self.__fields_set__: + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: _dict['status'] = None # set to None if file (nullable) is None - # and __fields_set__ contains the field - if self.file is None and "file" in self.__fields_set__: + # and model_fields_set contains the field + if self.file is None and "file" in self.model_fields_set: _dict['file'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ThirdPartyTrackReference: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ThirdPartyTrackReference from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ThirdPartyTrackReference.parse_obj(obj) + return cls.model_validate(obj) - _obj = ThirdPartyTrackReference.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "service": obj.get("service"), "foreign_id": obj.get("foreign_id"), diff --git a/python-client/libretime_client/models/timestamp.py b/python-client/libretime_client/models/timestamp.py index 952f164e..7888fdaa 100644 --- a/python-client/libretime_client/models/timestamp.py +++ b/python-client/libretime_client/models/timestamp.py @@ -18,54 +18,72 @@ import json from datetime import datetime - -from pydantic import BaseModel, Field, StrictInt +from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class Timestamp(BaseModel): """ Timestamp - """ - id: StrictInt = Field(...) - timestamp: datetime = Field(...) - __properties = ["id", "timestamp"] + """ # noqa: E501 + id: StrictInt + timestamp: datetime + __properties: ClassVar[List[str]] = ["id", "timestamp"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Timestamp: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Timestamp from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Timestamp: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Timestamp from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Timestamp.parse_obj(obj) + return cls.model_validate(obj) - _obj = Timestamp.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "timestamp": obj.get("timestamp") }) diff --git a/python-client/libretime_client/models/user.py b/python-client/libretime_client/models/user.py index e501bbc9..64856212 100644 --- a/python-client/libretime_client/models/user.py +++ b/python-client/libretime_client/models/user.py @@ -18,100 +18,119 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, conint, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from libretime_client.models.role_enum import RoleEnum +from typing import Optional, Set +from typing_extensions import Self class User(BaseModel): """ User - """ - id: StrictInt = Field(...) - role: RoleEnum = Field(...) - username: constr(strict=True, max_length=255) = Field(...) - email: Optional[constr(strict=True, max_length=1024)] = None - first_name: constr(strict=True, max_length=255) = Field(...) - last_name: constr(strict=True, max_length=255) = Field(...) - login_attempts: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + """ # noqa: E501 + id: StrictInt + role: RoleEnum + username: Annotated[str, Field(strict=True, max_length=255)] + email: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None + first_name: Annotated[str, Field(strict=True, max_length=255)] + last_name: Annotated[str, Field(strict=True, max_length=255)] + login_attempts: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None last_login: Optional[datetime] = None last_failed_login: Optional[datetime] = None - skype: Optional[constr(strict=True, max_length=1024)] = None - jabber: Optional[constr(strict=True, max_length=1024)] = None - phone: Optional[constr(strict=True, max_length=1024)] = None - __properties = ["id", "role", "username", "email", "first_name", "last_name", "login_attempts", "last_login", "last_failed_login", "skype", "jabber", "phone"] + skype: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None + jabber: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None + phone: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None + __properties: ClassVar[List[str]] = ["id", "role", "username", "email", "first_name", "last_name", "login_attempts", "last_login", "last_failed_login", "skype", "jabber", "phone"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> User: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of User from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if email (nullable) is None - # and __fields_set__ contains the field - if self.email is None and "email" in self.__fields_set__: + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: _dict['email'] = None # set to None if login_attempts (nullable) is None - # and __fields_set__ contains the field - if self.login_attempts is None and "login_attempts" in self.__fields_set__: + # and model_fields_set contains the field + if self.login_attempts is None and "login_attempts" in self.model_fields_set: _dict['login_attempts'] = None # set to None if last_login (nullable) is None - # and __fields_set__ contains the field - if self.last_login is None and "last_login" in self.__fields_set__: + # and model_fields_set contains the field + if self.last_login is None and "last_login" in self.model_fields_set: _dict['last_login'] = None # set to None if last_failed_login (nullable) is None - # and __fields_set__ contains the field - if self.last_failed_login is None and "last_failed_login" in self.__fields_set__: + # and model_fields_set contains the field + if self.last_failed_login is None and "last_failed_login" in self.model_fields_set: _dict['last_failed_login'] = None # set to None if skype (nullable) is None - # and __fields_set__ contains the field - if self.skype is None and "skype" in self.__fields_set__: + # and model_fields_set contains the field + if self.skype is None and "skype" in self.model_fields_set: _dict['skype'] = None # set to None if jabber (nullable) is None - # and __fields_set__ contains the field - if self.jabber is None and "jabber" in self.__fields_set__: + # and model_fields_set contains the field + if self.jabber is None and "jabber" in self.model_fields_set: _dict['jabber'] = None # set to None if phone (nullable) is None - # and __fields_set__ contains the field - if self.phone is None and "phone" in self.__fields_set__: + # and model_fields_set contains the field + if self.phone is None and "phone" in self.model_fields_set: _dict['phone'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> User: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of User from a dict""" if obj is None: return None if not isinstance(obj, dict): - return User.parse_obj(obj) + return cls.model_validate(obj) - _obj = User.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "role": obj.get("role"), "username": obj.get("username"), diff --git a/python-client/libretime_client/models/user_token.py b/python-client/libretime_client/models/user_token.py index 3ab6c22f..62d06b95 100644 --- a/python-client/libretime_client/models/user_token.py +++ b/python-client/libretime_client/models/user_token.py @@ -18,57 +18,76 @@ import json from datetime import datetime - -from pydantic import BaseModel, Field, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class UserToken(BaseModel): """ UserToken - """ - id: StrictInt = Field(...) - action: constr(strict=True, max_length=255) = Field(...) - token: constr(strict=True, max_length=40) = Field(...) - created: datetime = Field(...) - user: StrictInt = Field(...) - __properties = ["id", "action", "token", "created", "user"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + id: StrictInt + action: Annotated[str, Field(strict=True, max_length=255)] + token: Annotated[str, Field(strict=True, max_length=40)] + created: datetime + user: StrictInt + __properties: ClassVar[List[str]] = ["id", "action", "token", "created", "user"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> UserToken: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserToken from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> UserToken: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserToken from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UserToken.parse_obj(obj) + return cls.model_validate(obj) - _obj = UserToken.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "action": obj.get("action"), "token": obj.get("token"), diff --git a/python-client/libretime_client/models/version.py b/python-client/libretime_client/models/version.py index 31c67fdd..1f316ef3 100644 --- a/python-client/libretime_client/models/version.py +++ b/python-client/libretime_client/models/version.py @@ -17,54 +17,71 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class Version(BaseModel): """ Version - """ - api_version: StrictStr = Field(...) - __properties = ["api_version"] + """ # noqa: E501 + api_version: StrictStr + __properties: ClassVar[List[str]] = ["api_version"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Version: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Version from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "api_version", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "api_version", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Version: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Version from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Version.parse_obj(obj) + return cls.model_validate(obj) - _obj = Version.parse_obj({ + _obj = cls.model_validate({ "api_version": obj.get("api_version") }) return _obj diff --git a/python-client/libretime_client/models/webstream.py b/python-client/libretime_client/models/webstream.py index 2aca0319..d6449dde 100644 --- a/python-client/libretime_client/models/webstream.py +++ b/python-client/libretime_client/models/webstream.py @@ -18,77 +18,96 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, constr +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Webstream(BaseModel): """ Webstream - """ - id: StrictInt = Field(...) - created_at: datetime = Field(...) - updated_at: datetime = Field(...) + """ # noqa: E501 + id: StrictInt + created_at: datetime + updated_at: datetime last_played_at: Optional[datetime] = None - name: constr(strict=True, max_length=255) = Field(...) - description: constr(strict=True, max_length=255) = Field(...) - url: constr(strict=True, max_length=512) = Field(...) - length: StrictStr = Field(...) - mime: Optional[constr(strict=True, max_length=1024)] = None + name: Annotated[str, Field(strict=True, max_length=255)] + description: Annotated[str, Field(strict=True, max_length=255)] + url: Annotated[str, Field(strict=True, max_length=512)] + length: StrictStr + mime: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None owner: Optional[StrictInt] = None - __properties = ["id", "created_at", "updated_at", "last_played_at", "name", "description", "url", "length", "mime", "owner"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "last_played_at", "name", "description", "url", "length", "mime", "owner"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Webstream: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Webstream from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if last_played_at (nullable) is None - # and __fields_set__ contains the field - if self.last_played_at is None and "last_played_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.last_played_at is None and "last_played_at" in self.model_fields_set: _dict['last_played_at'] = None # set to None if mime (nullable) is None - # and __fields_set__ contains the field - if self.mime is None and "mime" in self.__fields_set__: + # and model_fields_set contains the field + if self.mime is None and "mime" in self.model_fields_set: _dict['mime'] = None # set to None if owner (nullable) is None - # and __fields_set__ contains the field - if self.owner is None and "owner" in self.__fields_set__: + # and model_fields_set contains the field + if self.owner is None and "owner" in self.model_fields_set: _dict['owner'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Webstream: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Webstream from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Webstream.parse_obj(obj) + return cls.model_validate(obj) - _obj = Webstream.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/python-client/libretime_client/models/webstream_metadata.py b/python-client/libretime_client/models/webstream_metadata.py index ec022a89..bcab16c1 100644 --- a/python-client/libretime_client/models/webstream_metadata.py +++ b/python-client/libretime_client/models/webstream_metadata.py @@ -18,56 +18,75 @@ import json from datetime import datetime - -from pydantic import BaseModel, Field, StrictInt, constr +from pydantic import BaseModel, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class WebstreamMetadata(BaseModel): """ WebstreamMetadata - """ - id: StrictInt = Field(...) - starts_at: datetime = Field(...) - data: constr(strict=True, max_length=1024) = Field(...) - schedule: StrictInt = Field(...) - __properties = ["id", "starts_at", "data", "schedule"] + """ # noqa: E501 + id: StrictInt + starts_at: datetime + data: Annotated[str, Field(strict=True, max_length=1024)] + schedule: StrictInt + __properties: ClassVar[List[str]] = ["id", "starts_at", "data", "schedule"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> WebstreamMetadata: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of WebstreamMetadata from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> WebstreamMetadata: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of WebstreamMetadata from a dict""" if obj is None: return None if not isinstance(obj, dict): - return WebstreamMetadata.parse_obj(obj) + return cls.model_validate(obj) - _obj = WebstreamMetadata.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "starts_at": obj.get("starts_at"), "data": obj.get("data"), diff --git a/python-client/libretime_client/models/week_day_enum.py b/python-client/libretime_client/models/week_day_enum.py index ecd7664c..ac7728f1 100644 --- a/python-client/libretime_client/models/week_day_enum.py +++ b/python-client/libretime_client/models/week_day_enum.py @@ -12,13 +12,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class WeekDayEnum(int, Enum): @@ -38,8 +35,8 @@ class WeekDayEnum(int, Enum): NUMBER_6 = 6 @classmethod - def from_json(cls, json_str: str) -> WeekDayEnum: + def from_json(cls, json_str: str) -> Self: """Create an instance of WeekDayEnum from a JSON string""" - return WeekDayEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python-client/libretime_client/rest.py b/python-client/libretime_client/rest.py index 3e2b0e2e..8b458078 100644 --- a/python-client/libretime_client/rest.py +++ b/python-client/libretime_client/rest.py @@ -14,43 +14,55 @@ import io import json -import logging import re import ssl -from urllib.parse import urlencode, quote_plus import urllib3 -from libretime_client.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError, BadRequestException +from libretime_client.exceptions import ApiException, ApiValueError +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): def __init__(self, resp) -> None: - self.urllib3_response = resp + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.headers.get(name, default) + return self.response.headers.get(name, default) class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None) -> None: + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -59,74 +71,79 @@ def __init__(self, configuration, pools_size=4, maxsize=None) -> None: else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + pool_args['retries'] = configuration.retries if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name + pool_args['server_hostname'] = configuration.tls_server_name if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager + self.pool_manager: urllib3.PoolManager + if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -135,63 +152,84 @@ def request(self, method, url, query_params=None, headers=None, post_params = post_params or {} headers = headers or {} - # url already contains the URL query string - # so reset query_params to empty dict - query_params = {} timeout = None if _request_timeout: - if isinstance(_request_timeout, (int,float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: # no content type provided or payload is json - if not headers.get('Content-Type') or re.search('json', headers['Content-Type'], re.IGNORECASE): + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + preload_content=False + ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body r = self.pool_manager.request( - method, url, + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -202,102 +240,16 @@ def request(self, method, url, query_params=None, headers=None, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields={}, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 400: - raise BadRequestException(http_resp=r) - - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def get_request(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def head_request(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def options_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def delete_request(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def post_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def put_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def patch_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return RESTResponse(r) diff --git a/python-client/pyproject.toml b/python-client/pyproject.toml index 7fbaba16..97728820 100644 --- a/python-client/pyproject.toml +++ b/python-client/pyproject.toml @@ -14,13 +14,16 @@ python = "^3.7" urllib3 = ">= 1.25.3" python-dateutil = ">=2.8.2" -pydantic = "^1.10.5, <2" -aenum = ">=3.1.11" +pydantic = ">=2" +typing-extensions = ">=4.7.1" [tool.poetry.dev-dependencies] pytest = ">=7.2.1" tox = ">=3.9.0" flake8 = ">=4.0.0" +types-python-dateutil = ">=2.8.19.14" +mypy = "1.4.1" + [build-system] requires = ["setuptools"] @@ -28,3 +31,41 @@ build-backend = "setuptools.build_meta" [tool.pylint.'MESSAGES CONTROL'] extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "libretime_client", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +strict_concatenate = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true diff --git a/python-client/requirements.txt b/python-client/requirements.txt index 258c179c..cc85509e 100644 --- a/python-client/requirements.txt +++ b/python-client/requirements.txt @@ -1,5 +1,5 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.25.3, < 2.1.0 -pydantic >= 1.10.5, < 2 -aenum >= 3.1.11 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/python-client/setup.py b/python-client/setup.py index 228a7584..3d221404 100644 --- a/python-client/setup.py +++ b/python-client/setup.py @@ -26,8 +26,8 @@ REQUIRES = [ "urllib3 >= 1.25.3, < 2.1.0", "python-dateutil", - "pydantic >= 1.10.5, < 2", - "aenum" + "pydantic >= 2", + "typing-extensions >= 4.7.1", ] setup( diff --git a/python-client/test-requirements.txt b/python-client/test-requirements.txt index 3a0d0b93..8e6d8cb1 100644 --- a/python-client/test-requirements.txt +++ b/python-client/test-requirements.txt @@ -1,3 +1,5 @@ pytest~=7.1.3 pytest-cov>=2.8.1 pytest-randomly>=3.12.0 +mypy>=1.4.1 +types-python-dateutil>=2.8.19