Skip to content

Latest commit

 

History

History
331 lines (275 loc) · 26.1 KB

sdk-map.md

File metadata and controls

331 lines (275 loc) · 26.1 KB

SDK map — Vimeo API (.NET)

A generated table of contents for this SDK. Consult this map and its sub-pages to learn signatures, error types, and server/auth wiring by lookup. Model shapes and enum values are not duplicated here — the map names the file declaring each type; read the shape there. The compiler is the backstop: a wrong name fails to build.

SDK display name Vimeo API
Root namespace VimeoApi
Target framework netstandard2.0 (C# LangVersion 14, Nullable enable)
API spec version 3.4.9
Generator APIMatic

Staleness check: the API spec version above changes when the SDK is regenerated from a new spec. If a lookup here fails to compile, trust the compiler and re-read the source file named in the row.

All Source paths on this map and its sub-pages are relative to the SDK root — the directory holding this file — never to the page that carries them; the project file is src/VimeoApi/VimeoApi.csproj. Open them as-is from the SDK root, from any page; if the SDK sits under a subdirectory of a larger repo, prefix that subdirectory.


Getting a client

var httpClient = new HttpClient();
// TODO: configure more client options here
var options = new VimeoApiClientOptions
{
    Bearer = "YOUR_BEARER_TOKEN",
    Oauth2ClientCredentials = new OAuth2ClientCredentials
    {
        ClientId = "YOUR_CLIENT_ID",
        ClientSecret = "YOUR_CLIENT_SECRET",
    },
    Oauth2AuthorizationCode = new OAuth2AuthorizationCodeCredentials
    {
        ClientId = "YOUR_CLIENT_ID",
        RedirectUri = "YOUR_REDIRECT_URI",
        PromptForAuthorizationCode = (authUrl, ct) => Task.FromResult(""),
    },
    Environment = ServerEnvironment.Production,
};
var client = new VimeoApiClient(httpClient, options);

DI alternative (services.AddVimeoApiClient):

services.AddVimeoApiClient(options =>
{
    options.Bearer = "YOUR_BEARER_TOKEN";
    options.Oauth2ClientCredentials =
        new OAuth2ClientCredentials { ClientId = "YOUR_CLIENT_ID", ClientSecret = "YOUR_CLIENT_SECRET" };
    options.Oauth2AuthorizationCode =
        new OAuth2AuthorizationCodeCredentials
        {
            ClientId = "YOUR_CLIENT_ID",
            RedirectUri = "YOUR_REDIRECT_URI",
            PromptForAuthorizationCode = (authUrl, ct) => Task.FromResult(""),
        };
    options.Environment = ServerEnvironment.Production;
    // TODO: configure more client options here
});

Every API group is a property on the client (e.g. client.ApiAppsWebhooks). Source: src/VimeoApi/VimeoApiClient.cs. The only constructor is VimeoApiClient(HttpClient httpClient, VimeoApiClientOptions options).

All VimeoApiClientOptions properties (source: src/VimeoApi/VimeoApiClientOptions.cs):

Property Type
Environment ServerEnvironment
Retry RetryOptions
Logging LoggingOptions
TimeProvider TimeProvider
Server ServerOptions
StreamReadTimeout TimeSpan?
Hooks IReadOnlyList<SdkHook>
Bearer string?
Oauth2AuthorizationCode OAuth2AuthorizationCodeCredentials?
Oauth2AuthorizationCodeTokenStrategy IOAuth2RefreshableTokenStrategy<OAuth2AuthorizationCodeCredentials>?
Oauth2ClientCredentials OAuth2ClientCredentials?
Oauth2ClientCredentialsTokenStrategy IOAuth2TokenStrategy<OAuth2ClientCredentials>?

ServerEnvironment (source: src/VimeoApi/Servers/ServerEnvironment.cs, namespace VimeoApi.Servers) OAuth2AuthorizationCodeCredentials (source: src/VimeoApi/Core/Authentication/OAuth2/AuthorizationCode/OAuth2AuthorizationCodeCredentials.cs, namespace VimeoApi.Core.Authentication.OAuth2.AuthorizationCode) OAuth2ClientCredentials (source: src/VimeoApi/Core/Authentication/OAuth2/ClientCredentials/OAuth2ClientCredentials.cs, namespace VimeoApi.Core.Authentication.OAuth2.ClientCredentials)

RetryOptions members (namespace VimeoApi.Core.Configuration — add using VimeoApi.Core.Configuration;; source: src/VimeoApi/Core/Configuration/RetryOptions.cs; all members are required, so build a full instance or start from RetryOptions.Default()):

Member Type
StatusCodesToRetry IReadOnlyList<HttpStatusCode>
HttpMethodsToRetry IReadOnlyList<HttpMethod>
MaxRetries int
Delay TimeSpan
Timeout TimeSpan?
BackOffFactor int
UseExponentialBackoff bool
MaxJitter TimeSpan
OnRetry Action<RetryAttempt>?

Error-handling model (read once — applies to every operation)

Operations are throw-based. On an error status the SDK throws ApiException<TError> (src/VimeoApi/Core/Exceptions/ApiException.cs, namespace VimeoApi.Core.Exceptions) exposing .Error of type TError beside the StatusCode, Headers and ContentType of the response. There are two cases:

  • Case A — typed error. TError is a generated …Error : ApiError class (namespace VimeoApi.Errors) with status-specific TryGet…(out …) accessors (each returns true when that shape is present) plus the inherited TryGetRawError(out RawError) fallback. The operation blocks name the exact TryGet… methods and the HTTP status each maps to.
  • Case B — raw error. TError is RawError (src/VimeoApi/Core/ErrorResponse/RawError.cs, namespace VimeoApi.Core.ErrorResponse): StatusCode: HttpStatusCode · ReadAsBytes(): ReadOnlyMemory<byte> · ReadAsString(): string · ReadAsJson<T>(): T?.

⚠ Each of the three lives in its own namespace. src/VimeoApi/Core/ holds several namespaces, so a catch block naming ApiException<T>, a typed {Operation}Error and RawError together needs a using for each.

ApiException<TError> is one leaf of the SdkException family (src/VimeoApi/Core/Exceptions/SdkException.cs): a request that produced no usable response surfaces as SdkConnectionException or SdkTimeoutException, a body that does not match its declared type as ResponseDeserializationException, and a credential that could not be applied as AuthSchemeException. Every one of them names the failed call. The full table is in README → Error Handling.

Core error types (src/VimeoApi/Core/ErrorResponse/) — public members with their declared types, verbatim from source:

Type Public members Source
ApiError — abstract base of the 411 typed error classes in src/VimeoApi/Errors/ TryGetRawError(out RawError error): bool src/VimeoApi/Core/ErrorResponse/ApiError.cs
RawError StatusCode: HttpStatusCode · ReadAsBytes(): ReadOnlyMemory<byte> · ReadAsString(): string · ReadAsJson<T>(): T? src/VimeoApi/Core/ErrorResponse/RawError.cs

Typed-error payload shapes (the out types in each operation page's error-accessor cells) are ordinary records/unions — no special handling. The operation's Type sources table gives the file that declares each one; read field names, declared types, and JSON wire names there, as for any other model.

try
{
    var response = await client.ApiAppsWebhooks.AddWebhook(new AddWebhookRequest { AppId = 128301d });
}
catch (ApiException<AddWebhookError> ex)
{
    // Case A — typed error
    if (ex.Error.TryGetError(out var error))
    {
        // Handle 400
    }
    else if (ex.Error.TryGetRawError(out var raw))
    {
        // Any other error status
    }
}
catch (ApiException<RawError> ex)
{
    // Case B — raw error
    // ex.Error.StatusCode, ex.Error.ReadAsString(), ex.Error.ReadAsJson<T>()
}

No-throw (…Result) variants: absent across this SDK — every operation is throw-only. Of 520 operations, 411 are Case A (typed) and 109 are Case B (raw).


Operations — by controller (100 groups, 520 operations)

Each links to a sub-page with one row per operation: signature, the request record's required members, query-param wire names, return type, error Case A/B, and Case A's typed accessors with their statuses. Each operation also carries a Type sources table — every type it names, with the file that declares it — so resolving a body, return, or error payload to its source is a lookup, never a search. RawError is excluded there (its members and path are above); an operation with no table names nothing but primitives and RawError.

Each row states what is specific to its operation. Everything below holds for EVERY operation unless that operation's row says otherwise, so a row silent on one of these points is telling you the default here applies — take it and move on rather than opening the source to confirm it.

Applies to every operation Stated where A row appears only when
Throw-only — no …Result/no-throw variant exists anywhere in this SDK this page, Error-handling model a no-throw sibling exists (none do at this SDK version)
No pagination — the operation returns a single response, not a Pageable here pagination is offered — the block carries a Pagination bullet naming the posture (page-, offset-, cursor- or link-based, or the page-without-page-size case)
Case B error accessors are always these four — StatusCode: HttpStatusCode · ReadAsBytes(): ReadOnlyMemory<byte> · ReadAsString(): string · ReadAsJson<T>(): T? the RawError row above never — a Case B label always implies exactly these four; Case A rows list their own typed accessors
Server group Default — base URL per Servers & auth below here the operation is on another group — its block carries a Server group bullet
Inputs are one request record — an operation that takes input takes a single request record as its first parameter; build it with an object initializer, using the property names in the record's source (its file is in the operation's Type sources). A member the row does not list as required is optional or already carries the spec's default here never — it always holds

The HTTP verb and route live on the operation itself, in the source file named at the top of its operations page. This map is method-first: the C# method is the interface you call. When something wire-level needs the route — reproducing a raw request, pointing the client at a mock, reading a provider-side log — read it from that file; do not reconstruct it from memory or infer it from the method name.

The endpoint's behavioural prose lives there too, as the XML <remarks> on the method. Rows here give you the contract — names, types, shapes, errors. Where an operation's semantics decide what you must pass — a parameter whose value changes server-side behaviour, an ordering or exclusivity rule between fields — that is what <remarks> settles; read it there rather than filling it in from memory.

Controller (client.X) Ops Page
ApiAppsWebhooks 5 map/operations/ApiAppsWebhooks.md
ApiInformationEssentials 1 map/operations/ApiInformationEssentials.md
AuthenticationExtrasAuthenticate 1 map/operations/AuthenticationExtrasAuthenticate.md
AuthenticationExtrasConvert 1 map/operations/AuthenticationExtrasConvert.md
AuthenticationExtrasEssentials 2 map/operations/AuthenticationExtrasEssentials.md
AuthenticationExtrasExchange 1 map/operations/AuthenticationExtrasExchange.md
CategoriesChannels 1 map/operations/CategoriesChannels.md
CategoriesEssentials 2 map/operations/CategoriesEssentials.md
CategoriesGroups 1 map/operations/CategoriesGroups.md
CategoriesUsers 8 map/operations/CategoriesUsers.md
CategoriesVideos 4 map/operations/CategoriesVideos.md
ChannelsCategories 4 map/operations/ChannelsCategories.md
ChannelsEssentials 7 map/operations/ChannelsEssentials.md
ChannelsModerators 7 map/operations/ChannelsModerators.md
ChannelsPrivateChannelMembers 4 map/operations/ChannelsPrivateChannelMembers.md
ChannelsSubscriptionsAndSubscribers 7 map/operations/ChannelsSubscriptionsAndSubscribers.md
ChannelsTags 5 map/operations/ChannelsTags.md
ChannelsVideos 7 map/operations/ChannelsVideos.md
EmbedPresetsCustomLogos 8 map/operations/EmbedPresetsCustomLogos.md
EmbedPresetsEssentials 10 map/operations/EmbedPresetsEssentials.md
EmbedPresetsFolders 1 map/operations/EmbedPresetsFolders.md
EmbedPresetsTimelineEvents 2 map/operations/EmbedPresetsTimelineEvents.md
EmbedPresetsVideos 5 map/operations/EmbedPresetsVideos.md
FoldersEssentials 11 map/operations/FoldersEssentials.md
FoldersItems 3 map/operations/FoldersItems.md
FoldersVideos 10 map/operations/FoldersVideos.md
GroupsEssentials 4 map/operations/GroupsEssentials.md
GroupsSubscriptions 4 map/operations/GroupsSubscriptions.md
GroupsUsers 5 map/operations/GroupsUsers.md
GroupsVideos 5 map/operations/GroupsVideos.md
LikesEssentials 11 map/operations/LikesEssentials.md
LiveAnalytics 1 map/operations/LiveAnalytics.md
LiveAudioTracks 2 map/operations/LiveAudioTracks.md
LiveEmbedPrivacy 6 map/operations/LiveEmbedPrivacy.md
LiveEssentials 19 map/operations/LiveEssentials.md
LiveEventM3U8Playback 2 map/operations/LiveEventM3U8Playback.md
LiveEventActivation 3 map/operations/LiveEventActivation.md
LiveEventAutomatedClosedCaptions 3 map/operations/LiveEventAutomatedClosedCaptions.md
LiveEventDestinations 12 map/operations/LiveEventDestinations.md
LiveEventEnd 3 map/operations/LiveEventEnd.md
LiveEventLowLatency 3 map/operations/LiveEventLowLatency.md
LiveEventSessions 2 map/operations/LiveEventSessions.md
LiveEventThumbnails 15 map/operations/LiveEventThumbnails.md
LiveEventVideos 12 map/operations/LiveEventVideos.md
LiveGraphics 3 map/operations/LiveGraphics.md
LiveScenes 5 map/operations/LiveScenes.md
OnDemandBackgrounds 5 map/operations/OnDemandBackgrounds.md
OnDemandEssentials 7 map/operations/OnDemandEssentials.md
OnDemandGenres 8 map/operations/OnDemandGenres.md
OnDemandPosters 4 map/operations/OnDemandPosters.md
OnDemandPromotions 5 map/operations/OnDemandPromotions.md
OnDemandPurchasesAndRentals 3 map/operations/OnDemandPurchasesAndRentals.md
OnDemandRegions 8 map/operations/OnDemandRegions.md
OnDemandSeasons 3 map/operations/OnDemandSeasons.md
OnDemandVideos 4 map/operations/OnDemandVideos.md
PaymentsEssentials 4 map/operations/PaymentsEssentials.md
PortfoliosEssentials 4 map/operations/PortfoliosEssentials.md
PortfoliosVideos 8 map/operations/PortfoliosVideos.md
SearchFederated 2 map/operations/SearchFederated.md
ShowcasesCustomShowcaseLogos 5 map/operations/ShowcasesCustomShowcaseLogos.md
ShowcasesCustomShowcaseThumbnails 5 map/operations/ShowcasesCustomShowcaseThumbnails.md
ShowcasesEssentials 14 map/operations/ShowcasesEssentials.md
ShowcasesShowcaseVideos 16 map/operations/ShowcasesShowcaseVideos.md
SubscriptionPlansEssentials 1 map/operations/SubscriptionPlansEssentials.md
TagsEssentials 1 map/operations/TagsEssentials.md
TeamsEssentials 5 map/operations/TeamsEssentials.md
TeamsMembers 3 map/operations/TeamsMembers.md
TutorialEssentials 1 map/operations/TutorialEssentials.md
UsersAnalytics 2 map/operations/UsersAnalytics.md
UsersEssentials 4 map/operations/UsersEssentials.md
UsersFeeds 2 map/operations/UsersFeeds.md
UsersFollowers 12 map/operations/UsersFollowers.md
UsersLms 1 map/operations/UsersLms.md
UsersPictures 10 map/operations/UsersPictures.md
UsersSearch 1 map/operations/UsersSearch.md
UsersWatchHistory 3 map/operations/UsersWatchHistory.md
VideosAi 11 map/operations/VideosAi.md
VideosAnimatedThumbnails 5 map/operations/VideosAnimatedThumbnails.md
VideosChapters 12 map/operations/VideosChapters.md
VideosContentRatings 1 map/operations/VideosContentRatings.md
VideosCreativeCommons 1 map/operations/VideosCreativeCommons.md
VideosCredits 8 map/operations/VideosCredits.md
VideosEmbedPrivacy 3 map/operations/VideosEmbedPrivacy.md
VideosEssentials 15 map/operations/VideosEssentials.md
VideosFragments 3 map/operations/VideosFragments.md
VideosLanguages 1 map/operations/VideosLanguages.md
VideosLiveM3U8Playback 2 map/operations/VideosLiveM3U8Playback.md
VideosModeration 1 map/operations/VideosModeration.md
VideosNondestructiveTrimming 1 map/operations/VideosNondestructiveTrimming.md
VideosRecommendations 1 map/operations/VideosRecommendations.md
VideosShowcases 2 map/operations/VideosShowcases.md
VideosTags 6 map/operations/VideosTags.md
VideosTextTracks 9 map/operations/VideosTextTracks.md
VideosThumbnails 7 map/operations/VideosThumbnails.md
VideosTranscripts 2 map/operations/VideosTranscripts.md
VideosUnlistedVideos 6 map/operations/VideosUnlistedVideos.md
VideosUploads 4 map/operations/VideosUploads.md
VideosVersions 13 map/operations/VideosVersions.md
VideosVideoComments 9 map/operations/VideosVideoComments.md
WatchLaterQueueEssentials 8 map/operations/WatchLaterQueueEssentials.md

Models — where they live, how to build them

Shapes live only in the source. Every file under src/VimeoApi/Models/, src/VimeoApi/Errors/ and src/VimeoApi/Requests/ declares exactly one public type, named after the file, and no two share a name — so a type name is its path. Take it from the operation's Type sources table, or build it from the kind's directory below. Never grep for a type.

Group Count Directory (file = <TypeName>.cs)
Records (plain record data models) 784 src/VimeoApi/Models/
Unions (AnyOf) — variant factories + TryGet… 1 src/VimeoApi/Models/AnyOf/
Enums (OpenStringEnum<T> / OpenIntEnum<T>) — C# member names + wire values 281 src/VimeoApi/Models/Enums/
Typed error classes (: ApiError, one per Case A operation) 411 src/VimeoApi/Errors/
Request records (one per operation that takes input; never serialized) 507 src/VimeoApi/Requests/ — a controller's records sit in a folder named after it (an operation with several tags is filed under the first tag it declares)

Conventions: records are immutable, init-only; required properties must be set in the object initializer; T? is optional. A field's wire name is its [JsonPropertyName] and often differs from the C# name (AmountInCents ↔ amount_in_cents) — read it off the property, don't derive it. OneOf/AnyOf unions wrap Optional<T> variants — build via static factory or implicit conversion, read via TryGet…(out …); AllOf compositions are not unions — every constituent is a required property, so set them all, and those constituent properties carry no [JsonPropertyName] and have no wire name of their own, because the generated converter flattens each constituent's own fields directly into the one parent JSON object. Enums are not C# enums — use the static members, whose names are PascalCase even when the wire value isn't (CollectionMethod.Invoice, not .invoice); there is no public factory, so resolve a raw value with TryGetKnownValue and branch with the generated Match, whose otherwise arm receives any value the SDK does not declare.

Namespaces by content type (add using accordingly):

Contents Namespace
Client & options (root) VimeoApi
Operation controllers (src/VimeoApi/Api/) VimeoApi.Api
Records (src/VimeoApi/Models/) VimeoApi.Models
Enums (src/VimeoApi/Models/Enums/) VimeoApi.Models.Enums
AnyOf unions (src/VimeoApi/Models/AnyOf/) VimeoApi.Models.AnyOf
Error classes (src/VimeoApi/Errors/) VimeoApi.Errors
Request records (src/VimeoApi/Requests/) VimeoApi.Requests — plus .<Controller> for a controller's records (an operation with several tags is filed under the first tag it declares)

Servers & auth

Bearer token. Set options.Bearer = "<token>".

OAuth2 (authorization code). Set options.Oauth2AuthorizationCode with client id, redirect URI and a PromptForAuthorizationCode callback; authorization at https://api.vimeo.com/oauth/authorize, tokens from https://api.vimeo.com/oauth/access_token. options.Oauth2AuthorizationCodeTokenStrategy overrides how tokens are acquired and cached; leave it unset for the SDK's own handling.

OAuth2 (client credentials). Set options.Oauth2ClientCredentials with your client id and secret; tokens are fetched from https://api.vimeo.com/oauth/authorize/client. options.Oauth2ClientCredentialsTokenStrategy overrides how tokens are acquired and cached; leave it unset for the SDK's own handling.

Operation blocks name their credential in an Auth bullet; an operation whose spec declares no scheme carries no such bullet.

  • AND — every credential listed must be set for the call to be fully authenticated.
  • OR — the first credential you set that applies successfully is the one sent, in the order listed.

A credential you never set is skipped rather than throwing, and the request is sent anyway — so an authentication failure can mean no credential was sent rather than a bad one. Under OR, if every credential you did set fails to apply, AuthSchemeException is thrown.

Environments. options.Environment selects the target environment (src/VimeoApi/Servers/ServerEnvironment.cs):

Environment Value Hosting
ServerEnvironment.Production (default) production Vimeo.com

1 server group. Base-URL templates and override points (options.Server.…):

Group Production base URL Override point
Default https://api.vimeo.com options.Server.Default.Production.BaseUrl

Retry/resilience is configurable via options.Retry (RetryOptions, backed by Polly).