/// <summary> /// Exchange an authorization code for an access token This method exchanges an OAuth authorization code for an OAuth access token. /// </summary> /// <exception cref="VimeoOpenApi.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="inlineObject27"></param> /// <returns>ApiResponse of Auth</returns> public VimeoOpenApi.Client.ApiResponse <Auth> ExchangeAuthCodeWithHttpInfo(InlineObject27 inlineObject27) { // verify the required parameter 'inlineObject27' is set if (inlineObject27 == null) { throw new VimeoOpenApi.Client.ApiException(400, "Missing required parameter 'inlineObject27' when calling AuthenticationExtrasExchangeApi->ExchangeAuthCode"); } VimeoOpenApi.Client.RequestOptions localVarRequestOptions = new VimeoOpenApi.Client.RequestOptions(); String[] _contentTypes = new String[] { "application/vnd.vimeo.auth+json" }; // to determine the Accept header String[] _accepts = new String[] { "application/vnd.vimeo.auth+json" }; var localVarContentType = VimeoOpenApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = VimeoOpenApi.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = inlineObject27; // authentication (oauth2) required // oauth required if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } // make the HTTP request var localVarResponse = this.Client.Post <Auth>("/oauth/access_token", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ExchangeAuthCode", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Exchange an authorization code for an access token This method exchanges an OAuth authorization code for an OAuth access token. /// </summary> /// <exception cref="VimeoOpenApi.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="inlineObject27"></param> /// <returns>Task of Auth</returns> public async System.Threading.Tasks.Task <Auth> ExchangeAuthCodeAsync(InlineObject27 inlineObject27) { VimeoOpenApi.Client.ApiResponse <Auth> localVarResponse = await ExchangeAuthCodeAsyncWithHttpInfo(inlineObject27); return(localVarResponse.Data); }
/// <summary> /// Exchange an authorization code for an access token This method exchanges an OAuth authorization code for an OAuth access token. /// </summary> /// <exception cref="VimeoOpenApi.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="inlineObject27"></param> /// <returns>Auth</returns> public Auth ExchangeAuthCode(InlineObject27 inlineObject27) { VimeoOpenApi.Client.ApiResponse <Auth> localVarResponse = ExchangeAuthCodeWithHttpInfo(inlineObject27); return(localVarResponse.Data); }