33//
44// This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
55// </copyright>
6- using System ;
7- using System . Collections . Generic ;
8- using System . Dynamic ;
9- using System . Globalization ;
10- using System . IO ;
11- using System . Linq ;
12- using System . Text ;
13- using System . Threading ;
14- using System . Threading . Tasks ;
156using APIMatic . Core ;
16- using APIMatic . Core . Types ;
177using APIMatic . Core . Utilities ;
18- using APIMatic . Core . Utilities . Date . Xml ;
19- using Newtonsoft . Json . Converters ;
20- using PaypalServerSdk . Standard ;
218using PaypalServerSdk . Standard . Exceptions ;
22- using PaypalServerSdk . Standard . Http . Client ;
239using PaypalServerSdk . Standard . Http . Response ;
24- using PaypalServerSdk . Standard . Utilities ;
10+ using System . Collections . Generic ;
2511using System . Net . Http ;
12+ using System . Threading ;
13+ using System . Threading . Tasks ;
2614
2715namespace PaypalServerSdk . Standard . Controllers
2816{
@@ -59,16 +47,16 @@ internal OAuthAuthorizationController(GlobalConfiguration globalConfiguration) :
5947 Dictionary < string , object > fieldParameters = null ,
6048 CancellationToken cancellationToken = default )
6149 => await CreateApiCall < Models . OAuthToken > ( )
62- . RequestBuilder ( _requestBuilder => _requestBuilder
50+ . RequestBuilder ( requestBuilder => requestBuilder
6351 . Setup ( HttpMethod . Post , "/v1/oauth2/token" )
64- . Parameters ( _parameters => _parameters
65- . AdditionalForms ( _additionalForms => _additionalForms . Setup ( fieldParameters ) )
66- . Form ( _form => _form . Setup ( "grant_type" , "client_credentials" ) )
67- . Header ( _header => _header . Setup ( "Authorization" , input . Authorization ) )
68- . Form ( _form => _form . Setup ( "scope" , input . Scope ) ) ) )
69- . ResponseHandler ( _responseHandler => _responseHandler
70- . ErrorCase ( "400" , CreateErrorCase ( "OAuth 2 provider returned an error." , ( _reason , _context ) => new OAuthProviderException ( _reason , _context ) ) )
71- . ErrorCase ( "401" , CreateErrorCase ( "OAuth 2 provider says client authentication failed." , ( _reason , _context ) => new OAuthProviderException ( _reason , _context ) ) ) )
52+ . Parameters ( parameters => parameters
53+ . AdditionalForms ( additionalForms => additionalForms . Setup ( fieldParameters ) )
54+ . Form ( form => form . Setup ( "grant_type" , "client_credentials" ) )
55+ . Header ( header => header . Setup ( "Authorization" , input . Authorization ) )
56+ . Form ( form => form . Setup ( "scope" , input . Scope ) ) ) )
57+ . ResponseHandler ( responseHandler => responseHandler
58+ . ErrorCase ( "400" , CreateErrorCase ( "OAuth 2 provider returned an error." , ( errorReason , context ) => new OAuthProviderException ( errorReason , context ) ) )
59+ . ErrorCase ( "401" , CreateErrorCase ( "OAuth 2 provider says client authentication failed." , ( errorReason , context ) => new OAuthProviderException ( errorReason , context ) ) ) )
7260 . ExecuteAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
7361 }
7462}
0 commit comments