diff --git a/.gitignore b/.gitignore index a655050..43995bd 100644 --- a/.gitignore +++ b/.gitignore @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f8ccaa4 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,33 @@ +# ref: https://docs.gitlab.com/ee/ci/README.html + +stages: + - test + +.nosetest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=mux_python + +nosetest-2.7: + extends: .nosetest + image: python:2.7-alpine +nosetest-3.3: + extends: .nosetest + image: python:3.3-alpine +nosetest-3.4: + extends: .nosetest + image: python:3.4-alpine +nosetest-3.5: + extends: .nosetest + image: python:3.5-alpine +nosetest-3.6: + extends: .nosetest + image: python:3.6-alpine +nosetest-3.7: + extends: .nosetest + image: python:3.7-alpine +nosetest-3.8: + extends: .nosetest + image: python:3.8-alpine diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..d22a2e5 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,232 @@ +.gitignore +.gitlab-ci.yml +README.md +docs/AbridgedVideoView.md +docs/Asset.md +docs/AssetErrors.md +docs/AssetMaster.md +docs/AssetNonStandardInputReasons.md +docs/AssetRecordingTimes.md +docs/AssetResponse.md +docs/AssetStaticRenditions.md +docs/AssetStaticRenditionsFiles.md +docs/AssetsApi.md +docs/BreakdownValue.md +docs/CreateAssetRequest.md +docs/CreateLiveStreamRequest.md +docs/CreatePlaybackIDRequest.md +docs/CreatePlaybackIDResponse.md +docs/CreateSimulcastTargetRequest.md +docs/CreateTrackRequest.md +docs/CreateTrackResponse.md +docs/CreateUploadRequest.md +docs/DeliveryReport.md +docs/DeliveryUsageApi.md +docs/DimensionValue.md +docs/DimensionsApi.md +docs/DirectUploadsApi.md +docs/DisableLiveStreamResponse.md +docs/EnableLiveStreamResponse.md +docs/Error.md +docs/ErrorsApi.md +docs/ExportsApi.md +docs/FilterValue.md +docs/FiltersApi.md +docs/GetAssetInputInfoResponse.md +docs/GetAssetOrLiveStreamIdResponse.md +docs/GetAssetOrLiveStreamIdResponseData.md +docs/GetAssetOrLiveStreamIdResponseDataObject.md +docs/GetAssetPlaybackIDResponse.md +docs/GetMetricTimeseriesDataResponse.md +docs/GetOverallValuesResponse.md +docs/GetRealTimeBreakdownResponse.md +docs/GetRealTimeHistogramTimeseriesResponse.md +docs/GetRealTimeHistogramTimeseriesResponseMeta.md +docs/GetRealTimeTimeseriesResponse.md +docs/Incident.md +docs/IncidentBreakdown.md +docs/IncidentNotification.md +docs/IncidentNotificationRule.md +docs/IncidentResponse.md +docs/IncidentsApi.md +docs/InputFile.md +docs/InputInfo.md +docs/InputSettings.md +docs/InputSettingsOverlaySettings.md +docs/InputTrack.md +docs/Insight.md +docs/ListAllMetricValuesResponse.md +docs/ListAssetsResponse.md +docs/ListBreakdownValuesResponse.md +docs/ListDeliveryUsageResponse.md +docs/ListDimensionValuesResponse.md +docs/ListDimensionsResponse.md +docs/ListErrorsResponse.md +docs/ListExportsResponse.md +docs/ListFilterValuesResponse.md +docs/ListFiltersResponse.md +docs/ListFiltersResponseData.md +docs/ListIncidentsResponse.md +docs/ListInsightsResponse.md +docs/ListLiveStreamsResponse.md +docs/ListRealTimeDimensionsResponse.md +docs/ListRealTimeDimensionsResponseData.md +docs/ListRealTimeMetricsResponse.md +docs/ListRelatedIncidentsResponse.md +docs/ListSigningKeysResponse.md +docs/ListUploadsResponse.md +docs/ListVideoViewsResponse.md +docs/LiveStream.md +docs/LiveStreamResponse.md +docs/LiveStreamsApi.md +docs/Metric.md +docs/MetricsApi.md +docs/NotificationRule.md +docs/OverallValues.md +docs/PlaybackID.md +docs/PlaybackIDApi.md +docs/PlaybackPolicy.md +docs/RealTimeApi.md +docs/RealTimeBreakdownValue.md +docs/RealTimeHistogramTimeseriesBucket.md +docs/RealTimeHistogramTimeseriesBucketValues.md +docs/RealTimeHistogramTimeseriesDatapoint.md +docs/RealTimeTimeseriesDatapoint.md +docs/Score.md +docs/SignalLiveStreamCompleteResponse.md +docs/SigningKey.md +docs/SigningKeyResponse.md +docs/SimulcastTarget.md +docs/SimulcastTargetResponse.md +docs/Track.md +docs/URLSigningKeysApi.md +docs/UpdateAssetMP4SupportRequest.md +docs/UpdateAssetMasterAccessRequest.md +docs/Upload.md +docs/UploadError.md +docs/UploadResponse.md +docs/VideoView.md +docs/VideoViewEvent.md +docs/VideoViewResponse.md +docs/VideoViewsApi.md +mux_python/__init__.py +mux_python/api/__init__.py +mux_python/api/assets_api.py +mux_python/api/delivery_usage_api.py +mux_python/api/dimensions_api.py +mux_python/api/direct_uploads_api.py +mux_python/api/errors_api.py +mux_python/api/exports_api.py +mux_python/api/filters_api.py +mux_python/api/incidents_api.py +mux_python/api/live_streams_api.py +mux_python/api/metrics_api.py +mux_python/api/playback_id_api.py +mux_python/api/real_time_api.py +mux_python/api/url_signing_keys_api.py +mux_python/api/video_views_api.py +mux_python/api_client.py +mux_python/configuration.py +mux_python/exceptions.py +mux_python/models/__init__.py +mux_python/models/abridged_video_view.py +mux_python/models/asset.py +mux_python/models/asset_errors.py +mux_python/models/asset_master.py +mux_python/models/asset_non_standard_input_reasons.py +mux_python/models/asset_recording_times.py +mux_python/models/asset_response.py +mux_python/models/asset_static_renditions.py +mux_python/models/asset_static_renditions_files.py +mux_python/models/breakdown_value.py +mux_python/models/create_asset_request.py +mux_python/models/create_live_stream_request.py +mux_python/models/create_playback_id_request.py +mux_python/models/create_playback_id_response.py +mux_python/models/create_simulcast_target_request.py +mux_python/models/create_track_request.py +mux_python/models/create_track_response.py +mux_python/models/create_upload_request.py +mux_python/models/delivery_report.py +mux_python/models/dimension_value.py +mux_python/models/disable_live_stream_response.py +mux_python/models/enable_live_stream_response.py +mux_python/models/error.py +mux_python/models/filter_value.py +mux_python/models/get_asset_input_info_response.py +mux_python/models/get_asset_or_live_stream_id_response.py +mux_python/models/get_asset_or_live_stream_id_response_data.py +mux_python/models/get_asset_or_live_stream_id_response_data_object.py +mux_python/models/get_asset_playback_id_response.py +mux_python/models/get_metric_timeseries_data_response.py +mux_python/models/get_overall_values_response.py +mux_python/models/get_real_time_breakdown_response.py +mux_python/models/get_real_time_histogram_timeseries_response.py +mux_python/models/get_real_time_histogram_timeseries_response_meta.py +mux_python/models/get_real_time_timeseries_response.py +mux_python/models/incident.py +mux_python/models/incident_breakdown.py +mux_python/models/incident_notification.py +mux_python/models/incident_notification_rule.py +mux_python/models/incident_response.py +mux_python/models/input_file.py +mux_python/models/input_info.py +mux_python/models/input_settings.py +mux_python/models/input_settings_overlay_settings.py +mux_python/models/input_track.py +mux_python/models/insight.py +mux_python/models/list_all_metric_values_response.py +mux_python/models/list_assets_response.py +mux_python/models/list_breakdown_values_response.py +mux_python/models/list_delivery_usage_response.py +mux_python/models/list_dimension_values_response.py +mux_python/models/list_dimensions_response.py +mux_python/models/list_errors_response.py +mux_python/models/list_exports_response.py +mux_python/models/list_filter_values_response.py +mux_python/models/list_filters_response.py +mux_python/models/list_filters_response_data.py +mux_python/models/list_incidents_response.py +mux_python/models/list_insights_response.py +mux_python/models/list_live_streams_response.py +mux_python/models/list_real_time_dimensions_response.py +mux_python/models/list_real_time_dimensions_response_data.py +mux_python/models/list_real_time_metrics_response.py +mux_python/models/list_related_incidents_response.py +mux_python/models/list_signing_keys_response.py +mux_python/models/list_uploads_response.py +mux_python/models/list_video_views_response.py +mux_python/models/live_stream.py +mux_python/models/live_stream_response.py +mux_python/models/metric.py +mux_python/models/notification_rule.py +mux_python/models/overall_values.py +mux_python/models/playback_id.py +mux_python/models/playback_policy.py +mux_python/models/real_time_breakdown_value.py +mux_python/models/real_time_histogram_timeseries_bucket.py +mux_python/models/real_time_histogram_timeseries_bucket_values.py +mux_python/models/real_time_histogram_timeseries_datapoint.py +mux_python/models/real_time_timeseries_datapoint.py +mux_python/models/score.py +mux_python/models/signal_live_stream_complete_response.py +mux_python/models/signing_key.py +mux_python/models/signing_key_response.py +mux_python/models/simulcast_target.py +mux_python/models/simulcast_target_response.py +mux_python/models/track.py +mux_python/models/update_asset_master_access_request.py +mux_python/models/update_asset_mp4_support_request.py +mux_python/models/upload.py +mux_python/models/upload_error.py +mux_python/models/upload_response.py +mux_python/models/video_view.py +mux_python/models/video_view_event.py +mux_python/models/video_view_response.py +mux_python/rest.py +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +tox.ini diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..32f3eaa --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.1 \ No newline at end of file diff --git a/README.md b/README.md index 39d92c5..ee59edd 100644 --- a/README.md +++ b/README.md @@ -1,127 +1,265 @@ -![Mux Python Banner](github-python-sdk.png) +# mux_python +Mux is how developers build online video. This API encompasses both +Mux Video and Mux Data functionality to help you build your video-related +projects better and faster than ever before. -![](https://github.com/muxinc/mux-python/workflows/Integration%20Test/badge.svg) -# Mux Python +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -Official Mux API wrapper for python projects, supporting both Mux Data and Mux Video. +- API version: v1 +- Package version: 1.12.0 +- Build package: org.openapitools.codegen.languages.PythonLegacyClientCodegen -[Mux Video](https://mux.com/video) is an API-first platform, powered by data and designed by video experts to make beautiful video possible for every development team. +## Requirements. -[Mux Data](https://mux.com/data) is a platform for monitoring your video streaming performance with just a few lines of code. Get in-depth quality of service analytics on web, mobile, and OTT devices. +Python 2.7 and 3.4+ -Not familiar with Mux? Check out https://mux.com/ for more information. +## Installation & Usage +### pip install -## Requirements +If the python package is hosted on a repository, you can install directly using: -Python 2.7 or 3.4+ - -### Compatibility with Ubuntu 14.04 +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) -Mux uses cross signed TLS root certificates, which may not be compatible with Ubuntu 14.04 LTS [as documented in this issue](https://github.com/certifi/python-certifi/issues/26). We suggest upgrading to a later LTS operating system if you encounter this issue. +Then import the package: +```python +import mux_python +``` -## Installation +### Setuptools -### Via pip +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). ```sh -pip install git+https://github.com/muxinc/mux-python.git +python setup.py install --user ``` -(you may need to run `pip` with root permission) +(or `sudo python setup.py install` to install the package for all users) -### Via source -```sh -git checkout https://github.com/muxinc/mux-python.git -cd mux-python -python setup.py install --user +Then import the package: +```python +import mux_python ``` ## Getting Started -### Overview - -Mux Python is a code generated lightweight wrapper around the Mux REST API and reflects them accurately. This has a few consequences you should watch out for: - -1) For almost all API responses, the object you're looking for will be in the `data` field on the API response object, as in the example below. This is because we designed our APIs with similar concepts to the [JSON:API](https://jsonapi.org/) standard. This means we'll be able to return more metadata from our API calls (such as related entities) without the need to make breaking changes to our APIs. We've decided not to hide that in this library. - -2) We don't use a lot of object orientation. For example API calls that happen on a single asset don't exist in the asset class, but are API calls in the AssetsApi which require an asset ID. - -### Authentication -To use the Mux API, you'll need an access token and a secret. [Details on obtaining these can be found here in the Mux documentation.](https://docs.mux.com/docs#section-1-get-an-api-access-token) - -Its up to you to manage your token and secret. In our examples, we read them from `MUX_TOKEN_ID` and `MUX_TOKEN_SECRET` in your environment. - -### Example Usage -Below is a quick example of using mux-python to list the Video assets stored in your Mux account. - -Be sure to also checkout the [exmples directory](examples/): -* [List Assets, Live Streams, Signing Keys, and Uploads.](examples/video/list-everything.py) -* [Create an Asset, wait for it to become availiable, and print its playback URL](examples/video/ingest.py) -* [Create a new Live Stream and retrieve its Stream key.](examples/video/create-live-stream.py) - -There's also example usage of every API call (also used for testing): -* [Video](examples/video/) - * [Assets](examples/video/exercise-assets.py) - * [Live Streams](examples/video/exercise-live-streams.py) - * [Signing Keys](examples/video/exercise-signing-keys.py) - * [Uploads](examples/video/exercise-uploads.py) -* [Data](examples/data/) - * [Errors](examples/data/exercise-errors.py) - * [Exports](examples/data/exercise-exports.py) - * [Filters](examples/data/exercise-filters.py) - * [Metrics](examples/data/exercise-metrics.py) - * [Video Views](examples/data/exercise-video-views.py) +Please follow the [installation procedure](#installation--usage) and then run the following: ```python -import os +from __future__ import print_function + +import time import mux_python from mux_python.rest import ApiException - -# Authentication Setup -configuration = mux_python.Configuration() -configuration.username = os.environ['MUX_TOKEN_ID'] -configuration.password = os.environ['MUX_TOKEN_SECRET'] - -# API Client Initialization -assets_api = mux_python.AssetsApi(mux_python.ApiClient(configuration)) - -# List Assets -print("Listing Assets: \n") -try: - list_assets_response = assets_api.list_assets() - for asset in list_assets_response.data: - print('Asset ID: ' + asset.id) - print('Status: ' + asset.status) - print('Duration: ' + str(asset.duration) + "\n") -except ApiException as e: - print("Exception when calling AssetsApi->list_assets: %s\n" % e) +from pprint import pprint + +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.AssetsApi(api_client) + create_asset_request = {"input":"https://muxed.s3.amazonaws.com/leds.mp4","playback_policy":["public"]} # CreateAssetRequest | + + try: + # Create an asset + api_response = api_instance.create_asset(create_asset_request) + pprint(api_response) + except ApiException as e: + print("Exception when calling AssetsApi->create_asset: %s\n" % e) + ``` -## Exceptions & Error Handling - -All exceptions inherit from `ApiException`, you can catch it as in the example above, or you can catch one of the more specific exceptions below. You can check the fields `error_type` and `error_messages` in all Exceptions to see what error the Mux API reported. - -### NotFoundException - -`NotFoundException` is thrown when a resource is not found. This is useful when trying to get an entity by its ID, for example `get_asset("some-id-here")` in the AssetsApi. - -### UnauthorizedException - -`UnauthorizedException` is thrown when Mux cannot authenticate your request. [You should check you have configured your credentials correctly.](#authentication) - -### ServiceException - -`ServiceException` is thrown when Mux returns a HTTP 5XX Status Code. If you encounter this reproducibly, please get in touch with [support@mux.com](mailto:support@mux.com). - -## Documentation +## Documentation for API Endpoints + +All URIs are relative to *https://api.mux.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AssetsApi* | [**create_asset**](docs/AssetsApi.md#create_asset) | **POST** /video/v1/assets | Create an asset +*AssetsApi* | [**create_asset_playback_id**](docs/AssetsApi.md#create_asset_playback_id) | **POST** /video/v1/assets/{ASSET_ID}/playback-ids | Create a playback ID +*AssetsApi* | [**create_asset_track**](docs/AssetsApi.md#create_asset_track) | **POST** /video/v1/assets/{ASSET_ID}/tracks | Create an asset track +*AssetsApi* | [**delete_asset**](docs/AssetsApi.md#delete_asset) | **DELETE** /video/v1/assets/{ASSET_ID} | Delete an asset +*AssetsApi* | [**delete_asset_playback_id**](docs/AssetsApi.md#delete_asset_playback_id) | **DELETE** /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID} | Delete a playback ID +*AssetsApi* | [**delete_asset_track**](docs/AssetsApi.md#delete_asset_track) | **DELETE** /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID} | Delete an asset track +*AssetsApi* | [**get_asset**](docs/AssetsApi.md#get_asset) | **GET** /video/v1/assets/{ASSET_ID} | Retrieve an asset +*AssetsApi* | [**get_asset_input_info**](docs/AssetsApi.md#get_asset_input_info) | **GET** /video/v1/assets/{ASSET_ID}/input-info | Retrieve asset input info +*AssetsApi* | [**get_asset_playback_id**](docs/AssetsApi.md#get_asset_playback_id) | **GET** /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID} | Retrieve a playback ID +*AssetsApi* | [**list_assets**](docs/AssetsApi.md#list_assets) | **GET** /video/v1/assets | List assets +*AssetsApi* | [**update_asset_master_access**](docs/AssetsApi.md#update_asset_master_access) | **PUT** /video/v1/assets/{ASSET_ID}/master-access | Update master access +*AssetsApi* | [**update_asset_mp4_support**](docs/AssetsApi.md#update_asset_mp4_support) | **PUT** /video/v1/assets/{ASSET_ID}/mp4-support | Update MP4 support +*DeliveryUsageApi* | [**list_delivery_usage**](docs/DeliveryUsageApi.md#list_delivery_usage) | **GET** /video/v1/delivery-usage | List Usage +*DimensionsApi* | [**list_dimension_values**](docs/DimensionsApi.md#list_dimension_values) | **GET** /data/v1/dimensions/{DIMENSION_ID} | Lists the values for a specific dimension +*DimensionsApi* | [**list_dimensions**](docs/DimensionsApi.md#list_dimensions) | **GET** /data/v1/dimensions | List Dimensions +*DirectUploadsApi* | [**cancel_direct_upload**](docs/DirectUploadsApi.md#cancel_direct_upload) | **PUT** /video/v1/uploads/{UPLOAD_ID}/cancel | Cancel a direct upload +*DirectUploadsApi* | [**create_direct_upload**](docs/DirectUploadsApi.md#create_direct_upload) | **POST** /video/v1/uploads | Create a new direct upload URL +*DirectUploadsApi* | [**get_direct_upload**](docs/DirectUploadsApi.md#get_direct_upload) | **GET** /video/v1/uploads/{UPLOAD_ID} | Retrieve a single direct upload's info +*DirectUploadsApi* | [**list_direct_uploads**](docs/DirectUploadsApi.md#list_direct_uploads) | **GET** /video/v1/uploads | List direct uploads +*ErrorsApi* | [**list_errors**](docs/ErrorsApi.md#list_errors) | **GET** /data/v1/errors | List Errors +*ExportsApi* | [**list_exports**](docs/ExportsApi.md#list_exports) | **GET** /data/v1/exports | List property video view export links +*FiltersApi* | [**list_filter_values**](docs/FiltersApi.md#list_filter_values) | **GET** /data/v1/filters/{FILTER_ID} | Lists values for a specific filter +*FiltersApi* | [**list_filters**](docs/FiltersApi.md#list_filters) | **GET** /data/v1/filters | List Filters +*IncidentsApi* | [**get_incident**](docs/IncidentsApi.md#get_incident) | **GET** /data/v1/incidents/{INCIDENT_ID} | Get an Incident +*IncidentsApi* | [**list_incidents**](docs/IncidentsApi.md#list_incidents) | **GET** /data/v1/incidents | List Incidents +*IncidentsApi* | [**list_related_incidents**](docs/IncidentsApi.md#list_related_incidents) | **GET** /data/v1/incidents/{INCIDENT_ID}/related | List Related Incidents +*LiveStreamsApi* | [**create_live_stream**](docs/LiveStreamsApi.md#create_live_stream) | **POST** /video/v1/live-streams | Create a live stream +*LiveStreamsApi* | [**create_live_stream_playback_id**](docs/LiveStreamsApi.md#create_live_stream_playback_id) | **POST** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids | Create a live stream playback ID +*LiveStreamsApi* | [**create_live_stream_simulcast_target**](docs/LiveStreamsApi.md#create_live_stream_simulcast_target) | **POST** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets | Create a live stream simulcast target +*LiveStreamsApi* | [**delete_live_stream**](docs/LiveStreamsApi.md#delete_live_stream) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID} | Delete a live stream +*LiveStreamsApi* | [**delete_live_stream_playback_id**](docs/LiveStreamsApi.md#delete_live_stream_playback_id) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID} | Delete a live stream playback ID +*LiveStreamsApi* | [**delete_live_stream_simulcast_target**](docs/LiveStreamsApi.md#delete_live_stream_simulcast_target) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Delete a Live Stream Simulcast Target +*LiveStreamsApi* | [**disable_live_stream**](docs/LiveStreamsApi.md#disable_live_stream) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/disable | Disable a live stream +*LiveStreamsApi* | [**enable_live_stream**](docs/LiveStreamsApi.md#enable_live_stream) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/enable | Enable a live stream +*LiveStreamsApi* | [**get_live_stream**](docs/LiveStreamsApi.md#get_live_stream) | **GET** /video/v1/live-streams/{LIVE_STREAM_ID} | Retrieve a live stream +*LiveStreamsApi* | [**get_live_stream_simulcast_target**](docs/LiveStreamsApi.md#get_live_stream_simulcast_target) | **GET** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Retrieve a Live Stream Simulcast Target +*LiveStreamsApi* | [**list_live_streams**](docs/LiveStreamsApi.md#list_live_streams) | **GET** /video/v1/live-streams | List live streams +*LiveStreamsApi* | [**reset_stream_key**](docs/LiveStreamsApi.md#reset_stream_key) | **POST** /video/v1/live-streams/{LIVE_STREAM_ID}/reset-stream-key | Reset a live stream’s stream key +*LiveStreamsApi* | [**signal_live_stream_complete**](docs/LiveStreamsApi.md#signal_live_stream_complete) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/complete | Signal a live stream is finished +*MetricsApi* | [**get_metric_timeseries_data**](docs/MetricsApi.md#get_metric_timeseries_data) | **GET** /data/v1/metrics/{METRIC_ID}/timeseries | Get metric timeseries data +*MetricsApi* | [**get_overall_values**](docs/MetricsApi.md#get_overall_values) | **GET** /data/v1/metrics/{METRIC_ID}/overall | Get Overall values +*MetricsApi* | [**list_all_metric_values**](docs/MetricsApi.md#list_all_metric_values) | **GET** /data/v1/metrics/comparison | List all metric values +*MetricsApi* | [**list_breakdown_values**](docs/MetricsApi.md#list_breakdown_values) | **GET** /data/v1/metrics/{METRIC_ID}/breakdown | List breakdown values +*MetricsApi* | [**list_insights**](docs/MetricsApi.md#list_insights) | **GET** /data/v1/metrics/{METRIC_ID}/insights | List Insights +*PlaybackIDApi* | [**get_asset_or_livestream_id**](docs/PlaybackIDApi.md#get_asset_or_livestream_id) | **GET** /video/v1/playback-ids/{PLAYBACK_ID} | Retrieve an Asset or Live Stream ID +*RealTimeApi* | [**get_realtime_breakdown**](docs/RealTimeApi.md#get_realtime_breakdown) | **GET** /data/v1/realtime/metrics/{REALTIME_METRIC_ID}/breakdown | Get Real-Time Breakdown +*RealTimeApi* | [**get_realtime_histogram_timeseries**](docs/RealTimeApi.md#get_realtime_histogram_timeseries) | **GET** /data/v1/realtime/metrics/{REALTIME_METRIC_ID}/histogram-timeseries | Get Real-Time Histogram Timeseries +*RealTimeApi* | [**get_realtime_timeseries**](docs/RealTimeApi.md#get_realtime_timeseries) | **GET** /data/v1/realtime/metrics/{REALTIME_METRIC_ID}/timeseries | Get Real-Time Timeseries +*RealTimeApi* | [**list_realtime_dimensions**](docs/RealTimeApi.md#list_realtime_dimensions) | **GET** /data/v1/realtime/dimensions | List Real-Time Dimensions +*RealTimeApi* | [**list_realtime_metrics**](docs/RealTimeApi.md#list_realtime_metrics) | **GET** /data/v1/realtime/metrics | List Real-Time Metrics +*URLSigningKeysApi* | [**create_url_signing_key**](docs/URLSigningKeysApi.md#create_url_signing_key) | **POST** /video/v1/signing-keys | Create a URL signing key +*URLSigningKeysApi* | [**delete_url_signing_key**](docs/URLSigningKeysApi.md#delete_url_signing_key) | **DELETE** /video/v1/signing-keys/{SIGNING_KEY_ID} | Delete a URL signing key +*URLSigningKeysApi* | [**get_url_signing_key**](docs/URLSigningKeysApi.md#get_url_signing_key) | **GET** /video/v1/signing-keys/{SIGNING_KEY_ID} | Retrieve a URL signing key +*URLSigningKeysApi* | [**list_url_signing_keys**](docs/URLSigningKeysApi.md#list_url_signing_keys) | **GET** /video/v1/signing-keys | List URL signing keys +*VideoViewsApi* | [**get_video_view**](docs/VideoViewsApi.md#get_video_view) | **GET** /data/v1/video-views/{VIDEO_VIEW_ID} | Get a Video View +*VideoViewsApi* | [**list_video_views**](docs/VideoViewsApi.md#list_video_views) | **GET** /data/v1/video-views | List Video Views + + +## Documentation For Models + + - [AbridgedVideoView](docs/AbridgedVideoView.md) + - [Asset](docs/Asset.md) + - [AssetErrors](docs/AssetErrors.md) + - [AssetMaster](docs/AssetMaster.md) + - [AssetNonStandardInputReasons](docs/AssetNonStandardInputReasons.md) + - [AssetRecordingTimes](docs/AssetRecordingTimes.md) + - [AssetResponse](docs/AssetResponse.md) + - [AssetStaticRenditions](docs/AssetStaticRenditions.md) + - [AssetStaticRenditionsFiles](docs/AssetStaticRenditionsFiles.md) + - [BreakdownValue](docs/BreakdownValue.md) + - [CreateAssetRequest](docs/CreateAssetRequest.md) + - [CreateLiveStreamRequest](docs/CreateLiveStreamRequest.md) + - [CreatePlaybackIDRequest](docs/CreatePlaybackIDRequest.md) + - [CreatePlaybackIDResponse](docs/CreatePlaybackIDResponse.md) + - [CreateSimulcastTargetRequest](docs/CreateSimulcastTargetRequest.md) + - [CreateTrackRequest](docs/CreateTrackRequest.md) + - [CreateTrackResponse](docs/CreateTrackResponse.md) + - [CreateUploadRequest](docs/CreateUploadRequest.md) + - [DeliveryReport](docs/DeliveryReport.md) + - [DimensionValue](docs/DimensionValue.md) + - [DisableLiveStreamResponse](docs/DisableLiveStreamResponse.md) + - [EnableLiveStreamResponse](docs/EnableLiveStreamResponse.md) + - [Error](docs/Error.md) + - [FilterValue](docs/FilterValue.md) + - [GetAssetInputInfoResponse](docs/GetAssetInputInfoResponse.md) + - [GetAssetOrLiveStreamIdResponse](docs/GetAssetOrLiveStreamIdResponse.md) + - [GetAssetOrLiveStreamIdResponseData](docs/GetAssetOrLiveStreamIdResponseData.md) + - [GetAssetOrLiveStreamIdResponseDataObject](docs/GetAssetOrLiveStreamIdResponseDataObject.md) + - [GetAssetPlaybackIDResponse](docs/GetAssetPlaybackIDResponse.md) + - [GetMetricTimeseriesDataResponse](docs/GetMetricTimeseriesDataResponse.md) + - [GetOverallValuesResponse](docs/GetOverallValuesResponse.md) + - [GetRealTimeBreakdownResponse](docs/GetRealTimeBreakdownResponse.md) + - [GetRealTimeHistogramTimeseriesResponse](docs/GetRealTimeHistogramTimeseriesResponse.md) + - [GetRealTimeHistogramTimeseriesResponseMeta](docs/GetRealTimeHistogramTimeseriesResponseMeta.md) + - [GetRealTimeTimeseriesResponse](docs/GetRealTimeTimeseriesResponse.md) + - [Incident](docs/Incident.md) + - [IncidentBreakdown](docs/IncidentBreakdown.md) + - [IncidentNotification](docs/IncidentNotification.md) + - [IncidentNotificationRule](docs/IncidentNotificationRule.md) + - [IncidentResponse](docs/IncidentResponse.md) + - [InputFile](docs/InputFile.md) + - [InputInfo](docs/InputInfo.md) + - [InputSettings](docs/InputSettings.md) + - [InputSettingsOverlaySettings](docs/InputSettingsOverlaySettings.md) + - [InputTrack](docs/InputTrack.md) + - [Insight](docs/Insight.md) + - [ListAllMetricValuesResponse](docs/ListAllMetricValuesResponse.md) + - [ListAssetsResponse](docs/ListAssetsResponse.md) + - [ListBreakdownValuesResponse](docs/ListBreakdownValuesResponse.md) + - [ListDeliveryUsageResponse](docs/ListDeliveryUsageResponse.md) + - [ListDimensionValuesResponse](docs/ListDimensionValuesResponse.md) + - [ListDimensionsResponse](docs/ListDimensionsResponse.md) + - [ListErrorsResponse](docs/ListErrorsResponse.md) + - [ListExportsResponse](docs/ListExportsResponse.md) + - [ListFilterValuesResponse](docs/ListFilterValuesResponse.md) + - [ListFiltersResponse](docs/ListFiltersResponse.md) + - [ListFiltersResponseData](docs/ListFiltersResponseData.md) + - [ListIncidentsResponse](docs/ListIncidentsResponse.md) + - [ListInsightsResponse](docs/ListInsightsResponse.md) + - [ListLiveStreamsResponse](docs/ListLiveStreamsResponse.md) + - [ListRealTimeDimensionsResponse](docs/ListRealTimeDimensionsResponse.md) + - [ListRealTimeDimensionsResponseData](docs/ListRealTimeDimensionsResponseData.md) + - [ListRealTimeMetricsResponse](docs/ListRealTimeMetricsResponse.md) + - [ListRelatedIncidentsResponse](docs/ListRelatedIncidentsResponse.md) + - [ListSigningKeysResponse](docs/ListSigningKeysResponse.md) + - [ListUploadsResponse](docs/ListUploadsResponse.md) + - [ListVideoViewsResponse](docs/ListVideoViewsResponse.md) + - [LiveStream](docs/LiveStream.md) + - [LiveStreamResponse](docs/LiveStreamResponse.md) + - [Metric](docs/Metric.md) + - [NotificationRule](docs/NotificationRule.md) + - [OverallValues](docs/OverallValues.md) + - [PlaybackID](docs/PlaybackID.md) + - [PlaybackPolicy](docs/PlaybackPolicy.md) + - [RealTimeBreakdownValue](docs/RealTimeBreakdownValue.md) + - [RealTimeHistogramTimeseriesBucket](docs/RealTimeHistogramTimeseriesBucket.md) + - [RealTimeHistogramTimeseriesBucketValues](docs/RealTimeHistogramTimeseriesBucketValues.md) + - [RealTimeHistogramTimeseriesDatapoint](docs/RealTimeHistogramTimeseriesDatapoint.md) + - [RealTimeTimeseriesDatapoint](docs/RealTimeTimeseriesDatapoint.md) + - [Score](docs/Score.md) + - [SignalLiveStreamCompleteResponse](docs/SignalLiveStreamCompleteResponse.md) + - [SigningKey](docs/SigningKey.md) + - [SigningKeyResponse](docs/SigningKeyResponse.md) + - [SimulcastTarget](docs/SimulcastTarget.md) + - [SimulcastTargetResponse](docs/SimulcastTargetResponse.md) + - [Track](docs/Track.md) + - [UpdateAssetMP4SupportRequest](docs/UpdateAssetMP4SupportRequest.md) + - [UpdateAssetMasterAccessRequest](docs/UpdateAssetMasterAccessRequest.md) + - [Upload](docs/Upload.md) + - [UploadError](docs/UploadError.md) + - [UploadResponse](docs/UploadResponse.md) + - [VideoView](docs/VideoView.md) + - [VideoViewEvent](docs/VideoViewEvent.md) + - [VideoViewResponse](docs/VideoViewResponse.md) + + +## Documentation For Authorization + + +## accessToken + +- **Type**: HTTP basic authentication + + +## Author -[Be sure to check out the documentation in the `docs` directory.](docs/) -## Issues -If you run into problems, [please raise a GitHub issue,](https://github.com/muxinc/mux-python/issues) filling in the issue template. We'll take a look as soon as possible. -## Contributing -Please do not submit PRs against this package. It is generated from our OpenAPI definitions - [Please open an issue instead!](https://github.com/muxinc/mux-python/issues) -## License -[MIT License.](LICENSE) Copyright 2019 Mux, Inc. diff --git a/docs/Asset.md b/docs/Asset.md index a5cf088..1aabb97 100644 --- a/docs/Asset.md +++ b/docs/Asset.md @@ -3,16 +3,15 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | Unique identifier for the Asset. | [optional] -**created_at** | **str** | Time at which the object was created. Measured in seconds since the Unix epoch. | [optional] -**deleted_at** | **str** | | [optional] +**id** | **str** | Unique identifier for the Asset. Max 255 characters. | [optional] +**created_at** | **str** | Time the Asset was created, defined as a Unix timestamp (seconds since epoch). | [optional] **status** | **str** | The status of the asset. | [optional] **duration** | **float** | The duration of the asset in seconds (max duration for a single asset is 24 hours). | [optional] **max_stored_resolution** | **str** | The maximum resolution that has been stored for the asset. The asset may be delivered at lower resolutions depending on the device and bandwidth, however it cannot be delivered at a higher value than is stored. | [optional] **max_stored_frame_rate** | **float** | The maximum frame rate that has been stored for the asset. The asset may be delivered at lower frame rates depending on the device and bandwidth, however it cannot be delivered at a higher value than is stored. This field may return -1 if the frame rate of the input cannot be reliably determined. | [optional] **aspect_ratio** | **str** | The aspect ratio of the asset in the form of `width:height`, for example `16:9`. | [optional] -**playback_ids** | [**list[PlaybackID]**](PlaybackID.md) | | [optional] -**tracks** | [**list[Track]**](Track.md) | | [optional] +**playback_ids** | [**list[PlaybackID]**](PlaybackID.md) | An array of Playback ID objects. Use these to create HLS playback URLs. See [Play your videos](https://docs.mux.com/guides/video/play-your-videos) for more details. | [optional] +**tracks** | [**list[Track]**](Track.md) | The individual media tracks that make up an asset. | [optional] **errors** | [**AssetErrors**](AssetErrors.md) | | [optional] **per_title_encode** | **bool** | | [optional] **is_live** | **bool** | Whether the asset is created from a live stream and the live stream is currently `active` and not in `idle` state. | [optional] @@ -26,7 +25,7 @@ Name | Type | Description | Notes **static_renditions** | [**AssetStaticRenditions**](AssetStaticRenditions.md) | | [optional] **recording_times** | [**list[AssetRecordingTimes]**](AssetRecordingTimes.md) | An array of individual live stream recording sessions. A recording session is created on each encoder connection during the live stream | [optional] **non_standard_input_reasons** | [**AssetNonStandardInputReasons**](AssetNonStandardInputReasons.md) | | [optional] -**test** | **bool** | Indicates this asset is a test asset if the value is `true`. A Test asset can help evaluate the Mux Video APIs without incurring any cost. There is no limit on number of test assets created. Test assets are watermarked with the Mux logo, limited to 10 seconds, and deleted after 24 hrs. | [optional] +**test** | **bool** | True means this live stream is a test asset. A test asset can help evaluate the Mux Video APIs without incurring any cost. There is no limit on number of test assets created. Test assets are watermarked with the Mux logo, limited to 10 seconds, and deleted after 24 hrs. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AssetErrors.md b/docs/AssetErrors.md index a23374b..c7b6abb 100644 --- a/docs/AssetErrors.md +++ b/docs/AssetErrors.md @@ -1,5 +1,6 @@ # AssetErrors +Object that describes any errors that happened when processing this asset. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/docs/AssetMaster.md b/docs/AssetMaster.md index b057362..6ccb387 100644 --- a/docs/AssetMaster.md +++ b/docs/AssetMaster.md @@ -1,10 +1,11 @@ # AssetMaster +An object containing the current status of Master Access and the link to the Master MP4 file when ready. This object does not exist if `master_acess` is set to `none` and when the temporary URL expires. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | **str** | | [optional] -**url** | **str** | | [optional] +**url** | **str** | The temporary URL to the master version of the video, as an MP4 file. This URL will expire after 24 hours. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AssetNonStandardInputReasons.md b/docs/AssetNonStandardInputReasons.md index 6dbc741..3043204 100644 --- a/docs/AssetNonStandardInputReasons.md +++ b/docs/AssetNonStandardInputReasons.md @@ -1,13 +1,14 @@ # AssetNonStandardInputReasons +An object containing one or more reasons the input file is non-standard. See [the guide on minimizing processing time](https://docs.mux.com/guides/video/minimize-processing-time) for more information on what a standard input is defined as. This object only exists on on-demand assets that have non-standard inputs, so if missing you can assume the input qualifies as standard. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**video_codec** | **str** | The video codec used on the input file. | [optional] -**audio_codec** | **str** | The audio codec used on the input file. | [optional] -**video_gop_size** | **str** | The video key frame Interval (also called as Group of Picture or GOP) of the input file. | [optional] -**video_frame_rate** | **str** | The video frame rate of the input file. | [optional] -**video_resolution** | **str** | The video resolution of the input file. | [optional] +**video_codec** | **str** | The video codec used on the input file. For example, the input file encoded with `hevc` video codec is non-standard and the value of this parameter is `hevc`. | [optional] +**audio_codec** | **str** | The audio codec used on the input file. Non-AAC audio codecs are non-standard. | [optional] +**video_gop_size** | **str** | The video key frame Interval (also called as Group of Picture or GOP) of the input file is `high`. This parameter is present when the gop is greater than 10 seconds. | [optional] +**video_frame_rate** | **str** | The video frame rate of the input file. Video with average frames per second (fps) less than 10 or greater than 120 is non-standard. A `-1` frame rate value indicates Mux could not determine the frame rate of the video track. | [optional] +**video_resolution** | **str** | The video resolution of the input file. Video resolution higher than 2048 pixels on any one dimension (height or width) is considered non-standard, The resolution value is presented as `width` x `height` in pixels. | [optional] **pixel_aspect_ratio** | **str** | The video pixel aspect ratio of the input file. | [optional] **video_edit_list** | **str** | Video Edit List reason indicates that the input file's video track contains a complex Edit Decision List. | [optional] **audio_edit_list** | **str** | Audio Edit List reason indicates that the input file's audio track contains a complex Edit Decision List. | [optional] diff --git a/docs/AssetStaticRenditions.md b/docs/AssetStaticRenditions.md index 0a3538a..d33ebce 100644 --- a/docs/AssetStaticRenditions.md +++ b/docs/AssetStaticRenditions.md @@ -1,10 +1,11 @@ # AssetStaticRenditions +An object containing the current status of any static renditions (mp4s). The object does not exist if no static renditions have been requested. See [Download your videos](https://docs.mux.com/guides/video/download-your-videos) for more information. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | **str** | Indicates the status of downloadable MP4 versions of this asset. | [optional] [default to 'disabled'] -**files** | [**list[AssetStaticRenditionsFiles]**](AssetStaticRenditionsFiles.md) | | [optional] +**files** | [**list[AssetStaticRenditionsFiles]**](AssetStaticRenditionsFiles.md) | Array of file objects. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AssetStaticRenditionsFiles.md b/docs/AssetStaticRenditionsFiles.md index 41fffb6..c3e2c2f 100644 --- a/docs/AssetStaticRenditionsFiles.md +++ b/docs/AssetStaticRenditionsFiles.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **height** | **int** | The height of the static rendition's file in pixels | [optional] **width** | **int** | The width of the static rendition's file in pixels | [optional] **bitrate** | **int** | The bitrate in bits per second | [optional] -**filesize** | **str** | | [optional] +**filesize** | **str** | The file size in bytes | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AssetsApi.md b/docs/AssetsApi.md index 354724a..d46e61c 100644 --- a/docs/AssetsApi.md +++ b/docs/AssetsApi.md @@ -27,28 +27,42 @@ Create a new Mux Video asset. ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration)) -create_asset_request = mux_python.CreateAssetRequest() # CreateAssetRequest | - -try: - # Create an asset - api_response = api_instance.create_asset(create_asset_request) - pprint(api_response) -except ApiException as e: - print("Exception when calling AssetsApi->create_asset: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.AssetsApi(api_client) + create_asset_request = {"input":"https://muxed.s3.amazonaws.com/leds.mp4","playback_policy":["public"]} # CreateAssetRequest | + + try: + # Create an asset + api_response = api_instance.create_asset(create_asset_request) + pprint(api_response) + except ApiException as e: + print("Exception when calling AssetsApi->create_asset: %s\n" % e) ``` ### Parameters @@ -70,6 +84,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Asset Created | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_asset_playback_id** @@ -79,29 +98,43 @@ Create a playback ID ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration)) -asset_id = 'asset_id_example' # str | The asset ID. -create_playback_id_request = mux_python.CreatePlaybackIDRequest() # CreatePlaybackIDRequest | - -try: - # Create a playback ID - api_response = api_instance.create_asset_playback_id(asset_id, create_playback_id_request) - pprint(api_response) -except ApiException as e: - print("Exception when calling AssetsApi->create_asset_playback_id: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.AssetsApi(api_client) + asset_id = 'asset_id_example' # str | The asset ID. +create_playback_id_request = {"policy":"public"} # CreatePlaybackIDRequest | + + try: + # Create a playback ID + api_response = api_instance.create_asset_playback_id(asset_id, create_playback_id_request) + pprint(api_response) + except ApiException as e: + print("Exception when calling AssetsApi->create_asset_playback_id: %s\n" % e) ``` ### Parameters @@ -124,6 +157,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_asset_track** @@ -133,29 +171,43 @@ Create an asset track ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration)) -asset_id = 'asset_id_example' # str | The asset ID. -create_track_request = mux_python.CreateTrackRequest() # CreateTrackRequest | - -try: - # Create an asset track - api_response = api_instance.create_asset_track(asset_id, create_track_request) - pprint(api_response) -except ApiException as e: - print("Exception when calling AssetsApi->create_asset_track: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.AssetsApi(api_client) + asset_id = 'asset_id_example' # str | The asset ID. +create_track_request = {"url":"https://example.com/myVideo_en.srt","type":"text","text_type":"subtitles","language_code":"en-US","name":"English","closed_captions":true,"passthrough":"English"} # CreateTrackRequest | + + try: + # Create an asset track + api_response = api_instance.create_asset_track(asset_id, create_track_request) + pprint(api_response) + except ApiException as e: + print("Exception when calling AssetsApi->create_asset_track: %s\n" % e) ``` ### Parameters @@ -178,6 +230,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_asset** @@ -189,27 +246,41 @@ Deletes a video asset and all its data ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration)) -asset_id = 'asset_id_example' # str | The asset ID. - -try: - # Delete an asset - api_instance.delete_asset(asset_id) -except ApiException as e: - print("Exception when calling AssetsApi->delete_asset: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.AssetsApi(api_client) + asset_id = 'asset_id_example' # str | The asset ID. + + try: + # Delete an asset + api_instance.delete_asset(asset_id) + except ApiException as e: + print("Exception when calling AssetsApi->delete_asset: %s\n" % e) ``` ### Parameters @@ -231,6 +302,11 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_asset_playback_id** @@ -240,28 +316,42 @@ Delete a playback ID ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) -# create an instance of the API class -api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration)) -asset_id = 'asset_id_example' # str | The asset ID. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.AssetsApi(api_client) + asset_id = 'asset_id_example' # str | The asset ID. playback_id = 'playback_id_example' # str | The live stream's playback ID. -try: - # Delete a playback ID - api_instance.delete_asset_playback_id(asset_id, playback_id) -except ApiException as e: - print("Exception when calling AssetsApi->delete_asset_playback_id: %s\n" % e) + try: + # Delete a playback ID + api_instance.delete_asset_playback_id(asset_id, playback_id) + except ApiException as e: + print("Exception when calling AssetsApi->delete_asset_playback_id: %s\n" % e) ``` ### Parameters @@ -284,6 +374,11 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_asset_track** @@ -293,28 +388,42 @@ Delete an asset track ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration)) -asset_id = 'asset_id_example' # str | The asset ID. +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.AssetsApi(api_client) + asset_id = 'asset_id_example' # str | The asset ID. track_id = 'track_id_example' # str | The track ID. -try: - # Delete an asset track - api_instance.delete_asset_track(asset_id, track_id) -except ApiException as e: - print("Exception when calling AssetsApi->delete_asset_track: %s\n" % e) + try: + # Delete an asset track + api_instance.delete_asset_track(asset_id, track_id) + except ApiException as e: + print("Exception when calling AssetsApi->delete_asset_track: %s\n" % e) ``` ### Parameters @@ -337,6 +446,11 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_asset** @@ -348,28 +462,42 @@ Retrieves the details of an asset that has previously been created. Supply the u ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration)) -asset_id = 'asset_id_example' # str | The asset ID. - -try: - # Retrieve an asset - api_response = api_instance.get_asset(asset_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling AssetsApi->get_asset: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.AssetsApi(api_client) + asset_id = 'asset_id_example' # str | The asset ID. + + try: + # Retrieve an asset + api_response = api_instance.get_asset(asset_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling AssetsApi->get_asset: %s\n" % e) ``` ### Parameters @@ -391,6 +519,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_asset_input_info** @@ -402,28 +535,42 @@ Returns a list of the input objects that were used to create the asset along wit ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration)) -asset_id = 'asset_id_example' # str | The asset ID. - -try: - # Retrieve asset input info - api_response = api_instance.get_asset_input_info(asset_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling AssetsApi->get_asset_input_info: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.AssetsApi(api_client) + asset_id = 'asset_id_example' # str | The asset ID. + + try: + # Retrieve asset input info + api_response = api_instance.get_asset_input_info(asset_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling AssetsApi->get_asset_input_info: %s\n" % e) ``` ### Parameters @@ -445,6 +592,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_asset_playback_id** @@ -454,29 +606,43 @@ Retrieve a playback ID ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration)) -asset_id = 'asset_id_example' # str | The asset ID. +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.AssetsApi(api_client) + asset_id = 'asset_id_example' # str | The asset ID. playback_id = 'playback_id_example' # str | The live stream's playback ID. -try: - # Retrieve a playback ID - api_response = api_instance.get_asset_playback_id(asset_id, playback_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling AssetsApi->get_asset_playback_id: %s\n" % e) + try: + # Retrieve a playback ID + api_response = api_instance.get_asset_playback_id(asset_id, playback_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling AssetsApi->get_asset_playback_id: %s\n" % e) ``` ### Parameters @@ -499,6 +665,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_assets** @@ -510,29 +681,43 @@ List all Mux assets. ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration)) -limit = 25 # int | Number of items to include in the response (optional) (default to 25) +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.AssetsApi(api_client) + limit = 25 # int | Number of items to include in the response (optional) (default to 25) page = 1 # int | Offset by this many pages, of the size of `limit` (optional) (default to 1) -try: - # List assets - api_response = api_instance.list_assets(limit=limit, page=page) - pprint(api_response) -except ApiException as e: - print("Exception when calling AssetsApi->list_assets: %s\n" % e) + try: + # List assets + api_response = api_instance.list_assets(limit=limit, page=page) + pprint(api_response) + except ApiException as e: + print("Exception when calling AssetsApi->list_assets: %s\n" % e) ``` ### Parameters @@ -555,6 +740,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_asset_master_access** @@ -562,33 +752,47 @@ Name | Type | Description | Notes Update master access -Allows you add temporary access to the master (highest-quality) version of the asset in MP4 format. A URL will be created that can be used to download the master version for 24 hours. After 24 hours Master Access will revert to \"none\". This master version is not optimized for web and not meant to be streamed, only downloaded for purposes like archiving or editing the video offline. +Allows you to add temporary access to the master (highest-quality) version of the asset in MP4 format. A URL will be created that can be used to download the master version for 24 hours. After 24 hours Master Access will revert to \"none\". This master version is not optimized for web and not meant to be streamed, only downloaded for purposes like archiving or editing the video offline. ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration)) -asset_id = 'asset_id_example' # str | The asset ID. -update_asset_master_access_request = mux_python.UpdateAssetMasterAccessRequest() # UpdateAssetMasterAccessRequest | - -try: - # Update master access - api_response = api_instance.update_asset_master_access(asset_id, update_asset_master_access_request) - pprint(api_response) -except ApiException as e: - print("Exception when calling AssetsApi->update_asset_master_access: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.AssetsApi(api_client) + asset_id = 'asset_id_example' # str | The asset ID. +update_asset_master_access_request = {"master_access":"temporary"} # UpdateAssetMasterAccessRequest | + + try: + # Update master access + api_response = api_instance.update_asset_master_access(asset_id, update_asset_master_access_request) + pprint(api_response) + except ApiException as e: + print("Exception when calling AssetsApi->update_asset_master_access: %s\n" % e) ``` ### Parameters @@ -611,6 +815,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_asset_mp4_support** @@ -618,33 +827,47 @@ Name | Type | Description | Notes Update MP4 support -Allows you add or remove mp4 support for assets that were created without it. Currently there are two values supported in this request, `standard` and `none`. `none` means that an asset *does not* have mp4 support, so submitting a request with `mp4_support` set to `none` will delete the mp4 assets from the asset in question. +Allows you to add or remove mp4 support for assets that were created without it. Currently there are two values supported in this request, `standard` and `none`. `none` means that an asset *does not* have mp4 support, so submitting a request with `mp4_support` set to `none` will delete the mp4 assets from the asset in question. ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.AssetsApi(mux_python.ApiClient(configuration)) -asset_id = 'asset_id_example' # str | The asset ID. -update_asset_mp4_support_request = mux_python.UpdateAssetMP4SupportRequest() # UpdateAssetMP4SupportRequest | - -try: - # Update MP4 support - api_response = api_instance.update_asset_mp4_support(asset_id, update_asset_mp4_support_request) - pprint(api_response) -except ApiException as e: - print("Exception when calling AssetsApi->update_asset_mp4_support: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.AssetsApi(api_client) + asset_id = 'asset_id_example' # str | The asset ID. +update_asset_mp4_support_request = {"mp4_support":"standard"} # UpdateAssetMP4SupportRequest | + + try: + # Update MP4 support + api_response = api_instance.update_asset_mp4_support(asset_id, update_asset_mp4_support_request) + pprint(api_response) + except ApiException as e: + print("Exception when calling AssetsApi->update_asset_mp4_support: %s\n" % e) ``` ### Parameters @@ -667,5 +890,10 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/CreateAssetRequest.md b/docs/CreateAssetRequest.md index 01393cb..01039fb 100644 --- a/docs/CreateAssetRequest.md +++ b/docs/CreateAssetRequest.md @@ -7,9 +7,9 @@ Name | Type | Description | Notes **playback_policy** | [**list[PlaybackPolicy]**](PlaybackPolicy.md) | An array of playback policy names that you want applied to this asset and available through `playback_ids`. Options include: `\"public\"` (anyone with the playback URL can stream the asset). And `\"signed\"` (an additional access token is required to play the asset). If no playback_policy is set, the asset will have no playback IDs and will therefore not be playable. For simplicity, a single string name can be used in place of the array in the case of only one playback policy. | [optional] **per_title_encode** | **bool** | | [optional] **passthrough** | **str** | Arbitrary metadata that will be included in the asset details and related webhooks. Can be used to store your own ID for a video along with the asset. **Max: 255 characters**. | [optional] -**mp4_support** | **str** | Specify what level (if any) of support for mp4 playback. In most cases you should use our default HLS-based streaming playback ({playback_id}.m3u8) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your vidoes guide](/guides/video/download-your-videos) for more information. | [optional] +**mp4_support** | **str** | Specify what level (if any) of support for mp4 playback. In most cases you should use our default HLS-based streaming playback ({playback_id}.m3u8) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your videos guide](/guides/video/download-your-videos) for more information. | [optional] **normalize_audio** | **bool** | Normalize the audio track loudness level. This parameter is only applicable to on-demand (not live) assets. | [optional] [default to False] -**master_access** | **str** | Specify what level (if any) of support for master access. Master access can be enabled temporarily for your asset to be downloaded. See the [Download your vidoes guide](/guides/video/download-your-videos) for more information. | [optional] +**master_access** | **str** | Specify what level (if any) of support for master access. Master access can be enabled temporarily for your asset to be downloaded. See the [Download your videos guide](/guides/video/download-your-videos) for more information. | [optional] **test** | **bool** | Marks the asset as a test asset when the value is set to true. A Test asset can help evaluate the Mux Video APIs without incurring any cost. There is no limit on number of test assets created. Test asset are watermarked with the Mux logo, limited to 10 seconds, deleted after 24 hrs. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DeliveryReport.md b/docs/DeliveryReport.md index af9a04d..3bbedd9 100644 --- a/docs/DeliveryReport.md +++ b/docs/DeliveryReport.md @@ -3,13 +3,13 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**live_stream_id** | **str** | | [optional] -**asset_id** | **str** | | [optional] -**passthrough** | **str** | | [optional] -**created_at** | **str** | | [optional] -**asset_state** | **str** | | [optional] -**asset_duration** | **float** | | [optional] -**delivered_seconds** | **float** | | [optional] +**live_stream_id** | **str** | Unique identifier for the live stream that created the asset. | [optional] +**asset_id** | **str** | Unique identifier for the asset. | [optional] +**passthrough** | **str** | The `passthrough` value for the asset. | [optional] +**created_at** | **str** | Time at which the asset was created. Measured in seconds since the Unix epoch. | [optional] +**asset_state** | **str** | The state of the asset. | [optional] +**asset_duration** | **float** | The duration of the asset in seconds. | [optional] +**delivered_seconds** | **float** | Total number of delivered seconds during this time window. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DeliveryUsageApi.md b/docs/DeliveryUsageApi.md index 20176cb..71727a4 100644 --- a/docs/DeliveryUsageApi.md +++ b/docs/DeliveryUsageApi.md @@ -16,31 +16,45 @@ Returns a list of delivery usage records and their associated Asset IDs or Live ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.DeliveryUsageApi(mux_python.ApiClient(configuration)) -page = 1 # int | Offset by this many pages, of the size of `limit` (optional) (default to 1) +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.DeliveryUsageApi(api_client) + page = 1 # int | Offset by this many pages, of the size of `limit` (optional) (default to 1) limit = 100 # int | Number of items to include in the response (optional) (default to 100) asset_id = 'asset_id_example' # str | Filter response to return delivery usage for this asset only. (optional) timeframe = ['timeframe_example'] # list[str] | Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional) -try: - # List Usage - api_response = api_instance.list_delivery_usage(page=page, limit=limit, asset_id=asset_id, timeframe=timeframe) - pprint(api_response) -except ApiException as e: - print("Exception when calling DeliveryUsageApi->list_delivery_usage: %s\n" % e) + try: + # List Usage + api_response = api_instance.list_delivery_usage(page=page, limit=limit, asset_id=asset_id, timeframe=timeframe) + pprint(api_response) + except ApiException as e: + print("Exception when calling DeliveryUsageApi->list_delivery_usage: %s\n" % e) ``` ### Parameters @@ -65,5 +79,10 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/DimensionsApi.md b/docs/DimensionsApi.md index 8c7f7f4..92cef8d 100644 --- a/docs/DimensionsApi.md +++ b/docs/DimensionsApi.md @@ -17,32 +17,46 @@ Lists the values for a dimension along with a total count of related views. No ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.DimensionsApi(mux_python.ApiClient(configuration)) -dimension_id = abcd1234 # str | ID of the Dimension +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.DimensionsApi(api_client) + dimension_id = 'abcd1234' # str | ID of the Dimension limit = 25 # int | Number of items to include in the response (optional) (default to 25) page = 1 # int | Offset by this many pages, of the size of `limit` (optional) (default to 1) filters = ['filters_example'] # list[str] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) timeframe = ['timeframe_example'] # list[str] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) -try: - # Lists the values for a specific dimension - api_response = api_instance.list_dimension_values(dimension_id, limit=limit, page=page, filters=filters, timeframe=timeframe) - pprint(api_response) -except ApiException as e: - print("Exception when calling DimensionsApi->list_dimension_values: %s\n" % e) + try: + # Lists the values for a specific dimension + api_response = api_instance.list_dimension_values(dimension_id, limit=limit, page=page, filters=filters, timeframe=timeframe) + pprint(api_response) + except ApiException as e: + print("Exception when calling DimensionsApi->list_dimension_values: %s\n" % e) ``` ### Parameters @@ -68,6 +82,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_dimensions** @@ -79,27 +98,41 @@ List all available dimensions. Note: This API replaces the list-filters API cal ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.DimensionsApi(mux_python.ApiClient(configuration)) - -try: - # List Dimensions - api_response = api_instance.list_dimensions() - pprint(api_response) -except ApiException as e: - print("Exception when calling DimensionsApi->list_dimensions: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.DimensionsApi(api_client) + + try: + # List Dimensions + api_response = api_instance.list_dimensions() + pprint(api_response) + except ApiException as e: + print("Exception when calling DimensionsApi->list_dimensions: %s\n" % e) ``` ### Parameters @@ -118,5 +151,10 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/DirectUploadsApi.md b/docs/DirectUploadsApi.md index deb125c..d9e9592 100644 --- a/docs/DirectUploadsApi.md +++ b/docs/DirectUploadsApi.md @@ -19,28 +19,42 @@ Cancels a direct upload and marks it as cancelled. If a pending upload finishes ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.DirectUploadsApi(mux_python.ApiClient(configuration)) -upload_id = abcd1234 # str | ID of the Upload - -try: - # Cancel a direct upload - api_response = api_instance.cancel_direct_upload(upload_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling DirectUploadsApi->cancel_direct_upload: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.DirectUploadsApi(api_client) + upload_id = 'abcd1234' # str | ID of the Upload + + try: + # Cancel a direct upload + api_response = api_instance.cancel_direct_upload(upload_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling DirectUploadsApi->cancel_direct_upload: %s\n" % e) ``` ### Parameters @@ -62,6 +76,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Cancellation no longer possible | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_direct_upload** @@ -71,28 +91,42 @@ Create a new direct upload URL ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.DirectUploadsApi(mux_python.ApiClient(configuration)) -create_upload_request = mux_python.CreateUploadRequest() # CreateUploadRequest | - -try: - # Create a new direct upload URL - api_response = api_instance.create_direct_upload(create_upload_request) - pprint(api_response) -except ApiException as e: - print("Exception when calling DirectUploadsApi->create_direct_upload: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.DirectUploadsApi(api_client) + create_upload_request = {"cors_origin":"https://example.com/","new_asset_settings":{"playback_policy":["public"],"mp4_support":"standard"}} # CreateUploadRequest | + + try: + # Create a new direct upload URL + api_response = api_instance.create_direct_upload(create_upload_request) + pprint(api_response) + except ApiException as e: + print("Exception when calling DirectUploadsApi->create_direct_upload: %s\n" % e) ``` ### Parameters @@ -114,6 +148,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_direct_upload** @@ -123,28 +162,42 @@ Retrieve a single direct upload's info ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.DirectUploadsApi(mux_python.ApiClient(configuration)) -upload_id = abcd1234 # str | ID of the Upload - -try: - # Retrieve a single direct upload's info - api_response = api_instance.get_direct_upload(upload_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling DirectUploadsApi->get_direct_upload: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.DirectUploadsApi(api_client) + upload_id = 'abcd1234' # str | ID of the Upload + + try: + # Retrieve a single direct upload's info + api_response = api_instance.get_direct_upload(upload_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling DirectUploadsApi->get_direct_upload: %s\n" % e) ``` ### Parameters @@ -166,6 +219,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_direct_uploads** @@ -175,29 +233,43 @@ List direct uploads ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) -# create an instance of the API class -api_instance = mux_python.DirectUploadsApi(mux_python.ApiClient(configuration)) -limit = 25 # int | Number of items to include in the response (optional) (default to 25) +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.DirectUploadsApi(api_client) + limit = 25 # int | Number of items to include in the response (optional) (default to 25) page = 1 # int | Offset by this many pages, of the size of `limit` (optional) (default to 1) -try: - # List direct uploads - api_response = api_instance.list_direct_uploads(limit=limit, page=page) - pprint(api_response) -except ApiException as e: - print("Exception when calling DirectUploadsApi->list_direct_uploads: %s\n" % e) + try: + # List direct uploads + api_response = api_instance.list_direct_uploads(limit=limit, page=page) + pprint(api_response) + except ApiException as e: + print("Exception when calling DirectUploadsApi->list_direct_uploads: %s\n" % e) ``` ### Parameters @@ -220,5 +292,10 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/DisableLiveStreamResponse.md b/docs/DisableLiveStreamResponse.md index b45904f..f218568 100644 --- a/docs/DisableLiveStreamResponse.md +++ b/docs/DisableLiveStreamResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**object**](.md) | | [optional] +**data** | **object** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/EnableLiveStreamResponse.md b/docs/EnableLiveStreamResponse.md index 3c83f05..2822acc 100644 --- a/docs/EnableLiveStreamResponse.md +++ b/docs/EnableLiveStreamResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**object**](.md) | | [optional] +**data** | **object** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Error.md b/docs/Error.md index f4c0f44..633389a 100644 --- a/docs/Error.md +++ b/docs/Error.md @@ -3,14 +3,14 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**percentage** | **float** | | [optional] -**notes** | **str** | | [optional] -**message** | **str** | | [optional] -**last_seen** | **str** | | [optional] -**description** | **str** | | [optional] -**count** | **int** | | [optional] -**code** | **int** | | [optional] +**id** | **int** | A unique identifier for this error. | [optional] +**percentage** | **float** | The percentage of views that experienced this error. | [optional] +**notes** | **str** | Notes that are attached to this error. | [optional] +**message** | **str** | The error message. | [optional] +**last_seen** | **str** | The last time this error was seen (ISO 8601 timestamp). | [optional] +**description** | **str** | Description of the error. | [optional] +**count** | **int** | The total number of views that experiend this error. | [optional] +**code** | **int** | The error code | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ErrorsApi.md b/docs/ErrorsApi.md index 3cb9ca2..f075a87 100644 --- a/docs/ErrorsApi.md +++ b/docs/ErrorsApi.md @@ -16,29 +16,43 @@ Returns a list of errors ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.ErrorsApi(mux_python.ApiClient(configuration)) -filters = ['filters_example'] # list[str] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.ErrorsApi(api_client) + filters = ['filters_example'] # list[str] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) timeframe = ['timeframe_example'] # list[str] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) -try: - # List Errors - api_response = api_instance.list_errors(filters=filters, timeframe=timeframe) - pprint(api_response) -except ApiException as e: - print("Exception when calling ErrorsApi->list_errors: %s\n" % e) + try: + # List Errors + api_response = api_instance.list_errors(filters=filters, timeframe=timeframe) + pprint(api_response) + except ApiException as e: + print("Exception when calling ErrorsApi->list_errors: %s\n" % e) ``` ### Parameters @@ -61,5 +75,10 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/ExportsApi.md b/docs/ExportsApi.md index e825eb4..847751f 100644 --- a/docs/ExportsApi.md +++ b/docs/ExportsApi.md @@ -16,27 +16,41 @@ Lists the available video view exports along with URLs to retrieve them ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.ExportsApi(mux_python.ApiClient(configuration)) - -try: - # List property video view export links - api_response = api_instance.list_exports() - pprint(api_response) -except ApiException as e: - print("Exception when calling ExportsApi->list_exports: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.ExportsApi(api_client) + + try: + # List property video view export links + api_response = api_instance.list_exports() + pprint(api_response) + except ApiException as e: + print("Exception when calling ExportsApi->list_exports: %s\n" % e) ``` ### Parameters @@ -55,5 +69,10 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/FiltersApi.md b/docs/FiltersApi.md index 944b6ed..a7cd2f2 100644 --- a/docs/FiltersApi.md +++ b/docs/FiltersApi.md @@ -17,32 +17,46 @@ Deprecated: The API has been replaced by the list-dimension-values API call. Li ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.FiltersApi(mux_python.ApiClient(configuration)) -filter_id = abcd1234 # str | ID of the Filter +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.FiltersApi(api_client) + filter_id = 'abcd1234' # str | ID of the Filter limit = 25 # int | Number of items to include in the response (optional) (default to 25) page = 1 # int | Offset by this many pages, of the size of `limit` (optional) (default to 1) filters = ['filters_example'] # list[str] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) timeframe = ['timeframe_example'] # list[str] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) -try: - # Lists values for a specific filter - api_response = api_instance.list_filter_values(filter_id, limit=limit, page=page, filters=filters, timeframe=timeframe) - pprint(api_response) -except ApiException as e: - print("Exception when calling FiltersApi->list_filter_values: %s\n" % e) + try: + # Lists values for a specific filter + api_response = api_instance.list_filter_values(filter_id, limit=limit, page=page, filters=filters, timeframe=timeframe) + pprint(api_response) + except ApiException as e: + print("Exception when calling FiltersApi->list_filter_values: %s\n" % e) ``` ### Parameters @@ -68,6 +82,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_filters** @@ -79,27 +98,41 @@ Deprecated: The API has been replaced by the list-dimensions API call. Lists al ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.FiltersApi(mux_python.ApiClient(configuration)) - -try: - # List Filters - api_response = api_instance.list_filters() - pprint(api_response) -except ApiException as e: - print("Exception when calling FiltersApi->list_filters: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.FiltersApi(api_client) + + try: + # List Filters + api_response = api_instance.list_filters() + pprint(api_response) + except ApiException as e: + print("Exception when calling FiltersApi->list_filters: %s\n" % e) ``` ### Parameters @@ -118,5 +151,10 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/GetAssetOrLiveStreamIdResponseDataObject.md b/docs/GetAssetOrLiveStreamIdResponseDataObject.md index 97d6c9a..797a90b 100644 --- a/docs/GetAssetOrLiveStreamIdResponseDataObject.md +++ b/docs/GetAssetOrLiveStreamIdResponseDataObject.md @@ -1,5 +1,6 @@ # GetAssetOrLiveStreamIdResponseDataObject +Describes the Asset or LiveStream object associated with the playback ID. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/docs/IncidentsApi.md b/docs/IncidentsApi.md index 7b79f71..fc1c2c2 100644 --- a/docs/IncidentsApi.md +++ b/docs/IncidentsApi.md @@ -18,28 +18,42 @@ Returns the details of an incident ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.IncidentsApi(mux_python.ApiClient(configuration)) -incident_id = abcd1234 # str | ID of the Incident - -try: - # Get an Incident - api_response = api_instance.get_incident(incident_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling IncidentsApi->get_incident: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.IncidentsApi(api_client) + incident_id = 'abcd1234' # str | ID of the Incident + + try: + # Get an Incident + api_response = api_instance.get_incident(incident_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling IncidentsApi->get_incident: %s\n" % e) ``` ### Parameters @@ -61,6 +75,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_incidents** @@ -72,33 +91,47 @@ Returns a list of incidents ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) -# create an instance of the API class -api_instance = mux_python.IncidentsApi(mux_python.ApiClient(configuration)) -limit = 25 # int | Number of items to include in the response (optional) (default to 25) +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.IncidentsApi(api_client) + limit = 25 # int | Number of items to include in the response (optional) (default to 25) page = 1 # int | Offset by this many pages, of the size of `limit` (optional) (default to 1) order_by = 'order_by_example' # str | Value to order the results by (optional) order_direction = 'order_direction_example' # str | Sort order. (optional) status = 'status_example' # str | Status to filter incidents by (optional) severity = 'severity_example' # str | Severity to filter incidents by (optional) -try: - # List Incidents - api_response = api_instance.list_incidents(limit=limit, page=page, order_by=order_by, order_direction=order_direction, status=status, severity=severity) - pprint(api_response) -except ApiException as e: - print("Exception when calling IncidentsApi->list_incidents: %s\n" % e) + try: + # List Incidents + api_response = api_instance.list_incidents(limit=limit, page=page, order_by=order_by, order_direction=order_direction, status=status, severity=severity) + pprint(api_response) + except ApiException as e: + print("Exception when calling IncidentsApi->list_incidents: %s\n" % e) ``` ### Parameters @@ -125,6 +158,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_related_incidents** @@ -136,32 +174,46 @@ Returns all the incidents that seem related to a specific incident ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) -# create an instance of the API class -api_instance = mux_python.IncidentsApi(mux_python.ApiClient(configuration)) -incident_id = abcd1234 # str | ID of the Incident +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.IncidentsApi(api_client) + incident_id = 'abcd1234' # str | ID of the Incident limit = 25 # int | Number of items to include in the response (optional) (default to 25) page = 1 # int | Offset by this many pages, of the size of `limit` (optional) (default to 1) order_by = 'order_by_example' # str | Value to order the results by (optional) order_direction = 'order_direction_example' # str | Sort order. (optional) -try: - # List Related Incidents - api_response = api_instance.list_related_incidents(incident_id, limit=limit, page=page, order_by=order_by, order_direction=order_direction) - pprint(api_response) -except ApiException as e: - print("Exception when calling IncidentsApi->list_related_incidents: %s\n" % e) + try: + # List Related Incidents + api_response = api_instance.list_related_incidents(incident_id, limit=limit, page=page, order_by=order_by, order_direction=order_direction) + pprint(api_response) + except ApiException as e: + print("Exception when calling IncidentsApi->list_related_incidents: %s\n" % e) ``` ### Parameters @@ -187,5 +239,10 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/InputSettings.md b/docs/InputSettings.md index c9039ad..e00e58c 100644 --- a/docs/InputSettings.md +++ b/docs/InputSettings.md @@ -1,12 +1,13 @@ # InputSettings +An array of objects that each describe an input file to be used to create the asset. As a shortcut, `input` can also be a string URL for a file when only one input file is used. See `input[].url` for requirements. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **url** | **str** | The web address of the file that Mux should download and use. * For subtitles text tracks, the url is the location of subtitle/captions file. Mux supports [SubRip Text (SRT)](https://en.wikipedia.org/wiki/SubRip) and [Web Video Text Tracks](https://www.w3.org/TR/webvtt1/) format for ingesting Subtitles and Closed Captions. * For Watermarking or Overlay, the url is the location of the watermark image. * When creating clips from existing Mux assets, the url is defined with `mux://assets/{asset_id}` template where `asset_id` is the Asset Identifier for creating the clip from. | [optional] **overlay_settings** | [**InputSettingsOverlaySettings**](InputSettingsOverlaySettings.md) | | [optional] -**start_time** | **float** | The time offset in seconds from the beginning of the video indicating the clip's starting marker. The default value is 0 when not included. | [optional] -**end_time** | **float** | The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included. | [optional] +**start_time** | **float** | The time offset in seconds from the beginning of the video indicating the clip's starting marker. The default value is 0 when not included. This parameter is only applicable for creating clips when `input.url` has `mux://assets/{asset_id}` format. | [optional] +**end_time** | **float** | The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included. This parameter is only applicable for creating clips when `input.url` has `mux://assets/{asset_id}` format. | [optional] **type** | **str** | This parameter is required for the `text` track type. | [optional] **text_type** | **str** | Type of text track. This parameter only supports subtitles value. For more information on Subtitles / Closed Captions, [see this blog post](https://mux.com/blog/subtitles-captions-webvtt-hls-and-those-magic-flags/). This parameter is required for `text` track type. | [optional] **language_code** | **str** | The language code value must be a valid [BCP 47](https://tools.ietf.org/html/bcp47) specification compliant value. For example, en for English or en-US for the US version of English. This parameter is required for text type and subtitles text type track. | [optional] diff --git a/docs/InputSettingsOverlaySettings.md b/docs/InputSettingsOverlaySettings.md index 274866f..5a6dc44 100644 --- a/docs/InputSettingsOverlaySettings.md +++ b/docs/InputSettingsOverlaySettings.md @@ -1,5 +1,6 @@ # InputSettingsOverlaySettings +An object that describes how the image file referenced in url should be placed over the video (i.e. watermarking). ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/docs/LiveStream.md b/docs/LiveStream.md index 54474b6..e7cdc98 100644 --- a/docs/LiveStream.md +++ b/docs/LiveStream.md @@ -3,19 +3,19 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | [optional] -**created_at** | **str** | | [optional] -**stream_key** | **str** | | [optional] -**active_asset_id** | **str** | | [optional] -**recent_asset_ids** | **list[str]** | | [optional] -**status** | **str** | | [optional] -**playback_ids** | [**list[PlaybackID]**](PlaybackID.md) | | [optional] +**id** | **str** | Unique identifier for the Live Stream. Max 255 characters. | [optional] +**created_at** | **str** | Time the Live Stream was created, defined as a Unix timestamp (seconds since epoch). | [optional] +**stream_key** | **str** | Unique key used for streaming to a Mux RTMP endpoint. This should be considered as sensitive as credentials, anyone with this stream key can begin streaming. | [optional] +**active_asset_id** | **str** | The Asset that is currently being created if there is an active broadcast. | [optional] +**recent_asset_ids** | **list[str]** | An array of strings with the most recent Assets that were created from this live stream. | [optional] +**status** | **str** | `idle` indicates that there is no active broadcast. `active` indicates that there is an active broadcast and `disabled` status indicates that no future RTMP streams can be published. | [optional] +**playback_ids** | [**list[PlaybackID]**](PlaybackID.md) | An array of Playback ID objects. Use these to create HLS playback URLs. See [Play your videos](https://docs.mux.com/guides/video/play-your-videos) for more details. | [optional] **new_asset_settings** | [**CreateAssetRequest**](CreateAssetRequest.md) | | [optional] -**passthrough** | **str** | | [optional] -**reconnect_window** | **float** | | [optional] -**reduced_latency** | **bool** | | [optional] -**simulcast_targets** | [**list[SimulcastTarget]**](SimulcastTarget.md) | | [optional] -**test** | **bool** | | [optional] +**passthrough** | **str** | Arbitrary metadata set for the asset. Max 255 characters. | [optional] +**reconnect_window** | **float** | When live streaming software disconnects from Mux, either intentionally or due to a drop in the network, the Reconnect Window is the time in seconds that Mux should wait for the streaming software to reconnect before considering the live stream finished and completing the recorded asset. **Min**: 0.1s. **Max**: 300s (5 minutes). | [optional] [default to 60] +**reduced_latency** | **bool** | Latency is the time from when the streamer does something in real life to when you see it happen in the player. Set this if you want lower latency for your live stream. **Note**: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. See the [Reduce live stream latency guide](https://docs.mux.com/guides/video/reduce-live-stream-latency) to understand the tradeoffs. | [optional] +**simulcast_targets** | [**list[SimulcastTarget]**](SimulcastTarget.md) | Each Simulcast Target contains configuration details to broadcast (or \"restream\") a live stream to a third-party streaming service. [See the Stream live to 3rd party platforms guide](https://docs.mux.com/guides/video/stream-live-to-3rd-party-platforms). | [optional] +**test** | **bool** | True means this live stream is a test live stream. Test live streams can be used to help evaluate the Mux Video APIs for free. There is no limit on the number of test live streams, but they are watermarked with the Mux logo, limited to 5 minutes, and deleted after 24 hours. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/LiveStreamsApi.md b/docs/LiveStreamsApi.md index 8642498..2a02f7c 100644 --- a/docs/LiveStreamsApi.md +++ b/docs/LiveStreamsApi.md @@ -26,28 +26,42 @@ Create a live stream ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration)) -create_live_stream_request = mux_python.CreateLiveStreamRequest() # CreateLiveStreamRequest | - -try: - # Create a live stream - api_response = api_instance.create_live_stream(create_live_stream_request) - pprint(api_response) -except ApiException as e: - print("Exception when calling LiveStreamsApi->create_live_stream: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + create_live_stream_request = {"playback_policy":"public","new_asset_settings":{"playback_policy":"public"}} # CreateLiveStreamRequest | + + try: + # Create a live stream + api_response = api_instance.create_live_stream(create_live_stream_request) + pprint(api_response) + except ApiException as e: + print("Exception when calling LiveStreamsApi->create_live_stream: %s\n" % e) ``` ### Parameters @@ -69,6 +83,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_live_stream_playback_id** @@ -78,29 +97,43 @@ Create a live stream playback ID ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration)) -live_stream_id = 'live_stream_id_example' # str | The live stream ID -create_playback_id_request =mux_python.CreatePlaybackIDRequest() # CreatePlaybackIDRequest | - -try: - # Create a live stream playback ID - api_response = api_instance.create_live_stream_playback_id(live_stream_id, create_playback_id_request) - pprint(api_response) -except ApiException as e: - print("Exception when calling LiveStreamsApi->create_live_stream_playback_id: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + live_stream_id = 'live_stream_id_example' # str | The live stream ID +create_playback_id_request = {"policy":"signed"} # CreatePlaybackIDRequest | + + try: + # Create a live stream playback ID + api_response = api_instance.create_live_stream_playback_id(live_stream_id, create_playback_id_request) + pprint(api_response) + except ApiException as e: + print("Exception when calling LiveStreamsApi->create_live_stream_playback_id: %s\n" % e) ``` ### Parameters @@ -123,6 +156,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_live_stream_simulcast_target** @@ -134,29 +172,43 @@ Create a simulcast target for the parent live stream. Simulcast target can only ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration)) -live_stream_id = 'live_stream_id_example' # str | The live stream ID -create_simulcast_target_request = mux_python.CreateSimulcastTargetRequest() # CreateSimulcastTargetRequest | - -try: - # Create a live stream simulcast target - api_response = api_instance.create_live_stream_simulcast_target(live_stream_id, create_simulcast_target_request) - pprint(api_response) -except ApiException as e: - print("Exception when calling LiveStreamsApi->create_live_stream_simulcast_target: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + live_stream_id = 'live_stream_id_example' # str | The live stream ID +create_simulcast_target_request = {"url":"rtmp://live.example.com/app","stream_key":"abcdefgh","passthrough":"Example"} # CreateSimulcastTargetRequest | + + try: + # Create a live stream simulcast target + api_response = api_instance.create_live_stream_simulcast_target(live_stream_id, create_simulcast_target_request) + pprint(api_response) + except ApiException as e: + print("Exception when calling LiveStreamsApi->create_live_stream_simulcast_target: %s\n" % e) ``` ### Parameters @@ -179,6 +231,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_live_stream** @@ -188,27 +245,41 @@ Delete a live stream ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration)) -live_stream_id = 'live_stream_id_example' # str | The live stream ID - -try: - # Delete a live stream - api_instance.delete_live_stream(live_stream_id) -except ApiException as e: - print("Exception when calling LiveStreamsApi->delete_live_stream: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + live_stream_id = 'live_stream_id_example' # str | The live stream ID + + try: + # Delete a live stream + api_instance.delete_live_stream(live_stream_id) + except ApiException as e: + print("Exception when calling LiveStreamsApi->delete_live_stream: %s\n" % e) ``` ### Parameters @@ -230,6 +301,11 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_live_stream_playback_id** @@ -239,28 +315,42 @@ Delete a live stream playback ID ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration)) -live_stream_id = 'live_stream_id_example' # str | The live stream ID +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + live_stream_id = 'live_stream_id_example' # str | The live stream ID playback_id = 'playback_id_example' # str | The live stream's playback ID. -try: - # Delete a live stream playback ID - api_instance.delete_live_stream_playback_id(live_stream_id, playback_id) -except ApiException as e: - print("Exception when calling LiveStreamsApi->delete_live_stream_playback_id: %s\n" % e) + try: + # Delete a live stream playback ID + api_instance.delete_live_stream_playback_id(live_stream_id, playback_id) + except ApiException as e: + print("Exception when calling LiveStreamsApi->delete_live_stream_playback_id: %s\n" % e) ``` ### Parameters @@ -283,6 +373,11 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_live_stream_simulcast_target** @@ -294,28 +389,42 @@ Delete the simulcast target using the simulcast target ID returned when creating ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) -# create an instance of the API class -api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration)) -live_stream_id = 'live_stream_id_example' # str | The live stream ID +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + live_stream_id = 'live_stream_id_example' # str | The live stream ID simulcast_target_id = 'simulcast_target_id_example' # str | The ID of the simulcast target. -try: - # Delete a Live Stream Simulcast Target - api_instance.delete_live_stream_simulcast_target(live_stream_id, simulcast_target_id) -except ApiException as e: - print("Exception when calling LiveStreamsApi->delete_live_stream_simulcast_target: %s\n" % e) + try: + # Delete a Live Stream Simulcast Target + api_instance.delete_live_stream_simulcast_target(live_stream_id, simulcast_target_id) + except ApiException as e: + print("Exception when calling LiveStreamsApi->delete_live_stream_simulcast_target: %s\n" % e) ``` ### Parameters @@ -338,6 +447,11 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **disable_live_stream** @@ -345,32 +459,46 @@ void (empty response body) Disable a live stream -Disables a live stream, making it reject incoming RTMP streams until re-enabled. +Disables a live stream, making it reject incoming RTMP streams until re-enabled. The API also ends the live stream recording immediately when active. Ending the live stream recording adds the `EXT-X-ENDLIST` tag to the HLS manifest which notifies the player that this live stream is over. Mux also closes the encoder connection immediately. Any attempt from the encoder to re-establish connection will fail till the live stream is re-enabled. ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration)) -live_stream_id = 'live_stream_id_example' # str | The live stream ID - -try: - # Disable a live stream - api_response = api_instance.disable_live_stream(live_stream_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling LiveStreamsApi->disable_live_stream: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + live_stream_id = 'live_stream_id_example' # str | The live stream ID + + try: + # Disable a live stream + api_response = api_instance.disable_live_stream(live_stream_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling LiveStreamsApi->disable_live_stream: %s\n" % e) ``` ### Parameters @@ -392,6 +520,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **enable_live_stream** @@ -403,28 +536,42 @@ Enables a live stream, allowing it to accept an incoming RTMP stream. ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration)) -live_stream_id = 'live_stream_id_example' # str | The live stream ID - -try: - # Enable a live stream - api_response = api_instance.enable_live_stream(live_stream_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling LiveStreamsApi->enable_live_stream: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + live_stream_id = 'live_stream_id_example' # str | The live stream ID + + try: + # Enable a live stream + api_response = api_instance.enable_live_stream(live_stream_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling LiveStreamsApi->enable_live_stream: %s\n" % e) ``` ### Parameters @@ -446,6 +593,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_live_stream** @@ -457,28 +609,42 @@ Retrieves the details of a live stream that has previously been created. Supply ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration)) -live_stream_id = 'live_stream_id_example' # str | The live stream ID - -try: - # Retrieve a live stream - api_response = api_instance.get_live_stream(live_stream_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling LiveStreamsApi->get_live_stream: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + live_stream_id = 'live_stream_id_example' # str | The live stream ID + + try: + # Retrieve a live stream + api_response = api_instance.get_live_stream(live_stream_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling LiveStreamsApi->get_live_stream: %s\n" % e) ``` ### Parameters @@ -500,6 +666,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_live_stream_simulcast_target** @@ -511,29 +682,43 @@ Retrieves the details of the simulcast target created for the parent live stream ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration)) -live_stream_id = 'live_stream_id_example' # str | The live stream ID +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + live_stream_id = 'live_stream_id_example' # str | The live stream ID simulcast_target_id = 'simulcast_target_id_example' # str | The ID of the simulcast target. -try: - # Retrieve a Live Stream Simulcast Target - api_response = api_instance.get_live_stream_simulcast_target(live_stream_id, simulcast_target_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling LiveStreamsApi->get_live_stream_simulcast_target: %s\n" % e) + try: + # Retrieve a Live Stream Simulcast Target + api_response = api_instance.get_live_stream_simulcast_target(live_stream_id, simulcast_target_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling LiveStreamsApi->get_live_stream_simulcast_target: %s\n" % e) ``` ### Parameters @@ -556,6 +741,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_live_streams** @@ -565,29 +755,43 @@ List live streams ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration)) -limit = 25 # int | Number of items to include in the response (optional) (default to 25) +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + limit = 25 # int | Number of items to include in the response (optional) (default to 25) page = 1 # int | Offset by this many pages, of the size of `limit` (optional) (default to 1) -try: - # List live streams - api_response = api_instance.list_live_streams(limit=limit, page=page) - pprint(api_response) -except ApiException as e: - print("Exception when calling LiveStreamsApi->list_live_streams: %s\n" % e) + try: + # List live streams + api_response = api_instance.list_live_streams(limit=limit, page=page) + pprint(api_response) + except ApiException as e: + print("Exception when calling LiveStreamsApi->list_live_streams: %s\n" % e) ``` ### Parameters @@ -610,6 +814,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **reset_stream_key** @@ -621,28 +830,42 @@ Reset a live stream key if you want to immediately stop the current stream key f ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration)) -live_stream_id = 'live_stream_id_example' # str | The live stream ID - -try: - # Reset a live stream’s stream key - api_response = api_instance.reset_stream_key(live_stream_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling LiveStreamsApi->reset_stream_key: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + live_stream_id = 'live_stream_id_example' # str | The live stream ID + + try: + # Reset a live stream’s stream key + api_response = api_instance.reset_stream_key(live_stream_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling LiveStreamsApi->reset_stream_key: %s\n" % e) ``` ### Parameters @@ -664,6 +887,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **signal_live_stream_complete** @@ -671,32 +899,46 @@ Name | Type | Description | Notes Signal a live stream is finished -(Optional) Make the recorded asset available immediately instead of waiting for the reconnect_window. +(Optional) End the live stream recording immediately instead of waiting for the reconnect_window. `EXT-X-ENDLIST` tag is added to the HLS manifest which notifies the player that this live stream is over. Mux does not close the encoder connection immediately. Encoders are often configured to re-establish connections immediately which would result in a new recorded asset. For this reason, Mux waits for 60s before closing the connection with the encoder. This 60s timeframe is meant to give encoder operators a chance to disconnect from their end. ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration)) -live_stream_id = 'live_stream_id_example' # str | The live stream ID - -try: - # Signal a live stream is finished - api_response = api_instance.signal_live_stream_complete(live_stream_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling LiveStreamsApi->signal_live_stream_complete: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + live_stream_id = 'live_stream_id_example' # str | The live stream ID + + try: + # Signal a live stream is finished + api_response = api_instance.signal_live_stream_complete(live_stream_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling LiveStreamsApi->signal_live_stream_complete: %s\n" % e) ``` ### Parameters @@ -718,5 +960,10 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/MetricsApi.md b/docs/MetricsApi.md index 573dd05..1cb68a5 100644 --- a/docs/MetricsApi.md +++ b/docs/MetricsApi.md @@ -20,33 +20,47 @@ Returns timeseries data for a specific metric ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.MetricsApi(mux_python.ApiClient(configuration)) -metric_id = video_startup_time # str | ID of the Metric +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.MetricsApi(api_client) + metric_id = 'video_startup_time' # str | ID of the Metric timeframe = ['timeframe_example'] # list[str] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) filters = ['filters_example'] # list[str] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) measurement = 'measurement_example' # str | Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) order_direction = 'order_direction_example' # str | Sort order. (optional) group_by = 'group_by_example' # str | Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. (optional) -try: - # Get metric timeseries data - api_response = api_instance.get_metric_timeseries_data(metric_id, timeframe=timeframe, filters=filters, measurement=measurement, order_direction=order_direction, group_by=group_by) - pprint(api_response) -except ApiException as e: - print("Exception when calling MetricsApi->get_metric_timeseries_data: %s\n" % e) + try: + # Get metric timeseries data + api_response = api_instance.get_metric_timeseries_data(metric_id, timeframe=timeframe, filters=filters, measurement=measurement, order_direction=order_direction, group_by=group_by) + pprint(api_response) + except ApiException as e: + print("Exception when calling MetricsApi->get_metric_timeseries_data: %s\n" % e) ``` ### Parameters @@ -73,6 +87,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_overall_values** @@ -84,31 +103,45 @@ Returns the overall value for a specific metric, as well as the total view count ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.MetricsApi(mux_python.ApiClient(configuration)) -metric_id = video_startup_time # str | ID of the Metric +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.MetricsApi(api_client) + metric_id = 'video_startup_time' # str | ID of the Metric timeframe = ['timeframe_example'] # list[str] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) filters = ['filters_example'] # list[str] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) measurement = 'measurement_example' # str | Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) -try: - # Get Overall values - api_response = api_instance.get_overall_values(metric_id, timeframe=timeframe, filters=filters, measurement=measurement) - pprint(api_response) -except ApiException as e: - print("Exception when calling MetricsApi->get_overall_values: %s\n" % e) + try: + # Get Overall values + api_response = api_instance.get_overall_values(metric_id, timeframe=timeframe, filters=filters, measurement=measurement) + pprint(api_response) + except ApiException as e: + print("Exception when calling MetricsApi->get_overall_values: %s\n" % e) ``` ### Parameters @@ -133,6 +166,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_all_metric_values** @@ -144,31 +182,45 @@ List all of the values across every breakdown for a specific metric ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) -# create an instance of the API class -api_instance = mux_python.MetricsApi(mux_python.ApiClient(configuration)) -timeframe = ['timeframe_example'] # list[str] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.MetricsApi(api_client) + timeframe = ['timeframe_example'] # list[str] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) filters = ['filters_example'] # list[str] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) dimension = 'dimension_example' # str | Dimension the specified value belongs to (optional) value = 'value_example' # str | Value to show all available metrics for (optional) -try: - # List all metric values - api_response = api_instance.list_all_metric_values(timeframe=timeframe, filters=filters, dimension=dimension, value=value) - pprint(api_response) -except ApiException as e: - print("Exception when calling MetricsApi->list_all_metric_values: %s\n" % e) + try: + # List all metric values + api_response = api_instance.list_all_metric_values(timeframe=timeframe, filters=filters, dimension=dimension, value=value) + pprint(api_response) + except ApiException as e: + print("Exception when calling MetricsApi->list_all_metric_values: %s\n" % e) ``` ### Parameters @@ -193,6 +245,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_breakdown_values** @@ -204,21 +261,35 @@ List the breakdown values for a specific metric ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) -# create an instance of the API class -api_instance = mux_python.MetricsApi(mux_python.ApiClient(configuration)) -metric_id = video_startup_time # str | ID of the Metric +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.MetricsApi(api_client) + metric_id = 'video_startup_time' # str | ID of the Metric group_by = 'group_by_example' # str | Breakdown value to group the results by (optional) measurement = 'measurement_example' # str | Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) filters = ['filters_example'] # list[str] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) @@ -228,12 +299,12 @@ order_by = 'order_by_example' # str | Value to order the results by (optional) order_direction = 'order_direction_example' # str | Sort order. (optional) timeframe = ['timeframe_example'] # list[str] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) -try: - # List breakdown values - api_response = api_instance.list_breakdown_values(metric_id, group_by=group_by, measurement=measurement, filters=filters, limit=limit, page=page, order_by=order_by, order_direction=order_direction, timeframe=timeframe) - pprint(api_response) -except ApiException as e: - print("Exception when calling MetricsApi->list_breakdown_values: %s\n" % e) + try: + # List breakdown values + api_response = api_instance.list_breakdown_values(metric_id, group_by=group_by, measurement=measurement, filters=filters, limit=limit, page=page, order_by=order_by, order_direction=order_direction, timeframe=timeframe) + pprint(api_response) + except ApiException as e: + print("Exception when calling MetricsApi->list_breakdown_values: %s\n" % e) ``` ### Parameters @@ -263,6 +334,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_insights** @@ -274,31 +350,45 @@ Returns a list of insights for a metric. These are the worst performing values a ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.MetricsApi(mux_python.ApiClient(configuration)) -metric_id = video_startup_time # str | ID of the Metric +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.MetricsApi(api_client) + metric_id = 'video_startup_time' # str | ID of the Metric measurement = 'measurement_example' # str | Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) order_direction = 'order_direction_example' # str | Sort order. (optional) timeframe = ['timeframe_example'] # list[str] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) -try: - # List Insights - api_response = api_instance.list_insights(metric_id, measurement=measurement, order_direction=order_direction, timeframe=timeframe) - pprint(api_response) -except ApiException as e: - print("Exception when calling MetricsApi->list_insights: %s\n" % e) + try: + # List Insights + api_response = api_instance.list_insights(metric_id, measurement=measurement, order_direction=order_direction, timeframe=timeframe) + pprint(api_response) + except ApiException as e: + print("Exception when calling MetricsApi->list_insights: %s\n" % e) ``` ### Parameters @@ -323,5 +413,10 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/PlaybackIDApi.md b/docs/PlaybackIDApi.md index fe83456..5ba079f 100644 --- a/docs/PlaybackIDApi.md +++ b/docs/PlaybackIDApi.md @@ -16,28 +16,42 @@ Retrieves the Identifier of the Asset or Live Stream associated with the Playbac ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.PlaybackIDApi(mux_python.ApiClient(configuration)) -playback_id = 'playback_id_example' # str | The live stream's playback ID. - -try: - # Retrieve an Asset or Live Stream ID - api_response = api_instance.get_asset_or_livestream_id(playback_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PlaybackIDApi->get_asset_or_livestream_id: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.PlaybackIDApi(api_client) + playback_id = 'playback_id_example' # str | The live stream's playback ID. + + try: + # Retrieve an Asset or Live Stream ID + api_response = api_instance.get_asset_or_livestream_id(playback_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling PlaybackIDApi->get_asset_or_livestream_id: %s\n" % e) ``` ### Parameters @@ -59,5 +73,10 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/PlaybackPolicy.md b/docs/PlaybackPolicy.md index 1d7cd3b..fe0ea0a 100644 --- a/docs/PlaybackPolicy.md +++ b/docs/PlaybackPolicy.md @@ -1,5 +1,6 @@ # PlaybackPolicy +* `public` playback IDs are accessible by constructing an HLS url like `https://stream.mux.com/${PLAYBACK_ID}` * `signed` playback IDS should be used with tokens `https://stream.mux.com/${PLAYBACK_ID}?token={TOKEN}`. See [Secure video playback](https://docs.mux.com/guides/video/secure-video-playback) for details about creating tokens. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/docs/RealTimeApi.md b/docs/RealTimeApi.md index 55f0082..098af10 100644 --- a/docs/RealTimeApi.md +++ b/docs/RealTimeApi.md @@ -20,33 +20,47 @@ Gets breakdown information for a specific dimension and metric along with the nu ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. -# create an instance of the API class -api_instance = mux_python.RealTimeApi(mux_python.ApiClient(configuration)) -realtime_metric_id = video-startup-time # str | ID of the Realtime Metric +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.RealTimeApi(api_client) + realtime_metric_id = 'video-startup-time' # str | ID of the Realtime Metric dimension = 'dimension_example' # str | Dimension the specified value belongs to (optional) timestamp = 3.4 # float | Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. (optional) filters = ['filters_example'] # list[str] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) order_by = 'order_by_example' # str | Value to order the results by (optional) order_direction = 'order_direction_example' # str | Sort order. (optional) -try: - # Get Real-Time Breakdown - api_response = api_instance.get_realtime_breakdown(realtime_metric_id, dimension=dimension, timestamp=timestamp, filters=filters, order_by=order_by, order_direction=order_direction) - pprint(api_response) -except ApiException as e: - print("Exception when calling RealTimeApi->get_realtime_breakdown: %s\n" % e) + try: + # Get Real-Time Breakdown + api_response = api_instance.get_realtime_breakdown(realtime_metric_id, dimension=dimension, timestamp=timestamp, filters=filters, order_by=order_by, order_direction=order_direction) + pprint(api_response) + except ApiException as e: + print("Exception when calling RealTimeApi->get_realtime_breakdown: %s\n" % e) ``` ### Parameters @@ -73,6 +87,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_realtime_histogram_timeseries** @@ -84,29 +103,43 @@ Gets histogram timeseries information for a specific metric. ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) -# create an instance of the API class -api_instance = mux_python.RealTimeApi(mux_python.ApiClient(configuration)) -realtime_metric_id = video-startup-time # str | ID of the Realtime Metric +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.RealTimeApi(api_client) + realtime_metric_id = 'video-startup-time' # str | ID of the Realtime Metric filters = ['filters_example'] # list[str] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) -try: - # Get Real-Time Histogram Timeseries - api_response = api_instance.get_realtime_histogram_timeseries(realtime_metric_id, filters=filters) - pprint(api_response) -except ApiException as e: - print("Exception when calling RealTimeApi->get_realtime_histogram_timeseries: %s\n" % e) + try: + # Get Real-Time Histogram Timeseries + api_response = api_instance.get_realtime_histogram_timeseries(realtime_metric_id, filters=filters) + pprint(api_response) + except ApiException as e: + print("Exception when calling RealTimeApi->get_realtime_histogram_timeseries: %s\n" % e) ``` ### Parameters @@ -129,6 +162,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_realtime_timeseries** @@ -140,29 +178,43 @@ Gets Time series information for a specific metric along with the number of conc ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) -# create an instance of the API class -api_instance = mux_python.RealTimeApi(mux_python.ApiClient(configuration)) -realtime_metric_id = video-startup-time # str | ID of the Realtime Metric +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.RealTimeApi(api_client) + realtime_metric_id = 'video-startup-time' # str | ID of the Realtime Metric filters = ['filters_example'] # list[str] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) -try: - # Get Real-Time Timeseries - api_response = api_instance.get_realtime_timeseries(realtime_metric_id, filters=filters) - pprint(api_response) -except ApiException as e: - print("Exception when calling RealTimeApi->get_realtime_timeseries: %s\n" % e) + try: + # Get Real-Time Timeseries + api_response = api_instance.get_realtime_timeseries(realtime_metric_id, filters=filters) + pprint(api_response) + except ApiException as e: + print("Exception when calling RealTimeApi->get_realtime_timeseries: %s\n" % e) ``` ### Parameters @@ -185,6 +237,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_realtime_dimensions** @@ -196,27 +253,41 @@ Lists availiable real-time dimensions ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.RealTimeApi(mux_python.ApiClient(configuration)) - -try: - # List Real-Time Dimensions - api_response = api_instance.list_realtime_dimensions() - pprint(api_response) -except ApiException as e: - print("Exception when calling RealTimeApi->list_realtime_dimensions: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.RealTimeApi(api_client) + + try: + # List Real-Time Dimensions + api_response = api_instance.list_realtime_dimensions() + pprint(api_response) + except ApiException as e: + print("Exception when calling RealTimeApi->list_realtime_dimensions: %s\n" % e) ``` ### Parameters @@ -235,6 +306,11 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_realtime_metrics** @@ -246,27 +322,41 @@ Lists availiable real-time metrics. ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.RealTimeApi(mux_python.ApiClient(configuration)) - -try: - # List Real-Time Metrics - api_response = api_instance.list_realtime_metrics() - pprint(api_response) -except ApiException as e: - print("Exception when calling RealTimeApi->list_realtime_metrics: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.RealTimeApi(api_client) + + try: + # List Real-Time Metrics + api_response = api_instance.list_realtime_metrics() + pprint(api_response) + except ApiException as e: + print("Exception when calling RealTimeApi->list_realtime_metrics: %s\n" % e) ``` ### Parameters @@ -285,5 +375,10 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/SignalLiveStreamCompleteResponse.md b/docs/SignalLiveStreamCompleteResponse.md index ded2eca..974fa4f 100644 --- a/docs/SignalLiveStreamCompleteResponse.md +++ b/docs/SignalLiveStreamCompleteResponse.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**object**](.md) | | [optional] +**data** | **object** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SigningKey.md b/docs/SigningKey.md index fcfc477..972dde6 100644 --- a/docs/SigningKey.md +++ b/docs/SigningKey.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | [optional] -**created_at** | **str** | | [optional] -**private_key** | **str** | | [optional] +**id** | **str** | Unique identifier for the Signing Key. | [optional] +**created_at** | **str** | Time at which the object was created. Measured in seconds since the Unix epoch. | [optional] +**private_key** | **str** | A Base64 encoded private key that can be used with the RS256 algorithm when creating a [JWT](https://jwt.io/). **Note that this value is only returned once when creating a URL signing key.** | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/URLSigningKeysApi.md b/docs/URLSigningKeysApi.md index c85d62a..db49f15 100644 --- a/docs/URLSigningKeysApi.md +++ b/docs/URLSigningKeysApi.md @@ -19,27 +19,41 @@ Creates a new signing key pair. When creating a new signing key, the API will ge ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.URLSigningKeysApi(mux_python.ApiClient(configuration)) - -try: - # Create a URL signing key - api_response = api_instance.create_url_signing_key() - pprint(api_response) -except ApiException as e: - print("Exception when calling URLSigningKeysApi->create_url_signing_key: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.URLSigningKeysApi(api_client) + + try: + # Create a URL signing key + api_response = api_instance.create_url_signing_key() + pprint(api_response) + except ApiException as e: + print("Exception when calling URLSigningKeysApi->create_url_signing_key: %s\n" % e) ``` ### Parameters @@ -58,6 +72,11 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_url_signing_key** @@ -69,27 +88,41 @@ Deletes an existing signing key. Use with caution, as this will invalidate any e ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.URLSigningKeysApi(mux_python.ApiClient(configuration)) -signing_key_id = 'signing_key_id_example' # str | The ID of the signing key. - -try: - # Delete a URL signing key - api_instance.delete_url_signing_key(signing_key_id) -except ApiException as e: - print("Exception when calling URLSigningKeysApi->delete_url_signing_key: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.URLSigningKeysApi(api_client) + signing_key_id = 'signing_key_id_example' # str | The ID of the signing key. + + try: + # Delete a URL signing key + api_instance.delete_url_signing_key(signing_key_id) + except ApiException as e: + print("Exception when calling URLSigningKeysApi->delete_url_signing_key: %s\n" % e) ``` ### Parameters @@ -111,6 +144,11 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_url_signing_key** @@ -122,28 +160,42 @@ Retrieves the details of a URL signing key that has previously been created. Sup ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.URLSigningKeysApi(mux_python.ApiClient(configuration)) -signing_key_id = 'signing_key_id_example' # str | The ID of the signing key. - -try: - # Retrieve a URL signing key - api_response = api_instance.get_url_signing_key(signing_key_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling URLSigningKeysApi->get_url_signing_key: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.URLSigningKeysApi(api_client) + signing_key_id = 'signing_key_id_example' # str | The ID of the signing key. + + try: + # Retrieve a URL signing key + api_response = api_instance.get_url_signing_key(signing_key_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling URLSigningKeysApi->get_url_signing_key: %s\n" % e) ``` ### Parameters @@ -165,6 +217,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_url_signing_keys** @@ -176,29 +233,43 @@ Returns a list of URL signing keys. ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) -# create an instance of the API class -api_instance = mux_python.URLSigningKeysApi(mux_python.ApiClient(configuration)) -limit = 25 # int | Number of items to include in the response (optional) (default to 25) +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.URLSigningKeysApi(api_client) + limit = 25 # int | Number of items to include in the response (optional) (default to 25) page = 1 # int | Offset by this many pages, of the size of `limit` (optional) (default to 1) -try: - # List URL signing keys - api_response = api_instance.list_url_signing_keys(limit=limit, page=page) - pprint(api_response) -except ApiException as e: - print("Exception when calling URLSigningKeysApi->list_url_signing_keys: %s\n" % e) + try: + # List URL signing keys + api_response = api_instance.list_url_signing_keys(limit=limit, page=page) + pprint(api_response) + except ApiException as e: + print("Exception when calling URLSigningKeysApi->list_url_signing_keys: %s\n" % e) ``` ### Parameters @@ -221,5 +292,10 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/Upload.md b/docs/Upload.md index de3145e..d74889c 100644 --- a/docs/Upload.md +++ b/docs/Upload.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | [optional] +**id** | **str** | Unique identifier for the Direct Upload. | [optional] **timeout** | **int** | Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out` | [optional] [default to 3600] **status** | **str** | | [optional] **new_asset_settings** | [**Asset**](Asset.md) | | [optional] @@ -11,7 +11,7 @@ Name | Type | Description | Notes **error** | [**UploadError**](UploadError.md) | | [optional] **cors_origin** | **str** | If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers. | [optional] **url** | **str** | The URL to upload the associated source media to. | [optional] -**test** | **bool** | | [optional] +**test** | **bool** | Indicates if this is a test Direct Upload, in which case the Asset that gets created will be a `test` Asset. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UploadError.md b/docs/UploadError.md index 4a83b6d..3288b49 100644 --- a/docs/UploadError.md +++ b/docs/UploadError.md @@ -1,10 +1,11 @@ # UploadError +Only set if an error occurred during asset creation. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **str** | | [optional] -**message** | **str** | | [optional] +**type** | **str** | Label for the specific error | [optional] +**message** | **str** | Human readable error message | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/VideoViewsApi.md b/docs/VideoViewsApi.md index 194cd67..32acd41 100644 --- a/docs/VideoViewsApi.md +++ b/docs/VideoViewsApi.md @@ -17,28 +17,42 @@ Returns the details of a video view ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = mux_python.VideoViewsApi(mux_python.ApiClient(configuration)) -video_view_id = abcd1234 # str | ID of the Video View - -try: - # Get a Video View - api_response = api_instance.get_video_view(video_view_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling VideoViewsApi->get_video_view: %s\n" % e) +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.VideoViewsApi(api_client) + video_view_id = 'abcd1234' # str | ID of the Video View + + try: + # Get a Video View + api_response = api_instance.get_video_view(video_view_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling VideoViewsApi->get_video_view: %s\n" % e) ``` ### Parameters @@ -60,6 +74,11 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_video_views** @@ -71,21 +90,35 @@ Returns a list of video views ### Example -* Basic Authentication (accessToken): +* Basic Authentication (accessToken): ```python from __future__ import print_function import time import mux_python from mux_python.rest import ApiException from pprint import pprint -configuration = mux_python.Configuration() -# Configure HTTP basic authorization: accessToken -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) -# create an instance of the API class -api_instance = mux_python.VideoViewsApi(mux_python.ApiClient(configuration)) -limit = 25 # int | Number of items to include in the response (optional) (default to 25) +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.VideoViewsApi(api_client) + limit = 25 # int | Number of items to include in the response (optional) (default to 25) page = 1 # int | Offset by this many pages, of the size of `limit` (optional) (default to 1) viewer_id = 'viewer_id_example' # str | Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. (optional) error_id = 56 # int | Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. (optional) @@ -93,12 +126,12 @@ order_direction = 'order_direction_example' # str | Sort order. (optional) filters = ['filters_example'] # list[str] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) timeframe = ['timeframe_example'] # list[str] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) -try: - # List Video Views - api_response = api_instance.list_video_views(limit=limit, page=page, viewer_id=viewer_id, error_id=error_id, order_direction=order_direction, filters=filters, timeframe=timeframe) - pprint(api_response) -except ApiException as e: - print("Exception when calling VideoViewsApi->list_video_views: %s\n" % e) + try: + # List Video Views + api_response = api_instance.list_video_views(limit=limit, page=page, viewer_id=viewer_id, error_id=error_id, order_direction=order_direction, filters=filters, timeframe=timeframe) + pprint(api_response) + except ApiException as e: + print("Exception when calling VideoViewsApi->list_video_views: %s\n" % e) ``` ### Parameters @@ -126,5 +159,10 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/mux_python/__init__.py b/mux_python/__init__.py index 6f30307..3c3baba 100644 --- a/mux_python/__init__.py +++ b/mux_python/__init__.py @@ -3,9 +3,12 @@ # flake8: noqa """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -29,11 +32,15 @@ from mux_python.api.url_signing_keys_api import URLSigningKeysApi from mux_python.api.video_views_api import VideoViewsApi - # import ApiClient from mux_python.api_client import ApiClient from mux_python.configuration import Configuration - +from mux_python.exceptions import OpenApiException +from mux_python.exceptions import ApiTypeError +from mux_python.exceptions import ApiValueError +from mux_python.exceptions import ApiKeyError +from mux_python.exceptions import ApiAttributeError +from mux_python.exceptions import ApiException # import models into sdk package from mux_python.models.abridged_video_view import AbridgedVideoView from mux_python.models.asset import Asset @@ -129,3 +136,4 @@ from mux_python.models.video_view import VideoView from mux_python.models.video_view_event import VideoViewEvent from mux_python.models.video_view_response import VideoViewResponse + diff --git a/mux_python/api/assets_api.py b/mux_python/api/assets_api.py index 26a2207..9c758d0 100644 --- a/mux_python/api/assets_api.py +++ b/mux_python/api/assets_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class AssetsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -29,21 +42,29 @@ def create_asset(self, create_asset_request, **kwargs): # noqa: E501 Create a new Mux Video asset. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_asset(create_asset_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param CreateAssetRequest create_asset_request: (required) - :return: AssetResponse + :param create_asset_request: (required) + :type create_asset_request: CreateAssetRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: AssetResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_asset_with_http_info(create_asset_request, **kwargs) # noqa: E501 - else: - (data) = self.create_asset_with_http_info(create_asset_request, **kwargs) # noqa: E501 - return data + return self.create_asset_with_http_info(create_asset_request, **kwargs) # noqa: E501 def create_asset_with_http_info(self, create_asset_request, **kwargs): # noqa: E501 """Create an asset # noqa: E501 @@ -51,36 +72,62 @@ def create_asset_with_http_info(self, create_asset_request, **kwargs): # noqa: Create a new Mux Video asset. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_asset_with_http_info(create_asset_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param CreateAssetRequest create_asset_request: (required) - :return: AssetResponse + :param create_asset_request: (required) + :type create_asset_request: CreateAssetRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(AssetResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['create_asset_request'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'create_asset_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_asset" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'create_asset_request' is set - if ('create_asset_request' not in local_var_params or - local_var_params['create_asset_request'] is None): - raise ValueError("Missing the required parameter `create_asset_request` when calling `create_asset`") # noqa: E501 + if self.api_client.client_side_validation and ('create_asset_request' not in local_var_params or # noqa: E501 + local_var_params['create_asset_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `create_asset_request` when calling `create_asset`") # noqa: E501 collection_formats = {} @@ -106,6 +153,10 @@ def create_asset_with_http_info(self, create_asset_request, **kwargs): # noqa: # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 201: "AssetResponse", + } return self.api_client.call_api( '/video/v1/assets', 'POST', @@ -115,76 +166,114 @@ def create_asset_with_http_info(self, create_asset_request, **kwargs): # noqa: body=body_params, post_params=form_params, files=local_var_files, - response_type='AssetResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def create_asset_playback_id(self, asset_id, create_playback_id_request, **kwargs): # noqa: E501 """Create a playback ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_asset_playback_id(asset_id, create_playback_id_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param CreatePlaybackIDRequest create_playback_id_request: (required) - :return: CreatePlaybackIDResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param create_playback_id_request: (required) + :type create_playback_id_request: CreatePlaybackIDRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: CreatePlaybackIDResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_asset_playback_id_with_http_info(asset_id, create_playback_id_request, **kwargs) # noqa: E501 - else: - (data) = self.create_asset_playback_id_with_http_info(asset_id, create_playback_id_request, **kwargs) # noqa: E501 - return data + return self.create_asset_playback_id_with_http_info(asset_id, create_playback_id_request, **kwargs) # noqa: E501 def create_asset_playback_id_with_http_info(self, asset_id, create_playback_id_request, **kwargs): # noqa: E501 """Create a playback ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_asset_playback_id_with_http_info(asset_id, create_playback_id_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param CreatePlaybackIDRequest create_playback_id_request: (required) - :return: CreatePlaybackIDResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param create_playback_id_request: (required) + :type create_playback_id_request: CreatePlaybackIDRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(CreatePlaybackIDResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['asset_id', 'create_playback_id_request'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'asset_id', + 'create_playback_id_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_asset_playback_id" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'asset_id' is set - if ('asset_id' not in local_var_params or - local_var_params['asset_id'] is None): - raise ValueError("Missing the required parameter `asset_id` when calling `create_asset_playback_id`") # noqa: E501 + if self.api_client.client_side_validation and ('asset_id' not in local_var_params or # noqa: E501 + local_var_params['asset_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `asset_id` when calling `create_asset_playback_id`") # noqa: E501 # verify the required parameter 'create_playback_id_request' is set - if ('create_playback_id_request' not in local_var_params or - local_var_params['create_playback_id_request'] is None): - raise ValueError("Missing the required parameter `create_playback_id_request` when calling `create_asset_playback_id`") # noqa: E501 + if self.api_client.client_side_validation and ('create_playback_id_request' not in local_var_params or # noqa: E501 + local_var_params['create_playback_id_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `create_playback_id_request` when calling `create_asset_playback_id`") # noqa: E501 collection_formats = {} @@ -212,6 +301,10 @@ def create_asset_playback_id_with_http_info(self, asset_id, create_playback_id_r # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 201: "CreatePlaybackIDResponse", + } return self.api_client.call_api( '/video/v1/assets/{ASSET_ID}/playback-ids', 'POST', @@ -221,76 +314,114 @@ def create_asset_playback_id_with_http_info(self, asset_id, create_playback_id_r body=body_params, post_params=form_params, files=local_var_files, - response_type='CreatePlaybackIDResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def create_asset_track(self, asset_id, create_track_request, **kwargs): # noqa: E501 """Create an asset track # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_asset_track(asset_id, create_track_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param CreateTrackRequest create_track_request: (required) - :return: CreateTrackResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param create_track_request: (required) + :type create_track_request: CreateTrackRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: CreateTrackResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_asset_track_with_http_info(asset_id, create_track_request, **kwargs) # noqa: E501 - else: - (data) = self.create_asset_track_with_http_info(asset_id, create_track_request, **kwargs) # noqa: E501 - return data + return self.create_asset_track_with_http_info(asset_id, create_track_request, **kwargs) # noqa: E501 def create_asset_track_with_http_info(self, asset_id, create_track_request, **kwargs): # noqa: E501 """Create an asset track # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_asset_track_with_http_info(asset_id, create_track_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param CreateTrackRequest create_track_request: (required) - :return: CreateTrackResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param create_track_request: (required) + :type create_track_request: CreateTrackRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(CreateTrackResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['asset_id', 'create_track_request'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'asset_id', + 'create_track_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_asset_track" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'asset_id' is set - if ('asset_id' not in local_var_params or - local_var_params['asset_id'] is None): - raise ValueError("Missing the required parameter `asset_id` when calling `create_asset_track`") # noqa: E501 + if self.api_client.client_side_validation and ('asset_id' not in local_var_params or # noqa: E501 + local_var_params['asset_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `asset_id` when calling `create_asset_track`") # noqa: E501 # verify the required parameter 'create_track_request' is set - if ('create_track_request' not in local_var_params or - local_var_params['create_track_request'] is None): - raise ValueError("Missing the required parameter `create_track_request` when calling `create_asset_track`") # noqa: E501 + if self.api_client.client_side_validation and ('create_track_request' not in local_var_params or # noqa: E501 + local_var_params['create_track_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `create_track_request` when calling `create_asset_track`") # noqa: E501 collection_formats = {} @@ -318,6 +449,10 @@ def create_asset_track_with_http_info(self, asset_id, create_track_request, **kw # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 201: "CreateTrackResponse", + } return self.api_client.call_api( '/video/v1/assets/{ASSET_ID}/tracks', 'POST', @@ -327,13 +462,14 @@ def create_asset_track_with_http_info(self, asset_id, create_track_request, **kw body=body_params, post_params=form_params, files=local_var_files, - response_type='CreateTrackResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def delete_asset(self, asset_id, **kwargs): # noqa: E501 """Delete an asset # noqa: E501 @@ -341,21 +477,29 @@ def delete_asset(self, asset_id, **kwargs): # noqa: E501 Deletes a video asset and all its data # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_asset(asset_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :return: None + :param asset_id: The asset ID. (required) + :type asset_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_asset_with_http_info(asset_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_asset_with_http_info(asset_id, **kwargs) # noqa: E501 - return data + return self.delete_asset_with_http_info(asset_id, **kwargs) # noqa: E501 def delete_asset_with_http_info(self, asset_id, **kwargs): # noqa: E501 """Delete an asset # noqa: E501 @@ -363,36 +507,62 @@ def delete_asset_with_http_info(self, asset_id, **kwargs): # noqa: E501 Deletes a video asset and all its data # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_asset_with_http_info(asset_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :return: None + :param asset_id: The asset ID. (required) + :type asset_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ local_var_params = locals() - all_params = ['asset_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'asset_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_asset" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'asset_id' is set - if ('asset_id' not in local_var_params or - local_var_params['asset_id'] is None): - raise ValueError("Missing the required parameter `asset_id` when calling `delete_asset`") # noqa: E501 + if self.api_client.client_side_validation and ('asset_id' not in local_var_params or # noqa: E501 + local_var_params['asset_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `asset_id` when calling `delete_asset`") # noqa: E501 collection_formats = {} @@ -410,6 +580,8 @@ def delete_asset_with_http_info(self, asset_id, **kwargs): # noqa: E501 body_params = None # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = {} return self.api_client.call_api( '/video/v1/assets/{ASSET_ID}', 'DELETE', @@ -419,76 +591,114 @@ def delete_asset_with_http_info(self, asset_id, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def delete_asset_playback_id(self, asset_id, playback_id, **kwargs): # noqa: E501 """Delete a playback ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_asset_playback_id(asset_id, playback_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param str playback_id: The live stream's playback ID. (required) - :return: None + :param asset_id: The asset ID. (required) + :type asset_id: str + :param playback_id: The live stream's playback ID. (required) + :type playback_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_asset_playback_id_with_http_info(asset_id, playback_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_asset_playback_id_with_http_info(asset_id, playback_id, **kwargs) # noqa: E501 - return data + return self.delete_asset_playback_id_with_http_info(asset_id, playback_id, **kwargs) # noqa: E501 def delete_asset_playback_id_with_http_info(self, asset_id, playback_id, **kwargs): # noqa: E501 """Delete a playback ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_asset_playback_id_with_http_info(asset_id, playback_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param str playback_id: The live stream's playback ID. (required) - :return: None + :param asset_id: The asset ID. (required) + :type asset_id: str + :param playback_id: The live stream's playback ID. (required) + :type playback_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ local_var_params = locals() - all_params = ['asset_id', 'playback_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'asset_id', + 'playback_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_asset_playback_id" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'asset_id' is set - if ('asset_id' not in local_var_params or - local_var_params['asset_id'] is None): - raise ValueError("Missing the required parameter `asset_id` when calling `delete_asset_playback_id`") # noqa: E501 + if self.api_client.client_side_validation and ('asset_id' not in local_var_params or # noqa: E501 + local_var_params['asset_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `asset_id` when calling `delete_asset_playback_id`") # noqa: E501 # verify the required parameter 'playback_id' is set - if ('playback_id' not in local_var_params or - local_var_params['playback_id'] is None): - raise ValueError("Missing the required parameter `playback_id` when calling `delete_asset_playback_id`") # noqa: E501 + if self.api_client.client_side_validation and ('playback_id' not in local_var_params or # noqa: E501 + local_var_params['playback_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `playback_id` when calling `delete_asset_playback_id`") # noqa: E501 collection_formats = {} @@ -508,6 +718,8 @@ def delete_asset_playback_id_with_http_info(self, asset_id, playback_id, **kwarg body_params = None # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = {} return self.api_client.call_api( '/video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID}', 'DELETE', @@ -517,76 +729,114 @@ def delete_asset_playback_id_with_http_info(self, asset_id, playback_id, **kwarg body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def delete_asset_track(self, asset_id, track_id, **kwargs): # noqa: E501 """Delete an asset track # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_asset_track(asset_id, track_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param str track_id: The track ID. (required) - :return: None + :param asset_id: The asset ID. (required) + :type asset_id: str + :param track_id: The track ID. (required) + :type track_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_asset_track_with_http_info(asset_id, track_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_asset_track_with_http_info(asset_id, track_id, **kwargs) # noqa: E501 - return data + return self.delete_asset_track_with_http_info(asset_id, track_id, **kwargs) # noqa: E501 def delete_asset_track_with_http_info(self, asset_id, track_id, **kwargs): # noqa: E501 """Delete an asset track # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_asset_track_with_http_info(asset_id, track_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param str track_id: The track ID. (required) - :return: None + :param asset_id: The asset ID. (required) + :type asset_id: str + :param track_id: The track ID. (required) + :type track_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ local_var_params = locals() - all_params = ['asset_id', 'track_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'asset_id', + 'track_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_asset_track" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'asset_id' is set - if ('asset_id' not in local_var_params or - local_var_params['asset_id'] is None): - raise ValueError("Missing the required parameter `asset_id` when calling `delete_asset_track`") # noqa: E501 + if self.api_client.client_side_validation and ('asset_id' not in local_var_params or # noqa: E501 + local_var_params['asset_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `asset_id` when calling `delete_asset_track`") # noqa: E501 # verify the required parameter 'track_id' is set - if ('track_id' not in local_var_params or - local_var_params['track_id'] is None): - raise ValueError("Missing the required parameter `track_id` when calling `delete_asset_track`") # noqa: E501 + if self.api_client.client_side_validation and ('track_id' not in local_var_params or # noqa: E501 + local_var_params['track_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `track_id` when calling `delete_asset_track`") # noqa: E501 collection_formats = {} @@ -606,6 +856,8 @@ def delete_asset_track_with_http_info(self, asset_id, track_id, **kwargs): # no body_params = None # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = {} return self.api_client.call_api( '/video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID}', 'DELETE', @@ -615,13 +867,14 @@ def delete_asset_track_with_http_info(self, asset_id, track_id, **kwargs): # no body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def get_asset(self, asset_id, **kwargs): # noqa: E501 """Retrieve an asset # noqa: E501 @@ -629,21 +882,29 @@ def get_asset(self, asset_id, **kwargs): # noqa: E501 Retrieves the details of an asset that has previously been created. Supply the unique asset ID that was returned from your previous request, and Mux will return the corresponding asset information. The same information is returned when creating an asset. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_asset(asset_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :return: AssetResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: AssetResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_asset_with_http_info(asset_id, **kwargs) # noqa: E501 - else: - (data) = self.get_asset_with_http_info(asset_id, **kwargs) # noqa: E501 - return data + return self.get_asset_with_http_info(asset_id, **kwargs) # noqa: E501 def get_asset_with_http_info(self, asset_id, **kwargs): # noqa: E501 """Retrieve an asset # noqa: E501 @@ -651,36 +912,62 @@ def get_asset_with_http_info(self, asset_id, **kwargs): # noqa: E501 Retrieves the details of an asset that has previously been created. Supply the unique asset ID that was returned from your previous request, and Mux will return the corresponding asset information. The same information is returned when creating an asset. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_asset_with_http_info(asset_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :return: AssetResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(AssetResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['asset_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'asset_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_asset" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'asset_id' is set - if ('asset_id' not in local_var_params or - local_var_params['asset_id'] is None): - raise ValueError("Missing the required parameter `asset_id` when calling `get_asset`") # noqa: E501 + if self.api_client.client_side_validation and ('asset_id' not in local_var_params or # noqa: E501 + local_var_params['asset_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `asset_id` when calling `get_asset`") # noqa: E501 collection_formats = {} @@ -702,6 +989,10 @@ def get_asset_with_http_info(self, asset_id, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "AssetResponse", + } return self.api_client.call_api( '/video/v1/assets/{ASSET_ID}', 'GET', @@ -711,13 +1002,14 @@ def get_asset_with_http_info(self, asset_id, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='AssetResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def get_asset_input_info(self, asset_id, **kwargs): # noqa: E501 """Retrieve asset input info # noqa: E501 @@ -725,21 +1017,29 @@ def get_asset_input_info(self, asset_id, **kwargs): # noqa: E501 Returns a list of the input objects that were used to create the asset along with any settings that were applied to each input. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_asset_input_info(asset_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :return: GetAssetInputInfoResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: GetAssetInputInfoResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_asset_input_info_with_http_info(asset_id, **kwargs) # noqa: E501 - else: - (data) = self.get_asset_input_info_with_http_info(asset_id, **kwargs) # noqa: E501 - return data + return self.get_asset_input_info_with_http_info(asset_id, **kwargs) # noqa: E501 def get_asset_input_info_with_http_info(self, asset_id, **kwargs): # noqa: E501 """Retrieve asset input info # noqa: E501 @@ -747,36 +1047,62 @@ def get_asset_input_info_with_http_info(self, asset_id, **kwargs): # noqa: E501 Returns a list of the input objects that were used to create the asset along with any settings that were applied to each input. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_asset_input_info_with_http_info(asset_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :return: GetAssetInputInfoResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(GetAssetInputInfoResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['asset_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'asset_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_asset_input_info" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'asset_id' is set - if ('asset_id' not in local_var_params or - local_var_params['asset_id'] is None): - raise ValueError("Missing the required parameter `asset_id` when calling `get_asset_input_info`") # noqa: E501 + if self.api_client.client_side_validation and ('asset_id' not in local_var_params or # noqa: E501 + local_var_params['asset_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `asset_id` when calling `get_asset_input_info`") # noqa: E501 collection_formats = {} @@ -798,6 +1124,10 @@ def get_asset_input_info_with_http_info(self, asset_id, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "GetAssetInputInfoResponse", + } return self.api_client.call_api( '/video/v1/assets/{ASSET_ID}/input-info', 'GET', @@ -807,76 +1137,114 @@ def get_asset_input_info_with_http_info(self, asset_id, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='GetAssetInputInfoResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def get_asset_playback_id(self, asset_id, playback_id, **kwargs): # noqa: E501 """Retrieve a playback ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_asset_playback_id(asset_id, playback_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param str playback_id: The live stream's playback ID. (required) - :return: GetAssetPlaybackIDResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param playback_id: The live stream's playback ID. (required) + :type playback_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: GetAssetPlaybackIDResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_asset_playback_id_with_http_info(asset_id, playback_id, **kwargs) # noqa: E501 - else: - (data) = self.get_asset_playback_id_with_http_info(asset_id, playback_id, **kwargs) # noqa: E501 - return data + return self.get_asset_playback_id_with_http_info(asset_id, playback_id, **kwargs) # noqa: E501 def get_asset_playback_id_with_http_info(self, asset_id, playback_id, **kwargs): # noqa: E501 """Retrieve a playback ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_asset_playback_id_with_http_info(asset_id, playback_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param str playback_id: The live stream's playback ID. (required) - :return: GetAssetPlaybackIDResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param playback_id: The live stream's playback ID. (required) + :type playback_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(GetAssetPlaybackIDResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['asset_id', 'playback_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'asset_id', + 'playback_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_asset_playback_id" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'asset_id' is set - if ('asset_id' not in local_var_params or - local_var_params['asset_id'] is None): - raise ValueError("Missing the required parameter `asset_id` when calling `get_asset_playback_id`") # noqa: E501 + if self.api_client.client_side_validation and ('asset_id' not in local_var_params or # noqa: E501 + local_var_params['asset_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `asset_id` when calling `get_asset_playback_id`") # noqa: E501 # verify the required parameter 'playback_id' is set - if ('playback_id' not in local_var_params or - local_var_params['playback_id'] is None): - raise ValueError("Missing the required parameter `playback_id` when calling `get_asset_playback_id`") # noqa: E501 + if self.api_client.client_side_validation and ('playback_id' not in local_var_params or # noqa: E501 + local_var_params['playback_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `playback_id` when calling `get_asset_playback_id`") # noqa: E501 collection_formats = {} @@ -900,6 +1268,10 @@ def get_asset_playback_id_with_http_info(self, asset_id, playback_id, **kwargs): # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "GetAssetPlaybackIDResponse", + } return self.api_client.call_api( '/video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID}', 'GET', @@ -909,13 +1281,14 @@ def get_asset_playback_id_with_http_info(self, asset_id, playback_id, **kwargs): body=body_params, post_params=form_params, files=local_var_files, - response_type='GetAssetPlaybackIDResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_assets(self, **kwargs): # noqa: E501 """List assets # noqa: E501 @@ -923,22 +1296,31 @@ def list_assets(self, **kwargs): # noqa: E501 List all Mux assets. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_assets(async_req=True) >>> result = thread.get() - :param async_req bool - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :return: ListAssetsResponse + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListAssetsResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_assets_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_assets_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_assets_with_http_info(**kwargs) # noqa: E501 def list_assets_with_http_info(self, **kwargs): # noqa: E501 """List assets # noqa: E501 @@ -946,28 +1328,56 @@ def list_assets_with_http_info(self, **kwargs): # noqa: E501 List all Mux assets. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_assets_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :return: ListAssetsResponse + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListAssetsResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['limit', 'page'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'limit', + 'page' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_assets" % key ) @@ -979,9 +1389,9 @@ def list_assets_with_http_info(self, **kwargs): # noqa: E501 path_params = {} query_params = [] - if 'limit' in local_var_params: + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'page' in local_var_params: + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 query_params.append(('page', local_var_params['page'])) # noqa: E501 header_params = {} @@ -996,6 +1406,10 @@ def list_assets_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListAssetsResponse", + } return self.api_client.call_api( '/video/v1/assets', 'GET', @@ -1005,78 +1419,116 @@ def list_assets_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListAssetsResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def update_asset_master_access(self, asset_id, update_asset_master_access_request, **kwargs): # noqa: E501 """Update master access # noqa: E501 - Allows you add temporary access to the master (highest-quality) version of the asset in MP4 format. A URL will be created that can be used to download the master version for 24 hours. After 24 hours Master Access will revert to \"none\". This master version is not optimized for web and not meant to be streamed, only downloaded for purposes like archiving or editing the video offline. # noqa: E501 + Allows you to add temporary access to the master (highest-quality) version of the asset in MP4 format. A URL will be created that can be used to download the master version for 24 hours. After 24 hours Master Access will revert to \"none\". This master version is not optimized for web and not meant to be streamed, only downloaded for purposes like archiving or editing the video offline. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_asset_master_access(asset_id, update_asset_master_access_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param UpdateAssetMasterAccessRequest update_asset_master_access_request: (required) - :return: AssetResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param update_asset_master_access_request: (required) + :type update_asset_master_access_request: UpdateAssetMasterAccessRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: AssetResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_asset_master_access_with_http_info(asset_id, update_asset_master_access_request, **kwargs) # noqa: E501 - else: - (data) = self.update_asset_master_access_with_http_info(asset_id, update_asset_master_access_request, **kwargs) # noqa: E501 - return data + return self.update_asset_master_access_with_http_info(asset_id, update_asset_master_access_request, **kwargs) # noqa: E501 def update_asset_master_access_with_http_info(self, asset_id, update_asset_master_access_request, **kwargs): # noqa: E501 """Update master access # noqa: E501 - Allows you add temporary access to the master (highest-quality) version of the asset in MP4 format. A URL will be created that can be used to download the master version for 24 hours. After 24 hours Master Access will revert to \"none\". This master version is not optimized for web and not meant to be streamed, only downloaded for purposes like archiving or editing the video offline. # noqa: E501 + Allows you to add temporary access to the master (highest-quality) version of the asset in MP4 format. A URL will be created that can be used to download the master version for 24 hours. After 24 hours Master Access will revert to \"none\". This master version is not optimized for web and not meant to be streamed, only downloaded for purposes like archiving or editing the video offline. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_asset_master_access_with_http_info(asset_id, update_asset_master_access_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param UpdateAssetMasterAccessRequest update_asset_master_access_request: (required) - :return: AssetResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param update_asset_master_access_request: (required) + :type update_asset_master_access_request: UpdateAssetMasterAccessRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(AssetResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['asset_id', 'update_asset_master_access_request'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'asset_id', + 'update_asset_master_access_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method update_asset_master_access" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'asset_id' is set - if ('asset_id' not in local_var_params or - local_var_params['asset_id'] is None): - raise ValueError("Missing the required parameter `asset_id` when calling `update_asset_master_access`") # noqa: E501 + if self.api_client.client_side_validation and ('asset_id' not in local_var_params or # noqa: E501 + local_var_params['asset_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `asset_id` when calling `update_asset_master_access`") # noqa: E501 # verify the required parameter 'update_asset_master_access_request' is set - if ('update_asset_master_access_request' not in local_var_params or - local_var_params['update_asset_master_access_request'] is None): - raise ValueError("Missing the required parameter `update_asset_master_access_request` when calling `update_asset_master_access`") # noqa: E501 + if self.api_client.client_side_validation and ('update_asset_master_access_request' not in local_var_params or # noqa: E501 + local_var_params['update_asset_master_access_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `update_asset_master_access_request` when calling `update_asset_master_access`") # noqa: E501 collection_formats = {} @@ -1104,6 +1556,10 @@ def update_asset_master_access_with_http_info(self, asset_id, update_asset_maste # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "AssetResponse", + } return self.api_client.call_api( '/video/v1/assets/{ASSET_ID}/master-access', 'PUT', @@ -1113,78 +1569,116 @@ def update_asset_master_access_with_http_info(self, asset_id, update_asset_maste body=body_params, post_params=form_params, files=local_var_files, - response_type='AssetResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def update_asset_mp4_support(self, asset_id, update_asset_mp4_support_request, **kwargs): # noqa: E501 """Update MP4 support # noqa: E501 - Allows you add or remove mp4 support for assets that were created without it. Currently there are two values supported in this request, `standard` and `none`. `none` means that an asset *does not* have mp4 support, so submitting a request with `mp4_support` set to `none` will delete the mp4 assets from the asset in question. # noqa: E501 + Allows you to add or remove mp4 support for assets that were created without it. Currently there are two values supported in this request, `standard` and `none`. `none` means that an asset *does not* have mp4 support, so submitting a request with `mp4_support` set to `none` will delete the mp4 assets from the asset in question. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_asset_mp4_support(asset_id, update_asset_mp4_support_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param UpdateAssetMP4SupportRequest update_asset_mp4_support_request: (required) - :return: AssetResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param update_asset_mp4_support_request: (required) + :type update_asset_mp4_support_request: UpdateAssetMP4SupportRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: AssetResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_asset_mp4_support_with_http_info(asset_id, update_asset_mp4_support_request, **kwargs) # noqa: E501 - else: - (data) = self.update_asset_mp4_support_with_http_info(asset_id, update_asset_mp4_support_request, **kwargs) # noqa: E501 - return data + return self.update_asset_mp4_support_with_http_info(asset_id, update_asset_mp4_support_request, **kwargs) # noqa: E501 def update_asset_mp4_support_with_http_info(self, asset_id, update_asset_mp4_support_request, **kwargs): # noqa: E501 """Update MP4 support # noqa: E501 - Allows you add or remove mp4 support for assets that were created without it. Currently there are two values supported in this request, `standard` and `none`. `none` means that an asset *does not* have mp4 support, so submitting a request with `mp4_support` set to `none` will delete the mp4 assets from the asset in question. # noqa: E501 + Allows you to add or remove mp4 support for assets that were created without it. Currently there are two values supported in this request, `standard` and `none`. `none` means that an asset *does not* have mp4 support, so submitting a request with `mp4_support` set to `none` will delete the mp4 assets from the asset in question. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_asset_mp4_support_with_http_info(asset_id, update_asset_mp4_support_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param str asset_id: The asset ID. (required) - :param UpdateAssetMP4SupportRequest update_asset_mp4_support_request: (required) - :return: AssetResponse + :param asset_id: The asset ID. (required) + :type asset_id: str + :param update_asset_mp4_support_request: (required) + :type update_asset_mp4_support_request: UpdateAssetMP4SupportRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(AssetResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['asset_id', 'update_asset_mp4_support_request'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'asset_id', + 'update_asset_mp4_support_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method update_asset_mp4_support" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'asset_id' is set - if ('asset_id' not in local_var_params or - local_var_params['asset_id'] is None): - raise ValueError("Missing the required parameter `asset_id` when calling `update_asset_mp4_support`") # noqa: E501 + if self.api_client.client_side_validation and ('asset_id' not in local_var_params or # noqa: E501 + local_var_params['asset_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `asset_id` when calling `update_asset_mp4_support`") # noqa: E501 # verify the required parameter 'update_asset_mp4_support_request' is set - if ('update_asset_mp4_support_request' not in local_var_params or - local_var_params['update_asset_mp4_support_request'] is None): - raise ValueError("Missing the required parameter `update_asset_mp4_support_request` when calling `update_asset_mp4_support`") # noqa: E501 + if self.api_client.client_side_validation and ('update_asset_mp4_support_request' not in local_var_params or # noqa: E501 + local_var_params['update_asset_mp4_support_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `update_asset_mp4_support_request` when calling `update_asset_mp4_support`") # noqa: E501 collection_formats = {} @@ -1212,6 +1706,10 @@ def update_asset_mp4_support_with_http_info(self, asset_id, update_asset_mp4_sup # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "AssetResponse", + } return self.api_client.call_api( '/video/v1/assets/{ASSET_ID}/mp4-support', 'PUT', @@ -1221,10 +1719,11 @@ def update_asset_mp4_support_with_http_info(self, asset_id, update_asset_mp4_sup body=body_params, post_params=form_params, files=local_var_files, - response_type='AssetResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api/delivery_usage_api.py b/mux_python/api/delivery_usage_api.py index 08fd338..aa7ae80 100644 --- a/mux_python/api/delivery_usage_api.py +++ b/mux_python/api/delivery_usage_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class DeliveryUsageApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -29,24 +42,35 @@ def list_delivery_usage(self, **kwargs): # noqa: E501 Returns a list of delivery usage records and their associated Asset IDs or Live Stream IDs. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_delivery_usage(async_req=True) >>> result = thread.get() - :param async_req bool - :param int page: Offset by this many pages, of the size of `limit` - :param int limit: Number of items to include in the response - :param str asset_id: Filter response to return delivery usage for this asset only. - :param list[str] timeframe: Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. - :return: ListDeliveryUsageResponse + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param limit: Number of items to include in the response + :type limit: int + :param asset_id: Filter response to return delivery usage for this asset only. + :type asset_id: str + :param timeframe: Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListDeliveryUsageResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_delivery_usage_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_delivery_usage_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_delivery_usage_with_http_info(**kwargs) # noqa: E501 def list_delivery_usage_with_http_info(self, **kwargs): # noqa: E501 """List Usage # noqa: E501 @@ -54,30 +78,62 @@ def list_delivery_usage_with_http_info(self, **kwargs): # noqa: E501 Returns a list of delivery usage records and their associated Asset IDs or Live Stream IDs. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_delivery_usage_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :param int page: Offset by this many pages, of the size of `limit` - :param int limit: Number of items to include in the response - :param str asset_id: Filter response to return delivery usage for this asset only. - :param list[str] timeframe: Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. - :return: ListDeliveryUsageResponse + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param limit: Number of items to include in the response + :type limit: int + :param asset_id: Filter response to return delivery usage for this asset only. + :type asset_id: str + :param timeframe: Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListDeliveryUsageResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['page', 'limit', 'asset_id', 'timeframe'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'page', + 'limit', + 'asset_id', + 'timeframe' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_delivery_usage" % key ) @@ -89,13 +145,13 @@ def list_delivery_usage_with_http_info(self, **kwargs): # noqa: E501 path_params = {} query_params = [] - if 'page' in local_var_params: + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'limit' in local_var_params: + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'asset_id' in local_var_params: + if 'asset_id' in local_var_params and local_var_params['asset_id'] is not None: # noqa: E501 query_params.append(('asset_id', local_var_params['asset_id'])) # noqa: E501 - if 'timeframe' in local_var_params: + if 'timeframe' in local_var_params and local_var_params['timeframe'] is not None: # noqa: E501 query_params.append(('timeframe[]', local_var_params['timeframe'])) # noqa: E501 collection_formats['timeframe[]'] = 'multi' # noqa: E501 @@ -111,6 +167,10 @@ def list_delivery_usage_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListDeliveryUsageResponse", + } return self.api_client.call_api( '/video/v1/delivery-usage', 'GET', @@ -120,10 +180,11 @@ def list_delivery_usage_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListDeliveryUsageResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api/dimensions_api.py b/mux_python/api/dimensions_api.py index 86358e1..dbdef65 100644 --- a/mux_python/api/dimensions_api.py +++ b/mux_python/api/dimensions_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class DimensionsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -29,25 +42,37 @@ def list_dimension_values(self, dimension_id, **kwargs): # noqa: E501 Lists the values for a dimension along with a total count of related views. Note: This API replaces the list-filter-values API call. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_dimension_values(dimension_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str dimension_id: ID of the Dimension (required) - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :return: ListDimensionValuesResponse + :param dimension_id: ID of the Dimension (required) + :type dimension_id: str + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListDimensionValuesResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_dimension_values_with_http_info(dimension_id, **kwargs) # noqa: E501 - else: - (data) = self.list_dimension_values_with_http_info(dimension_id, **kwargs) # noqa: E501 - return data + return self.list_dimension_values_with_http_info(dimension_id, **kwargs) # noqa: E501 def list_dimension_values_with_http_info(self, dimension_id, **kwargs): # noqa: E501 """Lists the values for a specific dimension # noqa: E501 @@ -55,40 +80,74 @@ def list_dimension_values_with_http_info(self, dimension_id, **kwargs): # noqa: Lists the values for a dimension along with a total count of related views. Note: This API replaces the list-filter-values API call. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_dimension_values_with_http_info(dimension_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str dimension_id: ID of the Dimension (required) - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :return: ListDimensionValuesResponse + :param dimension_id: ID of the Dimension (required) + :type dimension_id: str + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListDimensionValuesResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['dimension_id', 'limit', 'page', 'filters', 'timeframe'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'dimension_id', + 'limit', + 'page', + 'filters', + 'timeframe' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_dimension_values" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'dimension_id' is set - if ('dimension_id' not in local_var_params or - local_var_params['dimension_id'] is None): - raise ValueError("Missing the required parameter `dimension_id` when calling `list_dimension_values`") # noqa: E501 + if self.api_client.client_side_validation and ('dimension_id' not in local_var_params or # noqa: E501 + local_var_params['dimension_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `dimension_id` when calling `list_dimension_values`") # noqa: E501 collection_formats = {} @@ -97,14 +156,14 @@ def list_dimension_values_with_http_info(self, dimension_id, **kwargs): # noqa: path_params['DIMENSION_ID'] = local_var_params['dimension_id'] # noqa: E501 query_params = [] - if 'limit' in local_var_params: + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'page' in local_var_params: + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'filters' in local_var_params: + if 'filters' in local_var_params and local_var_params['filters'] is not None: # noqa: E501 query_params.append(('filters[]', local_var_params['filters'])) # noqa: E501 collection_formats['filters[]'] = 'multi' # noqa: E501 - if 'timeframe' in local_var_params: + if 'timeframe' in local_var_params and local_var_params['timeframe'] is not None: # noqa: E501 query_params.append(('timeframe[]', local_var_params['timeframe'])) # noqa: E501 collection_formats['timeframe[]'] = 'multi' # noqa: E501 @@ -120,6 +179,10 @@ def list_dimension_values_with_http_info(self, dimension_id, **kwargs): # noqa: # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListDimensionValuesResponse", + } return self.api_client.call_api( '/data/v1/dimensions/{DIMENSION_ID}', 'GET', @@ -129,13 +192,14 @@ def list_dimension_values_with_http_info(self, dimension_id, **kwargs): # noqa: body=body_params, post_params=form_params, files=local_var_files, - response_type='ListDimensionValuesResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_dimensions(self, **kwargs): # noqa: E501 """List Dimensions # noqa: E501 @@ -143,20 +207,27 @@ def list_dimensions(self, **kwargs): # noqa: E501 List all available dimensions. Note: This API replaces the list-filters API call. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_dimensions(async_req=True) >>> result = thread.get() - :param async_req bool - :return: ListDimensionsResponse + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListDimensionsResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_dimensions_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_dimensions_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_dimensions_with_http_info(**kwargs) # noqa: E501 def list_dimensions_with_http_info(self, **kwargs): # noqa: E501 """List Dimensions # noqa: E501 @@ -164,26 +235,50 @@ def list_dimensions_with_http_info(self, **kwargs): # noqa: E501 List all available dimensions. Note: This API replaces the list-filters API call. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_dimensions_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :return: ListDimensionsResponse + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListDimensionsResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_dimensions" % key ) @@ -208,6 +303,10 @@ def list_dimensions_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListDimensionsResponse", + } return self.api_client.call_api( '/data/v1/dimensions', 'GET', @@ -217,10 +316,11 @@ def list_dimensions_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListDimensionsResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api/direct_uploads_api.py b/mux_python/api/direct_uploads_api.py index f071c3d..f87fb51 100644 --- a/mux_python/api/direct_uploads_api.py +++ b/mux_python/api/direct_uploads_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class DirectUploadsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -29,21 +42,29 @@ def cancel_direct_upload(self, upload_id, **kwargs): # noqa: E501 Cancels a direct upload and marks it as cancelled. If a pending upload finishes after this request, no asset will be created. This request will only succeed if the upload is still in the `waiting` state. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_direct_upload(upload_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str upload_id: ID of the Upload (required) - :return: UploadResponse + :param upload_id: ID of the Upload (required) + :type upload_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: UploadResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.cancel_direct_upload_with_http_info(upload_id, **kwargs) # noqa: E501 - else: - (data) = self.cancel_direct_upload_with_http_info(upload_id, **kwargs) # noqa: E501 - return data + return self.cancel_direct_upload_with_http_info(upload_id, **kwargs) # noqa: E501 def cancel_direct_upload_with_http_info(self, upload_id, **kwargs): # noqa: E501 """Cancel a direct upload # noqa: E501 @@ -51,36 +72,62 @@ def cancel_direct_upload_with_http_info(self, upload_id, **kwargs): # noqa: E50 Cancels a direct upload and marks it as cancelled. If a pending upload finishes after this request, no asset will be created. This request will only succeed if the upload is still in the `waiting` state. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_direct_upload_with_http_info(upload_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str upload_id: ID of the Upload (required) - :return: UploadResponse + :param upload_id: ID of the Upload (required) + :type upload_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(UploadResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['upload_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'upload_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method cancel_direct_upload" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'upload_id' is set - if ('upload_id' not in local_var_params or - local_var_params['upload_id'] is None): - raise ValueError("Missing the required parameter `upload_id` when calling `cancel_direct_upload`") # noqa: E501 + if self.api_client.client_side_validation and ('upload_id' not in local_var_params or # noqa: E501 + local_var_params['upload_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `upload_id` when calling `cancel_direct_upload`") # noqa: E501 collection_formats = {} @@ -102,6 +149,11 @@ def cancel_direct_upload_with_http_info(self, upload_id, **kwargs): # noqa: E50 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "UploadResponse", + 403: None, + } return self.api_client.call_api( '/video/v1/uploads/{UPLOAD_ID}/cancel', 'PUT', @@ -111,70 +163,105 @@ def cancel_direct_upload_with_http_info(self, upload_id, **kwargs): # noqa: E50 body=body_params, post_params=form_params, files=local_var_files, - response_type='UploadResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def create_direct_upload(self, create_upload_request, **kwargs): # noqa: E501 """Create a new direct upload URL # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_direct_upload(create_upload_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param CreateUploadRequest create_upload_request: (required) - :return: UploadResponse + :param create_upload_request: (required) + :type create_upload_request: CreateUploadRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: UploadResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_direct_upload_with_http_info(create_upload_request, **kwargs) # noqa: E501 - else: - (data) = self.create_direct_upload_with_http_info(create_upload_request, **kwargs) # noqa: E501 - return data + return self.create_direct_upload_with_http_info(create_upload_request, **kwargs) # noqa: E501 def create_direct_upload_with_http_info(self, create_upload_request, **kwargs): # noqa: E501 """Create a new direct upload URL # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_direct_upload_with_http_info(create_upload_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param CreateUploadRequest create_upload_request: (required) - :return: UploadResponse + :param create_upload_request: (required) + :type create_upload_request: CreateUploadRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(UploadResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['create_upload_request'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'create_upload_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_direct_upload" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'create_upload_request' is set - if ('create_upload_request' not in local_var_params or - local_var_params['create_upload_request'] is None): - raise ValueError("Missing the required parameter `create_upload_request` when calling `create_direct_upload`") # noqa: E501 + if self.api_client.client_side_validation and ('create_upload_request' not in local_var_params or # noqa: E501 + local_var_params['create_upload_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `create_upload_request` when calling `create_direct_upload`") # noqa: E501 collection_formats = {} @@ -200,6 +287,10 @@ def create_direct_upload_with_http_info(self, create_upload_request, **kwargs): # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 201: "UploadResponse", + } return self.api_client.call_api( '/video/v1/uploads', 'POST', @@ -209,70 +300,105 @@ def create_direct_upload_with_http_info(self, create_upload_request, **kwargs): body=body_params, post_params=form_params, files=local_var_files, - response_type='UploadResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def get_direct_upload(self, upload_id, **kwargs): # noqa: E501 """Retrieve a single direct upload's info # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_direct_upload(upload_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str upload_id: ID of the Upload (required) - :return: UploadResponse + :param upload_id: ID of the Upload (required) + :type upload_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: UploadResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_direct_upload_with_http_info(upload_id, **kwargs) # noqa: E501 - else: - (data) = self.get_direct_upload_with_http_info(upload_id, **kwargs) # noqa: E501 - return data + return self.get_direct_upload_with_http_info(upload_id, **kwargs) # noqa: E501 def get_direct_upload_with_http_info(self, upload_id, **kwargs): # noqa: E501 """Retrieve a single direct upload's info # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_direct_upload_with_http_info(upload_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str upload_id: ID of the Upload (required) - :return: UploadResponse + :param upload_id: ID of the Upload (required) + :type upload_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(UploadResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['upload_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'upload_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_direct_upload" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'upload_id' is set - if ('upload_id' not in local_var_params or - local_var_params['upload_id'] is None): - raise ValueError("Missing the required parameter `upload_id` when calling `get_direct_upload`") # noqa: E501 + if self.api_client.client_side_validation and ('upload_id' not in local_var_params or # noqa: E501 + local_var_params['upload_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `upload_id` when calling `get_direct_upload`") # noqa: E501 collection_formats = {} @@ -294,6 +420,10 @@ def get_direct_upload_with_http_info(self, upload_id, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "UploadResponse", + } return self.api_client.call_api( '/video/v1/uploads/{UPLOAD_ID}', 'GET', @@ -303,63 +433,101 @@ def get_direct_upload_with_http_info(self, upload_id, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='UploadResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_direct_uploads(self, **kwargs): # noqa: E501 """List direct uploads # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_direct_uploads(async_req=True) >>> result = thread.get() - :param async_req bool - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :return: ListUploadsResponse + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListUploadsResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_direct_uploads_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_direct_uploads_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_direct_uploads_with_http_info(**kwargs) # noqa: E501 def list_direct_uploads_with_http_info(self, **kwargs): # noqa: E501 """List direct uploads # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_direct_uploads_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :return: ListUploadsResponse + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListUploadsResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['limit', 'page'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'limit', + 'page' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_direct_uploads" % key ) @@ -371,9 +539,9 @@ def list_direct_uploads_with_http_info(self, **kwargs): # noqa: E501 path_params = {} query_params = [] - if 'limit' in local_var_params: + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'page' in local_var_params: + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 query_params.append(('page', local_var_params['page'])) # noqa: E501 header_params = {} @@ -388,6 +556,10 @@ def list_direct_uploads_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListUploadsResponse", + } return self.api_client.call_api( '/video/v1/uploads', 'GET', @@ -397,10 +569,11 @@ def list_direct_uploads_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListUploadsResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api/errors_api.py b/mux_python/api/errors_api.py index 481e60d..a724a26 100644 --- a/mux_python/api/errors_api.py +++ b/mux_python/api/errors_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class ErrorsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -29,22 +42,31 @@ def list_errors(self, **kwargs): # noqa: E501 Returns a list of errors # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_errors(async_req=True) >>> result = thread.get() - :param async_req bool - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :return: ListErrorsResponse + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListErrorsResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_errors_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_errors_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_errors_with_http_info(**kwargs) # noqa: E501 def list_errors_with_http_info(self, **kwargs): # noqa: E501 """List Errors # noqa: E501 @@ -52,28 +74,56 @@ def list_errors_with_http_info(self, **kwargs): # noqa: E501 Returns a list of errors # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_errors_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :return: ListErrorsResponse + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListErrorsResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['filters', 'timeframe'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'filters', + 'timeframe' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_errors" % key ) @@ -85,10 +135,10 @@ def list_errors_with_http_info(self, **kwargs): # noqa: E501 path_params = {} query_params = [] - if 'filters' in local_var_params: + if 'filters' in local_var_params and local_var_params['filters'] is not None: # noqa: E501 query_params.append(('filters[]', local_var_params['filters'])) # noqa: E501 collection_formats['filters[]'] = 'multi' # noqa: E501 - if 'timeframe' in local_var_params: + if 'timeframe' in local_var_params and local_var_params['timeframe'] is not None: # noqa: E501 query_params.append(('timeframe[]', local_var_params['timeframe'])) # noqa: E501 collection_formats['timeframe[]'] = 'multi' # noqa: E501 @@ -104,6 +154,10 @@ def list_errors_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListErrorsResponse", + } return self.api_client.call_api( '/data/v1/errors', 'GET', @@ -113,10 +167,11 @@ def list_errors_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListErrorsResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api/exports_api.py b/mux_python/api/exports_api.py index 3ea474e..3bc0cd6 100644 --- a/mux_python/api/exports_api.py +++ b/mux_python/api/exports_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class ExportsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -29,20 +42,27 @@ def list_exports(self, **kwargs): # noqa: E501 Lists the available video view exports along with URLs to retrieve them # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_exports(async_req=True) >>> result = thread.get() - :param async_req bool - :return: ListExportsResponse + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListExportsResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_exports_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_exports_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_exports_with_http_info(**kwargs) # noqa: E501 def list_exports_with_http_info(self, **kwargs): # noqa: E501 """List property video view export links # noqa: E501 @@ -50,26 +70,50 @@ def list_exports_with_http_info(self, **kwargs): # noqa: E501 Lists the available video view exports along with URLs to retrieve them # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_exports_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :return: ListExportsResponse + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListExportsResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_exports" % key ) @@ -94,6 +138,10 @@ def list_exports_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListExportsResponse", + } return self.api_client.call_api( '/data/v1/exports', 'GET', @@ -103,10 +151,11 @@ def list_exports_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListExportsResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api/filters_api.py b/mux_python/api/filters_api.py index a6b244a..aadd85e 100644 --- a/mux_python/api/filters_api.py +++ b/mux_python/api/filters_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class FiltersApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -29,25 +42,37 @@ def list_filter_values(self, filter_id, **kwargs): # noqa: E501 Deprecated: The API has been replaced by the list-dimension-values API call. Lists the values for a filter along with a total count of related views. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_filter_values(filter_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str filter_id: ID of the Filter (required) - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :return: ListFilterValuesResponse + :param filter_id: ID of the Filter (required) + :type filter_id: str + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListFilterValuesResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_filter_values_with_http_info(filter_id, **kwargs) # noqa: E501 - else: - (data) = self.list_filter_values_with_http_info(filter_id, **kwargs) # noqa: E501 - return data + return self.list_filter_values_with_http_info(filter_id, **kwargs) # noqa: E501 def list_filter_values_with_http_info(self, filter_id, **kwargs): # noqa: E501 """Lists values for a specific filter # noqa: E501 @@ -55,40 +80,74 @@ def list_filter_values_with_http_info(self, filter_id, **kwargs): # noqa: E501 Deprecated: The API has been replaced by the list-dimension-values API call. Lists the values for a filter along with a total count of related views. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_filter_values_with_http_info(filter_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str filter_id: ID of the Filter (required) - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :return: ListFilterValuesResponse + :param filter_id: ID of the Filter (required) + :type filter_id: str + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListFilterValuesResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['filter_id', 'limit', 'page', 'filters', 'timeframe'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'filter_id', + 'limit', + 'page', + 'filters', + 'timeframe' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_filter_values" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'filter_id' is set - if ('filter_id' not in local_var_params or - local_var_params['filter_id'] is None): - raise ValueError("Missing the required parameter `filter_id` when calling `list_filter_values`") # noqa: E501 + if self.api_client.client_side_validation and ('filter_id' not in local_var_params or # noqa: E501 + local_var_params['filter_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `filter_id` when calling `list_filter_values`") # noqa: E501 collection_formats = {} @@ -97,14 +156,14 @@ def list_filter_values_with_http_info(self, filter_id, **kwargs): # noqa: E501 path_params['FILTER_ID'] = local_var_params['filter_id'] # noqa: E501 query_params = [] - if 'limit' in local_var_params: + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'page' in local_var_params: + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'filters' in local_var_params: + if 'filters' in local_var_params and local_var_params['filters'] is not None: # noqa: E501 query_params.append(('filters[]', local_var_params['filters'])) # noqa: E501 collection_formats['filters[]'] = 'multi' # noqa: E501 - if 'timeframe' in local_var_params: + if 'timeframe' in local_var_params and local_var_params['timeframe'] is not None: # noqa: E501 query_params.append(('timeframe[]', local_var_params['timeframe'])) # noqa: E501 collection_formats['timeframe[]'] = 'multi' # noqa: E501 @@ -120,6 +179,10 @@ def list_filter_values_with_http_info(self, filter_id, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListFilterValuesResponse", + } return self.api_client.call_api( '/data/v1/filters/{FILTER_ID}', 'GET', @@ -129,13 +192,14 @@ def list_filter_values_with_http_info(self, filter_id, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListFilterValuesResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_filters(self, **kwargs): # noqa: E501 """List Filters # noqa: E501 @@ -143,20 +207,27 @@ def list_filters(self, **kwargs): # noqa: E501 Deprecated: The API has been replaced by the list-dimensions API call. Lists all the filters broken out into basic and advanced. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_filters(async_req=True) >>> result = thread.get() - :param async_req bool - :return: ListFiltersResponse + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListFiltersResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_filters_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_filters_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_filters_with_http_info(**kwargs) # noqa: E501 def list_filters_with_http_info(self, **kwargs): # noqa: E501 """List Filters # noqa: E501 @@ -164,26 +235,50 @@ def list_filters_with_http_info(self, **kwargs): # noqa: E501 Deprecated: The API has been replaced by the list-dimensions API call. Lists all the filters broken out into basic and advanced. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_filters_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :return: ListFiltersResponse + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListFiltersResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_filters" % key ) @@ -208,6 +303,10 @@ def list_filters_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListFiltersResponse", + } return self.api_client.call_api( '/data/v1/filters', 'GET', @@ -217,10 +316,11 @@ def list_filters_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListFiltersResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api/incidents_api.py b/mux_python/api/incidents_api.py index 7f576f6..50b584f 100644 --- a/mux_python/api/incidents_api.py +++ b/mux_python/api/incidents_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class IncidentsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -29,21 +42,29 @@ def get_incident(self, incident_id, **kwargs): # noqa: E501 Returns the details of an incident # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_incident(incident_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str incident_id: ID of the Incident (required) - :return: IncidentResponse + :param incident_id: ID of the Incident (required) + :type incident_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: IncidentResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_incident_with_http_info(incident_id, **kwargs) # noqa: E501 - else: - (data) = self.get_incident_with_http_info(incident_id, **kwargs) # noqa: E501 - return data + return self.get_incident_with_http_info(incident_id, **kwargs) # noqa: E501 def get_incident_with_http_info(self, incident_id, **kwargs): # noqa: E501 """Get an Incident # noqa: E501 @@ -51,36 +72,62 @@ def get_incident_with_http_info(self, incident_id, **kwargs): # noqa: E501 Returns the details of an incident # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_incident_with_http_info(incident_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str incident_id: ID of the Incident (required) - :return: IncidentResponse + :param incident_id: ID of the Incident (required) + :type incident_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(IncidentResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['incident_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'incident_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_incident" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'incident_id' is set - if ('incident_id' not in local_var_params or - local_var_params['incident_id'] is None): - raise ValueError("Missing the required parameter `incident_id` when calling `get_incident`") # noqa: E501 + if self.api_client.client_side_validation and ('incident_id' not in local_var_params or # noqa: E501 + local_var_params['incident_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `incident_id` when calling `get_incident`") # noqa: E501 collection_formats = {} @@ -102,6 +149,10 @@ def get_incident_with_http_info(self, incident_id, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "IncidentResponse", + } return self.api_client.call_api( '/data/v1/incidents/{INCIDENT_ID}', 'GET', @@ -111,13 +162,14 @@ def get_incident_with_http_info(self, incident_id, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='IncidentResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_incidents(self, **kwargs): # noqa: E501 """List Incidents # noqa: E501 @@ -125,26 +177,39 @@ def list_incidents(self, **kwargs): # noqa: E501 Returns a list of incidents # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_incidents(async_req=True) >>> result = thread.get() - :param async_req bool - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :param str order_by: Value to order the results by - :param str order_direction: Sort order. - :param str status: Status to filter incidents by - :param str severity: Severity to filter incidents by - :return: ListIncidentsResponse + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param order_by: Value to order the results by + :type order_by: str + :param order_direction: Sort order. + :type order_direction: str + :param status: Status to filter incidents by + :type status: str + :param severity: Severity to filter incidents by + :type severity: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListIncidentsResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_incidents_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_incidents_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_incidents_with_http_info(**kwargs) # noqa: E501 def list_incidents_with_http_info(self, **kwargs): # noqa: E501 """List Incidents # noqa: E501 @@ -152,32 +217,68 @@ def list_incidents_with_http_info(self, **kwargs): # noqa: E501 Returns a list of incidents # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_incidents_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :param str order_by: Value to order the results by - :param str order_direction: Sort order. - :param str status: Status to filter incidents by - :param str severity: Severity to filter incidents by - :return: ListIncidentsResponse + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param order_by: Value to order the results by + :type order_by: str + :param order_direction: Sort order. + :type order_direction: str + :param status: Status to filter incidents by + :type status: str + :param severity: Severity to filter incidents by + :type severity: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListIncidentsResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['limit', 'page', 'order_by', 'order_direction', 'status', 'severity'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'limit', + 'page', + 'order_by', + 'order_direction', + 'status', + 'severity' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_incidents" % key ) @@ -189,17 +290,17 @@ def list_incidents_with_http_info(self, **kwargs): # noqa: E501 path_params = {} query_params = [] - if 'limit' in local_var_params: + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'page' in local_var_params: + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'order_by' in local_var_params: + if 'order_by' in local_var_params and local_var_params['order_by'] is not None: # noqa: E501 query_params.append(('order_by', local_var_params['order_by'])) # noqa: E501 - if 'order_direction' in local_var_params: + if 'order_direction' in local_var_params and local_var_params['order_direction'] is not None: # noqa: E501 query_params.append(('order_direction', local_var_params['order_direction'])) # noqa: E501 - if 'status' in local_var_params: + if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 query_params.append(('status', local_var_params['status'])) # noqa: E501 - if 'severity' in local_var_params: + if 'severity' in local_var_params and local_var_params['severity'] is not None: # noqa: E501 query_params.append(('severity', local_var_params['severity'])) # noqa: E501 header_params = {} @@ -214,6 +315,10 @@ def list_incidents_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListIncidentsResponse", + } return self.api_client.call_api( '/data/v1/incidents', 'GET', @@ -223,13 +328,14 @@ def list_incidents_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListIncidentsResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_related_incidents(self, incident_id, **kwargs): # noqa: E501 """List Related Incidents # noqa: E501 @@ -237,25 +343,37 @@ def list_related_incidents(self, incident_id, **kwargs): # noqa: E501 Returns all the incidents that seem related to a specific incident # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_related_incidents(incident_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str incident_id: ID of the Incident (required) - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :param str order_by: Value to order the results by - :param str order_direction: Sort order. - :return: ListRelatedIncidentsResponse + :param incident_id: ID of the Incident (required) + :type incident_id: str + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param order_by: Value to order the results by + :type order_by: str + :param order_direction: Sort order. + :type order_direction: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListRelatedIncidentsResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_related_incidents_with_http_info(incident_id, **kwargs) # noqa: E501 - else: - (data) = self.list_related_incidents_with_http_info(incident_id, **kwargs) # noqa: E501 - return data + return self.list_related_incidents_with_http_info(incident_id, **kwargs) # noqa: E501 def list_related_incidents_with_http_info(self, incident_id, **kwargs): # noqa: E501 """List Related Incidents # noqa: E501 @@ -263,40 +381,74 @@ def list_related_incidents_with_http_info(self, incident_id, **kwargs): # noqa: Returns all the incidents that seem related to a specific incident # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_related_incidents_with_http_info(incident_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str incident_id: ID of the Incident (required) - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :param str order_by: Value to order the results by - :param str order_direction: Sort order. - :return: ListRelatedIncidentsResponse + :param incident_id: ID of the Incident (required) + :type incident_id: str + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param order_by: Value to order the results by + :type order_by: str + :param order_direction: Sort order. + :type order_direction: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListRelatedIncidentsResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['incident_id', 'limit', 'page', 'order_by', 'order_direction'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'incident_id', + 'limit', + 'page', + 'order_by', + 'order_direction' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_related_incidents" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'incident_id' is set - if ('incident_id' not in local_var_params or - local_var_params['incident_id'] is None): - raise ValueError("Missing the required parameter `incident_id` when calling `list_related_incidents`") # noqa: E501 + if self.api_client.client_side_validation and ('incident_id' not in local_var_params or # noqa: E501 + local_var_params['incident_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `incident_id` when calling `list_related_incidents`") # noqa: E501 collection_formats = {} @@ -305,13 +457,13 @@ def list_related_incidents_with_http_info(self, incident_id, **kwargs): # noqa: path_params['INCIDENT_ID'] = local_var_params['incident_id'] # noqa: E501 query_params = [] - if 'limit' in local_var_params: + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'page' in local_var_params: + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'order_by' in local_var_params: + if 'order_by' in local_var_params and local_var_params['order_by'] is not None: # noqa: E501 query_params.append(('order_by', local_var_params['order_by'])) # noqa: E501 - if 'order_direction' in local_var_params: + if 'order_direction' in local_var_params and local_var_params['order_direction'] is not None: # noqa: E501 query_params.append(('order_direction', local_var_params['order_direction'])) # noqa: E501 header_params = {} @@ -326,6 +478,10 @@ def list_related_incidents_with_http_info(self, incident_id, **kwargs): # noqa: # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListRelatedIncidentsResponse", + } return self.api_client.call_api( '/data/v1/incidents/{INCIDENT_ID}/related', 'GET', @@ -335,10 +491,11 @@ def list_related_incidents_with_http_info(self, incident_id, **kwargs): # noqa: body=body_params, post_params=form_params, files=local_var_files, - response_type='ListRelatedIncidentsResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api/live_streams_api.py b/mux_python/api/live_streams_api.py index df806d1..1d8b0bf 100644 --- a/mux_python/api/live_streams_api.py +++ b/mux_python/api/live_streams_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class LiveStreamsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -28,57 +41,91 @@ def create_live_stream(self, create_live_stream_request, **kwargs): # noqa: E50 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_live_stream(create_live_stream_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param CreateLiveStreamRequest create_live_stream_request: (required) - :return: LiveStreamResponse + :param create_live_stream_request: (required) + :type create_live_stream_request: CreateLiveStreamRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: LiveStreamResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_live_stream_with_http_info(create_live_stream_request, **kwargs) # noqa: E501 - else: - (data) = self.create_live_stream_with_http_info(create_live_stream_request, **kwargs) # noqa: E501 - return data + return self.create_live_stream_with_http_info(create_live_stream_request, **kwargs) # noqa: E501 def create_live_stream_with_http_info(self, create_live_stream_request, **kwargs): # noqa: E501 """Create a live stream # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_live_stream_with_http_info(create_live_stream_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param CreateLiveStreamRequest create_live_stream_request: (required) - :return: LiveStreamResponse + :param create_live_stream_request: (required) + :type create_live_stream_request: CreateLiveStreamRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(LiveStreamResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['create_live_stream_request'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'create_live_stream_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_live_stream" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'create_live_stream_request' is set - if ('create_live_stream_request' not in local_var_params or - local_var_params['create_live_stream_request'] is None): - raise ValueError("Missing the required parameter `create_live_stream_request` when calling `create_live_stream`") # noqa: E501 + if self.api_client.client_side_validation and ('create_live_stream_request' not in local_var_params or # noqa: E501 + local_var_params['create_live_stream_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `create_live_stream_request` when calling `create_live_stream`") # noqa: E501 collection_formats = {} @@ -104,6 +151,10 @@ def create_live_stream_with_http_info(self, create_live_stream_request, **kwargs # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 201: "LiveStreamResponse", + } return self.api_client.call_api( '/video/v1/live-streams', 'POST', @@ -113,76 +164,114 @@ def create_live_stream_with_http_info(self, create_live_stream_request, **kwargs body=body_params, post_params=form_params, files=local_var_files, - response_type='LiveStreamResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def create_live_stream_playback_id(self, live_stream_id, create_playback_id_request, **kwargs): # noqa: E501 """Create a live stream playback ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_live_stream_playback_id(live_stream_id, create_playback_id_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :param CreatePlaybackIDRequest create_playback_id_request: (required) - :return: CreatePlaybackIDResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param create_playback_id_request: (required) + :type create_playback_id_request: CreatePlaybackIDRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: CreatePlaybackIDResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_live_stream_playback_id_with_http_info(live_stream_id, create_playback_id_request, **kwargs) # noqa: E501 - else: - (data) = self.create_live_stream_playback_id_with_http_info(live_stream_id, create_playback_id_request, **kwargs) # noqa: E501 - return data + return self.create_live_stream_playback_id_with_http_info(live_stream_id, create_playback_id_request, **kwargs) # noqa: E501 def create_live_stream_playback_id_with_http_info(self, live_stream_id, create_playback_id_request, **kwargs): # noqa: E501 """Create a live stream playback ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_live_stream_playback_id_with_http_info(live_stream_id, create_playback_id_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :param CreatePlaybackIDRequest create_playback_id_request: (required) - :return: CreatePlaybackIDResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param create_playback_id_request: (required) + :type create_playback_id_request: CreatePlaybackIDRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(CreatePlaybackIDResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['live_stream_id', 'create_playback_id_request'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'live_stream_id', + 'create_playback_id_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_live_stream_playback_id" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'live_stream_id' is set - if ('live_stream_id' not in local_var_params or - local_var_params['live_stream_id'] is None): - raise ValueError("Missing the required parameter `live_stream_id` when calling `create_live_stream_playback_id`") # noqa: E501 + if self.api_client.client_side_validation and ('live_stream_id' not in local_var_params or # noqa: E501 + local_var_params['live_stream_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `live_stream_id` when calling `create_live_stream_playback_id`") # noqa: E501 # verify the required parameter 'create_playback_id_request' is set - if ('create_playback_id_request' not in local_var_params or - local_var_params['create_playback_id_request'] is None): - raise ValueError("Missing the required parameter `create_playback_id_request` when calling `create_live_stream_playback_id`") # noqa: E501 + if self.api_client.client_side_validation and ('create_playback_id_request' not in local_var_params or # noqa: E501 + local_var_params['create_playback_id_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `create_playback_id_request` when calling `create_live_stream_playback_id`") # noqa: E501 collection_formats = {} @@ -210,6 +299,10 @@ def create_live_stream_playback_id_with_http_info(self, live_stream_id, create_p # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 201: "CreatePlaybackIDResponse", + } return self.api_client.call_api( '/video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids', 'POST', @@ -219,13 +312,14 @@ def create_live_stream_playback_id_with_http_info(self, live_stream_id, create_p body=body_params, post_params=form_params, files=local_var_files, - response_type='CreatePlaybackIDResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def create_live_stream_simulcast_target(self, live_stream_id, create_simulcast_target_request, **kwargs): # noqa: E501 """Create a live stream simulcast target # noqa: E501 @@ -233,22 +327,31 @@ def create_live_stream_simulcast_target(self, live_stream_id, create_simulcast_t Create a simulcast target for the parent live stream. Simulcast target can only be created when the parent live stream is in idle state. Only one simulcast target can be created at a time with this API. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_live_stream_simulcast_target(live_stream_id, create_simulcast_target_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :param CreateSimulcastTargetRequest create_simulcast_target_request: (required) - :return: SimulcastTargetResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param create_simulcast_target_request: (required) + :type create_simulcast_target_request: CreateSimulcastTargetRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: SimulcastTargetResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_live_stream_simulcast_target_with_http_info(live_stream_id, create_simulcast_target_request, **kwargs) # noqa: E501 - else: - (data) = self.create_live_stream_simulcast_target_with_http_info(live_stream_id, create_simulcast_target_request, **kwargs) # noqa: E501 - return data + return self.create_live_stream_simulcast_target_with_http_info(live_stream_id, create_simulcast_target_request, **kwargs) # noqa: E501 def create_live_stream_simulcast_target_with_http_info(self, live_stream_id, create_simulcast_target_request, **kwargs): # noqa: E501 """Create a live stream simulcast target # noqa: E501 @@ -256,41 +359,69 @@ def create_live_stream_simulcast_target_with_http_info(self, live_stream_id, cre Create a simulcast target for the parent live stream. Simulcast target can only be created when the parent live stream is in idle state. Only one simulcast target can be created at a time with this API. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_live_stream_simulcast_target_with_http_info(live_stream_id, create_simulcast_target_request, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :param CreateSimulcastTargetRequest create_simulcast_target_request: (required) - :return: SimulcastTargetResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param create_simulcast_target_request: (required) + :type create_simulcast_target_request: CreateSimulcastTargetRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(SimulcastTargetResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['live_stream_id', 'create_simulcast_target_request'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'live_stream_id', + 'create_simulcast_target_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_live_stream_simulcast_target" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'live_stream_id' is set - if ('live_stream_id' not in local_var_params or - local_var_params['live_stream_id'] is None): - raise ValueError("Missing the required parameter `live_stream_id` when calling `create_live_stream_simulcast_target`") # noqa: E501 + if self.api_client.client_side_validation and ('live_stream_id' not in local_var_params or # noqa: E501 + local_var_params['live_stream_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `live_stream_id` when calling `create_live_stream_simulcast_target`") # noqa: E501 # verify the required parameter 'create_simulcast_target_request' is set - if ('create_simulcast_target_request' not in local_var_params or - local_var_params['create_simulcast_target_request'] is None): - raise ValueError("Missing the required parameter `create_simulcast_target_request` when calling `create_live_stream_simulcast_target`") # noqa: E501 + if self.api_client.client_side_validation and ('create_simulcast_target_request' not in local_var_params or # noqa: E501 + local_var_params['create_simulcast_target_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `create_simulcast_target_request` when calling `create_live_stream_simulcast_target`") # noqa: E501 collection_formats = {} @@ -318,6 +449,10 @@ def create_live_stream_simulcast_target_with_http_info(self, live_stream_id, cre # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 201: "SimulcastTargetResponse", + } return self.api_client.call_api( '/video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets', 'POST', @@ -327,70 +462,105 @@ def create_live_stream_simulcast_target_with_http_info(self, live_stream_id, cre body=body_params, post_params=form_params, files=local_var_files, - response_type='SimulcastTargetResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def delete_live_stream(self, live_stream_id, **kwargs): # noqa: E501 """Delete a live stream # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_live_stream(live_stream_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :return: None + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_live_stream_with_http_info(live_stream_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_live_stream_with_http_info(live_stream_id, **kwargs) # noqa: E501 - return data + return self.delete_live_stream_with_http_info(live_stream_id, **kwargs) # noqa: E501 def delete_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: E501 """Delete a live stream # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_live_stream_with_http_info(live_stream_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :return: None + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ local_var_params = locals() - all_params = ['live_stream_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'live_stream_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_live_stream" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'live_stream_id' is set - if ('live_stream_id' not in local_var_params or - local_var_params['live_stream_id'] is None): - raise ValueError("Missing the required parameter `live_stream_id` when calling `delete_live_stream`") # noqa: E501 + if self.api_client.client_side_validation and ('live_stream_id' not in local_var_params or # noqa: E501 + local_var_params['live_stream_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `live_stream_id` when calling `delete_live_stream`") # noqa: E501 collection_formats = {} @@ -408,6 +578,8 @@ def delete_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: body_params = None # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = {} return self.api_client.call_api( '/video/v1/live-streams/{LIVE_STREAM_ID}', 'DELETE', @@ -417,76 +589,114 @@ def delete_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def delete_live_stream_playback_id(self, live_stream_id, playback_id, **kwargs): # noqa: E501 """Delete a live stream playback ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_live_stream_playback_id(live_stream_id, playback_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :param str playback_id: The live stream's playback ID. (required) - :return: None + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param playback_id: The live stream's playback ID. (required) + :type playback_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_live_stream_playback_id_with_http_info(live_stream_id, playback_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_live_stream_playback_id_with_http_info(live_stream_id, playback_id, **kwargs) # noqa: E501 - return data + return self.delete_live_stream_playback_id_with_http_info(live_stream_id, playback_id, **kwargs) # noqa: E501 def delete_live_stream_playback_id_with_http_info(self, live_stream_id, playback_id, **kwargs): # noqa: E501 """Delete a live stream playback ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_live_stream_playback_id_with_http_info(live_stream_id, playback_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :param str playback_id: The live stream's playback ID. (required) - :return: None + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param playback_id: The live stream's playback ID. (required) + :type playback_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ local_var_params = locals() - all_params = ['live_stream_id', 'playback_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'live_stream_id', + 'playback_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_live_stream_playback_id" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'live_stream_id' is set - if ('live_stream_id' not in local_var_params or - local_var_params['live_stream_id'] is None): - raise ValueError("Missing the required parameter `live_stream_id` when calling `delete_live_stream_playback_id`") # noqa: E501 + if self.api_client.client_side_validation and ('live_stream_id' not in local_var_params or # noqa: E501 + local_var_params['live_stream_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `live_stream_id` when calling `delete_live_stream_playback_id`") # noqa: E501 # verify the required parameter 'playback_id' is set - if ('playback_id' not in local_var_params or - local_var_params['playback_id'] is None): - raise ValueError("Missing the required parameter `playback_id` when calling `delete_live_stream_playback_id`") # noqa: E501 + if self.api_client.client_side_validation and ('playback_id' not in local_var_params or # noqa: E501 + local_var_params['playback_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `playback_id` when calling `delete_live_stream_playback_id`") # noqa: E501 collection_formats = {} @@ -506,6 +716,8 @@ def delete_live_stream_playback_id_with_http_info(self, live_stream_id, playback body_params = None # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = {} return self.api_client.call_api( '/video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID}', 'DELETE', @@ -515,13 +727,14 @@ def delete_live_stream_playback_id_with_http_info(self, live_stream_id, playback body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def delete_live_stream_simulcast_target(self, live_stream_id, simulcast_target_id, **kwargs): # noqa: E501 """Delete a Live Stream Simulcast Target # noqa: E501 @@ -529,22 +742,31 @@ def delete_live_stream_simulcast_target(self, live_stream_id, simulcast_target_i Delete the simulcast target using the simulcast target ID returned when creating the simulcast target. Simulcast Target can only be deleted when the parent live stream is in idle state. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_live_stream_simulcast_target(live_stream_id, simulcast_target_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :param str simulcast_target_id: The ID of the simulcast target. (required) - :return: None + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param simulcast_target_id: The ID of the simulcast target. (required) + :type simulcast_target_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, **kwargs) # noqa: E501 - return data + return self.delete_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, **kwargs) # noqa: E501 def delete_live_stream_simulcast_target_with_http_info(self, live_stream_id, simulcast_target_id, **kwargs): # noqa: E501 """Delete a Live Stream Simulcast Target # noqa: E501 @@ -552,41 +774,69 @@ def delete_live_stream_simulcast_target_with_http_info(self, live_stream_id, sim Delete the simulcast target using the simulcast target ID returned when creating the simulcast target. Simulcast Target can only be deleted when the parent live stream is in idle state. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :param str simulcast_target_id: The ID of the simulcast target. (required) - :return: None + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param simulcast_target_id: The ID of the simulcast target. (required) + :type simulcast_target_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ local_var_params = locals() - all_params = ['live_stream_id', 'simulcast_target_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'live_stream_id', + 'simulcast_target_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_live_stream_simulcast_target" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'live_stream_id' is set - if ('live_stream_id' not in local_var_params or - local_var_params['live_stream_id'] is None): - raise ValueError("Missing the required parameter `live_stream_id` when calling `delete_live_stream_simulcast_target`") # noqa: E501 + if self.api_client.client_side_validation and ('live_stream_id' not in local_var_params or # noqa: E501 + local_var_params['live_stream_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `live_stream_id` when calling `delete_live_stream_simulcast_target`") # noqa: E501 # verify the required parameter 'simulcast_target_id' is set - if ('simulcast_target_id' not in local_var_params or - local_var_params['simulcast_target_id'] is None): - raise ValueError("Missing the required parameter `simulcast_target_id` when calling `delete_live_stream_simulcast_target`") # noqa: E501 + if self.api_client.client_side_validation and ('simulcast_target_id' not in local_var_params or # noqa: E501 + local_var_params['simulcast_target_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `simulcast_target_id` when calling `delete_live_stream_simulcast_target`") # noqa: E501 collection_formats = {} @@ -606,6 +856,8 @@ def delete_live_stream_simulcast_target_with_http_info(self, live_stream_id, sim body_params = None # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = {} return self.api_client.call_api( '/video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID}', 'DELETE', @@ -615,72 +867,107 @@ def delete_live_stream_simulcast_target_with_http_info(self, live_stream_id, sim body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def disable_live_stream(self, live_stream_id, **kwargs): # noqa: E501 """Disable a live stream # noqa: E501 - Disables a live stream, making it reject incoming RTMP streams until re-enabled. # noqa: E501 + Disables a live stream, making it reject incoming RTMP streams until re-enabled. The API also ends the live stream recording immediately when active. Ending the live stream recording adds the `EXT-X-ENDLIST` tag to the HLS manifest which notifies the player that this live stream is over. Mux also closes the encoder connection immediately. Any attempt from the encoder to re-establish connection will fail till the live stream is re-enabled. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.disable_live_stream(live_stream_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :return: DisableLiveStreamResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: DisableLiveStreamResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.disable_live_stream_with_http_info(live_stream_id, **kwargs) # noqa: E501 - else: - (data) = self.disable_live_stream_with_http_info(live_stream_id, **kwargs) # noqa: E501 - return data + return self.disable_live_stream_with_http_info(live_stream_id, **kwargs) # noqa: E501 def disable_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: E501 """Disable a live stream # noqa: E501 - Disables a live stream, making it reject incoming RTMP streams until re-enabled. # noqa: E501 + Disables a live stream, making it reject incoming RTMP streams until re-enabled. The API also ends the live stream recording immediately when active. Ending the live stream recording adds the `EXT-X-ENDLIST` tag to the HLS manifest which notifies the player that this live stream is over. Mux also closes the encoder connection immediately. Any attempt from the encoder to re-establish connection will fail till the live stream is re-enabled. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.disable_live_stream_with_http_info(live_stream_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :return: DisableLiveStreamResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(DisableLiveStreamResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['live_stream_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'live_stream_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method disable_live_stream" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'live_stream_id' is set - if ('live_stream_id' not in local_var_params or - local_var_params['live_stream_id'] is None): - raise ValueError("Missing the required parameter `live_stream_id` when calling `disable_live_stream`") # noqa: E501 + if self.api_client.client_side_validation and ('live_stream_id' not in local_var_params or # noqa: E501 + local_var_params['live_stream_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `live_stream_id` when calling `disable_live_stream`") # noqa: E501 collection_formats = {} @@ -702,6 +989,10 @@ def disable_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "DisableLiveStreamResponse", + } return self.api_client.call_api( '/video/v1/live-streams/{LIVE_STREAM_ID}/disable', 'PUT', @@ -711,13 +1002,14 @@ def disable_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: body=body_params, post_params=form_params, files=local_var_files, - response_type='DisableLiveStreamResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def enable_live_stream(self, live_stream_id, **kwargs): # noqa: E501 """Enable a live stream # noqa: E501 @@ -725,21 +1017,29 @@ def enable_live_stream(self, live_stream_id, **kwargs): # noqa: E501 Enables a live stream, allowing it to accept an incoming RTMP stream. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.enable_live_stream(live_stream_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :return: EnableLiveStreamResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: EnableLiveStreamResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.enable_live_stream_with_http_info(live_stream_id, **kwargs) # noqa: E501 - else: - (data) = self.enable_live_stream_with_http_info(live_stream_id, **kwargs) # noqa: E501 - return data + return self.enable_live_stream_with_http_info(live_stream_id, **kwargs) # noqa: E501 def enable_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: E501 """Enable a live stream # noqa: E501 @@ -747,36 +1047,62 @@ def enable_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: Enables a live stream, allowing it to accept an incoming RTMP stream. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.enable_live_stream_with_http_info(live_stream_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :return: EnableLiveStreamResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(EnableLiveStreamResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['live_stream_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'live_stream_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method enable_live_stream" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'live_stream_id' is set - if ('live_stream_id' not in local_var_params or - local_var_params['live_stream_id'] is None): - raise ValueError("Missing the required parameter `live_stream_id` when calling `enable_live_stream`") # noqa: E501 + if self.api_client.client_side_validation and ('live_stream_id' not in local_var_params or # noqa: E501 + local_var_params['live_stream_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `live_stream_id` when calling `enable_live_stream`") # noqa: E501 collection_formats = {} @@ -798,6 +1124,10 @@ def enable_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "EnableLiveStreamResponse", + } return self.api_client.call_api( '/video/v1/live-streams/{LIVE_STREAM_ID}/enable', 'PUT', @@ -807,13 +1137,14 @@ def enable_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: body=body_params, post_params=form_params, files=local_var_files, - response_type='EnableLiveStreamResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def get_live_stream(self, live_stream_id, **kwargs): # noqa: E501 """Retrieve a live stream # noqa: E501 @@ -821,21 +1152,29 @@ def get_live_stream(self, live_stream_id, **kwargs): # noqa: E501 Retrieves the details of a live stream that has previously been created. Supply the unique live stream ID that was returned from your previous request, and Mux will return the corresponding live stream information. The same information is returned when creating a live stream. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_live_stream(live_stream_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :return: LiveStreamResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: LiveStreamResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_live_stream_with_http_info(live_stream_id, **kwargs) # noqa: E501 - else: - (data) = self.get_live_stream_with_http_info(live_stream_id, **kwargs) # noqa: E501 - return data + return self.get_live_stream_with_http_info(live_stream_id, **kwargs) # noqa: E501 def get_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: E501 """Retrieve a live stream # noqa: E501 @@ -843,36 +1182,62 @@ def get_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: E50 Retrieves the details of a live stream that has previously been created. Supply the unique live stream ID that was returned from your previous request, and Mux will return the corresponding live stream information. The same information is returned when creating a live stream. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_live_stream_with_http_info(live_stream_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :return: LiveStreamResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(LiveStreamResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['live_stream_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'live_stream_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_live_stream" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'live_stream_id' is set - if ('live_stream_id' not in local_var_params or - local_var_params['live_stream_id'] is None): - raise ValueError("Missing the required parameter `live_stream_id` when calling `get_live_stream`") # noqa: E501 + if self.api_client.client_side_validation and ('live_stream_id' not in local_var_params or # noqa: E501 + local_var_params['live_stream_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `live_stream_id` when calling `get_live_stream`") # noqa: E501 collection_formats = {} @@ -894,6 +1259,10 @@ def get_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: E50 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "LiveStreamResponse", + } return self.api_client.call_api( '/video/v1/live-streams/{LIVE_STREAM_ID}', 'GET', @@ -903,13 +1272,14 @@ def get_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: E50 body=body_params, post_params=form_params, files=local_var_files, - response_type='LiveStreamResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def get_live_stream_simulcast_target(self, live_stream_id, simulcast_target_id, **kwargs): # noqa: E501 """Retrieve a Live Stream Simulcast Target # noqa: E501 @@ -917,22 +1287,31 @@ def get_live_stream_simulcast_target(self, live_stream_id, simulcast_target_id, Retrieves the details of the simulcast target created for the parent live stream. Supply the unique live stream ID and simulcast target ID that was returned in the response of create simulcast target request, and Mux will return the corresponding information. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_live_stream_simulcast_target(live_stream_id, simulcast_target_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :param str simulcast_target_id: The ID of the simulcast target. (required) - :return: SimulcastTargetResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param simulcast_target_id: The ID of the simulcast target. (required) + :type simulcast_target_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: SimulcastTargetResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, **kwargs) # noqa: E501 - else: - (data) = self.get_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, **kwargs) # noqa: E501 - return data + return self.get_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, **kwargs) # noqa: E501 def get_live_stream_simulcast_target_with_http_info(self, live_stream_id, simulcast_target_id, **kwargs): # noqa: E501 """Retrieve a Live Stream Simulcast Target # noqa: E501 @@ -940,41 +1319,69 @@ def get_live_stream_simulcast_target_with_http_info(self, live_stream_id, simulc Retrieves the details of the simulcast target created for the parent live stream. Supply the unique live stream ID and simulcast target ID that was returned in the response of create simulcast target request, and Mux will return the corresponding information. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :param str simulcast_target_id: The ID of the simulcast target. (required) - :return: SimulcastTargetResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param simulcast_target_id: The ID of the simulcast target. (required) + :type simulcast_target_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(SimulcastTargetResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['live_stream_id', 'simulcast_target_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'live_stream_id', + 'simulcast_target_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_live_stream_simulcast_target" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'live_stream_id' is set - if ('live_stream_id' not in local_var_params or - local_var_params['live_stream_id'] is None): - raise ValueError("Missing the required parameter `live_stream_id` when calling `get_live_stream_simulcast_target`") # noqa: E501 + if self.api_client.client_side_validation and ('live_stream_id' not in local_var_params or # noqa: E501 + local_var_params['live_stream_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `live_stream_id` when calling `get_live_stream_simulcast_target`") # noqa: E501 # verify the required parameter 'simulcast_target_id' is set - if ('simulcast_target_id' not in local_var_params or - local_var_params['simulcast_target_id'] is None): - raise ValueError("Missing the required parameter `simulcast_target_id` when calling `get_live_stream_simulcast_target`") # noqa: E501 + if self.api_client.client_side_validation and ('simulcast_target_id' not in local_var_params or # noqa: E501 + local_var_params['simulcast_target_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `simulcast_target_id` when calling `get_live_stream_simulcast_target`") # noqa: E501 collection_formats = {} @@ -998,6 +1405,10 @@ def get_live_stream_simulcast_target_with_http_info(self, live_stream_id, simulc # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "SimulcastTargetResponse", + } return self.api_client.call_api( '/video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID}', 'GET', @@ -1007,63 +1418,101 @@ def get_live_stream_simulcast_target_with_http_info(self, live_stream_id, simulc body=body_params, post_params=form_params, files=local_var_files, - response_type='SimulcastTargetResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_live_streams(self, **kwargs): # noqa: E501 """List live streams # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_live_streams(async_req=True) >>> result = thread.get() - :param async_req bool - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :return: ListLiveStreamsResponse + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListLiveStreamsResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_live_streams_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_live_streams_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_live_streams_with_http_info(**kwargs) # noqa: E501 def list_live_streams_with_http_info(self, **kwargs): # noqa: E501 """List live streams # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_live_streams_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :return: ListLiveStreamsResponse + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListLiveStreamsResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['limit', 'page'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'limit', + 'page' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_live_streams" % key ) @@ -1075,9 +1524,9 @@ def list_live_streams_with_http_info(self, **kwargs): # noqa: E501 path_params = {} query_params = [] - if 'limit' in local_var_params: + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'page' in local_var_params: + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 query_params.append(('page', local_var_params['page'])) # noqa: E501 header_params = {} @@ -1092,6 +1541,10 @@ def list_live_streams_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListLiveStreamsResponse", + } return self.api_client.call_api( '/video/v1/live-streams', 'GET', @@ -1101,13 +1554,14 @@ def list_live_streams_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListLiveStreamsResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def reset_stream_key(self, live_stream_id, **kwargs): # noqa: E501 """Reset a live stream’s stream key # noqa: E501 @@ -1115,21 +1569,29 @@ def reset_stream_key(self, live_stream_id, **kwargs): # noqa: E501 Reset a live stream key if you want to immediately stop the current stream key from working and create a new stream key that can be used for future broadcasts. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.reset_stream_key(live_stream_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :return: LiveStreamResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: LiveStreamResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.reset_stream_key_with_http_info(live_stream_id, **kwargs) # noqa: E501 - else: - (data) = self.reset_stream_key_with_http_info(live_stream_id, **kwargs) # noqa: E501 - return data + return self.reset_stream_key_with_http_info(live_stream_id, **kwargs) # noqa: E501 def reset_stream_key_with_http_info(self, live_stream_id, **kwargs): # noqa: E501 """Reset a live stream’s stream key # noqa: E501 @@ -1137,36 +1599,62 @@ def reset_stream_key_with_http_info(self, live_stream_id, **kwargs): # noqa: E5 Reset a live stream key if you want to immediately stop the current stream key from working and create a new stream key that can be used for future broadcasts. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.reset_stream_key_with_http_info(live_stream_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :return: LiveStreamResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(LiveStreamResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['live_stream_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'live_stream_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method reset_stream_key" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'live_stream_id' is set - if ('live_stream_id' not in local_var_params or - local_var_params['live_stream_id'] is None): - raise ValueError("Missing the required parameter `live_stream_id` when calling `reset_stream_key`") # noqa: E501 + if self.api_client.client_side_validation and ('live_stream_id' not in local_var_params or # noqa: E501 + local_var_params['live_stream_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `live_stream_id` when calling `reset_stream_key`") # noqa: E501 collection_formats = {} @@ -1188,6 +1676,10 @@ def reset_stream_key_with_http_info(self, live_stream_id, **kwargs): # noqa: E5 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 201: "LiveStreamResponse", + } return self.api_client.call_api( '/video/v1/live-streams/{LIVE_STREAM_ID}/reset-stream-key', 'POST', @@ -1197,72 +1689,107 @@ def reset_stream_key_with_http_info(self, live_stream_id, **kwargs): # noqa: E5 body=body_params, post_params=form_params, files=local_var_files, - response_type='LiveStreamResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def signal_live_stream_complete(self, live_stream_id, **kwargs): # noqa: E501 """Signal a live stream is finished # noqa: E501 - (Optional) Make the recorded asset available immediately instead of waiting for the reconnect_window. # noqa: E501 + (Optional) End the live stream recording immediately instead of waiting for the reconnect_window. `EXT-X-ENDLIST` tag is added to the HLS manifest which notifies the player that this live stream is over. Mux does not close the encoder connection immediately. Encoders are often configured to re-establish connections immediately which would result in a new recorded asset. For this reason, Mux waits for 60s before closing the connection with the encoder. This 60s timeframe is meant to give encoder operators a chance to disconnect from their end. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.signal_live_stream_complete(live_stream_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :return: SignalLiveStreamCompleteResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: SignalLiveStreamCompleteResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.signal_live_stream_complete_with_http_info(live_stream_id, **kwargs) # noqa: E501 - else: - (data) = self.signal_live_stream_complete_with_http_info(live_stream_id, **kwargs) # noqa: E501 - return data + return self.signal_live_stream_complete_with_http_info(live_stream_id, **kwargs) # noqa: E501 def signal_live_stream_complete_with_http_info(self, live_stream_id, **kwargs): # noqa: E501 """Signal a live stream is finished # noqa: E501 - (Optional) Make the recorded asset available immediately instead of waiting for the reconnect_window. # noqa: E501 + (Optional) End the live stream recording immediately instead of waiting for the reconnect_window. `EXT-X-ENDLIST` tag is added to the HLS manifest which notifies the player that this live stream is over. Mux does not close the encoder connection immediately. Encoders are often configured to re-establish connections immediately which would result in a new recorded asset. For this reason, Mux waits for 60s before closing the connection with the encoder. This 60s timeframe is meant to give encoder operators a chance to disconnect from their end. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.signal_live_stream_complete_with_http_info(live_stream_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str live_stream_id: The live stream ID (required) - :return: SignalLiveStreamCompleteResponse + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(SignalLiveStreamCompleteResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['live_stream_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'live_stream_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method signal_live_stream_complete" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'live_stream_id' is set - if ('live_stream_id' not in local_var_params or - local_var_params['live_stream_id'] is None): - raise ValueError("Missing the required parameter `live_stream_id` when calling `signal_live_stream_complete`") # noqa: E501 + if self.api_client.client_side_validation and ('live_stream_id' not in local_var_params or # noqa: E501 + local_var_params['live_stream_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `live_stream_id` when calling `signal_live_stream_complete`") # noqa: E501 collection_formats = {} @@ -1284,6 +1811,10 @@ def signal_live_stream_complete_with_http_info(self, live_stream_id, **kwargs): # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "SignalLiveStreamCompleteResponse", + } return self.api_client.call_api( '/video/v1/live-streams/{LIVE_STREAM_ID}/complete', 'PUT', @@ -1293,10 +1824,11 @@ def signal_live_stream_complete_with_http_info(self, live_stream_id, **kwargs): body=body_params, post_params=form_params, files=local_var_files, - response_type='SignalLiveStreamCompleteResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api/metrics_api.py b/mux_python/api/metrics_api.py index 247cba4..90770f7 100644 --- a/mux_python/api/metrics_api.py +++ b/mux_python/api/metrics_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class MetricsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -29,26 +42,39 @@ def get_metric_timeseries_data(self, metric_id, **kwargs): # noqa: E501 Returns timeseries data for a specific metric # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_metric_timeseries_data(metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str metric_id: ID of the Metric (required) - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param str measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. - :param str order_direction: Sort order. - :param str group_by: Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. - :return: GetMetricTimeseriesDataResponse + :param metric_id: ID of the Metric (required) + :type metric_id: str + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. + :type measurement: str + :param order_direction: Sort order. + :type order_direction: str + :param group_by: Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. + :type group_by: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: GetMetricTimeseriesDataResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_metric_timeseries_data_with_http_info(metric_id, **kwargs) # noqa: E501 - else: - (data) = self.get_metric_timeseries_data_with_http_info(metric_id, **kwargs) # noqa: E501 - return data + return self.get_metric_timeseries_data_with_http_info(metric_id, **kwargs) # noqa: E501 def get_metric_timeseries_data_with_http_info(self, metric_id, **kwargs): # noqa: E501 """Get metric timeseries data # noqa: E501 @@ -56,41 +82,77 @@ def get_metric_timeseries_data_with_http_info(self, metric_id, **kwargs): # noq Returns timeseries data for a specific metric # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_metric_timeseries_data_with_http_info(metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str metric_id: ID of the Metric (required) - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param str measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. - :param str order_direction: Sort order. - :param str group_by: Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. - :return: GetMetricTimeseriesDataResponse + :param metric_id: ID of the Metric (required) + :type metric_id: str + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. + :type measurement: str + :param order_direction: Sort order. + :type order_direction: str + :param group_by: Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. + :type group_by: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(GetMetricTimeseriesDataResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['metric_id', 'timeframe', 'filters', 'measurement', 'order_direction', 'group_by'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'metric_id', + 'timeframe', + 'filters', + 'measurement', + 'order_direction', + 'group_by' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_metric_timeseries_data" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'metric_id' is set - if ('metric_id' not in local_var_params or - local_var_params['metric_id'] is None): - raise ValueError("Missing the required parameter `metric_id` when calling `get_metric_timeseries_data`") # noqa: E501 + if self.api_client.client_side_validation and ('metric_id' not in local_var_params or # noqa: E501 + local_var_params['metric_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `metric_id` when calling `get_metric_timeseries_data`") # noqa: E501 collection_formats = {} @@ -99,17 +161,17 @@ def get_metric_timeseries_data_with_http_info(self, metric_id, **kwargs): # noq path_params['METRIC_ID'] = local_var_params['metric_id'] # noqa: E501 query_params = [] - if 'timeframe' in local_var_params: + if 'timeframe' in local_var_params and local_var_params['timeframe'] is not None: # noqa: E501 query_params.append(('timeframe[]', local_var_params['timeframe'])) # noqa: E501 collection_formats['timeframe[]'] = 'multi' # noqa: E501 - if 'filters' in local_var_params: + if 'filters' in local_var_params and local_var_params['filters'] is not None: # noqa: E501 query_params.append(('filters[]', local_var_params['filters'])) # noqa: E501 collection_formats['filters[]'] = 'multi' # noqa: E501 - if 'measurement' in local_var_params: + if 'measurement' in local_var_params and local_var_params['measurement'] is not None: # noqa: E501 query_params.append(('measurement', local_var_params['measurement'])) # noqa: E501 - if 'order_direction' in local_var_params: + if 'order_direction' in local_var_params and local_var_params['order_direction'] is not None: # noqa: E501 query_params.append(('order_direction', local_var_params['order_direction'])) # noqa: E501 - if 'group_by' in local_var_params: + if 'group_by' in local_var_params and local_var_params['group_by'] is not None: # noqa: E501 query_params.append(('group_by', local_var_params['group_by'])) # noqa: E501 header_params = {} @@ -124,6 +186,10 @@ def get_metric_timeseries_data_with_http_info(self, metric_id, **kwargs): # noq # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "GetMetricTimeseriesDataResponse", + } return self.api_client.call_api( '/data/v1/metrics/{METRIC_ID}/timeseries', 'GET', @@ -133,13 +199,14 @@ def get_metric_timeseries_data_with_http_info(self, metric_id, **kwargs): # noq body=body_params, post_params=form_params, files=local_var_files, - response_type='GetMetricTimeseriesDataResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def get_overall_values(self, metric_id, **kwargs): # noqa: E501 """Get Overall values # noqa: E501 @@ -147,24 +214,35 @@ def get_overall_values(self, metric_id, **kwargs): # noqa: E501 Returns the overall value for a specific metric, as well as the total view count, watch time, and the Mux Global metric value for the metric. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_overall_values(metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str metric_id: ID of the Metric (required) - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param str measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. - :return: GetOverallValuesResponse + :param metric_id: ID of the Metric (required) + :type metric_id: str + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. + :type measurement: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: GetOverallValuesResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_overall_values_with_http_info(metric_id, **kwargs) # noqa: E501 - else: - (data) = self.get_overall_values_with_http_info(metric_id, **kwargs) # noqa: E501 - return data + return self.get_overall_values_with_http_info(metric_id, **kwargs) # noqa: E501 def get_overall_values_with_http_info(self, metric_id, **kwargs): # noqa: E501 """Get Overall values # noqa: E501 @@ -172,39 +250,71 @@ def get_overall_values_with_http_info(self, metric_id, **kwargs): # noqa: E501 Returns the overall value for a specific metric, as well as the total view count, watch time, and the Mux Global metric value for the metric. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_overall_values_with_http_info(metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str metric_id: ID of the Metric (required) - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param str measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. - :return: GetOverallValuesResponse + :param metric_id: ID of the Metric (required) + :type metric_id: str + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. + :type measurement: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(GetOverallValuesResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['metric_id', 'timeframe', 'filters', 'measurement'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'metric_id', + 'timeframe', + 'filters', + 'measurement' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_overall_values" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'metric_id' is set - if ('metric_id' not in local_var_params or - local_var_params['metric_id'] is None): - raise ValueError("Missing the required parameter `metric_id` when calling `get_overall_values`") # noqa: E501 + if self.api_client.client_side_validation and ('metric_id' not in local_var_params or # noqa: E501 + local_var_params['metric_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `metric_id` when calling `get_overall_values`") # noqa: E501 collection_formats = {} @@ -213,13 +323,13 @@ def get_overall_values_with_http_info(self, metric_id, **kwargs): # noqa: E501 path_params['METRIC_ID'] = local_var_params['metric_id'] # noqa: E501 query_params = [] - if 'timeframe' in local_var_params: + if 'timeframe' in local_var_params and local_var_params['timeframe'] is not None: # noqa: E501 query_params.append(('timeframe[]', local_var_params['timeframe'])) # noqa: E501 collection_formats['timeframe[]'] = 'multi' # noqa: E501 - if 'filters' in local_var_params: + if 'filters' in local_var_params and local_var_params['filters'] is not None: # noqa: E501 query_params.append(('filters[]', local_var_params['filters'])) # noqa: E501 collection_formats['filters[]'] = 'multi' # noqa: E501 - if 'measurement' in local_var_params: + if 'measurement' in local_var_params and local_var_params['measurement'] is not None: # noqa: E501 query_params.append(('measurement', local_var_params['measurement'])) # noqa: E501 header_params = {} @@ -234,6 +344,10 @@ def get_overall_values_with_http_info(self, metric_id, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "GetOverallValuesResponse", + } return self.api_client.call_api( '/data/v1/metrics/{METRIC_ID}/overall', 'GET', @@ -243,13 +357,14 @@ def get_overall_values_with_http_info(self, metric_id, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='GetOverallValuesResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_all_metric_values(self, **kwargs): # noqa: E501 """List all metric values # noqa: E501 @@ -257,24 +372,35 @@ def list_all_metric_values(self, **kwargs): # noqa: E501 List all of the values across every breakdown for a specific metric # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_all_metric_values(async_req=True) >>> result = thread.get() - :param async_req bool - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param str dimension: Dimension the specified value belongs to - :param str value: Value to show all available metrics for - :return: ListAllMetricValuesResponse + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param dimension: Dimension the specified value belongs to + :type dimension: str + :param value: Value to show all available metrics for + :type value: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListAllMetricValuesResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_all_metric_values_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_all_metric_values_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_all_metric_values_with_http_info(**kwargs) # noqa: E501 def list_all_metric_values_with_http_info(self, **kwargs): # noqa: E501 """List all metric values # noqa: E501 @@ -282,30 +408,62 @@ def list_all_metric_values_with_http_info(self, **kwargs): # noqa: E501 List all of the values across every breakdown for a specific metric # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_all_metric_values_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param str dimension: Dimension the specified value belongs to - :param str value: Value to show all available metrics for - :return: ListAllMetricValuesResponse + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param dimension: Dimension the specified value belongs to + :type dimension: str + :param value: Value to show all available metrics for + :type value: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListAllMetricValuesResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['timeframe', 'filters', 'dimension', 'value'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'timeframe', + 'filters', + 'dimension', + 'value' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_all_metric_values" % key ) @@ -317,15 +475,15 @@ def list_all_metric_values_with_http_info(self, **kwargs): # noqa: E501 path_params = {} query_params = [] - if 'timeframe' in local_var_params: + if 'timeframe' in local_var_params and local_var_params['timeframe'] is not None: # noqa: E501 query_params.append(('timeframe[]', local_var_params['timeframe'])) # noqa: E501 collection_formats['timeframe[]'] = 'multi' # noqa: E501 - if 'filters' in local_var_params: + if 'filters' in local_var_params and local_var_params['filters'] is not None: # noqa: E501 query_params.append(('filters[]', local_var_params['filters'])) # noqa: E501 collection_formats['filters[]'] = 'multi' # noqa: E501 - if 'dimension' in local_var_params: + if 'dimension' in local_var_params and local_var_params['dimension'] is not None: # noqa: E501 query_params.append(('dimension', local_var_params['dimension'])) # noqa: E501 - if 'value' in local_var_params: + if 'value' in local_var_params and local_var_params['value'] is not None: # noqa: E501 query_params.append(('value', local_var_params['value'])) # noqa: E501 header_params = {} @@ -340,6 +498,10 @@ def list_all_metric_values_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListAllMetricValuesResponse", + } return self.api_client.call_api( '/data/v1/metrics/comparison', 'GET', @@ -349,13 +511,14 @@ def list_all_metric_values_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListAllMetricValuesResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_breakdown_values(self, metric_id, **kwargs): # noqa: E501 """List breakdown values # noqa: E501 @@ -363,29 +526,45 @@ def list_breakdown_values(self, metric_id, **kwargs): # noqa: E501 List the breakdown values for a specific metric # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_breakdown_values(metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str metric_id: ID of the Metric (required) - :param str group_by: Breakdown value to group the results by - :param str measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :param str order_by: Value to order the results by - :param str order_direction: Sort order. - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :return: ListBreakdownValuesResponse + :param metric_id: ID of the Metric (required) + :type metric_id: str + :param group_by: Breakdown value to group the results by + :type group_by: str + :param measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. + :type measurement: str + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param order_by: Value to order the results by + :type order_by: str + :param order_direction: Sort order. + :type order_direction: str + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListBreakdownValuesResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_breakdown_values_with_http_info(metric_id, **kwargs) # noqa: E501 - else: - (data) = self.list_breakdown_values_with_http_info(metric_id, **kwargs) # noqa: E501 - return data + return self.list_breakdown_values_with_http_info(metric_id, **kwargs) # noqa: E501 def list_breakdown_values_with_http_info(self, metric_id, **kwargs): # noqa: E501 """List breakdown values # noqa: E501 @@ -393,44 +572,86 @@ def list_breakdown_values_with_http_info(self, metric_id, **kwargs): # noqa: E5 List the breakdown values for a specific metric # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_breakdown_values_with_http_info(metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str metric_id: ID of the Metric (required) - :param str group_by: Breakdown value to group the results by - :param str measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :param str order_by: Value to order the results by - :param str order_direction: Sort order. - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :return: ListBreakdownValuesResponse + :param metric_id: ID of the Metric (required) + :type metric_id: str + :param group_by: Breakdown value to group the results by + :type group_by: str + :param measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. + :type measurement: str + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param order_by: Value to order the results by + :type order_by: str + :param order_direction: Sort order. + :type order_direction: str + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListBreakdownValuesResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['metric_id', 'group_by', 'measurement', 'filters', 'limit', 'page', 'order_by', 'order_direction', 'timeframe'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'metric_id', + 'group_by', + 'measurement', + 'filters', + 'limit', + 'page', + 'order_by', + 'order_direction', + 'timeframe' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_breakdown_values" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'metric_id' is set - if ('metric_id' not in local_var_params or - local_var_params['metric_id'] is None): - raise ValueError("Missing the required parameter `metric_id` when calling `list_breakdown_values`") # noqa: E501 + if self.api_client.client_side_validation and ('metric_id' not in local_var_params or # noqa: E501 + local_var_params['metric_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `metric_id` when calling `list_breakdown_values`") # noqa: E501 collection_formats = {} @@ -439,22 +660,22 @@ def list_breakdown_values_with_http_info(self, metric_id, **kwargs): # noqa: E5 path_params['METRIC_ID'] = local_var_params['metric_id'] # noqa: E501 query_params = [] - if 'group_by' in local_var_params: + if 'group_by' in local_var_params and local_var_params['group_by'] is not None: # noqa: E501 query_params.append(('group_by', local_var_params['group_by'])) # noqa: E501 - if 'measurement' in local_var_params: + if 'measurement' in local_var_params and local_var_params['measurement'] is not None: # noqa: E501 query_params.append(('measurement', local_var_params['measurement'])) # noqa: E501 - if 'filters' in local_var_params: + if 'filters' in local_var_params and local_var_params['filters'] is not None: # noqa: E501 query_params.append(('filters[]', local_var_params['filters'])) # noqa: E501 collection_formats['filters[]'] = 'multi' # noqa: E501 - if 'limit' in local_var_params: + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'page' in local_var_params: + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'order_by' in local_var_params: + if 'order_by' in local_var_params and local_var_params['order_by'] is not None: # noqa: E501 query_params.append(('order_by', local_var_params['order_by'])) # noqa: E501 - if 'order_direction' in local_var_params: + if 'order_direction' in local_var_params and local_var_params['order_direction'] is not None: # noqa: E501 query_params.append(('order_direction', local_var_params['order_direction'])) # noqa: E501 - if 'timeframe' in local_var_params: + if 'timeframe' in local_var_params and local_var_params['timeframe'] is not None: # noqa: E501 query_params.append(('timeframe[]', local_var_params['timeframe'])) # noqa: E501 collection_formats['timeframe[]'] = 'multi' # noqa: E501 @@ -470,6 +691,10 @@ def list_breakdown_values_with_http_info(self, metric_id, **kwargs): # noqa: E5 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListBreakdownValuesResponse", + } return self.api_client.call_api( '/data/v1/metrics/{METRIC_ID}/breakdown', 'GET', @@ -479,13 +704,14 @@ def list_breakdown_values_with_http_info(self, metric_id, **kwargs): # noqa: E5 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListBreakdownValuesResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_insights(self, metric_id, **kwargs): # noqa: E501 """List Insights # noqa: E501 @@ -493,24 +719,35 @@ def list_insights(self, metric_id, **kwargs): # noqa: E501 Returns a list of insights for a metric. These are the worst performing values across all breakdowns sorted by how much they negatively impact a specific metric. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_insights(metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str metric_id: ID of the Metric (required) - :param str measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. - :param str order_direction: Sort order. - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :return: ListInsightsResponse + :param metric_id: ID of the Metric (required) + :type metric_id: str + :param measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. + :type measurement: str + :param order_direction: Sort order. + :type order_direction: str + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListInsightsResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_insights_with_http_info(metric_id, **kwargs) # noqa: E501 - else: - (data) = self.list_insights_with_http_info(metric_id, **kwargs) # noqa: E501 - return data + return self.list_insights_with_http_info(metric_id, **kwargs) # noqa: E501 def list_insights_with_http_info(self, metric_id, **kwargs): # noqa: E501 """List Insights # noqa: E501 @@ -518,39 +755,71 @@ def list_insights_with_http_info(self, metric_id, **kwargs): # noqa: E501 Returns a list of insights for a metric. These are the worst performing values across all breakdowns sorted by how much they negatively impact a specific metric. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_insights_with_http_info(metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str metric_id: ID of the Metric (required) - :param str measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. - :param str order_direction: Sort order. - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :return: ListInsightsResponse + :param metric_id: ID of the Metric (required) + :type metric_id: str + :param measurement: Measurement for the provided metric. If omitted, the deafult for the metric will be used. + :type measurement: str + :param order_direction: Sort order. + :type order_direction: str + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListInsightsResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['metric_id', 'measurement', 'order_direction', 'timeframe'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'metric_id', + 'measurement', + 'order_direction', + 'timeframe' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_insights" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'metric_id' is set - if ('metric_id' not in local_var_params or - local_var_params['metric_id'] is None): - raise ValueError("Missing the required parameter `metric_id` when calling `list_insights`") # noqa: E501 + if self.api_client.client_side_validation and ('metric_id' not in local_var_params or # noqa: E501 + local_var_params['metric_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `metric_id` when calling `list_insights`") # noqa: E501 collection_formats = {} @@ -559,11 +828,11 @@ def list_insights_with_http_info(self, metric_id, **kwargs): # noqa: E501 path_params['METRIC_ID'] = local_var_params['metric_id'] # noqa: E501 query_params = [] - if 'measurement' in local_var_params: + if 'measurement' in local_var_params and local_var_params['measurement'] is not None: # noqa: E501 query_params.append(('measurement', local_var_params['measurement'])) # noqa: E501 - if 'order_direction' in local_var_params: + if 'order_direction' in local_var_params and local_var_params['order_direction'] is not None: # noqa: E501 query_params.append(('order_direction', local_var_params['order_direction'])) # noqa: E501 - if 'timeframe' in local_var_params: + if 'timeframe' in local_var_params and local_var_params['timeframe'] is not None: # noqa: E501 query_params.append(('timeframe[]', local_var_params['timeframe'])) # noqa: E501 collection_formats['timeframe[]'] = 'multi' # noqa: E501 @@ -579,6 +848,10 @@ def list_insights_with_http_info(self, metric_id, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListInsightsResponse", + } return self.api_client.call_api( '/data/v1/metrics/{METRIC_ID}/insights', 'GET', @@ -588,10 +861,11 @@ def list_insights_with_http_info(self, metric_id, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListInsightsResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api/playback_id_api.py b/mux_python/api/playback_id_api.py index 7808d2a..bed65c5 100644 --- a/mux_python/api/playback_id_api.py +++ b/mux_python/api/playback_id_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class PlaybackIDApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -29,21 +42,29 @@ def get_asset_or_livestream_id(self, playback_id, **kwargs): # noqa: E501 Retrieves the Identifier of the Asset or Live Stream associated with the Playback ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_asset_or_livestream_id(playback_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str playback_id: The live stream's playback ID. (required) - :return: GetAssetOrLiveStreamIdResponse + :param playback_id: The live stream's playback ID. (required) + :type playback_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: GetAssetOrLiveStreamIdResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_asset_or_livestream_id_with_http_info(playback_id, **kwargs) # noqa: E501 - else: - (data) = self.get_asset_or_livestream_id_with_http_info(playback_id, **kwargs) # noqa: E501 - return data + return self.get_asset_or_livestream_id_with_http_info(playback_id, **kwargs) # noqa: E501 def get_asset_or_livestream_id_with_http_info(self, playback_id, **kwargs): # noqa: E501 """Retrieve an Asset or Live Stream ID # noqa: E501 @@ -51,36 +72,62 @@ def get_asset_or_livestream_id_with_http_info(self, playback_id, **kwargs): # n Retrieves the Identifier of the Asset or Live Stream associated with the Playback ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_asset_or_livestream_id_with_http_info(playback_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str playback_id: The live stream's playback ID. (required) - :return: GetAssetOrLiveStreamIdResponse + :param playback_id: The live stream's playback ID. (required) + :type playback_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(GetAssetOrLiveStreamIdResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['playback_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'playback_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_asset_or_livestream_id" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'playback_id' is set - if ('playback_id' not in local_var_params or - local_var_params['playback_id'] is None): - raise ValueError("Missing the required parameter `playback_id` when calling `get_asset_or_livestream_id`") # noqa: E501 + if self.api_client.client_side_validation and ('playback_id' not in local_var_params or # noqa: E501 + local_var_params['playback_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `playback_id` when calling `get_asset_or_livestream_id`") # noqa: E501 collection_formats = {} @@ -102,6 +149,10 @@ def get_asset_or_livestream_id_with_http_info(self, playback_id, **kwargs): # n # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "GetAssetOrLiveStreamIdResponse", + } return self.api_client.call_api( '/video/v1/playback-ids/{PLAYBACK_ID}', 'GET', @@ -111,10 +162,11 @@ def get_asset_or_livestream_id_with_http_info(self, playback_id, **kwargs): # n body=body_params, post_params=form_params, files=local_var_files, - response_type='GetAssetOrLiveStreamIdResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api/real_time_api.py b/mux_python/api/real_time_api.py index b9edaf3..b0ced4b 100644 --- a/mux_python/api/real_time_api.py +++ b/mux_python/api/real_time_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class RealTimeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -29,26 +42,39 @@ def get_realtime_breakdown(self, realtime_metric_id, **kwargs): # noqa: E501 Gets breakdown information for a specific dimension and metric along with the number of concurrent viewers and negative impact score. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_realtime_breakdown(realtime_metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str realtime_metric_id: ID of the Realtime Metric (required) - :param str dimension: Dimension the specified value belongs to - :param float timestamp: Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param str order_by: Value to order the results by - :param str order_direction: Sort order. - :return: GetRealTimeBreakdownResponse + :param realtime_metric_id: ID of the Realtime Metric (required) + :type realtime_metric_id: str + :param dimension: Dimension the specified value belongs to + :type dimension: str + :param timestamp: Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. + :type timestamp: float + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param order_by: Value to order the results by + :type order_by: str + :param order_direction: Sort order. + :type order_direction: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: GetRealTimeBreakdownResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_realtime_breakdown_with_http_info(realtime_metric_id, **kwargs) # noqa: E501 - else: - (data) = self.get_realtime_breakdown_with_http_info(realtime_metric_id, **kwargs) # noqa: E501 - return data + return self.get_realtime_breakdown_with_http_info(realtime_metric_id, **kwargs) # noqa: E501 def get_realtime_breakdown_with_http_info(self, realtime_metric_id, **kwargs): # noqa: E501 """Get Real-Time Breakdown # noqa: E501 @@ -56,41 +82,77 @@ def get_realtime_breakdown_with_http_info(self, realtime_metric_id, **kwargs): Gets breakdown information for a specific dimension and metric along with the number of concurrent viewers and negative impact score. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_realtime_breakdown_with_http_info(realtime_metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str realtime_metric_id: ID of the Realtime Metric (required) - :param str dimension: Dimension the specified value belongs to - :param float timestamp: Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param str order_by: Value to order the results by - :param str order_direction: Sort order. - :return: GetRealTimeBreakdownResponse + :param realtime_metric_id: ID of the Realtime Metric (required) + :type realtime_metric_id: str + :param dimension: Dimension the specified value belongs to + :type dimension: str + :param timestamp: Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. + :type timestamp: float + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param order_by: Value to order the results by + :type order_by: str + :param order_direction: Sort order. + :type order_direction: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(GetRealTimeBreakdownResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['realtime_metric_id', 'dimension', 'timestamp', 'filters', 'order_by', 'order_direction'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'realtime_metric_id', + 'dimension', + 'timestamp', + 'filters', + 'order_by', + 'order_direction' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_realtime_breakdown" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'realtime_metric_id' is set - if ('realtime_metric_id' not in local_var_params or - local_var_params['realtime_metric_id'] is None): - raise ValueError("Missing the required parameter `realtime_metric_id` when calling `get_realtime_breakdown`") # noqa: E501 + if self.api_client.client_side_validation and ('realtime_metric_id' not in local_var_params or # noqa: E501 + local_var_params['realtime_metric_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `realtime_metric_id` when calling `get_realtime_breakdown`") # noqa: E501 collection_formats = {} @@ -99,16 +161,16 @@ def get_realtime_breakdown_with_http_info(self, realtime_metric_id, **kwargs): path_params['REALTIME_METRIC_ID'] = local_var_params['realtime_metric_id'] # noqa: E501 query_params = [] - if 'dimension' in local_var_params: + if 'dimension' in local_var_params and local_var_params['dimension'] is not None: # noqa: E501 query_params.append(('dimension', local_var_params['dimension'])) # noqa: E501 - if 'timestamp' in local_var_params: + if 'timestamp' in local_var_params and local_var_params['timestamp'] is not None: # noqa: E501 query_params.append(('timestamp', local_var_params['timestamp'])) # noqa: E501 - if 'filters' in local_var_params: + if 'filters' in local_var_params and local_var_params['filters'] is not None: # noqa: E501 query_params.append(('filters[]', local_var_params['filters'])) # noqa: E501 collection_formats['filters[]'] = 'multi' # noqa: E501 - if 'order_by' in local_var_params: + if 'order_by' in local_var_params and local_var_params['order_by'] is not None: # noqa: E501 query_params.append(('order_by', local_var_params['order_by'])) # noqa: E501 - if 'order_direction' in local_var_params: + if 'order_direction' in local_var_params and local_var_params['order_direction'] is not None: # noqa: E501 query_params.append(('order_direction', local_var_params['order_direction'])) # noqa: E501 header_params = {} @@ -123,6 +185,10 @@ def get_realtime_breakdown_with_http_info(self, realtime_metric_id, **kwargs): # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "GetRealTimeBreakdownResponse", + } return self.api_client.call_api( '/data/v1/realtime/metrics/{REALTIME_METRIC_ID}/breakdown', 'GET', @@ -132,13 +198,14 @@ def get_realtime_breakdown_with_http_info(self, realtime_metric_id, **kwargs): body=body_params, post_params=form_params, files=local_var_files, - response_type='GetRealTimeBreakdownResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def get_realtime_histogram_timeseries(self, realtime_metric_id, **kwargs): # noqa: E501 """Get Real-Time Histogram Timeseries # noqa: E501 @@ -146,22 +213,31 @@ def get_realtime_histogram_timeseries(self, realtime_metric_id, **kwargs): # no Gets histogram timeseries information for a specific metric. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_realtime_histogram_timeseries(realtime_metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str realtime_metric_id: ID of the Realtime Metric (required) - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :return: GetRealTimeHistogramTimeseriesResponse + :param realtime_metric_id: ID of the Realtime Metric (required) + :type realtime_metric_id: str + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: GetRealTimeHistogramTimeseriesResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_realtime_histogram_timeseries_with_http_info(realtime_metric_id, **kwargs) # noqa: E501 - else: - (data) = self.get_realtime_histogram_timeseries_with_http_info(realtime_metric_id, **kwargs) # noqa: E501 - return data + return self.get_realtime_histogram_timeseries_with_http_info(realtime_metric_id, **kwargs) # noqa: E501 def get_realtime_histogram_timeseries_with_http_info(self, realtime_metric_id, **kwargs): # noqa: E501 """Get Real-Time Histogram Timeseries # noqa: E501 @@ -169,37 +245,65 @@ def get_realtime_histogram_timeseries_with_http_info(self, realtime_metric_id, * Gets histogram timeseries information for a specific metric. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_realtime_histogram_timeseries_with_http_info(realtime_metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str realtime_metric_id: ID of the Realtime Metric (required) - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :return: GetRealTimeHistogramTimeseriesResponse + :param realtime_metric_id: ID of the Realtime Metric (required) + :type realtime_metric_id: str + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(GetRealTimeHistogramTimeseriesResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['realtime_metric_id', 'filters'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'realtime_metric_id', + 'filters' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_realtime_histogram_timeseries" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'realtime_metric_id' is set - if ('realtime_metric_id' not in local_var_params or - local_var_params['realtime_metric_id'] is None): - raise ValueError("Missing the required parameter `realtime_metric_id` when calling `get_realtime_histogram_timeseries`") # noqa: E501 + if self.api_client.client_side_validation and ('realtime_metric_id' not in local_var_params or # noqa: E501 + local_var_params['realtime_metric_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `realtime_metric_id` when calling `get_realtime_histogram_timeseries`") # noqa: E501 collection_formats = {} @@ -208,7 +312,7 @@ def get_realtime_histogram_timeseries_with_http_info(self, realtime_metric_id, * path_params['REALTIME_METRIC_ID'] = local_var_params['realtime_metric_id'] # noqa: E501 query_params = [] - if 'filters' in local_var_params: + if 'filters' in local_var_params and local_var_params['filters'] is not None: # noqa: E501 query_params.append(('filters[]', local_var_params['filters'])) # noqa: E501 collection_formats['filters[]'] = 'multi' # noqa: E501 @@ -224,6 +328,10 @@ def get_realtime_histogram_timeseries_with_http_info(self, realtime_metric_id, * # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "GetRealTimeHistogramTimeseriesResponse", + } return self.api_client.call_api( '/data/v1/realtime/metrics/{REALTIME_METRIC_ID}/histogram-timeseries', 'GET', @@ -233,13 +341,14 @@ def get_realtime_histogram_timeseries_with_http_info(self, realtime_metric_id, * body=body_params, post_params=form_params, files=local_var_files, - response_type='GetRealTimeHistogramTimeseriesResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def get_realtime_timeseries(self, realtime_metric_id, **kwargs): # noqa: E501 """Get Real-Time Timeseries # noqa: E501 @@ -247,22 +356,31 @@ def get_realtime_timeseries(self, realtime_metric_id, **kwargs): # noqa: E501 Gets Time series information for a specific metric along with the number of concurrent viewers. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_realtime_timeseries(realtime_metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str realtime_metric_id: ID of the Realtime Metric (required) - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :return: GetRealTimeTimeseriesResponse + :param realtime_metric_id: ID of the Realtime Metric (required) + :type realtime_metric_id: str + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: GetRealTimeTimeseriesResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_realtime_timeseries_with_http_info(realtime_metric_id, **kwargs) # noqa: E501 - else: - (data) = self.get_realtime_timeseries_with_http_info(realtime_metric_id, **kwargs) # noqa: E501 - return data + return self.get_realtime_timeseries_with_http_info(realtime_metric_id, **kwargs) # noqa: E501 def get_realtime_timeseries_with_http_info(self, realtime_metric_id, **kwargs): # noqa: E501 """Get Real-Time Timeseries # noqa: E501 @@ -270,37 +388,65 @@ def get_realtime_timeseries_with_http_info(self, realtime_metric_id, **kwargs): Gets Time series information for a specific metric along with the number of concurrent viewers. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_realtime_timeseries_with_http_info(realtime_metric_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str realtime_metric_id: ID of the Realtime Metric (required) - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :return: GetRealTimeTimeseriesResponse + :param realtime_metric_id: ID of the Realtime Metric (required) + :type realtime_metric_id: str + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(GetRealTimeTimeseriesResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['realtime_metric_id', 'filters'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'realtime_metric_id', + 'filters' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_realtime_timeseries" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'realtime_metric_id' is set - if ('realtime_metric_id' not in local_var_params or - local_var_params['realtime_metric_id'] is None): - raise ValueError("Missing the required parameter `realtime_metric_id` when calling `get_realtime_timeseries`") # noqa: E501 + if self.api_client.client_side_validation and ('realtime_metric_id' not in local_var_params or # noqa: E501 + local_var_params['realtime_metric_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `realtime_metric_id` when calling `get_realtime_timeseries`") # noqa: E501 collection_formats = {} @@ -309,7 +455,7 @@ def get_realtime_timeseries_with_http_info(self, realtime_metric_id, **kwargs): path_params['REALTIME_METRIC_ID'] = local_var_params['realtime_metric_id'] # noqa: E501 query_params = [] - if 'filters' in local_var_params: + if 'filters' in local_var_params and local_var_params['filters'] is not None: # noqa: E501 query_params.append(('filters[]', local_var_params['filters'])) # noqa: E501 collection_formats['filters[]'] = 'multi' # noqa: E501 @@ -325,6 +471,10 @@ def get_realtime_timeseries_with_http_info(self, realtime_metric_id, **kwargs): # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "GetRealTimeTimeseriesResponse", + } return self.api_client.call_api( '/data/v1/realtime/metrics/{REALTIME_METRIC_ID}/timeseries', 'GET', @@ -334,13 +484,14 @@ def get_realtime_timeseries_with_http_info(self, realtime_metric_id, **kwargs): body=body_params, post_params=form_params, files=local_var_files, - response_type='GetRealTimeTimeseriesResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_realtime_dimensions(self, **kwargs): # noqa: E501 """List Real-Time Dimensions # noqa: E501 @@ -348,20 +499,27 @@ def list_realtime_dimensions(self, **kwargs): # noqa: E501 Lists availiable real-time dimensions # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_realtime_dimensions(async_req=True) >>> result = thread.get() - :param async_req bool - :return: ListRealTimeDimensionsResponse + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListRealTimeDimensionsResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_realtime_dimensions_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_realtime_dimensions_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_realtime_dimensions_with_http_info(**kwargs) # noqa: E501 def list_realtime_dimensions_with_http_info(self, **kwargs): # noqa: E501 """List Real-Time Dimensions # noqa: E501 @@ -369,26 +527,50 @@ def list_realtime_dimensions_with_http_info(self, **kwargs): # noqa: E501 Lists availiable real-time dimensions # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_realtime_dimensions_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :return: ListRealTimeDimensionsResponse + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListRealTimeDimensionsResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_realtime_dimensions" % key ) @@ -413,6 +595,10 @@ def list_realtime_dimensions_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListRealTimeDimensionsResponse", + } return self.api_client.call_api( '/data/v1/realtime/dimensions', 'GET', @@ -422,13 +608,14 @@ def list_realtime_dimensions_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListRealTimeDimensionsResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_realtime_metrics(self, **kwargs): # noqa: E501 """List Real-Time Metrics # noqa: E501 @@ -436,20 +623,27 @@ def list_realtime_metrics(self, **kwargs): # noqa: E501 Lists availiable real-time metrics. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_realtime_metrics(async_req=True) >>> result = thread.get() - :param async_req bool - :return: ListRealTimeMetricsResponse + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListRealTimeMetricsResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_realtime_metrics_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_realtime_metrics_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_realtime_metrics_with_http_info(**kwargs) # noqa: E501 def list_realtime_metrics_with_http_info(self, **kwargs): # noqa: E501 """List Real-Time Metrics # noqa: E501 @@ -457,26 +651,50 @@ def list_realtime_metrics_with_http_info(self, **kwargs): # noqa: E501 Lists availiable real-time metrics. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_realtime_metrics_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :return: ListRealTimeMetricsResponse + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListRealTimeMetricsResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_realtime_metrics" % key ) @@ -501,6 +719,10 @@ def list_realtime_metrics_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListRealTimeMetricsResponse", + } return self.api_client.call_api( '/data/v1/realtime/metrics', 'GET', @@ -510,10 +732,11 @@ def list_realtime_metrics_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListRealTimeMetricsResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api/url_signing_keys_api.py b/mux_python/api/url_signing_keys_api.py index a978f29..c26a779 100644 --- a/mux_python/api/url_signing_keys_api.py +++ b/mux_python/api/url_signing_keys_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class URLSigningKeysApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -29,20 +42,27 @@ def create_url_signing_key(self, **kwargs): # noqa: E501 Creates a new signing key pair. When creating a new signing key, the API will generate a 2048-bit RSA key-pair and return the private key and a generated key-id; the public key will be stored at Mux to validate signed tokens. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_url_signing_key(async_req=True) >>> result = thread.get() - :param async_req bool - :return: SigningKeyResponse + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: SigningKeyResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_url_signing_key_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.create_url_signing_key_with_http_info(**kwargs) # noqa: E501 - return data + return self.create_url_signing_key_with_http_info(**kwargs) # noqa: E501 def create_url_signing_key_with_http_info(self, **kwargs): # noqa: E501 """Create a URL signing key # noqa: E501 @@ -50,26 +70,50 @@ def create_url_signing_key_with_http_info(self, **kwargs): # noqa: E501 Creates a new signing key pair. When creating a new signing key, the API will generate a 2048-bit RSA key-pair and return the private key and a generated key-id; the public key will be stored at Mux to validate signed tokens. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_url_signing_key_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :return: SigningKeyResponse + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(SigningKeyResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_url_signing_key" % key ) @@ -94,6 +138,10 @@ def create_url_signing_key_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 201: "SigningKeyResponse", + } return self.api_client.call_api( '/video/v1/signing-keys', 'POST', @@ -103,13 +151,14 @@ def create_url_signing_key_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='SigningKeyResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def delete_url_signing_key(self, signing_key_id, **kwargs): # noqa: E501 """Delete a URL signing key # noqa: E501 @@ -117,21 +166,29 @@ def delete_url_signing_key(self, signing_key_id, **kwargs): # noqa: E501 Deletes an existing signing key. Use with caution, as this will invalidate any existing signatures and no URLs can be signed using the key again. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_url_signing_key(signing_key_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str signing_key_id: The ID of the signing key. (required) - :return: None + :param signing_key_id: The ID of the signing key. (required) + :type signing_key_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_url_signing_key_with_http_info(signing_key_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_url_signing_key_with_http_info(signing_key_id, **kwargs) # noqa: E501 - return data + return self.delete_url_signing_key_with_http_info(signing_key_id, **kwargs) # noqa: E501 def delete_url_signing_key_with_http_info(self, signing_key_id, **kwargs): # noqa: E501 """Delete a URL signing key # noqa: E501 @@ -139,36 +196,62 @@ def delete_url_signing_key_with_http_info(self, signing_key_id, **kwargs): # no Deletes an existing signing key. Use with caution, as this will invalidate any existing signatures and no URLs can be signed using the key again. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_url_signing_key_with_http_info(signing_key_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str signing_key_id: The ID of the signing key. (required) - :return: None + :param signing_key_id: The ID of the signing key. (required) + :type signing_key_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: None """ local_var_params = locals() - all_params = ['signing_key_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'signing_key_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_url_signing_key" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'signing_key_id' is set - if ('signing_key_id' not in local_var_params or - local_var_params['signing_key_id'] is None): - raise ValueError("Missing the required parameter `signing_key_id` when calling `delete_url_signing_key`") # noqa: E501 + if self.api_client.client_side_validation and ('signing_key_id' not in local_var_params or # noqa: E501 + local_var_params['signing_key_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `signing_key_id` when calling `delete_url_signing_key`") # noqa: E501 collection_formats = {} @@ -186,6 +269,8 @@ def delete_url_signing_key_with_http_info(self, signing_key_id, **kwargs): # no body_params = None # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = {} return self.api_client.call_api( '/video/v1/signing-keys/{SIGNING_KEY_ID}', 'DELETE', @@ -195,13 +280,14 @@ def delete_url_signing_key_with_http_info(self, signing_key_id, **kwargs): # no body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def get_url_signing_key(self, signing_key_id, **kwargs): # noqa: E501 """Retrieve a URL signing key # noqa: E501 @@ -209,21 +295,29 @@ def get_url_signing_key(self, signing_key_id, **kwargs): # noqa: E501 Retrieves the details of a URL signing key that has previously been created. Supply the unique signing key ID that was returned from your previous request, and Mux will return the corresponding signing key information. **The private key is not returned in this response.** # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_url_signing_key(signing_key_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str signing_key_id: The ID of the signing key. (required) - :return: SigningKeyResponse + :param signing_key_id: The ID of the signing key. (required) + :type signing_key_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: SigningKeyResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_url_signing_key_with_http_info(signing_key_id, **kwargs) # noqa: E501 - else: - (data) = self.get_url_signing_key_with_http_info(signing_key_id, **kwargs) # noqa: E501 - return data + return self.get_url_signing_key_with_http_info(signing_key_id, **kwargs) # noqa: E501 def get_url_signing_key_with_http_info(self, signing_key_id, **kwargs): # noqa: E501 """Retrieve a URL signing key # noqa: E501 @@ -231,36 +325,62 @@ def get_url_signing_key_with_http_info(self, signing_key_id, **kwargs): # noqa: Retrieves the details of a URL signing key that has previously been created. Supply the unique signing key ID that was returned from your previous request, and Mux will return the corresponding signing key information. **The private key is not returned in this response.** # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_url_signing_key_with_http_info(signing_key_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str signing_key_id: The ID of the signing key. (required) - :return: SigningKeyResponse + :param signing_key_id: The ID of the signing key. (required) + :type signing_key_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(SigningKeyResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['signing_key_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'signing_key_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_url_signing_key" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'signing_key_id' is set - if ('signing_key_id' not in local_var_params or - local_var_params['signing_key_id'] is None): - raise ValueError("Missing the required parameter `signing_key_id` when calling `get_url_signing_key`") # noqa: E501 + if self.api_client.client_side_validation and ('signing_key_id' not in local_var_params or # noqa: E501 + local_var_params['signing_key_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `signing_key_id` when calling `get_url_signing_key`") # noqa: E501 collection_formats = {} @@ -282,6 +402,10 @@ def get_url_signing_key_with_http_info(self, signing_key_id, **kwargs): # noqa: # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "SigningKeyResponse", + } return self.api_client.call_api( '/video/v1/signing-keys/{SIGNING_KEY_ID}', 'GET', @@ -291,13 +415,14 @@ def get_url_signing_key_with_http_info(self, signing_key_id, **kwargs): # noqa: body=body_params, post_params=form_params, files=local_var_files, - response_type='SigningKeyResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_url_signing_keys(self, **kwargs): # noqa: E501 """List URL signing keys # noqa: E501 @@ -305,22 +430,31 @@ def list_url_signing_keys(self, **kwargs): # noqa: E501 Returns a list of URL signing keys. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_url_signing_keys(async_req=True) >>> result = thread.get() - :param async_req bool - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :return: ListSigningKeysResponse + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListSigningKeysResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_url_signing_keys_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_url_signing_keys_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_url_signing_keys_with_http_info(**kwargs) # noqa: E501 def list_url_signing_keys_with_http_info(self, **kwargs): # noqa: E501 """List URL signing keys # noqa: E501 @@ -328,28 +462,56 @@ def list_url_signing_keys_with_http_info(self, **kwargs): # noqa: E501 Returns a list of URL signing keys. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_url_signing_keys_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :return: ListSigningKeysResponse + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListSigningKeysResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['limit', 'page'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'limit', + 'page' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_url_signing_keys" % key ) @@ -361,9 +523,9 @@ def list_url_signing_keys_with_http_info(self, **kwargs): # noqa: E501 path_params = {} query_params = [] - if 'limit' in local_var_params: + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'page' in local_var_params: + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 query_params.append(('page', local_var_params['page'])) # noqa: E501 header_params = {} @@ -378,6 +540,10 @@ def list_url_signing_keys_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListSigningKeysResponse", + } return self.api_client.call_api( '/video/v1/signing-keys', 'GET', @@ -387,10 +553,11 @@ def list_url_signing_keys_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListSigningKeysResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api/video_views_api.py b/mux_python/api/video_views_api.py index 53d3517..37591bc 100644 --- a/mux_python/api/video_views_api.py +++ b/mux_python/api/video_views_api.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,8 +18,18 @@ import six from mux_python.api_client import ApiClient +from mux_python.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + class VideoViewsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ def __init__(self, api_client=None): if api_client is None: @@ -29,21 +42,29 @@ def get_video_view(self, video_view_id, **kwargs): # noqa: E501 Returns the details of a video view # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_video_view(video_view_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str video_view_id: ID of the Video View (required) - :return: VideoViewResponse + :param video_view_id: ID of the Video View (required) + :type video_view_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: VideoViewResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_video_view_with_http_info(video_view_id, **kwargs) # noqa: E501 - else: - (data) = self.get_video_view_with_http_info(video_view_id, **kwargs) # noqa: E501 - return data + return self.get_video_view_with_http_info(video_view_id, **kwargs) # noqa: E501 def get_video_view_with_http_info(self, video_view_id, **kwargs): # noqa: E501 """Get a Video View # noqa: E501 @@ -51,36 +72,62 @@ def get_video_view_with_http_info(self, video_view_id, **kwargs): # noqa: E501 Returns the details of a video view # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_video_view_with_http_info(video_view_id, async_req=True) >>> result = thread.get() - :param async_req bool - :param str video_view_id: ID of the Video View (required) - :return: VideoViewResponse + :param video_view_id: ID of the Video View (required) + :type video_view_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(VideoViewResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['video_view_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'video_view_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_video_view" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'video_view_id' is set - if ('video_view_id' not in local_var_params or - local_var_params['video_view_id'] is None): - raise ValueError("Missing the required parameter `video_view_id` when calling `get_video_view`") # noqa: E501 + if self.api_client.client_side_validation and ('video_view_id' not in local_var_params or # noqa: E501 + local_var_params['video_view_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `video_view_id` when calling `get_video_view`") # noqa: E501 collection_formats = {} @@ -102,6 +149,10 @@ def get_video_view_with_http_info(self, video_view_id, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "VideoViewResponse", + } return self.api_client.call_api( '/data/v1/video-views/{VIDEO_VIEW_ID}', 'GET', @@ -111,13 +162,14 @@ def get_video_view_with_http_info(self, video_view_id, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='VideoViewResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) def list_video_views(self, **kwargs): # noqa: E501 """List Video Views # noqa: E501 @@ -125,27 +177,41 @@ def list_video_views(self, **kwargs): # noqa: E501 Returns a list of video views # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_video_views(async_req=True) >>> result = thread.get() - :param async_req bool - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :param str viewer_id: Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. - :param int error_id: Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. - :param str order_direction: Sort order. - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :return: ListVideoViewsResponse + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param viewer_id: Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. + :type viewer_id: str + :param error_id: Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. + :type error_id: int + :param order_direction: Sort order. + :type order_direction: str + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: ListVideoViewsResponse """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_video_views_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_video_views_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_video_views_with_http_info(**kwargs) # noqa: E501 def list_video_views_with_http_info(self, **kwargs): # noqa: E501 """List Video Views # noqa: E501 @@ -153,33 +219,71 @@ def list_video_views_with_http_info(self, **kwargs): # noqa: E501 Returns a list of video views # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_video_views_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :param int limit: Number of items to include in the response - :param int page: Offset by this many pages, of the size of `limit` - :param str viewer_id: Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. - :param int error_id: Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. - :param str order_direction: Sort order. - :param list[str] filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. - :param list[str] timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. - :return: ListVideoViewsResponse + :param limit: Number of items to include in the response + :type limit: int + :param page: Offset by this many pages, of the size of `limit` + :type page: int + :param viewer_id: Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. + :type viewer_id: str + :param error_id: Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. + :type error_id: int + :param order_direction: Sort order. + :type order_direction: str + :param filters: Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + :type filters: list[str] + :param timeframe: Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + :type timeframe: list[str] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting 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_auth: dict, optional + :return: Returns the result object. If the method is called asynchronously, returns the request thread. + :rtype: tuple(ListVideoViewsResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ['limit', 'page', 'viewer_id', 'error_id', 'order_direction', 'filters', 'timeframe'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = [ + 'limit', + 'page', + 'viewer_id', + 'error_id', + 'order_direction', + 'filters', + 'timeframe' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_video_views" % key ) @@ -191,20 +295,20 @@ def list_video_views_with_http_info(self, **kwargs): # noqa: E501 path_params = {} query_params = [] - if 'limit' in local_var_params: + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'page' in local_var_params: + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'viewer_id' in local_var_params: + if 'viewer_id' in local_var_params and local_var_params['viewer_id'] is not None: # noqa: E501 query_params.append(('viewer_id', local_var_params['viewer_id'])) # noqa: E501 - if 'error_id' in local_var_params: + if 'error_id' in local_var_params and local_var_params['error_id'] is not None: # noqa: E501 query_params.append(('error_id', local_var_params['error_id'])) # noqa: E501 - if 'order_direction' in local_var_params: + if 'order_direction' in local_var_params and local_var_params['order_direction'] is not None: # noqa: E501 query_params.append(('order_direction', local_var_params['order_direction'])) # noqa: E501 - if 'filters' in local_var_params: + if 'filters' in local_var_params and local_var_params['filters'] is not None: # noqa: E501 query_params.append(('filters[]', local_var_params['filters'])) # noqa: E501 collection_formats['filters[]'] = 'multi' # noqa: E501 - if 'timeframe' in local_var_params: + if 'timeframe' in local_var_params and local_var_params['timeframe'] is not None: # noqa: E501 query_params.append(('timeframe[]', local_var_params['timeframe'])) # noqa: E501 collection_formats['timeframe[]'] = 'multi' # noqa: E501 @@ -220,6 +324,10 @@ def list_video_views_with_http_info(self, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "ListVideoViewsResponse", + } return self.api_client.call_api( '/data/v1/video-views', 'GET', @@ -229,10 +337,11 @@ def list_video_views_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='ListVideoViewsResponse', # noqa: E501 + response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/mux_python/api_client.py b/mux_python/api_client.py index 9ce7cf1..6037621 100644 --- a/mux_python/api_client.py +++ b/mux_python/api_client.py @@ -1,13 +1,18 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ from __future__ import absolute_import +import atexit import datetime +from dateutil.parser import parse import json import mimetypes from multiprocessing.pool import ThreadPool @@ -22,6 +27,7 @@ from mux_python.configuration import Configuration import mux_python.models from mux_python import rest +from mux_python.exceptions import ApiValueError, ApiException class ApiClient(object): @@ -62,7 +68,7 @@ class ApiClient(object): def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1): if configuration is None: - configuration = Configuration() + configuration = Configuration.get_default_copy() self.configuration = configuration self.pool_threads = pool_threads @@ -72,13 +78,22 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'Mux Python | 1.12.0' + self.user_agent = 'OpenAPI-Generator/1.12.0/python' + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() - def __del__(self): + 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): @@ -86,6 +101,7 @@ def pool(self): 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 @@ -104,9 +120,10 @@ def set_default_header(self, header_name, header_value): def __call_api( self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, + files=None, response_types_map=None, auth_settings=None, _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None): + _preload_content=True, _request_timeout=None, _host=None, + _request_auth=None): config = self.configuration @@ -140,37 +157,62 @@ def __call_api( # post parameters if post_params or files: - post_params = self.prepare_post_parameters(post_params, 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.extend(self.files_parameters(files)) # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) + self.update_params_for_auth( + header_params, query_params, auth_settings, + request_auth=_request_auth) # body if body: body = self.sanitize_for_serialization(body) # request url - url = self.configuration.host + resource_path + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + try: + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + except ApiException as e: + e.body = e.body.decode('utf-8') if six.PY3 else e.body + raise e self.last_response = response_data return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None + + if not _preload_content: + return return_data + + response_type = response_types_map.get(response_data.status, None) + + if six.PY3 and response_type not in ["file", "bytes"]: + 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: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None if _return_http_data_only: return (return_data) @@ -277,16 +319,17 @@ def __deserialize(self, data, klass): elif klass == datetime.date: return self.__deserialize_date(data) elif klass == datetime.datetime: - return self.__deserialize_datatime(data) + return self.__deserialize_datetime(data) 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_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=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. @@ -316,6 +359,10 @@ def call_api(self, resource_path, method, 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. @@ -327,19 +374,23 @@ def call_api(self, resource_path, method, return self.__call_api(resource_path, method, path_params, query_params, header_params, body, post_params, files, - response_type, auth_settings, + response_types_map, auth_settings, _return_http_data_only, collection_formats, - _preload_content, _request_timeout) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, _request_timeout)) - return thread + _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, @@ -361,10 +412,8 @@ def request(self, method, url, query_params=None, headers=None, return self.rest_client.OPTIONS(url, query_params=query_params, headers=headers, - post_params=post_params, _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + _request_timeout=_request_timeout) elif method == "POST": return self.rest_client.POST(url, query_params=query_params, @@ -397,7 +446,7 @@ def request(self, method, url, query_params=None, headers=None, _request_timeout=_request_timeout, body=body) else: - raise ValueError( + raise ApiValueError( "http method must be `GET`, `HEAD`, `OPTIONS`," " `POST`, `PATCH`, `PUT` or `DELETE`." ) @@ -432,18 +481,14 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - def prepare_post_parameters(self, post_params=None, files=None): + def files_parameters(self, files=None): """Builds form parameters. - :param post_params: Normal form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - if post_params: - params = post_params - if files: for k, v in six.iteritems(files): if not v: @@ -492,29 +537,45 @@ def select_header_content_type(self, content_types): else: return content_types[0] - def update_params_for_auth(self, headers, querys, auth_settings): + def update_params_for_auth(self, headers, querys, auth_settings, + request_auth=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param querys: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return + if request_auth: + self._apply_auth_params(headers, querys, request_auth) + return + for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - if not auth_setting['value']: - continue - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - querys.append((auth_setting['key'], auth_setting['value'])) - else: - raise ValueError( - 'Authentication token must be in `query` or `header`' - ) + self._apply_auth_params(headers, querys, auth_setting) + + def _apply_auth_params(self, headers, querys, auth_setting): + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) def __deserialize_file(self, response): """Deserializes body to file @@ -569,7 +630,6 @@ def __deserialize_date(self, string): :return: date. """ try: - from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -579,7 +639,7 @@ def __deserialize_date(self, string): reason="Failed to parse `{0}` as date object".format(string) ) - def __deserialize_datatime(self, string): + def __deserialize_datetime(self, string): """Deserializes string to datetime. The string should be in iso8601 datetime format. @@ -588,7 +648,6 @@ def __deserialize_datatime(self, string): :return: datetime. """ try: - from dateutil.parser import parse return parse(string) except ImportError: return string @@ -608,23 +667,26 @@ def __deserialize_model(self, data, klass): :param klass: class literal. :return: model object. """ + has_discriminator = False + if (hasattr(klass, 'get_real_child_model') + and klass.discriminator_value_class_map): + has_discriminator = True - if not klass.openapi_types and not hasattr(klass, - 'get_real_child_model'): + if not klass.openapi_types and has_discriminator is False: return data kwargs = {} - if klass.openapi_types is not None: + if (data is not None and + klass.openapi_types is not None and + isinstance(data, (list, dict))): for attr, attr_type in six.iteritems(klass.openapi_types): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): + if klass.attribute_map[attr] in data: value = data[klass.attribute_map[attr]] kwargs[attr] = self.__deserialize(value, attr_type) instance = klass(**kwargs) - if hasattr(instance, 'get_real_child_model'): + if has_discriminator: klass_name = instance.get_real_child_model(data) if klass_name: instance = self.__deserialize(data, klass_name) diff --git a/mux_python/configuration.py b/mux_python/configuration.py index 940b72e..7dd11c9 100644 --- a/mux_python/configuration.py +++ b/mux_python/configuration.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -17,85 +20,249 @@ import six from six.moves import http_client as httplib +from mux_python.exceptions import ApiValueError -class TypeWithDefault(type): - def __init__(cls, name, bases, dct): - super(TypeWithDefault, cls).__init__(name, bases, dct) - cls._default = None - - def __call__(cls): - if cls._default is None: - cls._default = type.__call__(cls) - return copy.copy(cls._default) - - def set_default(cls, default): - cls._default = copy.copy(default) - +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} -class Configuration(six.with_metaclass(TypeWithDefault, object)): +class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param discard_unknown_keys: Boolean value indicating whether to discard + unknown properties. A server may send a response that includes additional + properties that are not known by the client in the following scenarios: + 1. The OpenAPI document is incomplete, i.e. it does not match the server + implementation. + 2. The client was generated using an older version of the OpenAPI document + and the server has been upgraded since then. + If a schema in the OpenAPI document defines the additionalProperties attribute, + then all undeclared properties received by the server are injected into the + additional properties map. In that case, there are undeclared properties, and + nothing to discard. + :param disabled_client_side_validations (string): Comma-separated list of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_client_side_validations is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format + + :Example: + + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + + Configure API client with HTTP basic authentication: + +conf = mux_python.Configuration( + username='the-user', + password='the-password', +) + """ - def __init__(self): - """Constructor""" - # Default Base url - self.host = "https://api.mux.com" - # Temp file folder for downloading files + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + discard_unknown_keys=False, + disabled_client_side_validations="", + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ssl_ca_cert=None, + ): + """Constructor + """ + self._base_path = "https://api.mux.com" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ self.temp_folder_path = None - + """Temp file folder for downloading files + """ # Authentication Settings - # dict to store API key(s) self.api_key = {} - # dict to store API prefix (e.g. Bearer) + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ self.api_key_prefix = {} - # Username for HTTP basic authentication - self.username = "" - # Password for HTTP basic authentication - self.password = "" - - # Logging Settings + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.discard_unknown_keys = discard_unknown_keys + self.disabled_client_side_validations = disabled_client_side_validations self.logger = {} + """Logging Settings + """ self.logger["package_logger"] = logging.getLogger("mux_python") self.logger["urllib3_logger"] = logging.getLogger("urllib3") - # Log format self.logger_format = '%(asctime)s %(levelname)s %(message)s' - # Log stream handler + """Log format + """ self.logger_stream_handler = None - # Log file handler + """Log stream handler + """ self.logger_file_handler = None - # Debug file location + """Log file handler + """ self.logger_file = None - # Debug switch + """Debug file location + """ self.debug = False + """Debug switch + """ - # SSL/TLS verification - # Set this to false to skip verifying SSL certificate when calling API - # from https server. self.verify_ssl = True - # Set this to customize the certificate file to verify the peer. - self.ssl_ca_cert = None - # client certificate file + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ self.cert_file = None - # client key file + """client certificate file + """ self.key_file = None - # Set this to True/False to enable/disable SSL hostname verification. + """client key file + """ self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ - # urllib3 connection pool's maximum number of connections saved - # per pool. urllib3 uses 1 connection as default value, but this is - # not the best value when you are making a lot of possibly parallel - # requests to the same host, which is often the case here. - # cpu_count * 5 is used as default value to increase performance. self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ - # Proxy URL self.proxy = None - # Safe chars for path_param + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + if name == 'disabled_client_side_validations': + s = set(filter(None, value.split(','))) + for v in s: + if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: + raise ApiValueError( + "Invalid keyword: '{0}''".format(v)) + self._disabled_client_side_validations = s + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = copy.deepcopy(default) + + @classmethod + def get_default_copy(cls): + """Return new instance of configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration passed by the set_default method. + + :return: The configuration object. + """ + if cls._default is not None: + return copy.deepcopy(cls._default) + return Configuration() @property def logger_file(self): @@ -182,25 +349,36 @@ def logger_format(self, value): self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def get_api_key_with_prefix(self, identifier): + def get_api_key_with_prefix(self, identifier, alias=None): """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. :return: The token for api key authentication. """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key def get_basic_auth_token(self): """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password return urllib3.util.make_headers( - basic_auth=self.username + ':' + self.password + basic_auth=username + ':' + password ).get('authorization') def auth_settings(self): @@ -208,16 +386,15 @@ def auth_settings(self): :return: The Auth Settings information dict. """ - return { - 'accessToken': - { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - }, - - } + auth = {} + if self.username is not None and self.password is not None: + auth['accessToken'] = { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + } + return auth def to_debug_report(self): """Gets the essential information for debugging. @@ -230,3 +407,65 @@ def to_debug_report(self): "Version of the API: v1\n"\ "SDK Package Version: 1.12.0".\ format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://api.mux.com", + 'description': "Mux Production Environment", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/mux_python/exceptions.py b/mux_python/exceptions.py new file mode 100644 index 0000000..1fdd7f6 --- /dev/null +++ b/mux_python/exceptions.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Mux API + + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech +""" + + +import six + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None): + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +class NotFoundException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(NotFoundException, self).__init__(status, reason, http_resp) + + +class UnauthorizedException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(UnauthorizedException, self).__init__(status, reason, http_resp) + + +class ForbiddenException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(ForbiddenException, self).__init__(status, reason, http_resp) + + +class ServiceException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(ServiceException, self).__init__(status, reason, http_resp) + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, six.integer_types): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/mux_python/models/__init__.py b/mux_python/models/__init__.py index dc901a9..c5427ab 100644 --- a/mux_python/models/__init__.py +++ b/mux_python/models/__init__.py @@ -2,9 +2,12 @@ # flake8: noqa """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ diff --git a/mux_python/models/abridged_video_view.py b/mux_python/models/abridged_video_view.py index 86e91e8..5906b9b 100644 --- a/mux_python/models/abridged_video_view.py +++ b/mux_python/models/abridged_video_view.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class AbridgedVideoView(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -49,8 +60,11 @@ class AbridgedVideoView(object): 'view_end': 'view_end' } - def __init__(self, id=None, viewer_os_family=None, viewer_application_name=None, video_title=None, total_row_count=None, player_error_message=None, player_error_code=None, error_type_id=None, country_code=None, view_start=None, view_end=None): # noqa: E501 + def __init__(self, id=None, viewer_os_family=None, viewer_application_name=None, video_title=None, total_row_count=None, player_error_message=None, player_error_code=None, error_type_id=None, country_code=None, view_start=None, view_end=None, local_vars_configuration=None): # noqa: E501 """AbridgedVideoView - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._id = None self._viewer_os_family = None @@ -104,7 +118,7 @@ def id(self, id): :param id: The id of this AbridgedVideoView. # noqa: E501 - :type: str + :type id: str """ self._id = id @@ -125,7 +139,7 @@ def viewer_os_family(self, viewer_os_family): :param viewer_os_family: The viewer_os_family of this AbridgedVideoView. # noqa: E501 - :type: str + :type viewer_os_family: str """ self._viewer_os_family = viewer_os_family @@ -146,7 +160,7 @@ def viewer_application_name(self, viewer_application_name): :param viewer_application_name: The viewer_application_name of this AbridgedVideoView. # noqa: E501 - :type: str + :type viewer_application_name: str """ self._viewer_application_name = viewer_application_name @@ -167,7 +181,7 @@ def video_title(self, video_title): :param video_title: The video_title of this AbridgedVideoView. # noqa: E501 - :type: str + :type video_title: str """ self._video_title = video_title @@ -188,7 +202,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this AbridgedVideoView. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -209,7 +223,7 @@ def player_error_message(self, player_error_message): :param player_error_message: The player_error_message of this AbridgedVideoView. # noqa: E501 - :type: str + :type player_error_message: str """ self._player_error_message = player_error_message @@ -230,7 +244,7 @@ def player_error_code(self, player_error_code): :param player_error_code: The player_error_code of this AbridgedVideoView. # noqa: E501 - :type: str + :type player_error_code: str """ self._player_error_code = player_error_code @@ -251,7 +265,7 @@ def error_type_id(self, error_type_id): :param error_type_id: The error_type_id of this AbridgedVideoView. # noqa: E501 - :type: int + :type error_type_id: int """ self._error_type_id = error_type_id @@ -272,7 +286,7 @@ def country_code(self, country_code): :param country_code: The country_code of this AbridgedVideoView. # noqa: E501 - :type: str + :type country_code: str """ self._country_code = country_code @@ -293,7 +307,7 @@ def view_start(self, view_start): :param view_start: The view_start of this AbridgedVideoView. # noqa: E501 - :type: str + :type view_start: str """ self._view_start = view_start @@ -314,32 +328,40 @@ def view_end(self, view_end): :param view_end: The view_end of this AbridgedVideoView. # noqa: E501 - :type: str + :type view_end: str """ self._view_end = view_end - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -356,8 +378,11 @@ def __eq__(self, other): if not isinstance(other, AbridgedVideoView): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AbridgedVideoView): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/asset.py b/mux_python/models/asset.py index 90cfee2..ea26a6b 100644 --- a/mux_python/models/asset.py +++ b/mux_python/models/asset.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class Asset(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -24,7 +35,6 @@ class Asset(object): openapi_types = { 'id': 'str', 'created_at': 'str', - 'deleted_at': 'str', 'status': 'str', 'duration': 'float', 'max_stored_resolution': 'str', @@ -51,7 +61,6 @@ class Asset(object): attribute_map = { 'id': 'id', 'created_at': 'created_at', - 'deleted_at': 'deleted_at', 'status': 'status', 'duration': 'duration', 'max_stored_resolution': 'max_stored_resolution', @@ -75,12 +84,14 @@ class Asset(object): 'test': 'test' } - def __init__(self, id=None, created_at=None, deleted_at=None, status=None, duration=None, max_stored_resolution=None, max_stored_frame_rate=None, aspect_ratio=None, playback_ids=None, tracks=None, errors=None, per_title_encode=None, is_live=None, passthrough=None, live_stream_id=None, master=None, master_access='none', mp4_support='none', source_asset_id=None, normalize_audio=False, static_renditions=None, recording_times=None, non_standard_input_reasons=None, test=None): # noqa: E501 + def __init__(self, id=None, created_at=None, status=None, duration=None, max_stored_resolution=None, max_stored_frame_rate=None, aspect_ratio=None, playback_ids=None, tracks=None, errors=None, per_title_encode=None, is_live=None, passthrough=None, live_stream_id=None, master=None, master_access='none', mp4_support='none', source_asset_id=None, normalize_audio=False, static_renditions=None, recording_times=None, non_standard_input_reasons=None, test=None, local_vars_configuration=None): # noqa: E501 """Asset - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._id = None self._created_at = None - self._deleted_at = None self._status = None self._duration = None self._max_stored_resolution = None @@ -108,8 +119,6 @@ def __init__(self, id=None, created_at=None, deleted_at=None, status=None, durat self.id = id if created_at is not None: self.created_at = created_at - if deleted_at is not None: - self.deleted_at = deleted_at if status is not None: self.status = status if duration is not None: @@ -157,7 +166,7 @@ def __init__(self, id=None, created_at=None, deleted_at=None, status=None, durat def id(self): """Gets the id of this Asset. # noqa: E501 - Unique identifier for the Asset. # noqa: E501 + Unique identifier for the Asset. Max 255 characters. # noqa: E501 :return: The id of this Asset. # noqa: E501 :rtype: str @@ -168,10 +177,10 @@ def id(self): def id(self, id): """Sets the id of this Asset. - Unique identifier for the Asset. # noqa: E501 + Unique identifier for the Asset. Max 255 characters. # noqa: E501 :param id: The id of this Asset. # noqa: E501 - :type: str + :type id: str """ self._id = id @@ -180,7 +189,7 @@ def id(self, id): def created_at(self): """Gets the created_at of this Asset. # noqa: E501 - Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501 + Time the Asset was created, defined as a Unix timestamp (seconds since epoch). # noqa: E501 :return: The created_at of this Asset. # noqa: E501 :rtype: str @@ -191,35 +200,14 @@ def created_at(self): def created_at(self, created_at): """Sets the created_at of this Asset. - Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501 + Time the Asset was created, defined as a Unix timestamp (seconds since epoch). # noqa: E501 :param created_at: The created_at of this Asset. # noqa: E501 - :type: str + :type created_at: str """ self._created_at = created_at - @property - def deleted_at(self): - """Gets the deleted_at of this Asset. # noqa: E501 - - - :return: The deleted_at of this Asset. # noqa: E501 - :rtype: str - """ - return self._deleted_at - - @deleted_at.setter - def deleted_at(self, deleted_at): - """Sets the deleted_at of this Asset. - - - :param deleted_at: The deleted_at of this Asset. # noqa: E501 - :type: str - """ - - self._deleted_at = deleted_at - @property def status(self): """Gets the status of this Asset. # noqa: E501 @@ -238,10 +226,10 @@ def status(self, status): The status of the asset. # noqa: E501 :param status: The status of this Asset. # noqa: E501 - :type: str + :type status: str """ allowed_values = ["preparing", "ready", "errored"] # noqa: E501 - if status not in allowed_values: + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 .format(status, allowed_values) @@ -267,7 +255,7 @@ def duration(self, duration): The duration of the asset in seconds (max duration for a single asset is 24 hours). # noqa: E501 :param duration: The duration of this Asset. # noqa: E501 - :type: float + :type duration: float """ self._duration = duration @@ -290,10 +278,10 @@ def max_stored_resolution(self, max_stored_resolution): The maximum resolution that has been stored for the asset. The asset may be delivered at lower resolutions depending on the device and bandwidth, however it cannot be delivered at a higher value than is stored. # noqa: E501 :param max_stored_resolution: The max_stored_resolution of this Asset. # noqa: E501 - :type: str + :type max_stored_resolution: str """ allowed_values = ["Audio only", "SD", "HD", "FHD", "UHD"] # noqa: E501 - if max_stored_resolution not in allowed_values: + if self.local_vars_configuration.client_side_validation and max_stored_resolution not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `max_stored_resolution` ({0}), must be one of {1}" # noqa: E501 .format(max_stored_resolution, allowed_values) @@ -319,7 +307,7 @@ def max_stored_frame_rate(self, max_stored_frame_rate): The maximum frame rate that has been stored for the asset. The asset may be delivered at lower frame rates depending on the device and bandwidth, however it cannot be delivered at a higher value than is stored. This field may return -1 if the frame rate of the input cannot be reliably determined. # noqa: E501 :param max_stored_frame_rate: The max_stored_frame_rate of this Asset. # noqa: E501 - :type: float + :type max_stored_frame_rate: float """ self._max_stored_frame_rate = max_stored_frame_rate @@ -342,7 +330,7 @@ def aspect_ratio(self, aspect_ratio): The aspect ratio of the asset in the form of `width:height`, for example `16:9`. # noqa: E501 :param aspect_ratio: The aspect_ratio of this Asset. # noqa: E501 - :type: str + :type aspect_ratio: str """ self._aspect_ratio = aspect_ratio @@ -351,6 +339,7 @@ def aspect_ratio(self, aspect_ratio): def playback_ids(self): """Gets the playback_ids of this Asset. # noqa: E501 + An array of Playback ID objects. Use these to create HLS playback URLs. See [Play your videos](https://docs.mux.com/guides/video/play-your-videos) for more details. # noqa: E501 :return: The playback_ids of this Asset. # noqa: E501 :rtype: list[PlaybackID] @@ -361,9 +350,10 @@ def playback_ids(self): def playback_ids(self, playback_ids): """Sets the playback_ids of this Asset. + An array of Playback ID objects. Use these to create HLS playback URLs. See [Play your videos](https://docs.mux.com/guides/video/play-your-videos) for more details. # noqa: E501 :param playback_ids: The playback_ids of this Asset. # noqa: E501 - :type: list[PlaybackID] + :type playback_ids: list[PlaybackID] """ self._playback_ids = playback_ids @@ -372,6 +362,7 @@ def playback_ids(self, playback_ids): def tracks(self): """Gets the tracks of this Asset. # noqa: E501 + The individual media tracks that make up an asset. # noqa: E501 :return: The tracks of this Asset. # noqa: E501 :rtype: list[Track] @@ -382,9 +373,10 @@ def tracks(self): def tracks(self, tracks): """Sets the tracks of this Asset. + The individual media tracks that make up an asset. # noqa: E501 :param tracks: The tracks of this Asset. # noqa: E501 - :type: list[Track] + :type tracks: list[Track] """ self._tracks = tracks @@ -405,7 +397,7 @@ def errors(self, errors): :param errors: The errors of this Asset. # noqa: E501 - :type: AssetErrors + :type errors: AssetErrors """ self._errors = errors @@ -426,7 +418,7 @@ def per_title_encode(self, per_title_encode): :param per_title_encode: The per_title_encode of this Asset. # noqa: E501 - :type: bool + :type per_title_encode: bool """ self._per_title_encode = per_title_encode @@ -449,7 +441,7 @@ def is_live(self, is_live): Whether the asset is created from a live stream and the live stream is currently `active` and not in `idle` state. # noqa: E501 :param is_live: The is_live of this Asset. # noqa: E501 - :type: bool + :type is_live: bool """ self._is_live = is_live @@ -472,7 +464,7 @@ def passthrough(self, passthrough): Arbitrary metadata set for the asset. Max 255 characters. # noqa: E501 :param passthrough: The passthrough of this Asset. # noqa: E501 - :type: str + :type passthrough: str """ self._passthrough = passthrough @@ -495,7 +487,7 @@ def live_stream_id(self, live_stream_id): Unique identifier for the live stream. This is an optional parameter added when the asset is created from a live stream. # noqa: E501 :param live_stream_id: The live_stream_id of this Asset. # noqa: E501 - :type: str + :type live_stream_id: str """ self._live_stream_id = live_stream_id @@ -516,7 +508,7 @@ def master(self, master): :param master: The master of this Asset. # noqa: E501 - :type: AssetMaster + :type master: AssetMaster """ self._master = master @@ -537,10 +529,10 @@ def master_access(self, master_access): :param master_access: The master_access of this Asset. # noqa: E501 - :type: str + :type master_access: str """ allowed_values = ["temporary", "none"] # noqa: E501 - if master_access not in allowed_values: + if self.local_vars_configuration.client_side_validation and master_access not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `master_access` ({0}), must be one of {1}" # noqa: E501 .format(master_access, allowed_values) @@ -564,10 +556,10 @@ def mp4_support(self, mp4_support): :param mp4_support: The mp4_support of this Asset. # noqa: E501 - :type: str + :type mp4_support: str """ allowed_values = ["standard", "none"] # noqa: E501 - if mp4_support not in allowed_values: + if self.local_vars_configuration.client_side_validation and mp4_support not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `mp4_support` ({0}), must be one of {1}" # noqa: E501 .format(mp4_support, allowed_values) @@ -593,7 +585,7 @@ def source_asset_id(self, source_asset_id): Asset Identifier of the video used as the source for creating the clip. # noqa: E501 :param source_asset_id: The source_asset_id of this Asset. # noqa: E501 - :type: str + :type source_asset_id: str """ self._source_asset_id = source_asset_id @@ -616,7 +608,7 @@ def normalize_audio(self, normalize_audio): Normalize the audio track loudness level. This parameter is only applicable to on-demand (not live) assets. # noqa: E501 :param normalize_audio: The normalize_audio of this Asset. # noqa: E501 - :type: bool + :type normalize_audio: bool """ self._normalize_audio = normalize_audio @@ -637,7 +629,7 @@ def static_renditions(self, static_renditions): :param static_renditions: The static_renditions of this Asset. # noqa: E501 - :type: AssetStaticRenditions + :type static_renditions: AssetStaticRenditions """ self._static_renditions = static_renditions @@ -660,7 +652,7 @@ def recording_times(self, recording_times): An array of individual live stream recording sessions. A recording session is created on each encoder connection during the live stream # noqa: E501 :param recording_times: The recording_times of this Asset. # noqa: E501 - :type: list[AssetRecordingTimes] + :type recording_times: list[AssetRecordingTimes] """ self._recording_times = recording_times @@ -681,7 +673,7 @@ def non_standard_input_reasons(self, non_standard_input_reasons): :param non_standard_input_reasons: The non_standard_input_reasons of this Asset. # noqa: E501 - :type: AssetNonStandardInputReasons + :type non_standard_input_reasons: AssetNonStandardInputReasons """ self._non_standard_input_reasons = non_standard_input_reasons @@ -690,7 +682,7 @@ def non_standard_input_reasons(self, non_standard_input_reasons): def test(self): """Gets the test of this Asset. # noqa: E501 - Indicates this asset is a test asset if the value is `true`. A Test asset can help evaluate the Mux Video APIs without incurring any cost. There is no limit on number of test assets created. Test assets are watermarked with the Mux logo, limited to 10 seconds, and deleted after 24 hrs. # noqa: E501 + True means this live stream is a test asset. A test asset can help evaluate the Mux Video APIs without incurring any cost. There is no limit on number of test assets created. Test assets are watermarked with the Mux logo, limited to 10 seconds, and deleted after 24 hrs. # noqa: E501 :return: The test of this Asset. # noqa: E501 :rtype: bool @@ -701,35 +693,43 @@ def test(self): def test(self, test): """Sets the test of this Asset. - Indicates this asset is a test asset if the value is `true`. A Test asset can help evaluate the Mux Video APIs without incurring any cost. There is no limit on number of test assets created. Test assets are watermarked with the Mux logo, limited to 10 seconds, and deleted after 24 hrs. # noqa: E501 + True means this live stream is a test asset. A test asset can help evaluate the Mux Video APIs without incurring any cost. There is no limit on number of test assets created. Test assets are watermarked with the Mux logo, limited to 10 seconds, and deleted after 24 hrs. # noqa: E501 :param test: The test of this Asset. # noqa: E501 - :type: bool + :type test: bool """ self._test = test - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -746,8 +746,11 @@ def __eq__(self, other): if not isinstance(other, Asset): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Asset): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/asset_errors.py b/mux_python/models/asset_errors.py index f8e7888..20def96 100644 --- a/mux_python/models/asset_errors.py +++ b/mux_python/models/asset_errors.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class AssetErrors(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class AssetErrors(object): 'messages': 'messages' } - def __init__(self, type=None, messages=None): # noqa: E501 + def __init__(self, type=None, messages=None, local_vars_configuration=None): # noqa: E501 """AssetErrors - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._type = None self._messages = None @@ -61,7 +75,7 @@ def type(self, type): The type of error that occurred for this asset. # noqa: E501 :param type: The type of this AssetErrors. # noqa: E501 - :type: str + :type type: str """ self._type = type @@ -84,32 +98,40 @@ def messages(self, messages): Error messages with more details. # noqa: E501 :param messages: The messages of this AssetErrors. # noqa: E501 - :type: list[str] + :type messages: list[str] """ self._messages = messages - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -126,8 +148,11 @@ def __eq__(self, other): if not isinstance(other, AssetErrors): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AssetErrors): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/asset_master.py b/mux_python/models/asset_master.py index baf6944..0924d46 100644 --- a/mux_python/models/asset_master.py +++ b/mux_python/models/asset_master.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class AssetMaster(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class AssetMaster(object): 'url': 'url' } - def __init__(self, status=None, url=None): # noqa: E501 + def __init__(self, status=None, url=None, local_vars_configuration=None): # noqa: E501 """AssetMaster - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._status = None self._url = None @@ -59,10 +73,10 @@ def status(self, status): :param status: The status of this AssetMaster. # noqa: E501 - :type: str + :type status: str """ allowed_values = ["ready", "preparing", "errored"] # noqa: E501 - if status not in allowed_values: + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 .format(status, allowed_values) @@ -74,6 +88,7 @@ def status(self, status): def url(self): """Gets the url of this AssetMaster. # noqa: E501 + The temporary URL to the master version of the video, as an MP4 file. This URL will expire after 24 hours. # noqa: E501 :return: The url of this AssetMaster. # noqa: E501 :rtype: str @@ -84,34 +99,43 @@ def url(self): def url(self, url): """Sets the url of this AssetMaster. + The temporary URL to the master version of the video, as an MP4 file. This URL will expire after 24 hours. # noqa: E501 :param url: The url of this AssetMaster. # noqa: E501 - :type: str + :type url: str """ self._url = url - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -128,8 +152,11 @@ def __eq__(self, other): if not isinstance(other, AssetMaster): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AssetMaster): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/asset_non_standard_input_reasons.py b/mux_python/models/asset_non_standard_input_reasons.py index 7ac0704..b1efe13 100644 --- a/mux_python/models/asset_non_standard_input_reasons.py +++ b/mux_python/models/asset_non_standard_input_reasons.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class AssetNonStandardInputReasons(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -45,8 +56,11 @@ class AssetNonStandardInputReasons(object): 'unexpected_media_file_parameters': 'unexpected_media_file_parameters' } - def __init__(self, video_codec=None, audio_codec=None, video_gop_size=None, video_frame_rate=None, video_resolution=None, pixel_aspect_ratio=None, video_edit_list=None, audio_edit_list=None, unexpected_media_file_parameters=None): # noqa: E501 + def __init__(self, video_codec=None, audio_codec=None, video_gop_size=None, video_frame_rate=None, video_resolution=None, pixel_aspect_ratio=None, video_edit_list=None, audio_edit_list=None, unexpected_media_file_parameters=None, local_vars_configuration=None): # noqa: E501 """AssetNonStandardInputReasons - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._video_codec = None self._audio_codec = None @@ -82,7 +96,7 @@ def __init__(self, video_codec=None, audio_codec=None, video_gop_size=None, vide def video_codec(self): """Gets the video_codec of this AssetNonStandardInputReasons. # noqa: E501 - The video codec used on the input file. # noqa: E501 + The video codec used on the input file. For example, the input file encoded with `hevc` video codec is non-standard and the value of this parameter is `hevc`. # noqa: E501 :return: The video_codec of this AssetNonStandardInputReasons. # noqa: E501 :rtype: str @@ -93,10 +107,10 @@ def video_codec(self): def video_codec(self, video_codec): """Sets the video_codec of this AssetNonStandardInputReasons. - The video codec used on the input file. # noqa: E501 + The video codec used on the input file. For example, the input file encoded with `hevc` video codec is non-standard and the value of this parameter is `hevc`. # noqa: E501 :param video_codec: The video_codec of this AssetNonStandardInputReasons. # noqa: E501 - :type: str + :type video_codec: str """ self._video_codec = video_codec @@ -105,7 +119,7 @@ def video_codec(self, video_codec): def audio_codec(self): """Gets the audio_codec of this AssetNonStandardInputReasons. # noqa: E501 - The audio codec used on the input file. # noqa: E501 + The audio codec used on the input file. Non-AAC audio codecs are non-standard. # noqa: E501 :return: The audio_codec of this AssetNonStandardInputReasons. # noqa: E501 :rtype: str @@ -116,10 +130,10 @@ def audio_codec(self): def audio_codec(self, audio_codec): """Sets the audio_codec of this AssetNonStandardInputReasons. - The audio codec used on the input file. # noqa: E501 + The audio codec used on the input file. Non-AAC audio codecs are non-standard. # noqa: E501 :param audio_codec: The audio_codec of this AssetNonStandardInputReasons. # noqa: E501 - :type: str + :type audio_codec: str """ self._audio_codec = audio_codec @@ -128,7 +142,7 @@ def audio_codec(self, audio_codec): def video_gop_size(self): """Gets the video_gop_size of this AssetNonStandardInputReasons. # noqa: E501 - The video key frame Interval (also called as Group of Picture or GOP) of the input file. # noqa: E501 + The video key frame Interval (also called as Group of Picture or GOP) of the input file is `high`. This parameter is present when the gop is greater than 10 seconds. # noqa: E501 :return: The video_gop_size of this AssetNonStandardInputReasons. # noqa: E501 :rtype: str @@ -139,13 +153,13 @@ def video_gop_size(self): def video_gop_size(self, video_gop_size): """Sets the video_gop_size of this AssetNonStandardInputReasons. - The video key frame Interval (also called as Group of Picture or GOP) of the input file. # noqa: E501 + The video key frame Interval (also called as Group of Picture or GOP) of the input file is `high`. This parameter is present when the gop is greater than 10 seconds. # noqa: E501 :param video_gop_size: The video_gop_size of this AssetNonStandardInputReasons. # noqa: E501 - :type: str + :type video_gop_size: str """ allowed_values = ["high"] # noqa: E501 - if video_gop_size not in allowed_values: + if self.local_vars_configuration.client_side_validation and video_gop_size not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `video_gop_size` ({0}), must be one of {1}" # noqa: E501 .format(video_gop_size, allowed_values) @@ -157,7 +171,7 @@ def video_gop_size(self, video_gop_size): def video_frame_rate(self): """Gets the video_frame_rate of this AssetNonStandardInputReasons. # noqa: E501 - The video frame rate of the input file. # noqa: E501 + The video frame rate of the input file. Video with average frames per second (fps) less than 10 or greater than 120 is non-standard. A `-1` frame rate value indicates Mux could not determine the frame rate of the video track. # noqa: E501 :return: The video_frame_rate of this AssetNonStandardInputReasons. # noqa: E501 :rtype: str @@ -168,10 +182,10 @@ def video_frame_rate(self): def video_frame_rate(self, video_frame_rate): """Sets the video_frame_rate of this AssetNonStandardInputReasons. - The video frame rate of the input file. # noqa: E501 + The video frame rate of the input file. Video with average frames per second (fps) less than 10 or greater than 120 is non-standard. A `-1` frame rate value indicates Mux could not determine the frame rate of the video track. # noqa: E501 :param video_frame_rate: The video_frame_rate of this AssetNonStandardInputReasons. # noqa: E501 - :type: str + :type video_frame_rate: str """ self._video_frame_rate = video_frame_rate @@ -180,7 +194,7 @@ def video_frame_rate(self, video_frame_rate): def video_resolution(self): """Gets the video_resolution of this AssetNonStandardInputReasons. # noqa: E501 - The video resolution of the input file. # noqa: E501 + The video resolution of the input file. Video resolution higher than 2048 pixels on any one dimension (height or width) is considered non-standard, The resolution value is presented as `width` x `height` in pixels. # noqa: E501 :return: The video_resolution of this AssetNonStandardInputReasons. # noqa: E501 :rtype: str @@ -191,10 +205,10 @@ def video_resolution(self): def video_resolution(self, video_resolution): """Sets the video_resolution of this AssetNonStandardInputReasons. - The video resolution of the input file. # noqa: E501 + The video resolution of the input file. Video resolution higher than 2048 pixels on any one dimension (height or width) is considered non-standard, The resolution value is presented as `width` x `height` in pixels. # noqa: E501 :param video_resolution: The video_resolution of this AssetNonStandardInputReasons. # noqa: E501 - :type: str + :type video_resolution: str """ self._video_resolution = video_resolution @@ -217,7 +231,7 @@ def pixel_aspect_ratio(self, pixel_aspect_ratio): The video pixel aspect ratio of the input file. # noqa: E501 :param pixel_aspect_ratio: The pixel_aspect_ratio of this AssetNonStandardInputReasons. # noqa: E501 - :type: str + :type pixel_aspect_ratio: str """ self._pixel_aspect_ratio = pixel_aspect_ratio @@ -240,10 +254,10 @@ def video_edit_list(self, video_edit_list): Video Edit List reason indicates that the input file's video track contains a complex Edit Decision List. # noqa: E501 :param video_edit_list: The video_edit_list of this AssetNonStandardInputReasons. # noqa: E501 - :type: str + :type video_edit_list: str """ allowed_values = ["non-standard"] # noqa: E501 - if video_edit_list not in allowed_values: + if self.local_vars_configuration.client_side_validation and video_edit_list not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `video_edit_list` ({0}), must be one of {1}" # noqa: E501 .format(video_edit_list, allowed_values) @@ -269,10 +283,10 @@ def audio_edit_list(self, audio_edit_list): Audio Edit List reason indicates that the input file's audio track contains a complex Edit Decision List. # noqa: E501 :param audio_edit_list: The audio_edit_list of this AssetNonStandardInputReasons. # noqa: E501 - :type: str + :type audio_edit_list: str """ allowed_values = ["non-standard"] # noqa: E501 - if audio_edit_list not in allowed_values: + if self.local_vars_configuration.client_side_validation and audio_edit_list not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `audio_edit_list` ({0}), must be one of {1}" # noqa: E501 .format(audio_edit_list, allowed_values) @@ -298,10 +312,10 @@ def unexpected_media_file_parameters(self, unexpected_media_file_parameters): A catch-all reason when the input file in created with non-standard encoding parameters. # noqa: E501 :param unexpected_media_file_parameters: The unexpected_media_file_parameters of this AssetNonStandardInputReasons. # noqa: E501 - :type: str + :type unexpected_media_file_parameters: str """ allowed_values = ["non-standard"] # noqa: E501 - if unexpected_media_file_parameters not in allowed_values: + if self.local_vars_configuration.client_side_validation and unexpected_media_file_parameters not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `unexpected_media_file_parameters` ({0}), must be one of {1}" # noqa: E501 .format(unexpected_media_file_parameters, allowed_values) @@ -309,27 +323,35 @@ def unexpected_media_file_parameters(self, unexpected_media_file_parameters): self._unexpected_media_file_parameters = unexpected_media_file_parameters - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -346,8 +368,11 @@ def __eq__(self, other): if not isinstance(other, AssetNonStandardInputReasons): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AssetNonStandardInputReasons): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/asset_recording_times.py b/mux_python/models/asset_recording_times.py index c6c763c..fb397c3 100644 --- a/mux_python/models/asset_recording_times.py +++ b/mux_python/models/asset_recording_times.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class AssetRecordingTimes(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class AssetRecordingTimes(object): 'duration': 'duration' } - def __init__(self, started_at=None, duration=None): # noqa: E501 + def __init__(self, started_at=None, duration=None, local_vars_configuration=None): # noqa: E501 """AssetRecordingTimes - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._started_at = None self._duration = None @@ -61,7 +75,7 @@ def started_at(self, started_at): The time at which the recording for the live stream started. The time value is Unix epoch time represented in ISO 8601 format. # noqa: E501 :param started_at: The started_at of this AssetRecordingTimes. # noqa: E501 - :type: datetime + :type started_at: datetime """ self._started_at = started_at @@ -84,32 +98,40 @@ def duration(self, duration): The duration of the live stream recorded. The time value is in seconds. # noqa: E501 :param duration: The duration of this AssetRecordingTimes. # noqa: E501 - :type: float + :type duration: float """ self._duration = duration - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -126,8 +148,11 @@ def __eq__(self, other): if not isinstance(other, AssetRecordingTimes): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AssetRecordingTimes): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/asset_response.py b/mux_python/models/asset_response.py index 52c8b05..8afe0c1 100644 --- a/mux_python/models/asset_response.py +++ b/mux_python/models/asset_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class AssetResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class AssetResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """AssetResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this AssetResponse. # noqa: E501 - :type: Asset + :type data: Asset """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, AssetResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AssetResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/asset_static_renditions.py b/mux_python/models/asset_static_renditions.py index c7c0803..36d72b6 100644 --- a/mux_python/models/asset_static_renditions.py +++ b/mux_python/models/asset_static_renditions.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class AssetStaticRenditions(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class AssetStaticRenditions(object): 'files': 'files' } - def __init__(self, status='disabled', files=None): # noqa: E501 + def __init__(self, status='disabled', files=None, local_vars_configuration=None): # noqa: E501 """AssetStaticRenditions - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._status = None self._files = None @@ -61,10 +75,10 @@ def status(self, status): Indicates the status of downloadable MP4 versions of this asset. # noqa: E501 :param status: The status of this AssetStaticRenditions. # noqa: E501 - :type: str + :type status: str """ allowed_values = ["ready", "preparing", "disabled", "errored"] # noqa: E501 - if status not in allowed_values: + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 .format(status, allowed_values) @@ -76,6 +90,7 @@ def status(self, status): def files(self): """Gets the files of this AssetStaticRenditions. # noqa: E501 + Array of file objects. # noqa: E501 :return: The files of this AssetStaticRenditions. # noqa: E501 :rtype: list[AssetStaticRenditionsFiles] @@ -86,34 +101,43 @@ def files(self): def files(self, files): """Sets the files of this AssetStaticRenditions. + Array of file objects. # noqa: E501 :param files: The files of this AssetStaticRenditions. # noqa: E501 - :type: list[AssetStaticRenditionsFiles] + :type files: list[AssetStaticRenditionsFiles] """ self._files = files - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -130,8 +154,11 @@ def __eq__(self, other): if not isinstance(other, AssetStaticRenditions): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AssetStaticRenditions): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/asset_static_renditions_files.py b/mux_python/models/asset_static_renditions_files.py index c11b086..f0e5f1a 100644 --- a/mux_python/models/asset_static_renditions_files.py +++ b/mux_python/models/asset_static_renditions_files.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class AssetStaticRenditionsFiles(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -39,8 +50,11 @@ class AssetStaticRenditionsFiles(object): 'filesize': 'filesize' } - def __init__(self, name=None, ext=None, height=None, width=None, bitrate=None, filesize=None): # noqa: E501 + def __init__(self, name=None, ext=None, height=None, width=None, bitrate=None, filesize=None, local_vars_configuration=None): # noqa: E501 """AssetStaticRenditionsFiles - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._name = None self._ext = None @@ -79,10 +93,10 @@ def name(self, name): :param name: The name of this AssetStaticRenditionsFiles. # noqa: E501 - :type: str + :type name: str """ allowed_values = ["low.mp4", "medium.mp4", "high.mp4", "audio.m4a"] # noqa: E501 - if name not in allowed_values: + if self.local_vars_configuration.client_side_validation and name not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 .format(name, allowed_values) @@ -108,10 +122,10 @@ def ext(self, ext): Extension of the static rendition file # noqa: E501 :param ext: The ext of this AssetStaticRenditionsFiles. # noqa: E501 - :type: str + :type ext: str """ allowed_values = ["mp4", "m4a"] # noqa: E501 - if ext not in allowed_values: + if self.local_vars_configuration.client_side_validation and ext not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `ext` ({0}), must be one of {1}" # noqa: E501 .format(ext, allowed_values) @@ -137,7 +151,7 @@ def height(self, height): The height of the static rendition's file in pixels # noqa: E501 :param height: The height of this AssetStaticRenditionsFiles. # noqa: E501 - :type: int + :type height: int """ self._height = height @@ -160,7 +174,7 @@ def width(self, width): The width of the static rendition's file in pixels # noqa: E501 :param width: The width of this AssetStaticRenditionsFiles. # noqa: E501 - :type: int + :type width: int """ self._width = width @@ -183,7 +197,7 @@ def bitrate(self, bitrate): The bitrate in bits per second # noqa: E501 :param bitrate: The bitrate of this AssetStaticRenditionsFiles. # noqa: E501 - :type: int + :type bitrate: int """ self._bitrate = bitrate @@ -192,6 +206,7 @@ def bitrate(self, bitrate): def filesize(self): """Gets the filesize of this AssetStaticRenditionsFiles. # noqa: E501 + The file size in bytes # noqa: E501 :return: The filesize of this AssetStaticRenditionsFiles. # noqa: E501 :rtype: str @@ -202,34 +217,43 @@ def filesize(self): def filesize(self, filesize): """Sets the filesize of this AssetStaticRenditionsFiles. + The file size in bytes # noqa: E501 :param filesize: The filesize of this AssetStaticRenditionsFiles. # noqa: E501 - :type: str + :type filesize: str """ self._filesize = filesize - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -246,8 +270,11 @@ def __eq__(self, other): if not isinstance(other, AssetStaticRenditionsFiles): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AssetStaticRenditionsFiles): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/breakdown_value.py b/mux_python/models/breakdown_value.py index dcaef8f..a25cfb7 100644 --- a/mux_python/models/breakdown_value.py +++ b/mux_python/models/breakdown_value.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class BreakdownValue(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -37,8 +48,11 @@ class BreakdownValue(object): 'field': 'field' } - def __init__(self, views=None, value=None, total_watch_time=None, negative_impact=None, field=None): # noqa: E501 + def __init__(self, views=None, value=None, total_watch_time=None, negative_impact=None, field=None, local_vars_configuration=None): # noqa: E501 """BreakdownValue - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._views = None self._value = None @@ -74,7 +88,7 @@ def views(self, views): :param views: The views of this BreakdownValue. # noqa: E501 - :type: int + :type views: int """ self._views = views @@ -95,7 +109,7 @@ def value(self, value): :param value: The value of this BreakdownValue. # noqa: E501 - :type: float + :type value: float """ self._value = value @@ -116,7 +130,7 @@ def total_watch_time(self, total_watch_time): :param total_watch_time: The total_watch_time of this BreakdownValue. # noqa: E501 - :type: int + :type total_watch_time: int """ self._total_watch_time = total_watch_time @@ -137,7 +151,7 @@ def negative_impact(self, negative_impact): :param negative_impact: The negative_impact of this BreakdownValue. # noqa: E501 - :type: int + :type negative_impact: int """ self._negative_impact = negative_impact @@ -158,32 +172,40 @@ def field(self, field): :param field: The field of this BreakdownValue. # noqa: E501 - :type: str + :type field: str """ self._field = field - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -200,8 +222,11 @@ def __eq__(self, other): if not isinstance(other, BreakdownValue): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, BreakdownValue): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/create_asset_request.py b/mux_python/models/create_asset_request.py index 95531fb..117501e 100644 --- a/mux_python/models/create_asset_request.py +++ b/mux_python/models/create_asset_request.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class CreateAssetRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -43,8 +54,11 @@ class CreateAssetRequest(object): 'test': 'test' } - def __init__(self, input=None, playback_policy=None, per_title_encode=None, passthrough=None, mp4_support=None, normalize_audio=False, master_access=None, test=None): # noqa: E501 + def __init__(self, input=None, playback_policy=None, per_title_encode=None, passthrough=None, mp4_support=None, normalize_audio=False, master_access=None, test=None, local_vars_configuration=None): # noqa: E501 """CreateAssetRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._input = None self._playback_policy = None @@ -91,7 +105,7 @@ def input(self, input): An array of objects that each describe an input file to be used to create the asset. As a shortcut, input can also be a string URL for a file when only one input file is used. See `input[].url` for requirements. # noqa: E501 :param input: The input of this CreateAssetRequest. # noqa: E501 - :type: list[InputSettings] + :type input: list[InputSettings] """ self._input = input @@ -114,7 +128,7 @@ def playback_policy(self, playback_policy): An array of playback policy names that you want applied to this asset and available through `playback_ids`. Options include: `\"public\"` (anyone with the playback URL can stream the asset). And `\"signed\"` (an additional access token is required to play the asset). If no playback_policy is set, the asset will have no playback IDs and will therefore not be playable. For simplicity, a single string name can be used in place of the array in the case of only one playback policy. # noqa: E501 :param playback_policy: The playback_policy of this CreateAssetRequest. # noqa: E501 - :type: list[PlaybackPolicy] + :type playback_policy: list[PlaybackPolicy] """ self._playback_policy = playback_policy @@ -135,7 +149,7 @@ def per_title_encode(self, per_title_encode): :param per_title_encode: The per_title_encode of this CreateAssetRequest. # noqa: E501 - :type: bool + :type per_title_encode: bool """ self._per_title_encode = per_title_encode @@ -158,7 +172,7 @@ def passthrough(self, passthrough): Arbitrary metadata that will be included in the asset details and related webhooks. Can be used to store your own ID for a video along with the asset. **Max: 255 characters**. # noqa: E501 :param passthrough: The passthrough of this CreateAssetRequest. # noqa: E501 - :type: str + :type passthrough: str """ self._passthrough = passthrough @@ -167,7 +181,7 @@ def passthrough(self, passthrough): def mp4_support(self): """Gets the mp4_support of this CreateAssetRequest. # noqa: E501 - Specify what level (if any) of support for mp4 playback. In most cases you should use our default HLS-based streaming playback ({playback_id}.m3u8) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your vidoes guide](/guides/video/download-your-videos) for more information. # noqa: E501 + Specify what level (if any) of support for mp4 playback. In most cases you should use our default HLS-based streaming playback ({playback_id}.m3u8) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your videos guide](/guides/video/download-your-videos) for more information. # noqa: E501 :return: The mp4_support of this CreateAssetRequest. # noqa: E501 :rtype: str @@ -178,13 +192,13 @@ def mp4_support(self): def mp4_support(self, mp4_support): """Sets the mp4_support of this CreateAssetRequest. - Specify what level (if any) of support for mp4 playback. In most cases you should use our default HLS-based streaming playback ({playback_id}.m3u8) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your vidoes guide](/guides/video/download-your-videos) for more information. # noqa: E501 + Specify what level (if any) of support for mp4 playback. In most cases you should use our default HLS-based streaming playback ({playback_id}.m3u8) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your videos guide](/guides/video/download-your-videos) for more information. # noqa: E501 :param mp4_support: The mp4_support of this CreateAssetRequest. # noqa: E501 - :type: str + :type mp4_support: str """ allowed_values = ["none", "standard"] # noqa: E501 - if mp4_support not in allowed_values: + if self.local_vars_configuration.client_side_validation and mp4_support not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `mp4_support` ({0}), must be one of {1}" # noqa: E501 .format(mp4_support, allowed_values) @@ -210,7 +224,7 @@ def normalize_audio(self, normalize_audio): Normalize the audio track loudness level. This parameter is only applicable to on-demand (not live) assets. # noqa: E501 :param normalize_audio: The normalize_audio of this CreateAssetRequest. # noqa: E501 - :type: bool + :type normalize_audio: bool """ self._normalize_audio = normalize_audio @@ -219,7 +233,7 @@ def normalize_audio(self, normalize_audio): def master_access(self): """Gets the master_access of this CreateAssetRequest. # noqa: E501 - Specify what level (if any) of support for master access. Master access can be enabled temporarily for your asset to be downloaded. See the [Download your vidoes guide](/guides/video/download-your-videos) for more information. # noqa: E501 + Specify what level (if any) of support for master access. Master access can be enabled temporarily for your asset to be downloaded. See the [Download your videos guide](/guides/video/download-your-videos) for more information. # noqa: E501 :return: The master_access of this CreateAssetRequest. # noqa: E501 :rtype: str @@ -230,13 +244,13 @@ def master_access(self): def master_access(self, master_access): """Sets the master_access of this CreateAssetRequest. - Specify what level (if any) of support for master access. Master access can be enabled temporarily for your asset to be downloaded. See the [Download your vidoes guide](/guides/video/download-your-videos) for more information. # noqa: E501 + Specify what level (if any) of support for master access. Master access can be enabled temporarily for your asset to be downloaded. See the [Download your videos guide](/guides/video/download-your-videos) for more information. # noqa: E501 :param master_access: The master_access of this CreateAssetRequest. # noqa: E501 - :type: str + :type master_access: str """ allowed_values = ["none", "temporary"] # noqa: E501 - if master_access not in allowed_values: + if self.local_vars_configuration.client_side_validation and master_access not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `master_access` ({0}), must be one of {1}" # noqa: E501 .format(master_access, allowed_values) @@ -262,32 +276,40 @@ def test(self, test): Marks the asset as a test asset when the value is set to true. A Test asset can help evaluate the Mux Video APIs without incurring any cost. There is no limit on number of test assets created. Test asset are watermarked with the Mux logo, limited to 10 seconds, deleted after 24 hrs. # noqa: E501 :param test: The test of this CreateAssetRequest. # noqa: E501 - :type: bool + :type test: bool """ self._test = test - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -304,8 +326,11 @@ def __eq__(self, other): if not isinstance(other, CreateAssetRequest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, CreateAssetRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/create_live_stream_request.py b/mux_python/models/create_live_stream_request.py index 838fecb..d2f31ba 100644 --- a/mux_python/models/create_live_stream_request.py +++ b/mux_python/models/create_live_stream_request.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class CreateLiveStreamRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -41,8 +52,11 @@ class CreateLiveStreamRequest(object): 'simulcast_targets': 'simulcast_targets' } - def __init__(self, playback_policy=None, new_asset_settings=None, reconnect_window=None, passthrough=None, reduced_latency=None, test=None, simulcast_targets=None): # noqa: E501 + def __init__(self, playback_policy=None, new_asset_settings=None, reconnect_window=None, passthrough=None, reduced_latency=None, test=None, simulcast_targets=None, local_vars_configuration=None): # noqa: E501 """CreateLiveStreamRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._playback_policy = None self._new_asset_settings = None @@ -84,7 +98,7 @@ def playback_policy(self, playback_policy): :param playback_policy: The playback_policy of this CreateLiveStreamRequest. # noqa: E501 - :type: list[PlaybackPolicy] + :type playback_policy: list[PlaybackPolicy] """ self._playback_policy = playback_policy @@ -105,7 +119,7 @@ def new_asset_settings(self, new_asset_settings): :param new_asset_settings: The new_asset_settings of this CreateLiveStreamRequest. # noqa: E501 - :type: CreateAssetRequest + :type new_asset_settings: CreateAssetRequest """ self._new_asset_settings = new_asset_settings @@ -128,11 +142,13 @@ def reconnect_window(self, reconnect_window): When live streaming software disconnects from Mux, either intentionally or due to a drop in the network, the Reconnect Window is the time in seconds that Mux should wait for the streaming software to reconnect before considering the live stream finished and completing the recorded asset. Defaults to 60 seconds on the API if not specified. # noqa: E501 :param reconnect_window: The reconnect_window of this CreateLiveStreamRequest. # noqa: E501 - :type: float + :type reconnect_window: float """ - if reconnect_window is not None and reconnect_window > 300: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + reconnect_window is not None and reconnect_window > 300): # noqa: E501 raise ValueError("Invalid value for `reconnect_window`, must be a value less than or equal to `300`") # noqa: E501 - if reconnect_window is not None and reconnect_window < 0.1: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + reconnect_window is not None and reconnect_window < 0.1): # noqa: E501 raise ValueError("Invalid value for `reconnect_window`, must be a value greater than or equal to `0.1`") # noqa: E501 self._reconnect_window = reconnect_window @@ -153,7 +169,7 @@ def passthrough(self, passthrough): :param passthrough: The passthrough of this CreateLiveStreamRequest. # noqa: E501 - :type: str + :type passthrough: str """ self._passthrough = passthrough @@ -176,7 +192,7 @@ def reduced_latency(self, reduced_latency): Latency is the time from when the streamer does something in real life to when you see it happen in the player. Set this if you want lower latency for your live stream. Note: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. Read more here: https://mux.com/blog/reduced-latency-for-mux-live-streaming-now-available/ # noqa: E501 :param reduced_latency: The reduced_latency of this CreateLiveStreamRequest. # noqa: E501 - :type: bool + :type reduced_latency: bool """ self._reduced_latency = reduced_latency @@ -197,7 +213,7 @@ def test(self, test): :param test: The test of this CreateLiveStreamRequest. # noqa: E501 - :type: bool + :type test: bool """ self._test = test @@ -218,32 +234,40 @@ def simulcast_targets(self, simulcast_targets): :param simulcast_targets: The simulcast_targets of this CreateLiveStreamRequest. # noqa: E501 - :type: list[CreateSimulcastTargetRequest] + :type simulcast_targets: list[CreateSimulcastTargetRequest] """ self._simulcast_targets = simulcast_targets - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -260,8 +284,11 @@ def __eq__(self, other): if not isinstance(other, CreateLiveStreamRequest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, CreateLiveStreamRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/create_playback_id_request.py b/mux_python/models/create_playback_id_request.py index e637492..ffe568b 100644 --- a/mux_python/models/create_playback_id_request.py +++ b/mux_python/models/create_playback_id_request.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class CreatePlaybackIDRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class CreatePlaybackIDRequest(object): 'policy': 'policy' } - def __init__(self, policy=None): # noqa: E501 + def __init__(self, policy=None, local_vars_configuration=None): # noqa: E501 """CreatePlaybackIDRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._policy = None self.discriminator = None @@ -54,32 +68,40 @@ def policy(self, policy): :param policy: The policy of this CreatePlaybackIDRequest. # noqa: E501 - :type: PlaybackPolicy + :type policy: PlaybackPolicy """ self._policy = policy - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, CreatePlaybackIDRequest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, CreatePlaybackIDRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/create_playback_id_response.py b/mux_python/models/create_playback_id_response.py index fe49646..748b99a 100644 --- a/mux_python/models/create_playback_id_response.py +++ b/mux_python/models/create_playback_id_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class CreatePlaybackIDResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class CreatePlaybackIDResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """CreatePlaybackIDResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this CreatePlaybackIDResponse. # noqa: E501 - :type: PlaybackID + :type data: PlaybackID """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, CreatePlaybackIDResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, CreatePlaybackIDResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/create_simulcast_target_request.py b/mux_python/models/create_simulcast_target_request.py index a4fec53..5e22dc9 100644 --- a/mux_python/models/create_simulcast_target_request.py +++ b/mux_python/models/create_simulcast_target_request.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class CreateSimulcastTargetRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class CreateSimulcastTargetRequest(object): 'url': 'url' } - def __init__(self, passthrough=None, stream_key=None, url=None): # noqa: E501 + def __init__(self, passthrough=None, stream_key=None, url=None, local_vars_configuration=None): # noqa: E501 """CreateSimulcastTargetRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._passthrough = None self._stream_key = None @@ -65,7 +79,7 @@ def passthrough(self, passthrough): Arbitrary metadata set by you when creating a simulcast target. # noqa: E501 :param passthrough: The passthrough of this CreateSimulcastTargetRequest. # noqa: E501 - :type: str + :type passthrough: str """ self._passthrough = passthrough @@ -88,7 +102,7 @@ def stream_key(self, stream_key): Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to. # noqa: E501 :param stream_key: The stream_key of this CreateSimulcastTargetRequest. # noqa: E501 - :type: str + :type stream_key: str """ self._stream_key = stream_key @@ -111,34 +125,42 @@ def url(self, url): RTMP hostname including application name for the third party live streaming service. Example: 'rtmp://live.example.com/app'. # noqa: E501 :param url: The url of this CreateSimulcastTargetRequest. # noqa: E501 - :type: str + :type url: str """ - if url is None: + if self.local_vars_configuration.client_side_validation and url is None: # noqa: E501 raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 self._url = url - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -155,8 +177,11 @@ def __eq__(self, other): if not isinstance(other, CreateSimulcastTargetRequest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, CreateSimulcastTargetRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/create_track_request.py b/mux_python/models/create_track_request.py index 4805d6f..8758cb3 100644 --- a/mux_python/models/create_track_request.py +++ b/mux_python/models/create_track_request.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class CreateTrackRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -41,8 +52,11 @@ class CreateTrackRequest(object): 'passthrough': 'passthrough' } - def __init__(self, url=None, type=None, text_type=None, language_code=None, name=None, closed_captions=None, passthrough=None): # noqa: E501 + def __init__(self, url=None, type=None, text_type=None, language_code=None, name=None, closed_captions=None, passthrough=None, local_vars_configuration=None): # noqa: E501 """CreateTrackRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._url = None self._type = None @@ -80,9 +94,9 @@ def url(self, url): :param url: The url of this CreateTrackRequest. # noqa: E501 - :type: str + :type url: str """ - if url is None: + if self.local_vars_configuration.client_side_validation and url is None: # noqa: E501 raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 self._url = url @@ -103,12 +117,12 @@ def type(self, type): :param type: The type of this CreateTrackRequest. # noqa: E501 - :type: str + :type type: str """ - if type is None: + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 allowed_values = ["text"] # noqa: E501 - if type not in allowed_values: + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 .format(type, allowed_values) @@ -132,12 +146,12 @@ def text_type(self, text_type): :param text_type: The text_type of this CreateTrackRequest. # noqa: E501 - :type: str + :type text_type: str """ - if text_type is None: + if self.local_vars_configuration.client_side_validation and text_type is None: # noqa: E501 raise ValueError("Invalid value for `text_type`, must not be `None`") # noqa: E501 allowed_values = ["subtitles"] # noqa: E501 - if text_type not in allowed_values: + if self.local_vars_configuration.client_side_validation and text_type not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `text_type` ({0}), must be one of {1}" # noqa: E501 .format(text_type, allowed_values) @@ -163,9 +177,9 @@ def language_code(self, language_code): The language code value must be a valid BCP 47 specification compliant value. For example, en for English or en-US for the US version of English. # noqa: E501 :param language_code: The language_code of this CreateTrackRequest. # noqa: E501 - :type: str + :type language_code: str """ - if language_code is None: + if self.local_vars_configuration.client_side_validation and language_code is None: # noqa: E501 raise ValueError("Invalid value for `language_code`, must not be `None`") # noqa: E501 self._language_code = language_code @@ -188,7 +202,7 @@ def name(self, name): The name of the track containing a human-readable description. This value must be unqiue across all the text type and subtitles text type tracks. HLS manifest will associate subtitle text track with this value. For example, set the value to \"English\" for subtitles text track with language_code as en-US. If this parameter is not included, Mux will auto-populate based on the language_code value. # noqa: E501 :param name: The name of this CreateTrackRequest. # noqa: E501 - :type: str + :type name: str """ self._name = name @@ -211,7 +225,7 @@ def closed_captions(self, closed_captions): Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). # noqa: E501 :param closed_captions: The closed_captions of this CreateTrackRequest. # noqa: E501 - :type: bool + :type closed_captions: bool """ self._closed_captions = closed_captions @@ -234,32 +248,40 @@ def passthrough(self, passthrough): Arbitrary metadata set for the track either when creating the asset or track. # noqa: E501 :param passthrough: The passthrough of this CreateTrackRequest. # noqa: E501 - :type: str + :type passthrough: str """ self._passthrough = passthrough - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -276,8 +298,11 @@ def __eq__(self, other): if not isinstance(other, CreateTrackRequest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, CreateTrackRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/create_track_response.py b/mux_python/models/create_track_response.py index 5781e46..702d04f 100644 --- a/mux_python/models/create_track_response.py +++ b/mux_python/models/create_track_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class CreateTrackResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class CreateTrackResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """CreateTrackResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this CreateTrackResponse. # noqa: E501 - :type: Track + :type data: Track """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, CreateTrackResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, CreateTrackResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/create_upload_request.py b/mux_python/models/create_upload_request.py index 2813ee6..67a28ec 100644 --- a/mux_python/models/create_upload_request.py +++ b/mux_python/models/create_upload_request.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class CreateUploadRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -35,8 +46,11 @@ class CreateUploadRequest(object): 'test': 'test' } - def __init__(self, timeout=3600, cors_origin=None, new_asset_settings=None, test=None): # noqa: E501 + def __init__(self, timeout=3600, cors_origin=None, new_asset_settings=None, test=None, local_vars_configuration=None): # noqa: E501 """CreateUploadRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._timeout = None self._cors_origin = None @@ -70,11 +84,13 @@ def timeout(self, timeout): Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out` # noqa: E501 :param timeout: The timeout of this CreateUploadRequest. # noqa: E501 - :type: int + :type timeout: int """ - if timeout is not None and timeout > 604800: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + timeout is not None and timeout > 604800): # noqa: E501 raise ValueError("Invalid value for `timeout`, must be a value less than or equal to `604800`") # noqa: E501 - if timeout is not None and timeout < 60: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + timeout is not None and timeout < 60): # noqa: E501 raise ValueError("Invalid value for `timeout`, must be a value greater than or equal to `60`") # noqa: E501 self._timeout = timeout @@ -97,7 +113,7 @@ def cors_origin(self, cors_origin): If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers. # noqa: E501 :param cors_origin: The cors_origin of this CreateUploadRequest. # noqa: E501 - :type: str + :type cors_origin: str """ self._cors_origin = cors_origin @@ -118,9 +134,9 @@ def new_asset_settings(self, new_asset_settings): :param new_asset_settings: The new_asset_settings of this CreateUploadRequest. # noqa: E501 - :type: CreateAssetRequest + :type new_asset_settings: CreateAssetRequest """ - if new_asset_settings is None: + if self.local_vars_configuration.client_side_validation and new_asset_settings is None: # noqa: E501 raise ValueError("Invalid value for `new_asset_settings`, must not be `None`") # noqa: E501 self._new_asset_settings = new_asset_settings @@ -141,32 +157,40 @@ def test(self, test): :param test: The test of this CreateUploadRequest. # noqa: E501 - :type: bool + :type test: bool """ self._test = test - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -183,8 +207,11 @@ def __eq__(self, other): if not isinstance(other, CreateUploadRequest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, CreateUploadRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/delivery_report.py b/mux_python/models/delivery_report.py index 07d5583..70f3151 100644 --- a/mux_python/models/delivery_report.py +++ b/mux_python/models/delivery_report.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class DeliveryReport(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -41,8 +52,11 @@ class DeliveryReport(object): 'delivered_seconds': 'delivered_seconds' } - def __init__(self, live_stream_id=None, asset_id=None, passthrough=None, created_at=None, asset_state=None, asset_duration=None, delivered_seconds=None): # noqa: E501 + def __init__(self, live_stream_id=None, asset_id=None, passthrough=None, created_at=None, asset_state=None, asset_duration=None, delivered_seconds=None, local_vars_configuration=None): # noqa: E501 """DeliveryReport - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._live_stream_id = None self._asset_id = None @@ -72,6 +86,7 @@ def __init__(self, live_stream_id=None, asset_id=None, passthrough=None, created def live_stream_id(self): """Gets the live_stream_id of this DeliveryReport. # noqa: E501 + Unique identifier for the live stream that created the asset. # noqa: E501 :return: The live_stream_id of this DeliveryReport. # noqa: E501 :rtype: str @@ -82,9 +97,10 @@ def live_stream_id(self): def live_stream_id(self, live_stream_id): """Sets the live_stream_id of this DeliveryReport. + Unique identifier for the live stream that created the asset. # noqa: E501 :param live_stream_id: The live_stream_id of this DeliveryReport. # noqa: E501 - :type: str + :type live_stream_id: str """ self._live_stream_id = live_stream_id @@ -93,6 +109,7 @@ def live_stream_id(self, live_stream_id): def asset_id(self): """Gets the asset_id of this DeliveryReport. # noqa: E501 + Unique identifier for the asset. # noqa: E501 :return: The asset_id of this DeliveryReport. # noqa: E501 :rtype: str @@ -103,9 +120,10 @@ def asset_id(self): def asset_id(self, asset_id): """Sets the asset_id of this DeliveryReport. + Unique identifier for the asset. # noqa: E501 :param asset_id: The asset_id of this DeliveryReport. # noqa: E501 - :type: str + :type asset_id: str """ self._asset_id = asset_id @@ -114,6 +132,7 @@ def asset_id(self, asset_id): def passthrough(self): """Gets the passthrough of this DeliveryReport. # noqa: E501 + The `passthrough` value for the asset. # noqa: E501 :return: The passthrough of this DeliveryReport. # noqa: E501 :rtype: str @@ -124,9 +143,10 @@ def passthrough(self): def passthrough(self, passthrough): """Sets the passthrough of this DeliveryReport. + The `passthrough` value for the asset. # noqa: E501 :param passthrough: The passthrough of this DeliveryReport. # noqa: E501 - :type: str + :type passthrough: str """ self._passthrough = passthrough @@ -135,6 +155,7 @@ def passthrough(self, passthrough): def created_at(self): """Gets the created_at of this DeliveryReport. # noqa: E501 + Time at which the asset was created. Measured in seconds since the Unix epoch. # noqa: E501 :return: The created_at of this DeliveryReport. # noqa: E501 :rtype: str @@ -145,9 +166,10 @@ def created_at(self): def created_at(self, created_at): """Sets the created_at of this DeliveryReport. + Time at which the asset was created. Measured in seconds since the Unix epoch. # noqa: E501 :param created_at: The created_at of this DeliveryReport. # noqa: E501 - :type: str + :type created_at: str """ self._created_at = created_at @@ -156,6 +178,7 @@ def created_at(self, created_at): def asset_state(self): """Gets the asset_state of this DeliveryReport. # noqa: E501 + The state of the asset. # noqa: E501 :return: The asset_state of this DeliveryReport. # noqa: E501 :rtype: str @@ -166,10 +189,17 @@ def asset_state(self): def asset_state(self, asset_state): """Sets the asset_state of this DeliveryReport. + The state of the asset. # noqa: E501 :param asset_state: The asset_state of this DeliveryReport. # noqa: E501 - :type: str + :type asset_state: str """ + allowed_values = ["ready", "errored", "deleted"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and asset_state not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `asset_state` ({0}), must be one of {1}" # noqa: E501 + .format(asset_state, allowed_values) + ) self._asset_state = asset_state @@ -177,6 +207,7 @@ def asset_state(self, asset_state): def asset_duration(self): """Gets the asset_duration of this DeliveryReport. # noqa: E501 + The duration of the asset in seconds. # noqa: E501 :return: The asset_duration of this DeliveryReport. # noqa: E501 :rtype: float @@ -187,9 +218,10 @@ def asset_duration(self): def asset_duration(self, asset_duration): """Sets the asset_duration of this DeliveryReport. + The duration of the asset in seconds. # noqa: E501 :param asset_duration: The asset_duration of this DeliveryReport. # noqa: E501 - :type: float + :type asset_duration: float """ self._asset_duration = asset_duration @@ -198,6 +230,7 @@ def asset_duration(self, asset_duration): def delivered_seconds(self): """Gets the delivered_seconds of this DeliveryReport. # noqa: E501 + Total number of delivered seconds during this time window. # noqa: E501 :return: The delivered_seconds of this DeliveryReport. # noqa: E501 :rtype: float @@ -208,34 +241,43 @@ def delivered_seconds(self): def delivered_seconds(self, delivered_seconds): """Sets the delivered_seconds of this DeliveryReport. + Total number of delivered seconds during this time window. # noqa: E501 :param delivered_seconds: The delivered_seconds of this DeliveryReport. # noqa: E501 - :type: float + :type delivered_seconds: float """ self._delivered_seconds = delivered_seconds - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -252,8 +294,11 @@ def __eq__(self, other): if not isinstance(other, DeliveryReport): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, DeliveryReport): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/dimension_value.py b/mux_python/models/dimension_value.py index e162dd8..02bcae3 100644 --- a/mux_python/models/dimension_value.py +++ b/mux_python/models/dimension_value.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class DimensionValue(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class DimensionValue(object): 'total_count': 'total_count' } - def __init__(self, value=None, total_count=None): # noqa: E501 + def __init__(self, value=None, total_count=None, local_vars_configuration=None): # noqa: E501 """DimensionValue - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._value = None self._total_count = None @@ -59,7 +73,7 @@ def value(self, value): :param value: The value of this DimensionValue. # noqa: E501 - :type: str + :type value: str """ self._value = value @@ -80,32 +94,40 @@ def total_count(self, total_count): :param total_count: The total_count of this DimensionValue. # noqa: E501 - :type: int + :type total_count: int """ self._total_count = total_count - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -122,8 +144,11 @@ def __eq__(self, other): if not isinstance(other, DimensionValue): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, DimensionValue): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/disable_live_stream_response.py b/mux_python/models/disable_live_stream_response.py index 191dff9..3b761fc 100644 --- a/mux_python/models/disable_live_stream_response.py +++ b/mux_python/models/disable_live_stream_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class DisableLiveStreamResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class DisableLiveStreamResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """DisableLiveStreamResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this DisableLiveStreamResponse. # noqa: E501 - :type: object + :type data: object """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, DisableLiveStreamResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, DisableLiveStreamResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/enable_live_stream_response.py b/mux_python/models/enable_live_stream_response.py index 87c13a0..5a3860b 100644 --- a/mux_python/models/enable_live_stream_response.py +++ b/mux_python/models/enable_live_stream_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class EnableLiveStreamResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class EnableLiveStreamResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """EnableLiveStreamResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this EnableLiveStreamResponse. # noqa: E501 - :type: object + :type data: object """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, EnableLiveStreamResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, EnableLiveStreamResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/error.py b/mux_python/models/error.py index ab43dff..832b3ab 100644 --- a/mux_python/models/error.py +++ b/mux_python/models/error.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class Error(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -43,8 +54,11 @@ class Error(object): 'code': 'code' } - def __init__(self, id=None, percentage=None, notes=None, message=None, last_seen=None, description=None, count=None, code=None): # noqa: E501 + def __init__(self, id=None, percentage=None, notes=None, message=None, last_seen=None, description=None, count=None, code=None, local_vars_configuration=None): # noqa: E501 """Error - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._id = None self._percentage = None @@ -77,6 +91,7 @@ def __init__(self, id=None, percentage=None, notes=None, message=None, last_seen def id(self): """Gets the id of this Error. # noqa: E501 + A unique identifier for this error. # noqa: E501 :return: The id of this Error. # noqa: E501 :rtype: int @@ -87,9 +102,10 @@ def id(self): def id(self, id): """Sets the id of this Error. + A unique identifier for this error. # noqa: E501 :param id: The id of this Error. # noqa: E501 - :type: int + :type id: int """ self._id = id @@ -98,6 +114,7 @@ def id(self, id): def percentage(self): """Gets the percentage of this Error. # noqa: E501 + The percentage of views that experienced this error. # noqa: E501 :return: The percentage of this Error. # noqa: E501 :rtype: float @@ -108,9 +125,10 @@ def percentage(self): def percentage(self, percentage): """Sets the percentage of this Error. + The percentage of views that experienced this error. # noqa: E501 :param percentage: The percentage of this Error. # noqa: E501 - :type: float + :type percentage: float """ self._percentage = percentage @@ -119,6 +137,7 @@ def percentage(self, percentage): def notes(self): """Gets the notes of this Error. # noqa: E501 + Notes that are attached to this error. # noqa: E501 :return: The notes of this Error. # noqa: E501 :rtype: str @@ -129,9 +148,10 @@ def notes(self): def notes(self, notes): """Sets the notes of this Error. + Notes that are attached to this error. # noqa: E501 :param notes: The notes of this Error. # noqa: E501 - :type: str + :type notes: str """ self._notes = notes @@ -140,6 +160,7 @@ def notes(self, notes): def message(self): """Gets the message of this Error. # noqa: E501 + The error message. # noqa: E501 :return: The message of this Error. # noqa: E501 :rtype: str @@ -150,9 +171,10 @@ def message(self): def message(self, message): """Sets the message of this Error. + The error message. # noqa: E501 :param message: The message of this Error. # noqa: E501 - :type: str + :type message: str """ self._message = message @@ -161,6 +183,7 @@ def message(self, message): def last_seen(self): """Gets the last_seen of this Error. # noqa: E501 + The last time this error was seen (ISO 8601 timestamp). # noqa: E501 :return: The last_seen of this Error. # noqa: E501 :rtype: str @@ -171,9 +194,10 @@ def last_seen(self): def last_seen(self, last_seen): """Sets the last_seen of this Error. + The last time this error was seen (ISO 8601 timestamp). # noqa: E501 :param last_seen: The last_seen of this Error. # noqa: E501 - :type: str + :type last_seen: str """ self._last_seen = last_seen @@ -182,6 +206,7 @@ def last_seen(self, last_seen): def description(self): """Gets the description of this Error. # noqa: E501 + Description of the error. # noqa: E501 :return: The description of this Error. # noqa: E501 :rtype: str @@ -192,9 +217,10 @@ def description(self): def description(self, description): """Sets the description of this Error. + Description of the error. # noqa: E501 :param description: The description of this Error. # noqa: E501 - :type: str + :type description: str """ self._description = description @@ -203,6 +229,7 @@ def description(self, description): def count(self): """Gets the count of this Error. # noqa: E501 + The total number of views that experiend this error. # noqa: E501 :return: The count of this Error. # noqa: E501 :rtype: int @@ -213,9 +240,10 @@ def count(self): def count(self, count): """Sets the count of this Error. + The total number of views that experiend this error. # noqa: E501 :param count: The count of this Error. # noqa: E501 - :type: int + :type count: int """ self._count = count @@ -224,6 +252,7 @@ def count(self, count): def code(self): """Gets the code of this Error. # noqa: E501 + The error code # noqa: E501 :return: The code of this Error. # noqa: E501 :rtype: int @@ -234,34 +263,43 @@ def code(self): def code(self, code): """Sets the code of this Error. + The error code # noqa: E501 :param code: The code of this Error. # noqa: E501 - :type: int + :type code: int """ self._code = code - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -278,8 +316,11 @@ def __eq__(self, other): if not isinstance(other, Error): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Error): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/filter_value.py b/mux_python/models/filter_value.py index 91b1364..2816db2 100644 --- a/mux_python/models/filter_value.py +++ b/mux_python/models/filter_value.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class FilterValue(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class FilterValue(object): 'total_count': 'total_count' } - def __init__(self, value=None, total_count=None): # noqa: E501 + def __init__(self, value=None, total_count=None, local_vars_configuration=None): # noqa: E501 """FilterValue - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._value = None self._total_count = None @@ -59,7 +73,7 @@ def value(self, value): :param value: The value of this FilterValue. # noqa: E501 - :type: str + :type value: str """ self._value = value @@ -80,32 +94,40 @@ def total_count(self, total_count): :param total_count: The total_count of this FilterValue. # noqa: E501 - :type: int + :type total_count: int """ self._total_count = total_count - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -122,8 +144,11 @@ def __eq__(self, other): if not isinstance(other, FilterValue): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, FilterValue): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/get_asset_input_info_response.py b/mux_python/models/get_asset_input_info_response.py index 603ec22..8e7a067 100644 --- a/mux_python/models/get_asset_input_info_response.py +++ b/mux_python/models/get_asset_input_info_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class GetAssetInputInfoResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class GetAssetInputInfoResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """GetAssetInputInfoResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this GetAssetInputInfoResponse. # noqa: E501 - :type: list[InputInfo] + :type data: list[InputInfo] """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, GetAssetInputInfoResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, GetAssetInputInfoResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/get_asset_or_live_stream_id_response.py b/mux_python/models/get_asset_or_live_stream_id_response.py index d61c827..ec139cf 100644 --- a/mux_python/models/get_asset_or_live_stream_id_response.py +++ b/mux_python/models/get_asset_or_live_stream_id_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class GetAssetOrLiveStreamIdResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class GetAssetOrLiveStreamIdResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """GetAssetOrLiveStreamIdResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this GetAssetOrLiveStreamIdResponse. # noqa: E501 - :type: GetAssetOrLiveStreamIdResponseData + :type data: GetAssetOrLiveStreamIdResponseData """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, GetAssetOrLiveStreamIdResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, GetAssetOrLiveStreamIdResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/get_asset_or_live_stream_id_response_data.py b/mux_python/models/get_asset_or_live_stream_id_response_data.py index 47cb17f..3605d88 100644 --- a/mux_python/models/get_asset_or_live_stream_id_response_data.py +++ b/mux_python/models/get_asset_or_live_stream_id_response_data.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class GetAssetOrLiveStreamIdResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class GetAssetOrLiveStreamIdResponseData(object): 'object': 'object' } - def __init__(self, id=None, policy=None, object=None): # noqa: E501 + def __init__(self, id=None, policy=None, object=None, local_vars_configuration=None): # noqa: E501 """GetAssetOrLiveStreamIdResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._id = None self._policy = None @@ -66,7 +80,7 @@ def id(self, id): The Playback ID used to retrieve the corresponding asset or the live stream ID # noqa: E501 :param id: The id of this GetAssetOrLiveStreamIdResponseData. # noqa: E501 - :type: str + :type id: str """ self._id = id @@ -87,7 +101,7 @@ def policy(self, policy): :param policy: The policy of this GetAssetOrLiveStreamIdResponseData. # noqa: E501 - :type: PlaybackPolicy + :type policy: PlaybackPolicy """ self._policy = policy @@ -108,32 +122,40 @@ def object(self, object): :param object: The object of this GetAssetOrLiveStreamIdResponseData. # noqa: E501 - :type: GetAssetOrLiveStreamIdResponseDataObject + :type object: GetAssetOrLiveStreamIdResponseDataObject """ self._object = object - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -150,8 +172,11 @@ def __eq__(self, other): if not isinstance(other, GetAssetOrLiveStreamIdResponseData): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, GetAssetOrLiveStreamIdResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/get_asset_or_live_stream_id_response_data_object.py b/mux_python/models/get_asset_or_live_stream_id_response_data_object.py index 03b5713..183bd15 100644 --- a/mux_python/models/get_asset_or_live_stream_id_response_data_object.py +++ b/mux_python/models/get_asset_or_live_stream_id_response_data_object.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class GetAssetOrLiveStreamIdResponseDataObject(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class GetAssetOrLiveStreamIdResponseDataObject(object): 'type': 'type' } - def __init__(self, id=None, type=None): # noqa: E501 + def __init__(self, id=None, type=None, local_vars_configuration=None): # noqa: E501 """GetAssetOrLiveStreamIdResponseDataObject - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._id = None self._type = None @@ -61,7 +75,7 @@ def id(self, id): The identifier of the object. # noqa: E501 :param id: The id of this GetAssetOrLiveStreamIdResponseDataObject. # noqa: E501 - :type: str + :type id: str """ self._id = id @@ -84,10 +98,10 @@ def type(self, type): Identifies the object type associated with the playback ID. # noqa: E501 :param type: The type of this GetAssetOrLiveStreamIdResponseDataObject. # noqa: E501 - :type: str + :type type: str """ allowed_values = ["asset", "live_stream"] # noqa: E501 - if type not in allowed_values: + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 .format(type, allowed_values) @@ -95,27 +109,35 @@ def type(self, type): self._type = type - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -132,8 +154,11 @@ def __eq__(self, other): if not isinstance(other, GetAssetOrLiveStreamIdResponseDataObject): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, GetAssetOrLiveStreamIdResponseDataObject): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/get_asset_playback_id_response.py b/mux_python/models/get_asset_playback_id_response.py index 0b75c36..ddc2149 100644 --- a/mux_python/models/get_asset_playback_id_response.py +++ b/mux_python/models/get_asset_playback_id_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class GetAssetPlaybackIDResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class GetAssetPlaybackIDResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """GetAssetPlaybackIDResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this GetAssetPlaybackIDResponse. # noqa: E501 - :type: PlaybackID + :type data: PlaybackID """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, GetAssetPlaybackIDResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, GetAssetPlaybackIDResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/get_metric_timeseries_data_response.py b/mux_python/models/get_metric_timeseries_data_response.py index 7fe697c..3b5edbb 100644 --- a/mux_python/models/get_metric_timeseries_data_response.py +++ b/mux_python/models/get_metric_timeseries_data_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class GetMetricTimeseriesDataResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class GetMetricTimeseriesDataResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """GetMetricTimeseriesDataResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this GetMetricTimeseriesDataResponse. # noqa: E501 - :type: list[list[str]] + :type data: list[list[str]] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this GetMetricTimeseriesDataResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this GetMetricTimeseriesDataResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, GetMetricTimeseriesDataResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, GetMetricTimeseriesDataResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/get_overall_values_response.py b/mux_python/models/get_overall_values_response.py index 59a84aa..d4859b4 100644 --- a/mux_python/models/get_overall_values_response.py +++ b/mux_python/models/get_overall_values_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class GetOverallValuesResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class GetOverallValuesResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """GetOverallValuesResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this GetOverallValuesResponse. # noqa: E501 - :type: OverallValues + :type data: OverallValues """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this GetOverallValuesResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this GetOverallValuesResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, GetOverallValuesResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, GetOverallValuesResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/get_real_time_breakdown_response.py b/mux_python/models/get_real_time_breakdown_response.py index 8e92b83..e461e61 100644 --- a/mux_python/models/get_real_time_breakdown_response.py +++ b/mux_python/models/get_real_time_breakdown_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class GetRealTimeBreakdownResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class GetRealTimeBreakdownResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """GetRealTimeBreakdownResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this GetRealTimeBreakdownResponse. # noqa: E501 - :type: list[RealTimeBreakdownValue] + :type data: list[RealTimeBreakdownValue] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this GetRealTimeBreakdownResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this GetRealTimeBreakdownResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, GetRealTimeBreakdownResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, GetRealTimeBreakdownResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/get_real_time_histogram_timeseries_response.py b/mux_python/models/get_real_time_histogram_timeseries_response.py index 1daf9b1..c75f6e9 100644 --- a/mux_python/models/get_real_time_histogram_timeseries_response.py +++ b/mux_python/models/get_real_time_histogram_timeseries_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class GetRealTimeHistogramTimeseriesResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -35,8 +46,11 @@ class GetRealTimeHistogramTimeseriesResponse(object): 'timeframe': 'timeframe' } - def __init__(self, meta=None, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, meta=None, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """GetRealTimeHistogramTimeseriesResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._meta = None self._data = None @@ -69,7 +83,7 @@ def meta(self, meta): :param meta: The meta of this GetRealTimeHistogramTimeseriesResponse. # noqa: E501 - :type: GetRealTimeHistogramTimeseriesResponseMeta + :type meta: GetRealTimeHistogramTimeseriesResponseMeta """ self._meta = meta @@ -90,7 +104,7 @@ def data(self, data): :param data: The data of this GetRealTimeHistogramTimeseriesResponse. # noqa: E501 - :type: list[RealTimeHistogramTimeseriesDatapoint] + :type data: list[RealTimeHistogramTimeseriesDatapoint] """ self._data = data @@ -111,7 +125,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this GetRealTimeHistogramTimeseriesResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -132,32 +146,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this GetRealTimeHistogramTimeseriesResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -174,8 +196,11 @@ def __eq__(self, other): if not isinstance(other, GetRealTimeHistogramTimeseriesResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, GetRealTimeHistogramTimeseriesResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/get_real_time_histogram_timeseries_response_meta.py b/mux_python/models/get_real_time_histogram_timeseries_response_meta.py index 70326b9..cc90a5f 100644 --- a/mux_python/models/get_real_time_histogram_timeseries_response_meta.py +++ b/mux_python/models/get_real_time_histogram_timeseries_response_meta.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class GetRealTimeHistogramTimeseriesResponseMeta(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class GetRealTimeHistogramTimeseriesResponseMeta(object): 'buckets': 'buckets' } - def __init__(self, buckets=None): # noqa: E501 + def __init__(self, buckets=None, local_vars_configuration=None): # noqa: E501 """GetRealTimeHistogramTimeseriesResponseMeta - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._buckets = None self.discriminator = None @@ -54,32 +68,40 @@ def buckets(self, buckets): :param buckets: The buckets of this GetRealTimeHistogramTimeseriesResponseMeta. # noqa: E501 - :type: list[RealTimeHistogramTimeseriesBucket] + :type buckets: list[RealTimeHistogramTimeseriesBucket] """ self._buckets = buckets - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, GetRealTimeHistogramTimeseriesResponseMeta): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, GetRealTimeHistogramTimeseriesResponseMeta): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/get_real_time_timeseries_response.py b/mux_python/models/get_real_time_timeseries_response.py index e0c1457..145e977 100644 --- a/mux_python/models/get_real_time_timeseries_response.py +++ b/mux_python/models/get_real_time_timeseries_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class GetRealTimeTimeseriesResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class GetRealTimeTimeseriesResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """GetRealTimeTimeseriesResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this GetRealTimeTimeseriesResponse. # noqa: E501 - :type: list[RealTimeTimeseriesDatapoint] + :type data: list[RealTimeTimeseriesDatapoint] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this GetRealTimeTimeseriesResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this GetRealTimeTimeseriesResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, GetRealTimeTimeseriesResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, GetRealTimeTimeseriesResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/incident.py b/mux_python/models/incident.py index 13faca5..8167d68 100644 --- a/mux_python/models/incident.py +++ b/mux_python/models/incident.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class Incident(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -69,8 +80,11 @@ class Incident(object): 'affected_views': 'affected_views' } - def __init__(self, threshold=None, status=None, started_at=None, severity=None, sample_size_unit=None, sample_size=None, resolved_at=None, notifications=None, notification_rules=None, measurement=None, measured_value_on_close=None, measured_value=None, incident_key=None, impact=None, id=None, error_description=None, description=None, breakdowns=None, affected_views_per_hour_on_open=None, affected_views_per_hour=None, affected_views=None): # noqa: E501 + def __init__(self, threshold=None, status=None, started_at=None, severity=None, sample_size_unit=None, sample_size=None, resolved_at=None, notifications=None, notification_rules=None, measurement=None, measured_value_on_close=None, measured_value=None, incident_key=None, impact=None, id=None, error_description=None, description=None, breakdowns=None, affected_views_per_hour_on_open=None, affected_views_per_hour=None, affected_views=None, local_vars_configuration=None): # noqa: E501 """Incident - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._threshold = None self._status = None @@ -154,7 +168,7 @@ def threshold(self, threshold): :param threshold: The threshold of this Incident. # noqa: E501 - :type: float + :type threshold: float """ self._threshold = threshold @@ -175,7 +189,7 @@ def status(self, status): :param status: The status of this Incident. # noqa: E501 - :type: str + :type status: str """ self._status = status @@ -196,7 +210,7 @@ def started_at(self, started_at): :param started_at: The started_at of this Incident. # noqa: E501 - :type: str + :type started_at: str """ self._started_at = started_at @@ -217,7 +231,7 @@ def severity(self, severity): :param severity: The severity of this Incident. # noqa: E501 - :type: str + :type severity: str """ self._severity = severity @@ -238,7 +252,7 @@ def sample_size_unit(self, sample_size_unit): :param sample_size_unit: The sample_size_unit of this Incident. # noqa: E501 - :type: str + :type sample_size_unit: str """ self._sample_size_unit = sample_size_unit @@ -259,7 +273,7 @@ def sample_size(self, sample_size): :param sample_size: The sample_size of this Incident. # noqa: E501 - :type: int + :type sample_size: int """ self._sample_size = sample_size @@ -280,7 +294,7 @@ def resolved_at(self, resolved_at): :param resolved_at: The resolved_at of this Incident. # noqa: E501 - :type: str + :type resolved_at: str """ self._resolved_at = resolved_at @@ -301,7 +315,7 @@ def notifications(self, notifications): :param notifications: The notifications of this Incident. # noqa: E501 - :type: list[IncidentNotification] + :type notifications: list[IncidentNotification] """ self._notifications = notifications @@ -322,7 +336,7 @@ def notification_rules(self, notification_rules): :param notification_rules: The notification_rules of this Incident. # noqa: E501 - :type: list[IncidentNotificationRule] + :type notification_rules: list[IncidentNotificationRule] """ self._notification_rules = notification_rules @@ -343,7 +357,7 @@ def measurement(self, measurement): :param measurement: The measurement of this Incident. # noqa: E501 - :type: str + :type measurement: str """ self._measurement = measurement @@ -364,7 +378,7 @@ def measured_value_on_close(self, measured_value_on_close): :param measured_value_on_close: The measured_value_on_close of this Incident. # noqa: E501 - :type: float + :type measured_value_on_close: float """ self._measured_value_on_close = measured_value_on_close @@ -385,7 +399,7 @@ def measured_value(self, measured_value): :param measured_value: The measured_value of this Incident. # noqa: E501 - :type: float + :type measured_value: float """ self._measured_value = measured_value @@ -406,7 +420,7 @@ def incident_key(self, incident_key): :param incident_key: The incident_key of this Incident. # noqa: E501 - :type: str + :type incident_key: str """ self._incident_key = incident_key @@ -427,7 +441,7 @@ def impact(self, impact): :param impact: The impact of this Incident. # noqa: E501 - :type: str + :type impact: str """ self._impact = impact @@ -448,7 +462,7 @@ def id(self, id): :param id: The id of this Incident. # noqa: E501 - :type: str + :type id: str """ self._id = id @@ -469,7 +483,7 @@ def error_description(self, error_description): :param error_description: The error_description of this Incident. # noqa: E501 - :type: str + :type error_description: str """ self._error_description = error_description @@ -490,7 +504,7 @@ def description(self, description): :param description: The description of this Incident. # noqa: E501 - :type: str + :type description: str """ self._description = description @@ -511,7 +525,7 @@ def breakdowns(self, breakdowns): :param breakdowns: The breakdowns of this Incident. # noqa: E501 - :type: list[IncidentBreakdown] + :type breakdowns: list[IncidentBreakdown] """ self._breakdowns = breakdowns @@ -532,7 +546,7 @@ def affected_views_per_hour_on_open(self, affected_views_per_hour_on_open): :param affected_views_per_hour_on_open: The affected_views_per_hour_on_open of this Incident. # noqa: E501 - :type: int + :type affected_views_per_hour_on_open: int """ self._affected_views_per_hour_on_open = affected_views_per_hour_on_open @@ -553,7 +567,7 @@ def affected_views_per_hour(self, affected_views_per_hour): :param affected_views_per_hour: The affected_views_per_hour of this Incident. # noqa: E501 - :type: int + :type affected_views_per_hour: int """ self._affected_views_per_hour = affected_views_per_hour @@ -574,32 +588,40 @@ def affected_views(self, affected_views): :param affected_views: The affected_views of this Incident. # noqa: E501 - :type: int + :type affected_views: int """ self._affected_views = affected_views - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -616,8 +638,11 @@ def __eq__(self, other): if not isinstance(other, Incident): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Incident): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/incident_breakdown.py b/mux_python/models/incident_breakdown.py index 4424070..5f2f1df 100644 --- a/mux_python/models/incident_breakdown.py +++ b/mux_python/models/incident_breakdown.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class IncidentBreakdown(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class IncidentBreakdown(object): 'id': 'id' } - def __init__(self, value=None, name=None, id=None): # noqa: E501 + def __init__(self, value=None, name=None, id=None, local_vars_configuration=None): # noqa: E501 """IncidentBreakdown - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._value = None self._name = None @@ -64,7 +78,7 @@ def value(self, value): :param value: The value of this IncidentBreakdown. # noqa: E501 - :type: str + :type value: str """ self._value = value @@ -85,7 +99,7 @@ def name(self, name): :param name: The name of this IncidentBreakdown. # noqa: E501 - :type: str + :type name: str """ self._name = name @@ -106,32 +120,40 @@ def id(self, id): :param id: The id of this IncidentBreakdown. # noqa: E501 - :type: str + :type id: str """ self._id = id - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, IncidentBreakdown): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, IncidentBreakdown): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/incident_notification.py b/mux_python/models/incident_notification.py index bff2193..0a45948 100644 --- a/mux_python/models/incident_notification.py +++ b/mux_python/models/incident_notification.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class IncidentNotification(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class IncidentNotification(object): 'attempted_at': 'attempted_at' } - def __init__(self, queued_at=None, id=None, attempted_at=None): # noqa: E501 + def __init__(self, queued_at=None, id=None, attempted_at=None, local_vars_configuration=None): # noqa: E501 """IncidentNotification - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._queued_at = None self._id = None @@ -64,7 +78,7 @@ def queued_at(self, queued_at): :param queued_at: The queued_at of this IncidentNotification. # noqa: E501 - :type: str + :type queued_at: str """ self._queued_at = queued_at @@ -85,7 +99,7 @@ def id(self, id): :param id: The id of this IncidentNotification. # noqa: E501 - :type: int + :type id: int """ self._id = id @@ -106,32 +120,40 @@ def attempted_at(self, attempted_at): :param attempted_at: The attempted_at of this IncidentNotification. # noqa: E501 - :type: str + :type attempted_at: str """ self._attempted_at = attempted_at - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, IncidentNotification): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, IncidentNotification): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/incident_notification_rule.py b/mux_python/models/incident_notification_rule.py index 96afa83..998234a 100644 --- a/mux_python/models/incident_notification_rule.py +++ b/mux_python/models/incident_notification_rule.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class IncidentNotificationRule(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -37,8 +48,11 @@ class IncidentNotificationRule(object): 'action': 'action' } - def __init__(self, status=None, rules=None, property_id=None, id=None, action=None): # noqa: E501 + def __init__(self, status=None, rules=None, property_id=None, id=None, action=None, local_vars_configuration=None): # noqa: E501 """IncidentNotificationRule - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._status = None self._rules = None @@ -74,7 +88,7 @@ def status(self, status): :param status: The status of this IncidentNotificationRule. # noqa: E501 - :type: str + :type status: str """ self._status = status @@ -95,7 +109,7 @@ def rules(self, rules): :param rules: The rules of this IncidentNotificationRule. # noqa: E501 - :type: list[NotificationRule] + :type rules: list[NotificationRule] """ self._rules = rules @@ -116,7 +130,7 @@ def property_id(self, property_id): :param property_id: The property_id of this IncidentNotificationRule. # noqa: E501 - :type: str + :type property_id: str """ self._property_id = property_id @@ -137,7 +151,7 @@ def id(self, id): :param id: The id of this IncidentNotificationRule. # noqa: E501 - :type: str + :type id: str """ self._id = id @@ -158,32 +172,40 @@ def action(self, action): :param action: The action of this IncidentNotificationRule. # noqa: E501 - :type: str + :type action: str """ self._action = action - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -200,8 +222,11 @@ def __eq__(self, other): if not isinstance(other, IncidentNotificationRule): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, IncidentNotificationRule): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/incident_response.py b/mux_python/models/incident_response.py index 19438ea..4992313 100644 --- a/mux_python/models/incident_response.py +++ b/mux_python/models/incident_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class IncidentResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class IncidentResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """IncidentResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._timeframe = None @@ -59,7 +73,7 @@ def data(self, data): :param data: The data of this IncidentResponse. # noqa: E501 - :type: Incident + :type data: Incident """ self._data = data @@ -80,32 +94,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this IncidentResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -122,8 +144,11 @@ def __eq__(self, other): if not isinstance(other, IncidentResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, IncidentResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/input_file.py b/mux_python/models/input_file.py index 0b7282a..d0a8c32 100644 --- a/mux_python/models/input_file.py +++ b/mux_python/models/input_file.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class InputFile(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class InputFile(object): 'tracks': 'tracks' } - def __init__(self, container_format=None, tracks=None): # noqa: E501 + def __init__(self, container_format=None, tracks=None, local_vars_configuration=None): # noqa: E501 """InputFile - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._container_format = None self._tracks = None @@ -59,7 +73,7 @@ def container_format(self, container_format): :param container_format: The container_format of this InputFile. # noqa: E501 - :type: str + :type container_format: str """ self._container_format = container_format @@ -80,32 +94,40 @@ def tracks(self, tracks): :param tracks: The tracks of this InputFile. # noqa: E501 - :type: list[InputTrack] + :type tracks: list[InputTrack] """ self._tracks = tracks - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -122,8 +144,11 @@ def __eq__(self, other): if not isinstance(other, InputFile): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, InputFile): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/input_info.py b/mux_python/models/input_info.py index 9da3031..7d6cac5 100644 --- a/mux_python/models/input_info.py +++ b/mux_python/models/input_info.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class InputInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class InputInfo(object): 'file': 'file' } - def __init__(self, settings=None, file=None): # noqa: E501 + def __init__(self, settings=None, file=None, local_vars_configuration=None): # noqa: E501 """InputInfo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._settings = None self._file = None @@ -59,7 +73,7 @@ def settings(self, settings): :param settings: The settings of this InputInfo. # noqa: E501 - :type: InputSettings + :type settings: InputSettings """ self._settings = settings @@ -80,32 +94,40 @@ def file(self, file): :param file: The file of this InputInfo. # noqa: E501 - :type: InputFile + :type file: InputFile """ self._file = file - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -122,8 +144,11 @@ def __eq__(self, other): if not isinstance(other, InputInfo): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, InputInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/input_settings.py b/mux_python/models/input_settings.py index 1081ee2..099957d 100644 --- a/mux_python/models/input_settings.py +++ b/mux_python/models/input_settings.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class InputSettings(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -47,8 +58,11 @@ class InputSettings(object): 'passthrough': 'passthrough' } - def __init__(self, url=None, overlay_settings=None, start_time=None, end_time=None, type=None, text_type=None, language_code=None, name=None, closed_captions=None, passthrough=None): # noqa: E501 + def __init__(self, url=None, overlay_settings=None, start_time=None, end_time=None, type=None, text_type=None, language_code=None, name=None, closed_captions=None, passthrough=None, local_vars_configuration=None): # noqa: E501 """InputSettings - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._url = None self._overlay_settings = None @@ -101,7 +115,7 @@ def url(self, url): The web address of the file that Mux should download and use. * For subtitles text tracks, the url is the location of subtitle/captions file. Mux supports [SubRip Text (SRT)](https://en.wikipedia.org/wiki/SubRip) and [Web Video Text Tracks](https://www.w3.org/TR/webvtt1/) format for ingesting Subtitles and Closed Captions. * For Watermarking or Overlay, the url is the location of the watermark image. * When creating clips from existing Mux assets, the url is defined with `mux://assets/{asset_id}` template where `asset_id` is the Asset Identifier for creating the clip from. # noqa: E501 :param url: The url of this InputSettings. # noqa: E501 - :type: str + :type url: str """ self._url = url @@ -122,7 +136,7 @@ def overlay_settings(self, overlay_settings): :param overlay_settings: The overlay_settings of this InputSettings. # noqa: E501 - :type: InputSettingsOverlaySettings + :type overlay_settings: InputSettingsOverlaySettings """ self._overlay_settings = overlay_settings @@ -131,7 +145,7 @@ def overlay_settings(self, overlay_settings): def start_time(self): """Gets the start_time of this InputSettings. # noqa: E501 - The time offset in seconds from the beginning of the video indicating the clip's starting marker. The default value is 0 when not included. # noqa: E501 + The time offset in seconds from the beginning of the video indicating the clip's starting marker. The default value is 0 when not included. This parameter is only applicable for creating clips when `input.url` has `mux://assets/{asset_id}` format. # noqa: E501 :return: The start_time of this InputSettings. # noqa: E501 :rtype: float @@ -142,10 +156,10 @@ def start_time(self): def start_time(self, start_time): """Sets the start_time of this InputSettings. - The time offset in seconds from the beginning of the video indicating the clip's starting marker. The default value is 0 when not included. # noqa: E501 + The time offset in seconds from the beginning of the video indicating the clip's starting marker. The default value is 0 when not included. This parameter is only applicable for creating clips when `input.url` has `mux://assets/{asset_id}` format. # noqa: E501 :param start_time: The start_time of this InputSettings. # noqa: E501 - :type: float + :type start_time: float """ self._start_time = start_time @@ -154,7 +168,7 @@ def start_time(self, start_time): def end_time(self): """Gets the end_time of this InputSettings. # noqa: E501 - The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included. # noqa: E501 + The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included. This parameter is only applicable for creating clips when `input.url` has `mux://assets/{asset_id}` format. # noqa: E501 :return: The end_time of this InputSettings. # noqa: E501 :rtype: float @@ -165,10 +179,10 @@ def end_time(self): def end_time(self, end_time): """Sets the end_time of this InputSettings. - The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included. # noqa: E501 + The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included. This parameter is only applicable for creating clips when `input.url` has `mux://assets/{asset_id}` format. # noqa: E501 :param end_time: The end_time of this InputSettings. # noqa: E501 - :type: float + :type end_time: float """ self._end_time = end_time @@ -191,10 +205,10 @@ def type(self, type): This parameter is required for the `text` track type. # noqa: E501 :param type: The type of this InputSettings. # noqa: E501 - :type: str + :type type: str """ allowed_values = ["video", "audio", "text"] # noqa: E501 - if type not in allowed_values: + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 .format(type, allowed_values) @@ -220,10 +234,10 @@ def text_type(self, text_type): Type of text track. This parameter only supports subtitles value. For more information on Subtitles / Closed Captions, [see this blog post](https://mux.com/blog/subtitles-captions-webvtt-hls-and-those-magic-flags/). This parameter is required for `text` track type. # noqa: E501 :param text_type: The text_type of this InputSettings. # noqa: E501 - :type: str + :type text_type: str """ allowed_values = ["subtitles"] # noqa: E501 - if text_type not in allowed_values: + if self.local_vars_configuration.client_side_validation and text_type not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `text_type` ({0}), must be one of {1}" # noqa: E501 .format(text_type, allowed_values) @@ -249,7 +263,7 @@ def language_code(self, language_code): The language code value must be a valid [BCP 47](https://tools.ietf.org/html/bcp47) specification compliant value. For example, en for English or en-US for the US version of English. This parameter is required for text type and subtitles text type track. # noqa: E501 :param language_code: The language_code of this InputSettings. # noqa: E501 - :type: str + :type language_code: str """ self._language_code = language_code @@ -272,7 +286,7 @@ def name(self, name): The name of the track containing a human-readable description. This value must be unique across all text type and subtitles `text` type tracks. The hls manifest will associate a subtitle text track with this value. For example, the value should be \"English\" for subtitles text track with language_code as en. This optional parameter should be used only for `text` type and subtitles `text` type track. If this parameter is not included, Mux will auto-populate based on the `input[].language_code` value. # noqa: E501 :param name: The name of this InputSettings. # noqa: E501 - :type: str + :type name: str """ self._name = name @@ -295,7 +309,7 @@ def closed_captions(self, closed_captions): Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This optional parameter should be used for `text` type and subtitles `text` type tracks. # noqa: E501 :param closed_captions: The closed_captions of this InputSettings. # noqa: E501 - :type: bool + :type closed_captions: bool """ self._closed_captions = closed_captions @@ -318,32 +332,40 @@ def passthrough(self, passthrough): This optional parameter should be used for `text` type and subtitles `text` type tracks. # noqa: E501 :param passthrough: The passthrough of this InputSettings. # noqa: E501 - :type: str + :type passthrough: str """ self._passthrough = passthrough - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -360,8 +382,11 @@ def __eq__(self, other): if not isinstance(other, InputSettings): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, InputSettings): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/input_settings_overlay_settings.py b/mux_python/models/input_settings_overlay_settings.py index 87c66d9..92b0112 100644 --- a/mux_python/models/input_settings_overlay_settings.py +++ b/mux_python/models/input_settings_overlay_settings.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class InputSettingsOverlaySettings(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -41,8 +52,11 @@ class InputSettingsOverlaySettings(object): 'opacity': 'opacity' } - def __init__(self, vertical_align=None, vertical_margin=None, horizontal_align=None, horizontal_margin=None, width=None, height=None, opacity=None): # noqa: E501 + def __init__(self, vertical_align=None, vertical_margin=None, horizontal_align=None, horizontal_margin=None, width=None, height=None, opacity=None, local_vars_configuration=None): # noqa: E501 """InputSettingsOverlaySettings - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._vertical_align = None self._vertical_margin = None @@ -86,10 +100,10 @@ def vertical_align(self, vertical_align): Where the vertical positioning of the overlay/watermark should begin from. Defaults to `\"top\"` # noqa: E501 :param vertical_align: The vertical_align of this InputSettingsOverlaySettings. # noqa: E501 - :type: str + :type vertical_align: str """ allowed_values = ["top", "middle", "bottom"] # noqa: E501 - if vertical_align not in allowed_values: + if self.local_vars_configuration.client_side_validation and vertical_align not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `vertical_align` ({0}), must be one of {1}" # noqa: E501 .format(vertical_align, allowed_values) @@ -115,7 +129,7 @@ def vertical_margin(self, vertical_margin): The distance from the vertical_align starting point and the image's closest edge. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). Negative values will move the overlay offscreen. In the case of 'middle', a positive value will shift the overlay towards the bottom and and a negative value will shift it towards the top. # noqa: E501 :param vertical_margin: The vertical_margin of this InputSettingsOverlaySettings. # noqa: E501 - :type: str + :type vertical_margin: str """ self._vertical_margin = vertical_margin @@ -138,10 +152,10 @@ def horizontal_align(self, horizontal_align): Where the horizontal positioning of the overlay/watermark should begin from. # noqa: E501 :param horizontal_align: The horizontal_align of this InputSettingsOverlaySettings. # noqa: E501 - :type: str + :type horizontal_align: str """ allowed_values = ["left", "center", "right"] # noqa: E501 - if horizontal_align not in allowed_values: + if self.local_vars_configuration.client_side_validation and horizontal_align not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `horizontal_align` ({0}), must be one of {1}" # noqa: E501 .format(horizontal_align, allowed_values) @@ -167,7 +181,7 @@ def horizontal_margin(self, horizontal_margin): The distance from the horizontal_align starting point and the image's closest edge. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). Negative values will move the overlay offscreen. In the case of 'center', a positive value will shift the image towards the right and and a negative value will shift it towards the left. # noqa: E501 :param horizontal_margin: The horizontal_margin of this InputSettingsOverlaySettings. # noqa: E501 - :type: str + :type horizontal_margin: str """ self._horizontal_margin = horizontal_margin @@ -190,7 +204,7 @@ def width(self, width): How wide the overlay should appear. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). If both width and height are left blank the width will be the true pixels of the image, applied as if the video has been scaled to fit a 1920x1080 frame. If height is supplied with no width, the width will scale proportionally to the height. # noqa: E501 :param width: The width of this InputSettingsOverlaySettings. # noqa: E501 - :type: str + :type width: str """ self._width = width @@ -213,7 +227,7 @@ def height(self, height): How tall the overlay should appear. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). If both width and height are left blank the height will be the true pixels of the image, applied as if the video has been scaled to fit a 1920x1080 frame. If width is supplied with no height, the height will scale proportionally to the width. # noqa: E501 :param height: The height of this InputSettingsOverlaySettings. # noqa: E501 - :type: str + :type height: str """ self._height = height @@ -236,32 +250,40 @@ def opacity(self, opacity): How opaque the overlay should appear, expressed as a percent. (Default 100%) # noqa: E501 :param opacity: The opacity of this InputSettingsOverlaySettings. # noqa: E501 - :type: str + :type opacity: str """ self._opacity = opacity - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -278,8 +300,11 @@ def __eq__(self, other): if not isinstance(other, InputSettingsOverlaySettings): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, InputSettingsOverlaySettings): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/input_track.py b/mux_python/models/input_track.py index 1b1a709..49abe43 100644 --- a/mux_python/models/input_track.py +++ b/mux_python/models/input_track.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class InputTrack(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -45,8 +56,11 @@ class InputTrack(object): 'channels': 'channels' } - def __init__(self, type=None, duration=None, encoding=None, width=None, height=None, frame_rate=None, sample_rate=None, sample_size=None, channels=None): # noqa: E501 + def __init__(self, type=None, duration=None, encoding=None, width=None, height=None, frame_rate=None, sample_rate=None, sample_size=None, channels=None, local_vars_configuration=None): # noqa: E501 """InputTrack - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._type = None self._duration = None @@ -94,7 +108,7 @@ def type(self, type): :param type: The type of this InputTrack. # noqa: E501 - :type: str + :type type: str """ self._type = type @@ -115,7 +129,7 @@ def duration(self, duration): :param duration: The duration of this InputTrack. # noqa: E501 - :type: float + :type duration: float """ self._duration = duration @@ -136,7 +150,7 @@ def encoding(self, encoding): :param encoding: The encoding of this InputTrack. # noqa: E501 - :type: str + :type encoding: str """ self._encoding = encoding @@ -157,7 +171,7 @@ def width(self, width): :param width: The width of this InputTrack. # noqa: E501 - :type: int + :type width: int """ self._width = width @@ -178,7 +192,7 @@ def height(self, height): :param height: The height of this InputTrack. # noqa: E501 - :type: int + :type height: int """ self._height = height @@ -199,7 +213,7 @@ def frame_rate(self, frame_rate): :param frame_rate: The frame_rate of this InputTrack. # noqa: E501 - :type: float + :type frame_rate: float """ self._frame_rate = frame_rate @@ -220,7 +234,7 @@ def sample_rate(self, sample_rate): :param sample_rate: The sample_rate of this InputTrack. # noqa: E501 - :type: int + :type sample_rate: int """ self._sample_rate = sample_rate @@ -241,7 +255,7 @@ def sample_size(self, sample_size): :param sample_size: The sample_size of this InputTrack. # noqa: E501 - :type: int + :type sample_size: int """ self._sample_size = sample_size @@ -262,32 +276,40 @@ def channels(self, channels): :param channels: The channels of this InputTrack. # noqa: E501 - :type: int + :type channels: int """ self._channels = channels - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -304,8 +326,11 @@ def __eq__(self, other): if not isinstance(other, InputTrack): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, InputTrack): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/insight.py b/mux_python/models/insight.py index 49f9c23..9dbc70b 100644 --- a/mux_python/models/insight.py +++ b/mux_python/models/insight.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class Insight(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -39,8 +50,11 @@ class Insight(object): 'filter_column': 'filter_column' } - def __init__(self, total_watch_time=None, total_views=None, negative_impact_score=None, metric=None, filter_value=None, filter_column=None): # noqa: E501 + def __init__(self, total_watch_time=None, total_views=None, negative_impact_score=None, metric=None, filter_value=None, filter_column=None, local_vars_configuration=None): # noqa: E501 """Insight - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._total_watch_time = None self._total_views = None @@ -79,7 +93,7 @@ def total_watch_time(self, total_watch_time): :param total_watch_time: The total_watch_time of this Insight. # noqa: E501 - :type: int + :type total_watch_time: int """ self._total_watch_time = total_watch_time @@ -100,7 +114,7 @@ def total_views(self, total_views): :param total_views: The total_views of this Insight. # noqa: E501 - :type: int + :type total_views: int """ self._total_views = total_views @@ -121,7 +135,7 @@ def negative_impact_score(self, negative_impact_score): :param negative_impact_score: The negative_impact_score of this Insight. # noqa: E501 - :type: float + :type negative_impact_score: float """ self._negative_impact_score = negative_impact_score @@ -142,7 +156,7 @@ def metric(self, metric): :param metric: The metric of this Insight. # noqa: E501 - :type: float + :type metric: float """ self._metric = metric @@ -163,7 +177,7 @@ def filter_value(self, filter_value): :param filter_value: The filter_value of this Insight. # noqa: E501 - :type: str + :type filter_value: str """ self._filter_value = filter_value @@ -184,32 +198,40 @@ def filter_column(self, filter_column): :param filter_column: The filter_column of this Insight. # noqa: E501 - :type: str + :type filter_column: str """ self._filter_column = filter_column - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -226,8 +248,11 @@ def __eq__(self, other): if not isinstance(other, Insight): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Insight): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_all_metric_values_response.py b/mux_python/models/list_all_metric_values_response.py index f1e71db..3092346 100644 --- a/mux_python/models/list_all_metric_values_response.py +++ b/mux_python/models/list_all_metric_values_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListAllMetricValuesResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListAllMetricValuesResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListAllMetricValuesResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListAllMetricValuesResponse. # noqa: E501 - :type: list[Score] + :type data: list[Score] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListAllMetricValuesResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListAllMetricValuesResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListAllMetricValuesResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListAllMetricValuesResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_assets_response.py b/mux_python/models/list_assets_response.py index d1e57d9..5056a06 100644 --- a/mux_python/models/list_assets_response.py +++ b/mux_python/models/list_assets_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListAssetsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class ListAssetsResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """ListAssetsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this ListAssetsResponse. # noqa: E501 - :type: list[Asset] + :type data: list[Asset] """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, ListAssetsResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListAssetsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_breakdown_values_response.py b/mux_python/models/list_breakdown_values_response.py index 8abaa12..d24b16a 100644 --- a/mux_python/models/list_breakdown_values_response.py +++ b/mux_python/models/list_breakdown_values_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListBreakdownValuesResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListBreakdownValuesResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListBreakdownValuesResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListBreakdownValuesResponse. # noqa: E501 - :type: list[BreakdownValue] + :type data: list[BreakdownValue] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListBreakdownValuesResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListBreakdownValuesResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListBreakdownValuesResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListBreakdownValuesResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_delivery_usage_response.py b/mux_python/models/list_delivery_usage_response.py index 5b20eb3..8bfbbf5 100644 --- a/mux_python/models/list_delivery_usage_response.py +++ b/mux_python/models/list_delivery_usage_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListDeliveryUsageResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -35,8 +46,11 @@ class ListDeliveryUsageResponse(object): 'limit': 'limit' } - def __init__(self, data=None, total_row_count=None, timeframe=None, limit=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, limit=None, local_vars_configuration=None): # noqa: E501 """ListDeliveryUsageResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -69,7 +83,7 @@ def data(self, data): :param data: The data of this ListDeliveryUsageResponse. # noqa: E501 - :type: list[DeliveryReport] + :type data: list[DeliveryReport] """ self._data = data @@ -90,7 +104,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListDeliveryUsageResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -111,7 +125,7 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListDeliveryUsageResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe @@ -134,32 +148,40 @@ def limit(self, limit): Number of assets returned in this response. Default value is 100. # noqa: E501 :param limit: The limit of this ListDeliveryUsageResponse. # noqa: E501 - :type: int + :type limit: int """ self._limit = limit - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -176,8 +198,11 @@ def __eq__(self, other): if not isinstance(other, ListDeliveryUsageResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListDeliveryUsageResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_dimension_values_response.py b/mux_python/models/list_dimension_values_response.py index b033f64..249005b 100644 --- a/mux_python/models/list_dimension_values_response.py +++ b/mux_python/models/list_dimension_values_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListDimensionValuesResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListDimensionValuesResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListDimensionValuesResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListDimensionValuesResponse. # noqa: E501 - :type: list[DimensionValue] + :type data: list[DimensionValue] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListDimensionValuesResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListDimensionValuesResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListDimensionValuesResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListDimensionValuesResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_dimensions_response.py b/mux_python/models/list_dimensions_response.py index 09ffa5b..ca1322d 100644 --- a/mux_python/models/list_dimensions_response.py +++ b/mux_python/models/list_dimensions_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListDimensionsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListDimensionsResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListDimensionsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListDimensionsResponse. # noqa: E501 - :type: ListFiltersResponseData + :type data: ListFiltersResponseData """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListDimensionsResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListDimensionsResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListDimensionsResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListDimensionsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_errors_response.py b/mux_python/models/list_errors_response.py index 44d98d8..1c08f1b 100644 --- a/mux_python/models/list_errors_response.py +++ b/mux_python/models/list_errors_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListErrorsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListErrorsResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListErrorsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListErrorsResponse. # noqa: E501 - :type: list[Error] + :type data: list[Error] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListErrorsResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListErrorsResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListErrorsResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListErrorsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_exports_response.py b/mux_python/models/list_exports_response.py index 5748feb..88d9722 100644 --- a/mux_python/models/list_exports_response.py +++ b/mux_python/models/list_exports_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListExportsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListExportsResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListExportsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListExportsResponse. # noqa: E501 - :type: list[str] + :type data: list[str] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListExportsResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListExportsResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListExportsResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListExportsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_filter_values_response.py b/mux_python/models/list_filter_values_response.py index cee998e..2640e3b 100644 --- a/mux_python/models/list_filter_values_response.py +++ b/mux_python/models/list_filter_values_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListFilterValuesResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListFilterValuesResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListFilterValuesResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListFilterValuesResponse. # noqa: E501 - :type: list[FilterValue] + :type data: list[FilterValue] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListFilterValuesResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListFilterValuesResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListFilterValuesResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListFilterValuesResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_filters_response.py b/mux_python/models/list_filters_response.py index 5d9ee19..e74d001 100644 --- a/mux_python/models/list_filters_response.py +++ b/mux_python/models/list_filters_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListFiltersResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListFiltersResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListFiltersResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListFiltersResponse. # noqa: E501 - :type: ListFiltersResponseData + :type data: ListFiltersResponseData """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListFiltersResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListFiltersResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListFiltersResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListFiltersResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_filters_response_data.py b/mux_python/models/list_filters_response_data.py index 4f1687f..e4de2c3 100644 --- a/mux_python/models/list_filters_response_data.py +++ b/mux_python/models/list_filters_response_data.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListFiltersResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class ListFiltersResponseData(object): 'advanced': 'advanced' } - def __init__(self, basic=None, advanced=None): # noqa: E501 + def __init__(self, basic=None, advanced=None, local_vars_configuration=None): # noqa: E501 """ListFiltersResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._basic = None self._advanced = None @@ -59,7 +73,7 @@ def basic(self, basic): :param basic: The basic of this ListFiltersResponseData. # noqa: E501 - :type: list[str] + :type basic: list[str] """ self._basic = basic @@ -80,32 +94,40 @@ def advanced(self, advanced): :param advanced: The advanced of this ListFiltersResponseData. # noqa: E501 - :type: list[str] + :type advanced: list[str] """ self._advanced = advanced - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -122,8 +144,11 @@ def __eq__(self, other): if not isinstance(other, ListFiltersResponseData): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListFiltersResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_incidents_response.py b/mux_python/models/list_incidents_response.py index abc0616..841f969 100644 --- a/mux_python/models/list_incidents_response.py +++ b/mux_python/models/list_incidents_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListIncidentsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListIncidentsResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListIncidentsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListIncidentsResponse. # noqa: E501 - :type: list[Incident] + :type data: list[Incident] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListIncidentsResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListIncidentsResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListIncidentsResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListIncidentsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_insights_response.py b/mux_python/models/list_insights_response.py index 4de715b..4243f5f 100644 --- a/mux_python/models/list_insights_response.py +++ b/mux_python/models/list_insights_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListInsightsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListInsightsResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListInsightsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListInsightsResponse. # noqa: E501 - :type: list[Insight] + :type data: list[Insight] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListInsightsResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListInsightsResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListInsightsResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListInsightsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_live_streams_response.py b/mux_python/models/list_live_streams_response.py index 9da98f0..30c391c 100644 --- a/mux_python/models/list_live_streams_response.py +++ b/mux_python/models/list_live_streams_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListLiveStreamsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class ListLiveStreamsResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """ListLiveStreamsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this ListLiveStreamsResponse. # noqa: E501 - :type: list[LiveStream] + :type data: list[LiveStream] """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, ListLiveStreamsResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListLiveStreamsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_real_time_dimensions_response.py b/mux_python/models/list_real_time_dimensions_response.py index 863a057..b9d936d 100644 --- a/mux_python/models/list_real_time_dimensions_response.py +++ b/mux_python/models/list_real_time_dimensions_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListRealTimeDimensionsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListRealTimeDimensionsResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListRealTimeDimensionsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListRealTimeDimensionsResponse. # noqa: E501 - :type: list[ListRealTimeDimensionsResponseData] + :type data: list[ListRealTimeDimensionsResponseData] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListRealTimeDimensionsResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListRealTimeDimensionsResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListRealTimeDimensionsResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListRealTimeDimensionsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_real_time_dimensions_response_data.py b/mux_python/models/list_real_time_dimensions_response_data.py index cfaedbd..d6a4d8e 100644 --- a/mux_python/models/list_real_time_dimensions_response_data.py +++ b/mux_python/models/list_real_time_dimensions_response_data.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListRealTimeDimensionsResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class ListRealTimeDimensionsResponseData(object): 'display_name': 'display_name' } - def __init__(self, name=None, display_name=None): # noqa: E501 + def __init__(self, name=None, display_name=None, local_vars_configuration=None): # noqa: E501 """ListRealTimeDimensionsResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._name = None self._display_name = None @@ -59,7 +73,7 @@ def name(self, name): :param name: The name of this ListRealTimeDimensionsResponseData. # noqa: E501 - :type: str + :type name: str """ self._name = name @@ -80,32 +94,40 @@ def display_name(self, display_name): :param display_name: The display_name of this ListRealTimeDimensionsResponseData. # noqa: E501 - :type: str + :type display_name: str """ self._display_name = display_name - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -122,8 +144,11 @@ def __eq__(self, other): if not isinstance(other, ListRealTimeDimensionsResponseData): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListRealTimeDimensionsResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_real_time_metrics_response.py b/mux_python/models/list_real_time_metrics_response.py index ecb6abb..b53e200 100644 --- a/mux_python/models/list_real_time_metrics_response.py +++ b/mux_python/models/list_real_time_metrics_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListRealTimeMetricsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListRealTimeMetricsResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListRealTimeMetricsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListRealTimeMetricsResponse. # noqa: E501 - :type: list[ListRealTimeDimensionsResponseData] + :type data: list[ListRealTimeDimensionsResponseData] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListRealTimeMetricsResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListRealTimeMetricsResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListRealTimeMetricsResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListRealTimeMetricsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_related_incidents_response.py b/mux_python/models/list_related_incidents_response.py index ef85af9..3976f43 100644 --- a/mux_python/models/list_related_incidents_response.py +++ b/mux_python/models/list_related_incidents_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListRelatedIncidentsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListRelatedIncidentsResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListRelatedIncidentsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListRelatedIncidentsResponse. # noqa: E501 - :type: list[Incident] + :type data: list[Incident] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListRelatedIncidentsResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListRelatedIncidentsResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListRelatedIncidentsResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListRelatedIncidentsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_signing_keys_response.py b/mux_python/models/list_signing_keys_response.py index 6854f84..c4aad0d 100644 --- a/mux_python/models/list_signing_keys_response.py +++ b/mux_python/models/list_signing_keys_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListSigningKeysResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class ListSigningKeysResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """ListSigningKeysResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this ListSigningKeysResponse. # noqa: E501 - :type: list[SigningKey] + :type data: list[SigningKey] """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, ListSigningKeysResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListSigningKeysResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_uploads_response.py b/mux_python/models/list_uploads_response.py index 03f8514..9039a6d 100644 --- a/mux_python/models/list_uploads_response.py +++ b/mux_python/models/list_uploads_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListUploadsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class ListUploadsResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """ListUploadsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this ListUploadsResponse. # noqa: E501 - :type: list[Upload] + :type data: list[Upload] """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, ListUploadsResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListUploadsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/list_video_views_response.py b/mux_python/models/list_video_views_response.py index 11ac677..91ef5ae 100644 --- a/mux_python/models/list_video_views_response.py +++ b/mux_python/models/list_video_views_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class ListVideoViewsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class ListVideoViewsResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, total_row_count=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, total_row_count=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """ListVideoViewsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._total_row_count = None @@ -64,7 +78,7 @@ def data(self, data): :param data: The data of this ListVideoViewsResponse. # noqa: E501 - :type: list[AbridgedVideoView] + :type data: list[AbridgedVideoView] """ self._data = data @@ -85,7 +99,7 @@ def total_row_count(self, total_row_count): :param total_row_count: The total_row_count of this ListVideoViewsResponse. # noqa: E501 - :type: int + :type total_row_count: int """ self._total_row_count = total_row_count @@ -106,32 +120,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this ListVideoViewsResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, ListVideoViewsResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ListVideoViewsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/live_stream.py b/mux_python/models/live_stream.py index 313ecfd..7f906b5 100644 --- a/mux_python/models/live_stream.py +++ b/mux_python/models/live_stream.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class LiveStream(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -53,8 +64,11 @@ class LiveStream(object): 'test': 'test' } - def __init__(self, id=None, created_at=None, stream_key=None, active_asset_id=None, recent_asset_ids=None, status=None, playback_ids=None, new_asset_settings=None, passthrough=None, reconnect_window=None, reduced_latency=None, simulcast_targets=None, test=None): # noqa: E501 + def __init__(self, id=None, created_at=None, stream_key=None, active_asset_id=None, recent_asset_ids=None, status=None, playback_ids=None, new_asset_settings=None, passthrough=None, reconnect_window=60, reduced_latency=None, simulcast_targets=None, test=None, local_vars_configuration=None): # noqa: E501 """LiveStream - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._id = None self._created_at = None @@ -102,6 +116,7 @@ def __init__(self, id=None, created_at=None, stream_key=None, active_asset_id=No def id(self): """Gets the id of this LiveStream. # noqa: E501 + Unique identifier for the Live Stream. Max 255 characters. # noqa: E501 :return: The id of this LiveStream. # noqa: E501 :rtype: str @@ -112,9 +127,10 @@ def id(self): def id(self, id): """Sets the id of this LiveStream. + Unique identifier for the Live Stream. Max 255 characters. # noqa: E501 :param id: The id of this LiveStream. # noqa: E501 - :type: str + :type id: str """ self._id = id @@ -123,6 +139,7 @@ def id(self, id): def created_at(self): """Gets the created_at of this LiveStream. # noqa: E501 + Time the Live Stream was created, defined as a Unix timestamp (seconds since epoch). # noqa: E501 :return: The created_at of this LiveStream. # noqa: E501 :rtype: str @@ -133,9 +150,10 @@ def created_at(self): def created_at(self, created_at): """Sets the created_at of this LiveStream. + Time the Live Stream was created, defined as a Unix timestamp (seconds since epoch). # noqa: E501 :param created_at: The created_at of this LiveStream. # noqa: E501 - :type: str + :type created_at: str """ self._created_at = created_at @@ -144,6 +162,7 @@ def created_at(self, created_at): def stream_key(self): """Gets the stream_key of this LiveStream. # noqa: E501 + Unique key used for streaming to a Mux RTMP endpoint. This should be considered as sensitive as credentials, anyone with this stream key can begin streaming. # noqa: E501 :return: The stream_key of this LiveStream. # noqa: E501 :rtype: str @@ -154,9 +173,10 @@ def stream_key(self): def stream_key(self, stream_key): """Sets the stream_key of this LiveStream. + Unique key used for streaming to a Mux RTMP endpoint. This should be considered as sensitive as credentials, anyone with this stream key can begin streaming. # noqa: E501 :param stream_key: The stream_key of this LiveStream. # noqa: E501 - :type: str + :type stream_key: str """ self._stream_key = stream_key @@ -165,6 +185,7 @@ def stream_key(self, stream_key): def active_asset_id(self): """Gets the active_asset_id of this LiveStream. # noqa: E501 + The Asset that is currently being created if there is an active broadcast. # noqa: E501 :return: The active_asset_id of this LiveStream. # noqa: E501 :rtype: str @@ -175,9 +196,10 @@ def active_asset_id(self): def active_asset_id(self, active_asset_id): """Sets the active_asset_id of this LiveStream. + The Asset that is currently being created if there is an active broadcast. # noqa: E501 :param active_asset_id: The active_asset_id of this LiveStream. # noqa: E501 - :type: str + :type active_asset_id: str """ self._active_asset_id = active_asset_id @@ -186,6 +208,7 @@ def active_asset_id(self, active_asset_id): def recent_asset_ids(self): """Gets the recent_asset_ids of this LiveStream. # noqa: E501 + An array of strings with the most recent Assets that were created from this live stream. # noqa: E501 :return: The recent_asset_ids of this LiveStream. # noqa: E501 :rtype: list[str] @@ -196,9 +219,10 @@ def recent_asset_ids(self): def recent_asset_ids(self, recent_asset_ids): """Sets the recent_asset_ids of this LiveStream. + An array of strings with the most recent Assets that were created from this live stream. # noqa: E501 :param recent_asset_ids: The recent_asset_ids of this LiveStream. # noqa: E501 - :type: list[str] + :type recent_asset_ids: list[str] """ self._recent_asset_ids = recent_asset_ids @@ -207,6 +231,7 @@ def recent_asset_ids(self, recent_asset_ids): def status(self): """Gets the status of this LiveStream. # noqa: E501 + `idle` indicates that there is no active broadcast. `active` indicates that there is an active broadcast and `disabled` status indicates that no future RTMP streams can be published. # noqa: E501 :return: The status of this LiveStream. # noqa: E501 :rtype: str @@ -217,10 +242,17 @@ def status(self): def status(self, status): """Sets the status of this LiveStream. + `idle` indicates that there is no active broadcast. `active` indicates that there is an active broadcast and `disabled` status indicates that no future RTMP streams can be published. # noqa: E501 :param status: The status of this LiveStream. # noqa: E501 - :type: str + :type status: str """ + allowed_values = ["active", "idle", "disabled"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) self._status = status @@ -228,6 +260,7 @@ def status(self, status): def playback_ids(self): """Gets the playback_ids of this LiveStream. # noqa: E501 + An array of Playback ID objects. Use these to create HLS playback URLs. See [Play your videos](https://docs.mux.com/guides/video/play-your-videos) for more details. # noqa: E501 :return: The playback_ids of this LiveStream. # noqa: E501 :rtype: list[PlaybackID] @@ -238,9 +271,10 @@ def playback_ids(self): def playback_ids(self, playback_ids): """Sets the playback_ids of this LiveStream. + An array of Playback ID objects. Use these to create HLS playback URLs. See [Play your videos](https://docs.mux.com/guides/video/play-your-videos) for more details. # noqa: E501 :param playback_ids: The playback_ids of this LiveStream. # noqa: E501 - :type: list[PlaybackID] + :type playback_ids: list[PlaybackID] """ self._playback_ids = playback_ids @@ -261,7 +295,7 @@ def new_asset_settings(self, new_asset_settings): :param new_asset_settings: The new_asset_settings of this LiveStream. # noqa: E501 - :type: CreateAssetRequest + :type new_asset_settings: CreateAssetRequest """ self._new_asset_settings = new_asset_settings @@ -270,6 +304,7 @@ def new_asset_settings(self, new_asset_settings): def passthrough(self): """Gets the passthrough of this LiveStream. # noqa: E501 + Arbitrary metadata set for the asset. Max 255 characters. # noqa: E501 :return: The passthrough of this LiveStream. # noqa: E501 :rtype: str @@ -280,9 +315,10 @@ def passthrough(self): def passthrough(self, passthrough): """Sets the passthrough of this LiveStream. + Arbitrary metadata set for the asset. Max 255 characters. # noqa: E501 :param passthrough: The passthrough of this LiveStream. # noqa: E501 - :type: str + :type passthrough: str """ self._passthrough = passthrough @@ -291,6 +327,7 @@ def passthrough(self, passthrough): def reconnect_window(self): """Gets the reconnect_window of this LiveStream. # noqa: E501 + When live streaming software disconnects from Mux, either intentionally or due to a drop in the network, the Reconnect Window is the time in seconds that Mux should wait for the streaming software to reconnect before considering the live stream finished and completing the recorded asset. **Min**: 0.1s. **Max**: 300s (5 minutes). # noqa: E501 :return: The reconnect_window of this LiveStream. # noqa: E501 :rtype: float @@ -301,9 +338,10 @@ def reconnect_window(self): def reconnect_window(self, reconnect_window): """Sets the reconnect_window of this LiveStream. + When live streaming software disconnects from Mux, either intentionally or due to a drop in the network, the Reconnect Window is the time in seconds that Mux should wait for the streaming software to reconnect before considering the live stream finished and completing the recorded asset. **Min**: 0.1s. **Max**: 300s (5 minutes). # noqa: E501 :param reconnect_window: The reconnect_window of this LiveStream. # noqa: E501 - :type: float + :type reconnect_window: float """ self._reconnect_window = reconnect_window @@ -312,6 +350,7 @@ def reconnect_window(self, reconnect_window): def reduced_latency(self): """Gets the reduced_latency of this LiveStream. # noqa: E501 + Latency is the time from when the streamer does something in real life to when you see it happen in the player. Set this if you want lower latency for your live stream. **Note**: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. See the [Reduce live stream latency guide](https://docs.mux.com/guides/video/reduce-live-stream-latency) to understand the tradeoffs. # noqa: E501 :return: The reduced_latency of this LiveStream. # noqa: E501 :rtype: bool @@ -322,9 +361,10 @@ def reduced_latency(self): def reduced_latency(self, reduced_latency): """Sets the reduced_latency of this LiveStream. + Latency is the time from when the streamer does something in real life to when you see it happen in the player. Set this if you want lower latency for your live stream. **Note**: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. See the [Reduce live stream latency guide](https://docs.mux.com/guides/video/reduce-live-stream-latency) to understand the tradeoffs. # noqa: E501 :param reduced_latency: The reduced_latency of this LiveStream. # noqa: E501 - :type: bool + :type reduced_latency: bool """ self._reduced_latency = reduced_latency @@ -333,6 +373,7 @@ def reduced_latency(self, reduced_latency): def simulcast_targets(self): """Gets the simulcast_targets of this LiveStream. # noqa: E501 + Each Simulcast Target contains configuration details to broadcast (or \"restream\") a live stream to a third-party streaming service. [See the Stream live to 3rd party platforms guide](https://docs.mux.com/guides/video/stream-live-to-3rd-party-platforms). # noqa: E501 :return: The simulcast_targets of this LiveStream. # noqa: E501 :rtype: list[SimulcastTarget] @@ -343,9 +384,10 @@ def simulcast_targets(self): def simulcast_targets(self, simulcast_targets): """Sets the simulcast_targets of this LiveStream. + Each Simulcast Target contains configuration details to broadcast (or \"restream\") a live stream to a third-party streaming service. [See the Stream live to 3rd party platforms guide](https://docs.mux.com/guides/video/stream-live-to-3rd-party-platforms). # noqa: E501 :param simulcast_targets: The simulcast_targets of this LiveStream. # noqa: E501 - :type: list[SimulcastTarget] + :type simulcast_targets: list[SimulcastTarget] """ self._simulcast_targets = simulcast_targets @@ -354,6 +396,7 @@ def simulcast_targets(self, simulcast_targets): def test(self): """Gets the test of this LiveStream. # noqa: E501 + True means this live stream is a test live stream. Test live streams can be used to help evaluate the Mux Video APIs for free. There is no limit on the number of test live streams, but they are watermarked with the Mux logo, limited to 5 minutes, and deleted after 24 hours. # noqa: E501 :return: The test of this LiveStream. # noqa: E501 :rtype: bool @@ -364,34 +407,43 @@ def test(self): def test(self, test): """Sets the test of this LiveStream. + True means this live stream is a test live stream. Test live streams can be used to help evaluate the Mux Video APIs for free. There is no limit on the number of test live streams, but they are watermarked with the Mux logo, limited to 5 minutes, and deleted after 24 hours. # noqa: E501 :param test: The test of this LiveStream. # noqa: E501 - :type: bool + :type test: bool """ self._test = test - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -408,8 +460,11 @@ def __eq__(self, other): if not isinstance(other, LiveStream): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, LiveStream): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/live_stream_response.py b/mux_python/models/live_stream_response.py index 2245e4a..7ab16a8 100644 --- a/mux_python/models/live_stream_response.py +++ b/mux_python/models/live_stream_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class LiveStreamResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class LiveStreamResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """LiveStreamResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this LiveStreamResponse. # noqa: E501 - :type: LiveStream + :type data: LiveStream """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, LiveStreamResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, LiveStreamResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/metric.py b/mux_python/models/metric.py index f4db3fb..e9264dc 100644 --- a/mux_python/models/metric.py +++ b/mux_python/models/metric.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class Metric(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -37,8 +48,11 @@ class Metric(object): 'measurement': 'measurement' } - def __init__(self, value=None, type=None, name=None, metric=None, measurement=None): # noqa: E501 + def __init__(self, value=None, type=None, name=None, metric=None, measurement=None, local_vars_configuration=None): # noqa: E501 """Metric - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._value = None self._type = None @@ -74,7 +88,7 @@ def value(self, value): :param value: The value of this Metric. # noqa: E501 - :type: float + :type value: float """ self._value = value @@ -95,7 +109,7 @@ def type(self, type): :param type: The type of this Metric. # noqa: E501 - :type: str + :type type: str """ self._type = type @@ -116,7 +130,7 @@ def name(self, name): :param name: The name of this Metric. # noqa: E501 - :type: str + :type name: str """ self._name = name @@ -137,7 +151,7 @@ def metric(self, metric): :param metric: The metric of this Metric. # noqa: E501 - :type: str + :type metric: str """ self._metric = metric @@ -158,32 +172,40 @@ def measurement(self, measurement): :param measurement: The measurement of this Metric. # noqa: E501 - :type: str + :type measurement: str """ self._measurement = measurement - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -200,8 +222,11 @@ def __eq__(self, other): if not isinstance(other, Metric): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Metric): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/notification_rule.py b/mux_python/models/notification_rule.py index 237de72..312b4d4 100644 --- a/mux_python/models/notification_rule.py +++ b/mux_python/models/notification_rule.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class NotificationRule(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class NotificationRule(object): 'id': 'id' } - def __init__(self, value=None, name=None, id=None): # noqa: E501 + def __init__(self, value=None, name=None, id=None, local_vars_configuration=None): # noqa: E501 """NotificationRule - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._value = None self._name = None @@ -64,7 +78,7 @@ def value(self, value): :param value: The value of this NotificationRule. # noqa: E501 - :type: str + :type value: str """ self._value = value @@ -85,7 +99,7 @@ def name(self, name): :param name: The name of this NotificationRule. # noqa: E501 - :type: str + :type name: str """ self._name = name @@ -106,32 +120,40 @@ def id(self, id): :param id: The id of this NotificationRule. # noqa: E501 - :type: str + :type id: str """ self._id = id - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, NotificationRule): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, NotificationRule): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/overall_values.py b/mux_python/models/overall_values.py index 175886d..0c51ba4 100644 --- a/mux_python/models/overall_values.py +++ b/mux_python/models/overall_values.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class OverallValues(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -35,8 +46,11 @@ class OverallValues(object): 'global_value': 'global_value' } - def __init__(self, value=None, total_watch_time=None, total_views=None, global_value=None): # noqa: E501 + def __init__(self, value=None, total_watch_time=None, total_views=None, global_value=None, local_vars_configuration=None): # noqa: E501 """OverallValues - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._value = None self._total_watch_time = None @@ -69,7 +83,7 @@ def value(self, value): :param value: The value of this OverallValues. # noqa: E501 - :type: float + :type value: float """ self._value = value @@ -90,7 +104,7 @@ def total_watch_time(self, total_watch_time): :param total_watch_time: The total_watch_time of this OverallValues. # noqa: E501 - :type: int + :type total_watch_time: int """ self._total_watch_time = total_watch_time @@ -111,7 +125,7 @@ def total_views(self, total_views): :param total_views: The total_views of this OverallValues. # noqa: E501 - :type: int + :type total_views: int """ self._total_views = total_views @@ -132,32 +146,40 @@ def global_value(self, global_value): :param global_value: The global_value of this OverallValues. # noqa: E501 - :type: float + :type global_value: float """ self._global_value = global_value - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -174,8 +196,11 @@ def __eq__(self, other): if not isinstance(other, OverallValues): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, OverallValues): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/playback_id.py b/mux_python/models/playback_id.py index 963586e..b4699dc 100644 --- a/mux_python/models/playback_id.py +++ b/mux_python/models/playback_id.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class PlaybackID(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class PlaybackID(object): 'policy': 'policy' } - def __init__(self, id=None, policy=None): # noqa: E501 + def __init__(self, id=None, policy=None, local_vars_configuration=None): # noqa: E501 """PlaybackID - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._id = None self._policy = None @@ -61,7 +75,7 @@ def id(self, id): Unique identifier for the PlaybackID # noqa: E501 :param id: The id of this PlaybackID. # noqa: E501 - :type: str + :type id: str """ self._id = id @@ -82,32 +96,40 @@ def policy(self, policy): :param policy: The policy of this PlaybackID. # noqa: E501 - :type: PlaybackPolicy + :type policy: PlaybackPolicy """ self._policy = policy - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -124,8 +146,11 @@ def __eq__(self, other): if not isinstance(other, PlaybackID): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, PlaybackID): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/playback_policy.py b/mux_python/models/playback_policy.py index 0f08b8d..67af02c 100644 --- a/mux_python/models/playback_policy.py +++ b/mux_python/models/playback_policy.py @@ -1,17 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class PlaybackPolicy(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ """ allowed enum values @@ -19,6 +31,8 @@ class PlaybackPolicy(object): PUBLIC = "public" SIGNED = "signed" + allowable_values = [PUBLIC, SIGNED] # noqa: E501 + """ Attributes: openapi_types (dict): The key is attribute name @@ -32,31 +46,42 @@ class PlaybackPolicy(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, local_vars_configuration=None): # noqa: E501 """PlaybackPolicy - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self.discriminator = None - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -73,8 +98,11 @@ def __eq__(self, other): if not isinstance(other, PlaybackPolicy): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, PlaybackPolicy): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/real_time_breakdown_value.py b/mux_python/models/real_time_breakdown_value.py index 5f7d69f..8d88127 100644 --- a/mux_python/models/real_time_breakdown_value.py +++ b/mux_python/models/real_time_breakdown_value.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class RealTimeBreakdownValue(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -37,8 +48,11 @@ class RealTimeBreakdownValue(object): 'concurent_viewers': 'concurent_viewers' } - def __init__(self, value=None, negative_impact=None, metric_value=None, display_value=None, concurent_viewers=None): # noqa: E501 + def __init__(self, value=None, negative_impact=None, metric_value=None, display_value=None, concurent_viewers=None, local_vars_configuration=None): # noqa: E501 """RealTimeBreakdownValue - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._value = None self._negative_impact = None @@ -74,7 +88,7 @@ def value(self, value): :param value: The value of this RealTimeBreakdownValue. # noqa: E501 - :type: str + :type value: str """ self._value = value @@ -95,7 +109,7 @@ def negative_impact(self, negative_impact): :param negative_impact: The negative_impact of this RealTimeBreakdownValue. # noqa: E501 - :type: int + :type negative_impact: int """ self._negative_impact = negative_impact @@ -116,7 +130,7 @@ def metric_value(self, metric_value): :param metric_value: The metric_value of this RealTimeBreakdownValue. # noqa: E501 - :type: float + :type metric_value: float """ self._metric_value = metric_value @@ -137,7 +151,7 @@ def display_value(self, display_value): :param display_value: The display_value of this RealTimeBreakdownValue. # noqa: E501 - :type: str + :type display_value: str """ self._display_value = display_value @@ -158,32 +172,40 @@ def concurent_viewers(self, concurent_viewers): :param concurent_viewers: The concurent_viewers of this RealTimeBreakdownValue. # noqa: E501 - :type: int + :type concurent_viewers: int """ self._concurent_viewers = concurent_viewers - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -200,8 +222,11 @@ def __eq__(self, other): if not isinstance(other, RealTimeBreakdownValue): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, RealTimeBreakdownValue): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/real_time_histogram_timeseries_bucket.py b/mux_python/models/real_time_histogram_timeseries_bucket.py index 0416482..d7177ae 100644 --- a/mux_python/models/real_time_histogram_timeseries_bucket.py +++ b/mux_python/models/real_time_histogram_timeseries_bucket.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class RealTimeHistogramTimeseriesBucket(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class RealTimeHistogramTimeseriesBucket(object): 'end': 'end' } - def __init__(self, start=None, end=None): # noqa: E501 + def __init__(self, start=None, end=None, local_vars_configuration=None): # noqa: E501 """RealTimeHistogramTimeseriesBucket - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._start = None self._end = None @@ -59,7 +73,7 @@ def start(self, start): :param start: The start of this RealTimeHistogramTimeseriesBucket. # noqa: E501 - :type: int + :type start: int """ self._start = start @@ -80,32 +94,40 @@ def end(self, end): :param end: The end of this RealTimeHistogramTimeseriesBucket. # noqa: E501 - :type: int + :type end: int """ self._end = end - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -122,8 +144,11 @@ def __eq__(self, other): if not isinstance(other, RealTimeHistogramTimeseriesBucket): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, RealTimeHistogramTimeseriesBucket): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/real_time_histogram_timeseries_bucket_values.py b/mux_python/models/real_time_histogram_timeseries_bucket_values.py index eb5cb21..c26f384 100644 --- a/mux_python/models/real_time_histogram_timeseries_bucket_values.py +++ b/mux_python/models/real_time_histogram_timeseries_bucket_values.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class RealTimeHistogramTimeseriesBucketValues(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class RealTimeHistogramTimeseriesBucketValues(object): 'count': 'count' } - def __init__(self, percentage=None, count=None): # noqa: E501 + def __init__(self, percentage=None, count=None, local_vars_configuration=None): # noqa: E501 """RealTimeHistogramTimeseriesBucketValues - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._percentage = None self._count = None @@ -59,7 +73,7 @@ def percentage(self, percentage): :param percentage: The percentage of this RealTimeHistogramTimeseriesBucketValues. # noqa: E501 - :type: float + :type percentage: float """ self._percentage = percentage @@ -80,32 +94,40 @@ def count(self, count): :param count: The count of this RealTimeHistogramTimeseriesBucketValues. # noqa: E501 - :type: int + :type count: int """ self._count = count - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -122,8 +144,11 @@ def __eq__(self, other): if not isinstance(other, RealTimeHistogramTimeseriesBucketValues): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, RealTimeHistogramTimeseriesBucketValues): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/real_time_histogram_timeseries_datapoint.py b/mux_python/models/real_time_histogram_timeseries_datapoint.py index 318ee69..97ac38a 100644 --- a/mux_python/models/real_time_histogram_timeseries_datapoint.py +++ b/mux_python/models/real_time_histogram_timeseries_datapoint.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class RealTimeHistogramTimeseriesDatapoint(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -41,8 +52,11 @@ class RealTimeHistogramTimeseriesDatapoint(object): 'average': 'average' } - def __init__(self, timestamp=None, sum=None, p95=None, median=None, max_percentage=None, bucket_values=None, average=None): # noqa: E501 + def __init__(self, timestamp=None, sum=None, p95=None, median=None, max_percentage=None, bucket_values=None, average=None, local_vars_configuration=None): # noqa: E501 """RealTimeHistogramTimeseriesDatapoint - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._timestamp = None self._sum = None @@ -84,7 +98,7 @@ def timestamp(self, timestamp): :param timestamp: The timestamp of this RealTimeHistogramTimeseriesDatapoint. # noqa: E501 - :type: str + :type timestamp: str """ self._timestamp = timestamp @@ -105,7 +119,7 @@ def sum(self, sum): :param sum: The sum of this RealTimeHistogramTimeseriesDatapoint. # noqa: E501 - :type: int + :type sum: int """ self._sum = sum @@ -126,7 +140,7 @@ def p95(self, p95): :param p95: The p95 of this RealTimeHistogramTimeseriesDatapoint. # noqa: E501 - :type: float + :type p95: float """ self._p95 = p95 @@ -147,7 +161,7 @@ def median(self, median): :param median: The median of this RealTimeHistogramTimeseriesDatapoint. # noqa: E501 - :type: float + :type median: float """ self._median = median @@ -168,7 +182,7 @@ def max_percentage(self, max_percentage): :param max_percentage: The max_percentage of this RealTimeHistogramTimeseriesDatapoint. # noqa: E501 - :type: float + :type max_percentage: float """ self._max_percentage = max_percentage @@ -189,7 +203,7 @@ def bucket_values(self, bucket_values): :param bucket_values: The bucket_values of this RealTimeHistogramTimeseriesDatapoint. # noqa: E501 - :type: list[RealTimeHistogramTimeseriesBucketValues] + :type bucket_values: list[RealTimeHistogramTimeseriesBucketValues] """ self._bucket_values = bucket_values @@ -210,32 +224,40 @@ def average(self, average): :param average: The average of this RealTimeHistogramTimeseriesDatapoint. # noqa: E501 - :type: float + :type average: float """ self._average = average - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -252,8 +274,11 @@ def __eq__(self, other): if not isinstance(other, RealTimeHistogramTimeseriesDatapoint): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, RealTimeHistogramTimeseriesDatapoint): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/real_time_timeseries_datapoint.py b/mux_python/models/real_time_timeseries_datapoint.py index e3c26a4..a63f785 100644 --- a/mux_python/models/real_time_timeseries_datapoint.py +++ b/mux_python/models/real_time_timeseries_datapoint.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class RealTimeTimeseriesDatapoint(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class RealTimeTimeseriesDatapoint(object): 'concurent_viewers': 'concurent_viewers' } - def __init__(self, value=None, date=None, concurent_viewers=None): # noqa: E501 + def __init__(self, value=None, date=None, concurent_viewers=None, local_vars_configuration=None): # noqa: E501 """RealTimeTimeseriesDatapoint - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._value = None self._date = None @@ -64,7 +78,7 @@ def value(self, value): :param value: The value of this RealTimeTimeseriesDatapoint. # noqa: E501 - :type: float + :type value: float """ self._value = value @@ -85,7 +99,7 @@ def date(self, date): :param date: The date of this RealTimeTimeseriesDatapoint. # noqa: E501 - :type: str + :type date: str """ self._date = date @@ -106,32 +120,40 @@ def concurent_viewers(self, concurent_viewers): :param concurent_viewers: The concurent_viewers of this RealTimeTimeseriesDatapoint. # noqa: E501 - :type: int + :type concurent_viewers: int """ self._concurent_viewers = concurent_viewers - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +170,11 @@ def __eq__(self, other): if not isinstance(other, RealTimeTimeseriesDatapoint): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, RealTimeTimeseriesDatapoint): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/score.py b/mux_python/models/score.py index f0e451c..baa4fe4 100644 --- a/mux_python/models/score.py +++ b/mux_python/models/score.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class Score(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -39,8 +50,11 @@ class Score(object): 'items': 'items' } - def __init__(self, watch_time=None, view_count=None, name=None, value=None, metric=None, items=None): # noqa: E501 + def __init__(self, watch_time=None, view_count=None, name=None, value=None, metric=None, items=None, local_vars_configuration=None): # noqa: E501 """Score - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._watch_time = None self._view_count = None @@ -79,7 +93,7 @@ def watch_time(self, watch_time): :param watch_time: The watch_time of this Score. # noqa: E501 - :type: int + :type watch_time: int """ self._watch_time = watch_time @@ -100,7 +114,7 @@ def view_count(self, view_count): :param view_count: The view_count of this Score. # noqa: E501 - :type: int + :type view_count: int """ self._view_count = view_count @@ -121,7 +135,7 @@ def name(self, name): :param name: The name of this Score. # noqa: E501 - :type: str + :type name: str """ self._name = name @@ -142,7 +156,7 @@ def value(self, value): :param value: The value of this Score. # noqa: E501 - :type: float + :type value: float """ self._value = value @@ -163,7 +177,7 @@ def metric(self, metric): :param metric: The metric of this Score. # noqa: E501 - :type: str + :type metric: str """ self._metric = metric @@ -184,32 +198,40 @@ def items(self, items): :param items: The items of this Score. # noqa: E501 - :type: list[Metric] + :type items: list[Metric] """ self._items = items - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -226,8 +248,11 @@ def __eq__(self, other): if not isinstance(other, Score): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Score): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/signal_live_stream_complete_response.py b/mux_python/models/signal_live_stream_complete_response.py index b14588b..f702fcb 100644 --- a/mux_python/models/signal_live_stream_complete_response.py +++ b/mux_python/models/signal_live_stream_complete_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class SignalLiveStreamCompleteResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class SignalLiveStreamCompleteResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """SignalLiveStreamCompleteResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this SignalLiveStreamCompleteResponse. # noqa: E501 - :type: object + :type data: object """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, SignalLiveStreamCompleteResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, SignalLiveStreamCompleteResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/signing_key.py b/mux_python/models/signing_key.py index c098ad8..e7677b2 100644 --- a/mux_python/models/signing_key.py +++ b/mux_python/models/signing_key.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class SigningKey(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -33,8 +44,11 @@ class SigningKey(object): 'private_key': 'private_key' } - def __init__(self, id=None, created_at=None, private_key=None): # noqa: E501 + def __init__(self, id=None, created_at=None, private_key=None, local_vars_configuration=None): # noqa: E501 """SigningKey - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._id = None self._created_at = None @@ -52,6 +66,7 @@ def __init__(self, id=None, created_at=None, private_key=None): # noqa: E501 def id(self): """Gets the id of this SigningKey. # noqa: E501 + Unique identifier for the Signing Key. # noqa: E501 :return: The id of this SigningKey. # noqa: E501 :rtype: str @@ -62,9 +77,10 @@ def id(self): def id(self, id): """Sets the id of this SigningKey. + Unique identifier for the Signing Key. # noqa: E501 :param id: The id of this SigningKey. # noqa: E501 - :type: str + :type id: str """ self._id = id @@ -73,6 +89,7 @@ def id(self, id): def created_at(self): """Gets the created_at of this SigningKey. # noqa: E501 + Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501 :return: The created_at of this SigningKey. # noqa: E501 :rtype: str @@ -83,9 +100,10 @@ def created_at(self): def created_at(self, created_at): """Sets the created_at of this SigningKey. + Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501 :param created_at: The created_at of this SigningKey. # noqa: E501 - :type: str + :type created_at: str """ self._created_at = created_at @@ -94,6 +112,7 @@ def created_at(self, created_at): def private_key(self): """Gets the private_key of this SigningKey. # noqa: E501 + A Base64 encoded private key that can be used with the RS256 algorithm when creating a [JWT](https://jwt.io/). **Note that this value is only returned once when creating a URL signing key.** # noqa: E501 :return: The private_key of this SigningKey. # noqa: E501 :rtype: str @@ -104,34 +123,43 @@ def private_key(self): def private_key(self, private_key): """Sets the private_key of this SigningKey. + A Base64 encoded private key that can be used with the RS256 algorithm when creating a [JWT](https://jwt.io/). **Note that this value is only returned once when creating a URL signing key.** # noqa: E501 :param private_key: The private_key of this SigningKey. # noqa: E501 - :type: str + :type private_key: str """ self._private_key = private_key - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -148,8 +176,11 @@ def __eq__(self, other): if not isinstance(other, SigningKey): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, SigningKey): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/signing_key_response.py b/mux_python/models/signing_key_response.py index 3b61121..34d2de5 100644 --- a/mux_python/models/signing_key_response.py +++ b/mux_python/models/signing_key_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class SigningKeyResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class SigningKeyResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """SigningKeyResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this SigningKeyResponse. # noqa: E501 - :type: SigningKey + :type data: SigningKey """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, SigningKeyResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, SigningKeyResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/simulcast_target.py b/mux_python/models/simulcast_target.py index 6a07af6..daaa0ed 100644 --- a/mux_python/models/simulcast_target.py +++ b/mux_python/models/simulcast_target.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class SimulcastTarget(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -37,8 +48,11 @@ class SimulcastTarget(object): 'url': 'url' } - def __init__(self, id=None, passthrough=None, status=None, stream_key=None, url=None): # noqa: E501 + def __init__(self, id=None, passthrough=None, status=None, stream_key=None, url=None, local_vars_configuration=None): # noqa: E501 """SimulcastTarget - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._id = None self._passthrough = None @@ -76,7 +90,7 @@ def id(self, id): ID of the Simulcast Target # noqa: E501 :param id: The id of this SimulcastTarget. # noqa: E501 - :type: str + :type id: str """ self._id = id @@ -99,7 +113,7 @@ def passthrough(self, passthrough): Arbitrary Metadata set when creating a simulcast target. # noqa: E501 :param passthrough: The passthrough of this SimulcastTarget. # noqa: E501 - :type: str + :type passthrough: str """ self._passthrough = passthrough @@ -122,10 +136,10 @@ def status(self, status): The current status of the simulcast target. See Statuses below for detailed description. * `idle`: Default status. When the parent live stream is in disconnected status, simulcast targets will be idle state. * `starting`: The simulcast target transitions into this state when the parent live stream transition into connected state. * `broadcasting`: The simulcast target has successfully connected to the third party live streaming service and is pushing video to that service. * `errored`: The simulcast target encountered an error either while attempting to connect to the third party live streaming service, or mid-broadcasting. Compared to other errored statuses in the Mux Video API, a simulcast may transition back into the broadcasting state if a connection with the service can be re-established. # noqa: E501 :param status: The status of this SimulcastTarget. # noqa: E501 - :type: str + :type status: str """ allowed_values = ["idle", "starting", "broadcasting", "errored"] # noqa: E501 - if status not in allowed_values: + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 .format(status, allowed_values) @@ -151,7 +165,7 @@ def stream_key(self, stream_key): Stream Key represents an stream identifier for the third party live streaming service to simulcast the parent live stream too. # noqa: E501 :param stream_key: The stream_key of this SimulcastTarget. # noqa: E501 - :type: str + :type stream_key: str """ self._stream_key = stream_key @@ -174,32 +188,40 @@ def url(self, url): RTMP hostname including the application name for the third party live streaming service. # noqa: E501 :param url: The url of this SimulcastTarget. # noqa: E501 - :type: str + :type url: str """ self._url = url - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -216,8 +238,11 @@ def __eq__(self, other): if not isinstance(other, SimulcastTarget): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, SimulcastTarget): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/simulcast_target_response.py b/mux_python/models/simulcast_target_response.py index a9239ab..069e873 100644 --- a/mux_python/models/simulcast_target_response.py +++ b/mux_python/models/simulcast_target_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class SimulcastTargetResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class SimulcastTargetResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """SimulcastTargetResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this SimulcastTargetResponse. # noqa: E501 - :type: SimulcastTarget + :type data: SimulcastTarget """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, SimulcastTargetResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, SimulcastTargetResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/track.py b/mux_python/models/track.py index 960c76c..81cf1bd 100644 --- a/mux_python/models/track.py +++ b/mux_python/models/track.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class Track(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -53,8 +64,11 @@ class Track(object): 'passthrough': 'passthrough' } - def __init__(self, id=None, type=None, duration=None, max_width=None, max_height=None, max_frame_rate=None, max_channels=None, max_channel_layout=None, text_type=None, language_code=None, name=None, closed_captions=None, passthrough=None): # noqa: E501 + def __init__(self, id=None, type=None, duration=None, max_width=None, max_height=None, max_frame_rate=None, max_channels=None, max_channel_layout=None, text_type=None, language_code=None, name=None, closed_captions=None, passthrough=None, local_vars_configuration=None): # noqa: E501 """Track - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._id = None self._type = None @@ -116,7 +130,7 @@ def id(self, id): Unique identifier for the Track # noqa: E501 :param id: The id of this Track. # noqa: E501 - :type: str + :type id: str """ self._id = id @@ -139,10 +153,10 @@ def type(self, type): The type of track # noqa: E501 :param type: The type of this Track. # noqa: E501 - :type: str + :type type: str """ allowed_values = ["video", "audio", "text"] # noqa: E501 - if type not in allowed_values: + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 .format(type, allowed_values) @@ -168,7 +182,7 @@ def duration(self, duration): The duration in seconds of the track media. This parameter is not set for the `text` type track. This field is optional and may not be set. The top level `duration` field of an asset will always be set. # noqa: E501 :param duration: The duration of this Track. # noqa: E501 - :type: float + :type duration: float """ self._duration = duration @@ -191,7 +205,7 @@ def max_width(self, max_width): The maximum width in pixels available for the track. Only set for the `video` type track. # noqa: E501 :param max_width: The max_width of this Track. # noqa: E501 - :type: int + :type max_width: int """ self._max_width = max_width @@ -214,7 +228,7 @@ def max_height(self, max_height): The maximum height in pixels available for the track. Only set for the `video` type track. # noqa: E501 :param max_height: The max_height of this Track. # noqa: E501 - :type: int + :type max_height: int """ self._max_height = max_height @@ -237,7 +251,7 @@ def max_frame_rate(self, max_frame_rate): The maximum frame rate available for the track. Only set for the `video` type track. This field may return `-1` if the frame rate of the input cannot be reliably determined. # noqa: E501 :param max_frame_rate: The max_frame_rate of this Track. # noqa: E501 - :type: float + :type max_frame_rate: float """ self._max_frame_rate = max_frame_rate @@ -260,7 +274,7 @@ def max_channels(self, max_channels): The maximum number of audio channels the track supports. Only set for the `audio` type track. # noqa: E501 :param max_channels: The max_channels of this Track. # noqa: E501 - :type: int + :type max_channels: int """ self._max_channels = max_channels @@ -283,10 +297,10 @@ def max_channel_layout(self, max_channel_layout): Only set for the `audio` type track. # noqa: E501 :param max_channel_layout: The max_channel_layout of this Track. # noqa: E501 - :type: str + :type max_channel_layout: str """ allowed_values = ["mono", "stereo", "5.2", "7.1"] # noqa: E501 - if max_channel_layout not in allowed_values: + if self.local_vars_configuration.client_side_validation and max_channel_layout not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `max_channel_layout` ({0}), must be one of {1}" # noqa: E501 .format(max_channel_layout, allowed_values) @@ -312,10 +326,10 @@ def text_type(self, text_type): This parameter is set only for the `text` type track. # noqa: E501 :param text_type: The text_type of this Track. # noqa: E501 - :type: str + :type text_type: str """ allowed_values = ["subtitles"] # noqa: E501 - if text_type not in allowed_values: + if self.local_vars_configuration.client_side_validation and text_type not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `text_type` ({0}), must be one of {1}" # noqa: E501 .format(text_type, allowed_values) @@ -341,7 +355,7 @@ def language_code(self, language_code): The language code value represents [BCP 47](https://tools.ietf.org/html/bcp47) specification compliant value. For example, `en` for English or `en-US` for the US version of English. This parameter is set for `text` type and `subtitles` text type track. # noqa: E501 :param language_code: The language_code of this Track. # noqa: E501 - :type: str + :type language_code: str """ self._language_code = language_code @@ -364,7 +378,7 @@ def name(self, name): The name of the track containing a human-readable description. The hls manifest will associate a subtitle text track with this value. For example, the value is \"English\" for subtitles text track for the `language_code` value of `en-US`. This parameter is set for the `text` type and `subtitles` text type track. # noqa: E501 :param name: The name of this Track. # noqa: E501 - :type: str + :type name: str """ self._name = name @@ -387,7 +401,7 @@ def closed_captions(self, closed_captions): Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This parameter is set for the `text` type and `subtitles` text type track. # noqa: E501 :param closed_captions: The closed_captions of this Track. # noqa: E501 - :type: bool + :type closed_captions: bool """ self._closed_captions = closed_captions @@ -410,32 +424,40 @@ def passthrough(self, passthrough): Arbitrary metadata set for the track either when creating the asset or track. This parameter is set for `text` type and `subtitles` text type track. Max 255 characters. # noqa: E501 :param passthrough: The passthrough of this Track. # noqa: E501 - :type: str + :type passthrough: str """ self._passthrough = passthrough - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -452,8 +474,11 @@ def __eq__(self, other): if not isinstance(other, Track): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Track): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/update_asset_master_access_request.py b/mux_python/models/update_asset_master_access_request.py index 668b067..b081e98 100644 --- a/mux_python/models/update_asset_master_access_request.py +++ b/mux_python/models/update_asset_master_access_request.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class UpdateAssetMasterAccessRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class UpdateAssetMasterAccessRequest(object): 'master_access': 'master_access' } - def __init__(self, master_access=None): # noqa: E501 + def __init__(self, master_access=None, local_vars_configuration=None): # noqa: E501 """UpdateAssetMasterAccessRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._master_access = None self.discriminator = None @@ -56,10 +70,10 @@ def master_access(self, master_access): Add or remove access to the master version of the video. # noqa: E501 :param master_access: The master_access of this UpdateAssetMasterAccessRequest. # noqa: E501 - :type: str + :type master_access: str """ allowed_values = ["temporary", "none"] # noqa: E501 - if master_access not in allowed_values: + if self.local_vars_configuration.client_side_validation and master_access not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `master_access` ({0}), must be one of {1}" # noqa: E501 .format(master_access, allowed_values) @@ -67,27 +81,35 @@ def master_access(self, master_access): self._master_access = master_access - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -104,8 +126,11 @@ def __eq__(self, other): if not isinstance(other, UpdateAssetMasterAccessRequest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, UpdateAssetMasterAccessRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/update_asset_mp4_support_request.py b/mux_python/models/update_asset_mp4_support_request.py index 81b6207..7a0957b 100644 --- a/mux_python/models/update_asset_mp4_support_request.py +++ b/mux_python/models/update_asset_mp4_support_request.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class UpdateAssetMP4SupportRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class UpdateAssetMP4SupportRequest(object): 'mp4_support': 'mp4_support' } - def __init__(self, mp4_support=None): # noqa: E501 + def __init__(self, mp4_support=None, local_vars_configuration=None): # noqa: E501 """UpdateAssetMP4SupportRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._mp4_support = None self.discriminator = None @@ -56,10 +70,10 @@ def mp4_support(self, mp4_support): String value for the level of mp4 support # noqa: E501 :param mp4_support: The mp4_support of this UpdateAssetMP4SupportRequest. # noqa: E501 - :type: str + :type mp4_support: str """ allowed_values = ["standard", "none"] # noqa: E501 - if mp4_support not in allowed_values: + if self.local_vars_configuration.client_side_validation and mp4_support not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `mp4_support` ({0}), must be one of {1}" # noqa: E501 .format(mp4_support, allowed_values) @@ -67,27 +81,35 @@ def mp4_support(self, mp4_support): self._mp4_support = mp4_support - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -104,8 +126,11 @@ def __eq__(self, other): if not isinstance(other, UpdateAssetMP4SupportRequest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, UpdateAssetMP4SupportRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/upload.py b/mux_python/models/upload.py index 1408b51..e793716 100644 --- a/mux_python/models/upload.py +++ b/mux_python/models/upload.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class Upload(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -45,8 +56,11 @@ class Upload(object): 'test': 'test' } - def __init__(self, id=None, timeout=3600, status=None, new_asset_settings=None, asset_id=None, error=None, cors_origin=None, url=None, test=None): # noqa: E501 + def __init__(self, id=None, timeout=3600, status=None, new_asset_settings=None, asset_id=None, error=None, cors_origin=None, url=None, test=None, local_vars_configuration=None): # noqa: E501 """Upload - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._id = None self._timeout = None @@ -82,6 +96,7 @@ def __init__(self, id=None, timeout=3600, status=None, new_asset_settings=None, def id(self): """Gets the id of this Upload. # noqa: E501 + Unique identifier for the Direct Upload. # noqa: E501 :return: The id of this Upload. # noqa: E501 :rtype: str @@ -92,9 +107,10 @@ def id(self): def id(self, id): """Sets the id of this Upload. + Unique identifier for the Direct Upload. # noqa: E501 :param id: The id of this Upload. # noqa: E501 - :type: str + :type id: str """ self._id = id @@ -117,11 +133,13 @@ def timeout(self, timeout): Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out` # noqa: E501 :param timeout: The timeout of this Upload. # noqa: E501 - :type: int + :type timeout: int """ - if timeout is not None and timeout > 604800: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + timeout is not None and timeout > 604800): # noqa: E501 raise ValueError("Invalid value for `timeout`, must be a value less than or equal to `604800`") # noqa: E501 - if timeout is not None and timeout < 60: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + timeout is not None and timeout < 60): # noqa: E501 raise ValueError("Invalid value for `timeout`, must be a value greater than or equal to `60`") # noqa: E501 self._timeout = timeout @@ -142,10 +160,10 @@ def status(self, status): :param status: The status of this Upload. # noqa: E501 - :type: str + :type status: str """ allowed_values = ["waiting", "asset_created", "errored", "cancelled", "timed_out"] # noqa: E501 - if status not in allowed_values: + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 .format(status, allowed_values) @@ -169,7 +187,7 @@ def new_asset_settings(self, new_asset_settings): :param new_asset_settings: The new_asset_settings of this Upload. # noqa: E501 - :type: Asset + :type new_asset_settings: Asset """ self._new_asset_settings = new_asset_settings @@ -192,7 +210,7 @@ def asset_id(self, asset_id): Only set once the upload is in the `asset_created` state. # noqa: E501 :param asset_id: The asset_id of this Upload. # noqa: E501 - :type: str + :type asset_id: str """ self._asset_id = asset_id @@ -213,7 +231,7 @@ def error(self, error): :param error: The error of this Upload. # noqa: E501 - :type: UploadError + :type error: UploadError """ self._error = error @@ -236,7 +254,7 @@ def cors_origin(self, cors_origin): If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers. # noqa: E501 :param cors_origin: The cors_origin of this Upload. # noqa: E501 - :type: str + :type cors_origin: str """ self._cors_origin = cors_origin @@ -259,7 +277,7 @@ def url(self, url): The URL to upload the associated source media to. # noqa: E501 :param url: The url of this Upload. # noqa: E501 - :type: str + :type url: str """ self._url = url @@ -268,6 +286,7 @@ def url(self, url): def test(self): """Gets the test of this Upload. # noqa: E501 + Indicates if this is a test Direct Upload, in which case the Asset that gets created will be a `test` Asset. # noqa: E501 :return: The test of this Upload. # noqa: E501 :rtype: bool @@ -278,34 +297,43 @@ def test(self): def test(self, test): """Sets the test of this Upload. + Indicates if this is a test Direct Upload, in which case the Asset that gets created will be a `test` Asset. # noqa: E501 :param test: The test of this Upload. # noqa: E501 - :type: bool + :type test: bool """ self._test = test - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -322,8 +350,11 @@ def __eq__(self, other): if not isinstance(other, Upload): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Upload): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/upload_error.py b/mux_python/models/upload_error.py index 474ae6c..ac0360a 100644 --- a/mux_python/models/upload_error.py +++ b/mux_python/models/upload_error.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class UploadError(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class UploadError(object): 'message': 'message' } - def __init__(self, type=None, message=None): # noqa: E501 + def __init__(self, type=None, message=None, local_vars_configuration=None): # noqa: E501 """UploadError - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._type = None self._message = None @@ -47,6 +61,7 @@ def __init__(self, type=None, message=None): # noqa: E501 def type(self): """Gets the type of this UploadError. # noqa: E501 + Label for the specific error # noqa: E501 :return: The type of this UploadError. # noqa: E501 :rtype: str @@ -57,9 +72,10 @@ def type(self): def type(self, type): """Sets the type of this UploadError. + Label for the specific error # noqa: E501 :param type: The type of this UploadError. # noqa: E501 - :type: str + :type type: str """ self._type = type @@ -68,6 +84,7 @@ def type(self, type): def message(self): """Gets the message of this UploadError. # noqa: E501 + Human readable error message # noqa: E501 :return: The message of this UploadError. # noqa: E501 :rtype: str @@ -78,34 +95,43 @@ def message(self): def message(self, message): """Sets the message of this UploadError. + Human readable error message # noqa: E501 :param message: The message of this UploadError. # noqa: E501 - :type: str + :type message: str """ self._message = message - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -122,8 +148,11 @@ def __eq__(self, other): if not isinstance(other, UploadError): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, UploadError): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/upload_response.py b/mux_python/models/upload_response.py index ee879b5..26d1925 100644 --- a/mux_python/models/upload_response.py +++ b/mux_python/models/upload_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class UploadResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -29,8 +40,11 @@ class UploadResponse(object): 'data': 'data' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 """UploadResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self.discriminator = None @@ -54,32 +68,40 @@ def data(self, data): :param data: The data of this UploadResponse. # noqa: E501 - :type: Upload + :type data: Upload """ self._data = data - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -96,8 +118,11 @@ def __eq__(self, other): if not isinstance(other, UploadResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, UploadResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/video_view.py b/mux_python/models/video_view.py index 4d68a88..06efbf9 100644 --- a/mux_python/models/video_view.py +++ b/mux_python/models/video_view.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class VideoView(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -251,8 +262,11 @@ class VideoView(object): 'player_mux_plugin_name': 'player_mux_plugin_name' } - def __init__(self, view_total_upscaling=None, preroll_ad_asset_hostname=None, player_source_domain=None, region=None, viewer_user_agent=None, preroll_requested=None, page_type=None, startup_score=None, view_seek_duration=None, country_name=None, player_source_height=None, longitude=None, buffering_count=None, video_duration=None, player_source_type=None, city=None, view_id=None, platform_description=None, video_startup_preroll_request_time=None, viewer_device_name=None, video_series=None, viewer_application_name=None, updated_at=None, view_total_content_playback_time=None, cdn=None, player_instance_id=None, video_language=None, player_source_width=None, player_error_message=None, player_mux_plugin_version=None, watched=None, playback_score=None, page_url=None, metro=None, view_max_request_latency=None, requests_for_first_preroll=None, view_total_downscaling=None, latitude=None, player_source_host_name=None, inserted_at=None, view_end=None, mux_embed_version=None, player_language=None, page_load_time=None, viewer_device_category=None, video_startup_preroll_load_time=None, player_version=None, watch_time=None, player_source_stream_type=None, preroll_ad_tag_hostname=None, viewer_device_manufacturer=None, rebuffering_score=None, experiment_name=None, viewer_os_version=None, player_preload=None, buffering_duration=None, player_view_count=None, player_software=None, player_load_time=None, platform_summary=None, video_encoding_variant=None, player_width=None, view_seek_count=None, viewer_experience_score=None, view_error_id=None, video_variant_name=None, preroll_played=None, viewer_application_engine=None, viewer_os_architecture=None, player_error_code=None, buffering_rate=None, events=None, player_name=None, view_start=None, view_average_request_throughput=None, video_producer=None, error_type_id=None, mux_viewer_id=None, video_id=None, continent_code=None, session_id=None, exit_before_video_start=None, video_content_type=None, viewer_os_family=None, player_poster=None, view_average_request_latency=None, video_variant_id=None, player_source_duration=None, player_source_url=None, mux_api_version=None, video_title=None, id=None, short_time=None, rebuffer_percentage=None, time_to_first_frame=None, viewer_user_id=None, video_stream_type=None, player_startup_time=None, viewer_application_version=None, view_max_downscale_percentage=None, view_max_upscale_percentage=None, country_code=None, used_fullscreen=None, isp=None, property_id=None, player_autoplay=None, player_height=None, asn=None, asn_name=None, quality_score=None, player_software_version=None, player_mux_plugin_name=None): # noqa: E501 + def __init__(self, view_total_upscaling=None, preroll_ad_asset_hostname=None, player_source_domain=None, region=None, viewer_user_agent=None, preroll_requested=None, page_type=None, startup_score=None, view_seek_duration=None, country_name=None, player_source_height=None, longitude=None, buffering_count=None, video_duration=None, player_source_type=None, city=None, view_id=None, platform_description=None, video_startup_preroll_request_time=None, viewer_device_name=None, video_series=None, viewer_application_name=None, updated_at=None, view_total_content_playback_time=None, cdn=None, player_instance_id=None, video_language=None, player_source_width=None, player_error_message=None, player_mux_plugin_version=None, watched=None, playback_score=None, page_url=None, metro=None, view_max_request_latency=None, requests_for_first_preroll=None, view_total_downscaling=None, latitude=None, player_source_host_name=None, inserted_at=None, view_end=None, mux_embed_version=None, player_language=None, page_load_time=None, viewer_device_category=None, video_startup_preroll_load_time=None, player_version=None, watch_time=None, player_source_stream_type=None, preroll_ad_tag_hostname=None, viewer_device_manufacturer=None, rebuffering_score=None, experiment_name=None, viewer_os_version=None, player_preload=None, buffering_duration=None, player_view_count=None, player_software=None, player_load_time=None, platform_summary=None, video_encoding_variant=None, player_width=None, view_seek_count=None, viewer_experience_score=None, view_error_id=None, video_variant_name=None, preroll_played=None, viewer_application_engine=None, viewer_os_architecture=None, player_error_code=None, buffering_rate=None, events=None, player_name=None, view_start=None, view_average_request_throughput=None, video_producer=None, error_type_id=None, mux_viewer_id=None, video_id=None, continent_code=None, session_id=None, exit_before_video_start=None, video_content_type=None, viewer_os_family=None, player_poster=None, view_average_request_latency=None, video_variant_id=None, player_source_duration=None, player_source_url=None, mux_api_version=None, video_title=None, id=None, short_time=None, rebuffer_percentage=None, time_to_first_frame=None, viewer_user_id=None, video_stream_type=None, player_startup_time=None, viewer_application_version=None, view_max_downscale_percentage=None, view_max_upscale_percentage=None, country_code=None, used_fullscreen=None, isp=None, property_id=None, player_autoplay=None, player_height=None, asn=None, asn_name=None, quality_score=None, player_software_version=None, player_mux_plugin_name=None, local_vars_configuration=None): # noqa: E501 """VideoView - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._view_total_upscaling = None self._preroll_ad_asset_hostname = None @@ -609,7 +623,7 @@ def view_total_upscaling(self, view_total_upscaling): :param view_total_upscaling: The view_total_upscaling of this VideoView. # noqa: E501 - :type: str + :type view_total_upscaling: str """ self._view_total_upscaling = view_total_upscaling @@ -630,7 +644,7 @@ def preroll_ad_asset_hostname(self, preroll_ad_asset_hostname): :param preroll_ad_asset_hostname: The preroll_ad_asset_hostname of this VideoView. # noqa: E501 - :type: str + :type preroll_ad_asset_hostname: str """ self._preroll_ad_asset_hostname = preroll_ad_asset_hostname @@ -651,7 +665,7 @@ def player_source_domain(self, player_source_domain): :param player_source_domain: The player_source_domain of this VideoView. # noqa: E501 - :type: str + :type player_source_domain: str """ self._player_source_domain = player_source_domain @@ -672,7 +686,7 @@ def region(self, region): :param region: The region of this VideoView. # noqa: E501 - :type: str + :type region: str """ self._region = region @@ -693,7 +707,7 @@ def viewer_user_agent(self, viewer_user_agent): :param viewer_user_agent: The viewer_user_agent of this VideoView. # noqa: E501 - :type: str + :type viewer_user_agent: str """ self._viewer_user_agent = viewer_user_agent @@ -714,7 +728,7 @@ def preroll_requested(self, preroll_requested): :param preroll_requested: The preroll_requested of this VideoView. # noqa: E501 - :type: bool + :type preroll_requested: bool """ self._preroll_requested = preroll_requested @@ -735,7 +749,7 @@ def page_type(self, page_type): :param page_type: The page_type of this VideoView. # noqa: E501 - :type: str + :type page_type: str """ self._page_type = page_type @@ -756,7 +770,7 @@ def startup_score(self, startup_score): :param startup_score: The startup_score of this VideoView. # noqa: E501 - :type: str + :type startup_score: str """ self._startup_score = startup_score @@ -777,7 +791,7 @@ def view_seek_duration(self, view_seek_duration): :param view_seek_duration: The view_seek_duration of this VideoView. # noqa: E501 - :type: int + :type view_seek_duration: int """ self._view_seek_duration = view_seek_duration @@ -798,7 +812,7 @@ def country_name(self, country_name): :param country_name: The country_name of this VideoView. # noqa: E501 - :type: str + :type country_name: str """ self._country_name = country_name @@ -819,7 +833,7 @@ def player_source_height(self, player_source_height): :param player_source_height: The player_source_height of this VideoView. # noqa: E501 - :type: int + :type player_source_height: int """ self._player_source_height = player_source_height @@ -840,7 +854,7 @@ def longitude(self, longitude): :param longitude: The longitude of this VideoView. # noqa: E501 - :type: str + :type longitude: str """ self._longitude = longitude @@ -861,7 +875,7 @@ def buffering_count(self, buffering_count): :param buffering_count: The buffering_count of this VideoView. # noqa: E501 - :type: int + :type buffering_count: int """ self._buffering_count = buffering_count @@ -882,7 +896,7 @@ def video_duration(self, video_duration): :param video_duration: The video_duration of this VideoView. # noqa: E501 - :type: int + :type video_duration: int """ self._video_duration = video_duration @@ -903,7 +917,7 @@ def player_source_type(self, player_source_type): :param player_source_type: The player_source_type of this VideoView. # noqa: E501 - :type: str + :type player_source_type: str """ self._player_source_type = player_source_type @@ -924,7 +938,7 @@ def city(self, city): :param city: The city of this VideoView. # noqa: E501 - :type: str + :type city: str """ self._city = city @@ -945,7 +959,7 @@ def view_id(self, view_id): :param view_id: The view_id of this VideoView. # noqa: E501 - :type: str + :type view_id: str """ self._view_id = view_id @@ -966,7 +980,7 @@ def platform_description(self, platform_description): :param platform_description: The platform_description of this VideoView. # noqa: E501 - :type: str + :type platform_description: str """ self._platform_description = platform_description @@ -987,7 +1001,7 @@ def video_startup_preroll_request_time(self, video_startup_preroll_request_time) :param video_startup_preroll_request_time: The video_startup_preroll_request_time of this VideoView. # noqa: E501 - :type: int + :type video_startup_preroll_request_time: int """ self._video_startup_preroll_request_time = video_startup_preroll_request_time @@ -1008,7 +1022,7 @@ def viewer_device_name(self, viewer_device_name): :param viewer_device_name: The viewer_device_name of this VideoView. # noqa: E501 - :type: str + :type viewer_device_name: str """ self._viewer_device_name = viewer_device_name @@ -1029,7 +1043,7 @@ def video_series(self, video_series): :param video_series: The video_series of this VideoView. # noqa: E501 - :type: str + :type video_series: str """ self._video_series = video_series @@ -1050,7 +1064,7 @@ def viewer_application_name(self, viewer_application_name): :param viewer_application_name: The viewer_application_name of this VideoView. # noqa: E501 - :type: str + :type viewer_application_name: str """ self._viewer_application_name = viewer_application_name @@ -1071,7 +1085,7 @@ def updated_at(self, updated_at): :param updated_at: The updated_at of this VideoView. # noqa: E501 - :type: str + :type updated_at: str """ self._updated_at = updated_at @@ -1092,7 +1106,7 @@ def view_total_content_playback_time(self, view_total_content_playback_time): :param view_total_content_playback_time: The view_total_content_playback_time of this VideoView. # noqa: E501 - :type: int + :type view_total_content_playback_time: int """ self._view_total_content_playback_time = view_total_content_playback_time @@ -1113,7 +1127,7 @@ def cdn(self, cdn): :param cdn: The cdn of this VideoView. # noqa: E501 - :type: str + :type cdn: str """ self._cdn = cdn @@ -1134,7 +1148,7 @@ def player_instance_id(self, player_instance_id): :param player_instance_id: The player_instance_id of this VideoView. # noqa: E501 - :type: str + :type player_instance_id: str """ self._player_instance_id = player_instance_id @@ -1155,7 +1169,7 @@ def video_language(self, video_language): :param video_language: The video_language of this VideoView. # noqa: E501 - :type: str + :type video_language: str """ self._video_language = video_language @@ -1176,7 +1190,7 @@ def player_source_width(self, player_source_width): :param player_source_width: The player_source_width of this VideoView. # noqa: E501 - :type: int + :type player_source_width: int """ self._player_source_width = player_source_width @@ -1197,7 +1211,7 @@ def player_error_message(self, player_error_message): :param player_error_message: The player_error_message of this VideoView. # noqa: E501 - :type: str + :type player_error_message: str """ self._player_error_message = player_error_message @@ -1218,7 +1232,7 @@ def player_mux_plugin_version(self, player_mux_plugin_version): :param player_mux_plugin_version: The player_mux_plugin_version of this VideoView. # noqa: E501 - :type: str + :type player_mux_plugin_version: str """ self._player_mux_plugin_version = player_mux_plugin_version @@ -1239,7 +1253,7 @@ def watched(self, watched): :param watched: The watched of this VideoView. # noqa: E501 - :type: bool + :type watched: bool """ self._watched = watched @@ -1260,7 +1274,7 @@ def playback_score(self, playback_score): :param playback_score: The playback_score of this VideoView. # noqa: E501 - :type: str + :type playback_score: str """ self._playback_score = playback_score @@ -1281,7 +1295,7 @@ def page_url(self, page_url): :param page_url: The page_url of this VideoView. # noqa: E501 - :type: str + :type page_url: str """ self._page_url = page_url @@ -1302,7 +1316,7 @@ def metro(self, metro): :param metro: The metro of this VideoView. # noqa: E501 - :type: str + :type metro: str """ self._metro = metro @@ -1323,7 +1337,7 @@ def view_max_request_latency(self, view_max_request_latency): :param view_max_request_latency: The view_max_request_latency of this VideoView. # noqa: E501 - :type: int + :type view_max_request_latency: int """ self._view_max_request_latency = view_max_request_latency @@ -1344,7 +1358,7 @@ def requests_for_first_preroll(self, requests_for_first_preroll): :param requests_for_first_preroll: The requests_for_first_preroll of this VideoView. # noqa: E501 - :type: int + :type requests_for_first_preroll: int """ self._requests_for_first_preroll = requests_for_first_preroll @@ -1365,7 +1379,7 @@ def view_total_downscaling(self, view_total_downscaling): :param view_total_downscaling: The view_total_downscaling of this VideoView. # noqa: E501 - :type: str + :type view_total_downscaling: str """ self._view_total_downscaling = view_total_downscaling @@ -1386,7 +1400,7 @@ def latitude(self, latitude): :param latitude: The latitude of this VideoView. # noqa: E501 - :type: str + :type latitude: str """ self._latitude = latitude @@ -1407,7 +1421,7 @@ def player_source_host_name(self, player_source_host_name): :param player_source_host_name: The player_source_host_name of this VideoView. # noqa: E501 - :type: str + :type player_source_host_name: str """ self._player_source_host_name = player_source_host_name @@ -1428,7 +1442,7 @@ def inserted_at(self, inserted_at): :param inserted_at: The inserted_at of this VideoView. # noqa: E501 - :type: str + :type inserted_at: str """ self._inserted_at = inserted_at @@ -1449,7 +1463,7 @@ def view_end(self, view_end): :param view_end: The view_end of this VideoView. # noqa: E501 - :type: str + :type view_end: str """ self._view_end = view_end @@ -1470,7 +1484,7 @@ def mux_embed_version(self, mux_embed_version): :param mux_embed_version: The mux_embed_version of this VideoView. # noqa: E501 - :type: str + :type mux_embed_version: str """ self._mux_embed_version = mux_embed_version @@ -1491,7 +1505,7 @@ def player_language(self, player_language): :param player_language: The player_language of this VideoView. # noqa: E501 - :type: str + :type player_language: str """ self._player_language = player_language @@ -1512,7 +1526,7 @@ def page_load_time(self, page_load_time): :param page_load_time: The page_load_time of this VideoView. # noqa: E501 - :type: int + :type page_load_time: int """ self._page_load_time = page_load_time @@ -1533,7 +1547,7 @@ def viewer_device_category(self, viewer_device_category): :param viewer_device_category: The viewer_device_category of this VideoView. # noqa: E501 - :type: str + :type viewer_device_category: str """ self._viewer_device_category = viewer_device_category @@ -1554,7 +1568,7 @@ def video_startup_preroll_load_time(self, video_startup_preroll_load_time): :param video_startup_preroll_load_time: The video_startup_preroll_load_time of this VideoView. # noqa: E501 - :type: int + :type video_startup_preroll_load_time: int """ self._video_startup_preroll_load_time = video_startup_preroll_load_time @@ -1575,7 +1589,7 @@ def player_version(self, player_version): :param player_version: The player_version of this VideoView. # noqa: E501 - :type: str + :type player_version: str """ self._player_version = player_version @@ -1596,7 +1610,7 @@ def watch_time(self, watch_time): :param watch_time: The watch_time of this VideoView. # noqa: E501 - :type: int + :type watch_time: int """ self._watch_time = watch_time @@ -1617,7 +1631,7 @@ def player_source_stream_type(self, player_source_stream_type): :param player_source_stream_type: The player_source_stream_type of this VideoView. # noqa: E501 - :type: str + :type player_source_stream_type: str """ self._player_source_stream_type = player_source_stream_type @@ -1638,7 +1652,7 @@ def preroll_ad_tag_hostname(self, preroll_ad_tag_hostname): :param preroll_ad_tag_hostname: The preroll_ad_tag_hostname of this VideoView. # noqa: E501 - :type: str + :type preroll_ad_tag_hostname: str """ self._preroll_ad_tag_hostname = preroll_ad_tag_hostname @@ -1659,7 +1673,7 @@ def viewer_device_manufacturer(self, viewer_device_manufacturer): :param viewer_device_manufacturer: The viewer_device_manufacturer of this VideoView. # noqa: E501 - :type: str + :type viewer_device_manufacturer: str """ self._viewer_device_manufacturer = viewer_device_manufacturer @@ -1680,7 +1694,7 @@ def rebuffering_score(self, rebuffering_score): :param rebuffering_score: The rebuffering_score of this VideoView. # noqa: E501 - :type: str + :type rebuffering_score: str """ self._rebuffering_score = rebuffering_score @@ -1701,7 +1715,7 @@ def experiment_name(self, experiment_name): :param experiment_name: The experiment_name of this VideoView. # noqa: E501 - :type: str + :type experiment_name: str """ self._experiment_name = experiment_name @@ -1722,7 +1736,7 @@ def viewer_os_version(self, viewer_os_version): :param viewer_os_version: The viewer_os_version of this VideoView. # noqa: E501 - :type: str + :type viewer_os_version: str """ self._viewer_os_version = viewer_os_version @@ -1743,7 +1757,7 @@ def player_preload(self, player_preload): :param player_preload: The player_preload of this VideoView. # noqa: E501 - :type: bool + :type player_preload: bool """ self._player_preload = player_preload @@ -1764,7 +1778,7 @@ def buffering_duration(self, buffering_duration): :param buffering_duration: The buffering_duration of this VideoView. # noqa: E501 - :type: int + :type buffering_duration: int """ self._buffering_duration = buffering_duration @@ -1785,7 +1799,7 @@ def player_view_count(self, player_view_count): :param player_view_count: The player_view_count of this VideoView. # noqa: E501 - :type: int + :type player_view_count: int """ self._player_view_count = player_view_count @@ -1806,7 +1820,7 @@ def player_software(self, player_software): :param player_software: The player_software of this VideoView. # noqa: E501 - :type: str + :type player_software: str """ self._player_software = player_software @@ -1827,7 +1841,7 @@ def player_load_time(self, player_load_time): :param player_load_time: The player_load_time of this VideoView. # noqa: E501 - :type: int + :type player_load_time: int """ self._player_load_time = player_load_time @@ -1848,7 +1862,7 @@ def platform_summary(self, platform_summary): :param platform_summary: The platform_summary of this VideoView. # noqa: E501 - :type: str + :type platform_summary: str """ self._platform_summary = platform_summary @@ -1869,7 +1883,7 @@ def video_encoding_variant(self, video_encoding_variant): :param video_encoding_variant: The video_encoding_variant of this VideoView. # noqa: E501 - :type: str + :type video_encoding_variant: str """ self._video_encoding_variant = video_encoding_variant @@ -1890,7 +1904,7 @@ def player_width(self, player_width): :param player_width: The player_width of this VideoView. # noqa: E501 - :type: int + :type player_width: int """ self._player_width = player_width @@ -1911,7 +1925,7 @@ def view_seek_count(self, view_seek_count): :param view_seek_count: The view_seek_count of this VideoView. # noqa: E501 - :type: int + :type view_seek_count: int """ self._view_seek_count = view_seek_count @@ -1932,7 +1946,7 @@ def viewer_experience_score(self, viewer_experience_score): :param viewer_experience_score: The viewer_experience_score of this VideoView. # noqa: E501 - :type: str + :type viewer_experience_score: str """ self._viewer_experience_score = viewer_experience_score @@ -1953,7 +1967,7 @@ def view_error_id(self, view_error_id): :param view_error_id: The view_error_id of this VideoView. # noqa: E501 - :type: int + :type view_error_id: int """ self._view_error_id = view_error_id @@ -1974,7 +1988,7 @@ def video_variant_name(self, video_variant_name): :param video_variant_name: The video_variant_name of this VideoView. # noqa: E501 - :type: str + :type video_variant_name: str """ self._video_variant_name = video_variant_name @@ -1995,7 +2009,7 @@ def preroll_played(self, preroll_played): :param preroll_played: The preroll_played of this VideoView. # noqa: E501 - :type: bool + :type preroll_played: bool """ self._preroll_played = preroll_played @@ -2016,7 +2030,7 @@ def viewer_application_engine(self, viewer_application_engine): :param viewer_application_engine: The viewer_application_engine of this VideoView. # noqa: E501 - :type: str + :type viewer_application_engine: str """ self._viewer_application_engine = viewer_application_engine @@ -2037,7 +2051,7 @@ def viewer_os_architecture(self, viewer_os_architecture): :param viewer_os_architecture: The viewer_os_architecture of this VideoView. # noqa: E501 - :type: str + :type viewer_os_architecture: str """ self._viewer_os_architecture = viewer_os_architecture @@ -2058,7 +2072,7 @@ def player_error_code(self, player_error_code): :param player_error_code: The player_error_code of this VideoView. # noqa: E501 - :type: str + :type player_error_code: str """ self._player_error_code = player_error_code @@ -2079,7 +2093,7 @@ def buffering_rate(self, buffering_rate): :param buffering_rate: The buffering_rate of this VideoView. # noqa: E501 - :type: str + :type buffering_rate: str """ self._buffering_rate = buffering_rate @@ -2100,7 +2114,7 @@ def events(self, events): :param events: The events of this VideoView. # noqa: E501 - :type: list[VideoViewEvent] + :type events: list[VideoViewEvent] """ self._events = events @@ -2121,7 +2135,7 @@ def player_name(self, player_name): :param player_name: The player_name of this VideoView. # noqa: E501 - :type: str + :type player_name: str """ self._player_name = player_name @@ -2142,7 +2156,7 @@ def view_start(self, view_start): :param view_start: The view_start of this VideoView. # noqa: E501 - :type: str + :type view_start: str """ self._view_start = view_start @@ -2163,7 +2177,7 @@ def view_average_request_throughput(self, view_average_request_throughput): :param view_average_request_throughput: The view_average_request_throughput of this VideoView. # noqa: E501 - :type: int + :type view_average_request_throughput: int """ self._view_average_request_throughput = view_average_request_throughput @@ -2184,7 +2198,7 @@ def video_producer(self, video_producer): :param video_producer: The video_producer of this VideoView. # noqa: E501 - :type: str + :type video_producer: str """ self._video_producer = video_producer @@ -2205,7 +2219,7 @@ def error_type_id(self, error_type_id): :param error_type_id: The error_type_id of this VideoView. # noqa: E501 - :type: int + :type error_type_id: int """ self._error_type_id = error_type_id @@ -2226,7 +2240,7 @@ def mux_viewer_id(self, mux_viewer_id): :param mux_viewer_id: The mux_viewer_id of this VideoView. # noqa: E501 - :type: str + :type mux_viewer_id: str """ self._mux_viewer_id = mux_viewer_id @@ -2247,7 +2261,7 @@ def video_id(self, video_id): :param video_id: The video_id of this VideoView. # noqa: E501 - :type: str + :type video_id: str """ self._video_id = video_id @@ -2268,7 +2282,7 @@ def continent_code(self, continent_code): :param continent_code: The continent_code of this VideoView. # noqa: E501 - :type: str + :type continent_code: str """ self._continent_code = continent_code @@ -2289,7 +2303,7 @@ def session_id(self, session_id): :param session_id: The session_id of this VideoView. # noqa: E501 - :type: str + :type session_id: str """ self._session_id = session_id @@ -2310,7 +2324,7 @@ def exit_before_video_start(self, exit_before_video_start): :param exit_before_video_start: The exit_before_video_start of this VideoView. # noqa: E501 - :type: bool + :type exit_before_video_start: bool """ self._exit_before_video_start = exit_before_video_start @@ -2331,7 +2345,7 @@ def video_content_type(self, video_content_type): :param video_content_type: The video_content_type of this VideoView. # noqa: E501 - :type: str + :type video_content_type: str """ self._video_content_type = video_content_type @@ -2352,7 +2366,7 @@ def viewer_os_family(self, viewer_os_family): :param viewer_os_family: The viewer_os_family of this VideoView. # noqa: E501 - :type: str + :type viewer_os_family: str """ self._viewer_os_family = viewer_os_family @@ -2373,7 +2387,7 @@ def player_poster(self, player_poster): :param player_poster: The player_poster of this VideoView. # noqa: E501 - :type: str + :type player_poster: str """ self._player_poster = player_poster @@ -2394,7 +2408,7 @@ def view_average_request_latency(self, view_average_request_latency): :param view_average_request_latency: The view_average_request_latency of this VideoView. # noqa: E501 - :type: int + :type view_average_request_latency: int """ self._view_average_request_latency = view_average_request_latency @@ -2415,7 +2429,7 @@ def video_variant_id(self, video_variant_id): :param video_variant_id: The video_variant_id of this VideoView. # noqa: E501 - :type: str + :type video_variant_id: str """ self._video_variant_id = video_variant_id @@ -2436,7 +2450,7 @@ def player_source_duration(self, player_source_duration): :param player_source_duration: The player_source_duration of this VideoView. # noqa: E501 - :type: int + :type player_source_duration: int """ self._player_source_duration = player_source_duration @@ -2457,7 +2471,7 @@ def player_source_url(self, player_source_url): :param player_source_url: The player_source_url of this VideoView. # noqa: E501 - :type: str + :type player_source_url: str """ self._player_source_url = player_source_url @@ -2478,7 +2492,7 @@ def mux_api_version(self, mux_api_version): :param mux_api_version: The mux_api_version of this VideoView. # noqa: E501 - :type: str + :type mux_api_version: str """ self._mux_api_version = mux_api_version @@ -2499,7 +2513,7 @@ def video_title(self, video_title): :param video_title: The video_title of this VideoView. # noqa: E501 - :type: str + :type video_title: str """ self._video_title = video_title @@ -2520,7 +2534,7 @@ def id(self, id): :param id: The id of this VideoView. # noqa: E501 - :type: str + :type id: str """ self._id = id @@ -2541,7 +2555,7 @@ def short_time(self, short_time): :param short_time: The short_time of this VideoView. # noqa: E501 - :type: str + :type short_time: str """ self._short_time = short_time @@ -2562,7 +2576,7 @@ def rebuffer_percentage(self, rebuffer_percentage): :param rebuffer_percentage: The rebuffer_percentage of this VideoView. # noqa: E501 - :type: str + :type rebuffer_percentage: str """ self._rebuffer_percentage = rebuffer_percentage @@ -2583,7 +2597,7 @@ def time_to_first_frame(self, time_to_first_frame): :param time_to_first_frame: The time_to_first_frame of this VideoView. # noqa: E501 - :type: int + :type time_to_first_frame: int """ self._time_to_first_frame = time_to_first_frame @@ -2604,7 +2618,7 @@ def viewer_user_id(self, viewer_user_id): :param viewer_user_id: The viewer_user_id of this VideoView. # noqa: E501 - :type: str + :type viewer_user_id: str """ self._viewer_user_id = viewer_user_id @@ -2625,7 +2639,7 @@ def video_stream_type(self, video_stream_type): :param video_stream_type: The video_stream_type of this VideoView. # noqa: E501 - :type: str + :type video_stream_type: str """ self._video_stream_type = video_stream_type @@ -2646,7 +2660,7 @@ def player_startup_time(self, player_startup_time): :param player_startup_time: The player_startup_time of this VideoView. # noqa: E501 - :type: int + :type player_startup_time: int """ self._player_startup_time = player_startup_time @@ -2667,7 +2681,7 @@ def viewer_application_version(self, viewer_application_version): :param viewer_application_version: The viewer_application_version of this VideoView. # noqa: E501 - :type: str + :type viewer_application_version: str """ self._viewer_application_version = viewer_application_version @@ -2688,7 +2702,7 @@ def view_max_downscale_percentage(self, view_max_downscale_percentage): :param view_max_downscale_percentage: The view_max_downscale_percentage of this VideoView. # noqa: E501 - :type: str + :type view_max_downscale_percentage: str """ self._view_max_downscale_percentage = view_max_downscale_percentage @@ -2709,7 +2723,7 @@ def view_max_upscale_percentage(self, view_max_upscale_percentage): :param view_max_upscale_percentage: The view_max_upscale_percentage of this VideoView. # noqa: E501 - :type: str + :type view_max_upscale_percentage: str """ self._view_max_upscale_percentage = view_max_upscale_percentage @@ -2730,7 +2744,7 @@ def country_code(self, country_code): :param country_code: The country_code of this VideoView. # noqa: E501 - :type: str + :type country_code: str """ self._country_code = country_code @@ -2751,7 +2765,7 @@ def used_fullscreen(self, used_fullscreen): :param used_fullscreen: The used_fullscreen of this VideoView. # noqa: E501 - :type: bool + :type used_fullscreen: bool """ self._used_fullscreen = used_fullscreen @@ -2772,7 +2786,7 @@ def isp(self, isp): :param isp: The isp of this VideoView. # noqa: E501 - :type: str + :type isp: str """ self._isp = isp @@ -2793,7 +2807,7 @@ def property_id(self, property_id): :param property_id: The property_id of this VideoView. # noqa: E501 - :type: int + :type property_id: int """ self._property_id = property_id @@ -2814,7 +2828,7 @@ def player_autoplay(self, player_autoplay): :param player_autoplay: The player_autoplay of this VideoView. # noqa: E501 - :type: bool + :type player_autoplay: bool """ self._player_autoplay = player_autoplay @@ -2835,7 +2849,7 @@ def player_height(self, player_height): :param player_height: The player_height of this VideoView. # noqa: E501 - :type: int + :type player_height: int """ self._player_height = player_height @@ -2856,7 +2870,7 @@ def asn(self, asn): :param asn: The asn of this VideoView. # noqa: E501 - :type: int + :type asn: int """ self._asn = asn @@ -2877,7 +2891,7 @@ def asn_name(self, asn_name): :param asn_name: The asn_name of this VideoView. # noqa: E501 - :type: str + :type asn_name: str """ self._asn_name = asn_name @@ -2898,7 +2912,7 @@ def quality_score(self, quality_score): :param quality_score: The quality_score of this VideoView. # noqa: E501 - :type: str + :type quality_score: str """ self._quality_score = quality_score @@ -2919,7 +2933,7 @@ def player_software_version(self, player_software_version): :param player_software_version: The player_software_version of this VideoView. # noqa: E501 - :type: str + :type player_software_version: str """ self._player_software_version = player_software_version @@ -2940,32 +2954,40 @@ def player_mux_plugin_name(self, player_mux_plugin_name): :param player_mux_plugin_name: The player_mux_plugin_name of this VideoView. # noqa: E501 - :type: str + :type player_mux_plugin_name: str """ self._player_mux_plugin_name = player_mux_plugin_name - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -2982,8 +3004,11 @@ def __eq__(self, other): if not isinstance(other, VideoView): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, VideoView): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/video_view_event.py b/mux_python/models/video_view_event.py index e6b9993..bab270b 100644 --- a/mux_python/models/video_view_event.py +++ b/mux_python/models/video_view_event.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class VideoViewEvent(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -35,8 +46,11 @@ class VideoViewEvent(object): 'event_time': 'event_time' } - def __init__(self, viewer_time=None, playback_time=None, name=None, event_time=None): # noqa: E501 + def __init__(self, viewer_time=None, playback_time=None, name=None, event_time=None, local_vars_configuration=None): # noqa: E501 """VideoViewEvent - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._viewer_time = None self._playback_time = None @@ -69,7 +83,7 @@ def viewer_time(self, viewer_time): :param viewer_time: The viewer_time of this VideoViewEvent. # noqa: E501 - :type: int + :type viewer_time: int """ self._viewer_time = viewer_time @@ -90,7 +104,7 @@ def playback_time(self, playback_time): :param playback_time: The playback_time of this VideoViewEvent. # noqa: E501 - :type: int + :type playback_time: int """ self._playback_time = playback_time @@ -111,7 +125,7 @@ def name(self, name): :param name: The name of this VideoViewEvent. # noqa: E501 - :type: str + :type name: str """ self._name = name @@ -132,32 +146,40 @@ def event_time(self, event_time): :param event_time: The event_time of this VideoViewEvent. # noqa: E501 - :type: int + :type event_time: int """ self._event_time = event_time - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -174,8 +196,11 @@ def __eq__(self, other): if not isinstance(other, VideoViewEvent): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, VideoViewEvent): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/models/video_view_response.py b/mux_python/models/video_view_response.py index ab50828..acdf613 100644 --- a/mux_python/models/video_view_response.py +++ b/mux_python/models/video_view_response.py @@ -1,18 +1,29 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ +import inspect import pprint import re # noqa: F401 import six +from mux_python.configuration import Configuration + + class VideoViewResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + """ """ Attributes: @@ -31,8 +42,11 @@ class VideoViewResponse(object): 'timeframe': 'timeframe' } - def __init__(self, data=None, timeframe=None): # noqa: E501 + def __init__(self, data=None, timeframe=None, local_vars_configuration=None): # noqa: E501 """VideoViewResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration self._data = None self._timeframe = None @@ -59,7 +73,7 @@ def data(self, data): :param data: The data of this VideoViewResponse. # noqa: E501 - :type: VideoView + :type data: VideoView """ self._data = data @@ -80,32 +94,40 @@ def timeframe(self, timeframe): :param timeframe: The timeframe of this VideoViewResponse. # noqa: E501 - :type: list[int] + :type timeframe: list[int] """ self._timeframe = timeframe - def to_dict(self): + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr if isinstance(value, list): result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + lambda x: convert(x), value )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, + lambda item: (item[0], convert(item[1])), value.items() )) else: - result[attr] = value + result[attr] = convert(value) return result @@ -122,8 +144,11 @@ def __eq__(self, other): if not isinstance(other, VideoViewResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, VideoViewResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/mux_python/rest.py b/mux_python/rest.py index 8e4e207..a09d9ba 100644 --- a/mux_python/rest.py +++ b/mux_python/rest.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -15,15 +18,12 @@ import re import ssl -import certifi # python 2 and python 3 compatibility library import six from six.moves.urllib.parse import urlencode +import urllib3 -try: - import urllib3 -except ImportError: - raise ImportError('OpenAPI Python client requires urllib3.') +from mux_python.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError logger = logging.getLogger(__name__) @@ -61,17 +61,16 @@ def __init__(self, configuration, pools_size=4, maxsize=None): else: cert_reqs = ssl.CERT_NONE - # ca_certs - if configuration.ssl_ca_cert: - ca_certs = configuration.ssl_ca_cert - else: - # if not set certificate file, use Mozilla's root certificates. - ca_certs = certifi.where() - addition_pool_args = {} if configuration.assert_hostname is not None: addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if configuration.socket_options is not None: + addition_pool_args['socket_options'] = configuration.socket_options + if maxsize is None: if configuration.connection_pool_maxsize is not None: maxsize = configuration.connection_pool_maxsize @@ -84,10 +83,11 @@ def __init__(self, configuration, pools_size=4, maxsize=None): num_pools=pools_size, maxsize=maxsize, cert_reqs=cert_reqs, - ca_certs=ca_certs, + 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 ) else: @@ -95,7 +95,7 @@ def __init__(self, configuration, pools_size=4, maxsize=None): num_pools=pools_size, maxsize=maxsize, cert_reqs=cert_reqs, - ca_certs=ca_certs, + ca_certs=configuration.ssl_ca_cert, cert_file=configuration.cert_file, key_file=configuration.key_file, **addition_pool_args @@ -127,7 +127,7 @@ def request(self, method, url, query_params=None, headers=None, 'PATCH', 'OPTIONS'] if post_params and body: - raise ValueError( + raise ApiValueError( "body parameter cannot be used with post_params parameter." ) @@ -136,7 +136,7 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, six.integer_types + (float, )): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): @@ -184,7 +184,7 @@ def request(self, method, url, query_params=None, headers=None, # Pass a `string` parameter directly in the body to support # other content types than Json when `body` argument is # provided in serialized form - elif isinstance(body, str): + elif isinstance(body, str) or isinstance(body, bytes): request_body = body r = self.pool_manager.request( method, url, @@ -212,27 +212,22 @@ def request(self, method, url, query_params=None, headers=None, if _preload_content: r = RESTResponse(r) - # In the python 3, the response.data is bytes. - # we need to decode it to string. - if six.PY3: - r.data = r.data.decode('utf8') - # log response body logger.debug("response body: %s", r.data) - if r.status == 401: - raise UnauthorizedException(http_resp=r) + if not 200 <= r.status <= 299: + if r.status == 401: + raise UnauthorizedException(http_resp=r) - if r.status == 403: - raise ForbiddenException(http_resp=r) + if r.status == 403: + raise ForbiddenException(http_resp=r) - if r.status == 404: - raise NotFoundException(http_resp=r) + if r.status == 404: + raise NotFoundException(http_resp=r) - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) + if 500 <= r.status <= 599: + raise ServiceException(http_resp=r) - if not 200 <= r.status <= 299: raise ApiException(http_resp=r) return r @@ -301,61 +296,3 @@ def PATCH(self, url, headers=None, query_params=None, post_params=None, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) - - -class ApiException(Exception): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - # Extract the error details from the response if we can - try: - error_response = json.loads(http_resp.data) - self.error_type = error_response['error']['type'] - self.error_messages = error_response['error']['messages'] - except Exception as e: - self.error_type = None - self.error_messages = None - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - self.error_type = None - self.error_messages = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - -class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - ApiException.__init__(self, status, reason, http_resp) - -class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - ApiException.__init__(self, status, reason, http_resp) - -class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - ApiException.__init__(self, status, reason, http_resp) - -class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - ApiException.__init__(self, status, reason, http_resp) diff --git a/requirements.txt b/requirements.txt index bafdc07..d0518ec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -certifi >= 14.05.14 +future; python_version<="2.7" six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 -urllib3 >= 1.15.1 +urllib3 >= 1.25.3 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..11433ee --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/setup.py b/setup.py index 6ab0c5f..bb2e0a6 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,12 @@ # coding: utf-8 """ -Mux Python - Copyright 2019 Mux Inc. + Mux API -NOTE: This class is auto generated. Do not edit the class manually. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Generated by: https://openapi-generator.tech """ @@ -18,21 +21,20 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +REQUIRES = ["urllib3 >= 1.25.3", "six >= 1.10", "python-dateutil"] setup( name=NAME, version=VERSION, - description="Official Mux API wrapper for python projects 🐍.", - author_email="sdks@mux.com", - url="https://github.com/muxinc/mux-python", - download_url="https://github.com/muxinc/mux-python/archive/1.12.0.tar.gz", - keywords=["Mux API", "Video", "Live Stream", "VOD", "Streaming"], + description="Mux API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "Mux API"], install_requires=REQUIRES, - packages=find_packages(), + packages=find_packages(exclude=["test", "tests"]), include_package_data=True, long_description="""\ - Official Mux API wrapper for python projects 🐍. - Not familiar with Mux? Check out https://mux.com/ for more information. + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 """ ) diff --git a/test-requirements.txt b/test-requirements.txt index 2702246..4ed3991 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,3 @@ -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..618d9d1 --- /dev/null +++ b/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py27, py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=mux_python