Skip to content

Latest commit

 

History

History
194 lines (177 loc) · 9.78 KB

File metadata and controls

194 lines (177 loc) · 9.78 KB

Client Class Documentation

The following parameters are configurable for the API Client:

Parameter Type Description
http_client_instance Union[Session, HttpClientProvider] The Http Client passed from the sdk user for making requests
override_http_client_configuration bool The value which determines to override properties of the passed Http Client from the sdk user
http_call_back HttpCallBack The callback value that is invoked before and after an HTTP call is made to an endpoint
timeout float The value to use for connection timeout.
Default: 30
max_retries int The number of times to retry an endpoint call if it fails.
Default: 0
backoff_factor float A backoff factor to apply between attempts after the second try.
Default: 2
retry_statuses Array of int The http statuses on which retry is to be done.
Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524]
retry_methods Array of string The http methods on which retry is to be done.
Default: ["GET", "PUT", "GET", "PUT"]
proxy_settings ProxySettings Optional proxy configuration to route HTTP requests through a proxy server.
logging_configuration LoggingConfiguration The SDK logging configuration for API calls
bearer_credentials BearerCredentials The credential object for OAuth 2 Bearer token
oauth_2_authorization_code_credentials Oauth2AuthorizationCodeCredentials The credential object for OAuth 2 Authorization Code Grant
oauth_2_client_credentials_credentials Oauth2ClientCredentialsCredentials The credential object for OAuth 2 Client Credentials Grant

The API client can be initialized as follows:

Code-Based Client Initialization

import logging

from vimeoapi.configuration import Environment
from vimeoapi.http.auth.bearer import BearerCredentials
from vimeoapi.http.auth.oauth_2_authorization_code import Oauth2AuthorizationCodeCredentials
from vimeoapi.http.auth.oauth_2_client_credentials import Oauth2ClientCredentialsCredentials
from vimeoapi.logging.configuration.api_logging_configuration import LoggingConfiguration
from vimeoapi.logging.configuration.api_logging_configuration import RequestLoggingConfiguration
from vimeoapi.logging.configuration.api_logging_configuration import ResponseLoggingConfiguration
from vimeoapi.models.oauth_scope_oauth_2_authorization_code import OauthScopeOauth2AuthorizationCode
from vimeoapi.models.oauth_scope_oauth_2_client_credentials import OauthScopeOauth2ClientCredentials
from vimeoapi.vimeoapi_client import VimeoapiClient

client = VimeoapiClient(
    bearer_credentials=BearerCredentials(
        access_token='AccessToken'
    ),
    oauth_2_authorization_code_credentials=Oauth2AuthorizationCodeCredentials(
        oauth_client_id='OAuthClientId',
        oauth_client_secret='OAuthClientSecret',
        oauth_redirect_uri='OAuthRedirectUri',
        oauth_scopes=[
            OauthScopeOauth2AuthorizationCode.AI,
            OauthScopeOauth2AuthorizationCode.CREATE
        ]
    ),
    oauth_2_client_credentials_credentials=Oauth2ClientCredentialsCredentials(
        oauth_client_id='OAuthClientId',
        oauth_client_secret='OAuthClientSecret',
        oauth_scopes=[
            OauthScopeOauth2ClientCredentials.AI,
            OauthScopeOauth2ClientCredentials.CREATE
        ]
    ),
    environment=Environment.PRODUCTION,
    logging_configuration=LoggingConfiguration(
        log_level=logging.INFO,
        request_logging_config=RequestLoggingConfiguration(
            log_body=True
        ),
        response_logging_config=ResponseLoggingConfiguration(
            log_headers=True
        )
    )
)

Environment-Based Client Initialization

from vimeoapi.vimeoapi_client import VimeoapiClient

# Specify the path to your .env file if it’s located outside the project’s root directory.
client = VimeoapiClient.from_environment(dotenv_path='/path/to/.env')

See the Environment-Based Client Initialization section for details.

Vimeo API Client

The gateway for the SDK. This class acts as a factory for the Apis and also holds the configuration of the SDK.

Apis

Name Description
api_apps_webhooks Gets ApiAppsWebhooksApi
api_information_essentials Gets ApiInformationEssentialsApi
authentication_extras_authenticate Gets AuthenticationExtrasAuthenticateApi
authentication_extras_convert Gets AuthenticationExtrasConvertApi
authentication_extras_essentials Gets AuthenticationExtrasEssentialsApi
authentication_extras_exchange Gets AuthenticationExtrasExchangeApi
categories_channels Gets CategoriesChannelsApi
categories_essentials Gets CategoriesEssentialsApi
categories_groups Gets CategoriesGroupsApi
categories_users Gets CategoriesUsersApi
categories_videos Gets CategoriesVideosApi
channels_categories Gets ChannelsCategoriesApi
channels_essentials Gets ChannelsEssentialsApi
channels_moderators Gets ChannelsModeratorsApi
channels_private_channel_members Gets ChannelsPrivateChannelMembersApi
channels_subscriptions_and_subscribers Gets ChannelsSubscriptionsAndSubscribersApi
channels_tags Gets ChannelsTagsApi
channels_videos Gets ChannelsVideosApi
embed_presets_custom_logos Gets EmbedPresetsCustomLogosApi
embed_presets_essentials Gets EmbedPresetsEssentialsApi
embed_presets_folders Gets EmbedPresetsFoldersApi
embed_presets_timeline_events Gets EmbedPresetsTimelineEventsApi
embed_presets_videos Gets EmbedPresetsVideosApi
folders_essentials Gets FoldersEssentialsApi
folders_items Gets FoldersItemsApi
folders_videos Gets FoldersVideosApi
groups_essentials Gets GroupsEssentialsApi
groups_subscriptions Gets GroupsSubscriptionsApi
groups_users Gets GroupsUsersApi
groups_videos Gets GroupsVideosApi
likes_essentials Gets LikesEssentialsApi
live_analytics Gets LiveAnalyticsApi
live_audio_tracks Gets LiveAudioTracksApi
live_embed_privacy Gets LiveEmbedPrivacyApi
live_essentials Gets LiveEssentialsApi
live_event_m_3_u_8_playback Gets LiveEventM3U8PlaybackApi
live_event_activation Gets LiveEventActivationApi
live_event_automated_closed_captions Gets LiveEventAutomatedClosedCaptionsApi
live_event_destinations Gets LiveEventDestinationsApi
live_event_end Gets LiveEventEndApi
live_event_low_latency Gets LiveEventLowLatencyApi
live_event_sessions Gets LiveEventSessionsApi
live_event_thumbnails Gets LiveEventThumbnailsApi
live_event_videos Gets LiveEventVideosApi
live_graphics Gets LiveGraphicsApi
live_scenes Gets LiveScenesApi
on_demand_backgrounds Gets OnDemandBackgroundsApi
on_demand_essentials Gets OnDemandEssentialsApi
on_demand_genres Gets OnDemandGenresApi
on_demand_posters Gets OnDemandPostersApi
on_demand_promotions Gets OnDemandPromotionsApi
on_demand_purchases_and_rentals Gets OnDemandPurchasesAndRentalsApi
on_demand_regions Gets OnDemandRegionsApi
on_demand_seasons Gets OnDemandSeasonsApi
on_demand_videos Gets OnDemandVideosApi
payments_essentials Gets PaymentsEssentialsApi
portfolios_essentials Gets PortfoliosEssentialsApi
portfolios_videos Gets PortfoliosVideosApi
search_federated Gets SearchFederatedApi
showcases_custom_showcase_logos Gets ShowcasesCustomShowcaseLogosApi
showcases_custom_showcase_thumbnails Gets ShowcasesCustomShowcaseThumbnailsApi
showcases_essentials Gets ShowcasesEssentialsApi
showcases_showcase_videos Gets ShowcasesShowcaseVideosApi
subscription_plans_essentials Gets SubscriptionPlansEssentialsApi
tags_essentials Gets TagsEssentialsApi
teams_essentials Gets TeamsEssentialsApi
teams_members Gets TeamsMembersApi
tutorial_essentials Gets TutorialEssentialsApi
users_analytics Gets UsersAnalyticsApi
users_essentials Gets UsersEssentialsApi
users_feeds Gets UsersFeedsApi
users_followers Gets UsersFollowersApi
users_lms Gets UsersLmsApi
users_pictures Gets UsersPicturesApi
users_search Gets UsersSearchApi
users_watch_history Gets UsersWatchHistoryApi
videos_ai Gets VideosAiApi
videos_animated_thumbnails Gets VideosAnimatedThumbnailsApi
videos_chapters Gets VideosChaptersApi
videos_content_ratings Gets VideosContentRatingsApi
videos_creative_commons Gets VideosCreativeCommonsApi
videos_credits Gets VideosCreditsApi
videos_embed_privacy Gets VideosEmbedPrivacyApi
videos_essentials Gets VideosEssentialsApi
videos_fragments Gets VideosFragmentsApi
videos_languages Gets VideosLanguagesApi
videos_live_m_3_u_8_playback Gets VideosLiveM3U8PlaybackApi
videos_moderation Gets VideosModerationApi
videos_nondestructive_trimming Gets VideosNondestructiveTrimmingApi
videos_recommendations Gets VideosRecommendationsApi
videos_showcases Gets VideosShowcasesApi
videos_tags Gets VideosTagsApi
videos_text_tracks Gets VideosTextTracksApi
videos_thumbnails Gets VideosThumbnailsApi
videos_transcripts Gets VideosTranscriptsApi
videos_unlisted_videos Gets VideosUnlistedVideosApi
videos_uploads Gets VideosUploadsApi
videos_versions Gets VideosVersionsApi
videos_video_comments Gets VideosVideoCommentsApi
watch_later_queue_essentials Gets WatchLaterQueueEssentialsApi
oauth_authorization Gets OauthAuthorizationApi