Skip to content

Commit 25832ab

Browse files
api-spec changes
1 parent b525bcc commit 25832ab

File tree

39 files changed

+991
-416
lines changed

39 files changed

+991
-416
lines changed

Api/TokenApi.cs

Lines changed: 58 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ public interface ITokenApi : IApiAccessor
3535
/// </remarks>
3636
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
3737
/// <param name="tokenId">The Id of a token representing a Customer, Payment Instrument or Instrument Identifier.</param>
38+
/// <param name="postPaymentCredentialsRequest"></param>
3839
/// <param name="profileId">The Id of a profile containing user specific TMS configuration. (optional)</param>
3940
/// <returns>string</returns>
40-
string PostTokenPaymentCredentials (string tokenId, string profileId = null);
41+
string PostTokenPaymentCredentials (string tokenId, PostPaymentCredentialsRequest postPaymentCredentialsRequest, string profileId = null);
4142

4243
/// <summary>
4344
/// Generate Payment Credentials for a TMS Token
@@ -47,9 +48,10 @@ public interface ITokenApi : IApiAccessor
4748
/// </remarks>
4849
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
4950
/// <param name="tokenId">The Id of a token representing a Customer, Payment Instrument or Instrument Identifier.</param>
51+
/// <param name="postPaymentCredentialsRequest"></param>
5052
/// <param name="profileId">The Id of a profile containing user specific TMS configuration. (optional)</param>
5153
/// <returns>ApiResponse of string</returns>
52-
ApiResponse<string> PostTokenPaymentCredentialsWithHttpInfo (string tokenId, string profileId = null);
54+
ApiResponse<string> PostTokenPaymentCredentialsWithHttpInfo (string tokenId, PostPaymentCredentialsRequest postPaymentCredentialsRequest, string profileId = null);
5355
#endregion Synchronous Operations
5456
#region Asynchronous Operations
5557
/// <summary>
@@ -60,9 +62,10 @@ public interface ITokenApi : IApiAccessor
6062
/// </remarks>
6163
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
6264
/// <param name="tokenId">The Id of a token representing a Customer, Payment Instrument or Instrument Identifier.</param>
65+
/// <param name="postPaymentCredentialsRequest"></param>
6366
/// <param name="profileId">The Id of a profile containing user specific TMS configuration. (optional)</param>
6467
/// <returns>Task of string</returns>
65-
System.Threading.Tasks.Task<string> PostTokenPaymentCredentialsAsync (string tokenId, string profileId = null);
68+
System.Threading.Tasks.Task<string> PostTokenPaymentCredentialsAsync (string tokenId, PostPaymentCredentialsRequest postPaymentCredentialsRequest, string profileId = null);
6669

6770
/// <summary>
6871
/// Generate Payment Credentials for a TMS Token
@@ -72,9 +75,10 @@ public interface ITokenApi : IApiAccessor
7275
/// </remarks>
7376
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
7477
/// <param name="tokenId">The Id of a token representing a Customer, Payment Instrument or Instrument Identifier.</param>
78+
/// <param name="postPaymentCredentialsRequest"></param>
7579
/// <param name="profileId">The Id of a profile containing user specific TMS configuration. (optional)</param>
7680
/// <returns>Task of ApiResponse (string)</returns>
77-
System.Threading.Tasks.Task<ApiResponse<string>> PostTokenPaymentCredentialsAsyncWithHttpInfo (string tokenId, string profileId = null);
81+
System.Threading.Tasks.Task<ApiResponse<string>> PostTokenPaymentCredentialsAsyncWithHttpInfo (string tokenId, PostPaymentCredentialsRequest postPaymentCredentialsRequest, string profileId = null);
7882
#endregion Asynchronous Operations
7983
}
8084

@@ -220,13 +224,14 @@ public void SetStatusCode(int? statusCode)
220224
/// </summary>
221225
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
222226
/// <param name="tokenId">The Id of a token representing a Customer, Payment Instrument or Instrument Identifier.</param>
227+
/// <param name="postPaymentCredentialsRequest"></param>
223228
/// <param name="profileId">The Id of a profile containing user specific TMS configuration. (optional)</param>
224229
/// <returns>string</returns>
225-
public string PostTokenPaymentCredentials (string tokenId, string profileId = null)
230+
public string PostTokenPaymentCredentials (string tokenId, PostPaymentCredentialsRequest postPaymentCredentialsRequest, string profileId = null)
226231
{
227232
logger.Debug("CALLING API \"PostTokenPaymentCredentials\" STARTED");
228233
this.SetStatusCode(null);
229-
ApiResponse<string> localVarResponse = PostTokenPaymentCredentialsWithHttpInfo(tokenId, profileId);
234+
ApiResponse<string> localVarResponse = PostTokenPaymentCredentialsWithHttpInfo(tokenId, postPaymentCredentialsRequest, profileId);
230235
logger.Debug("CALLING API \"PostTokenPaymentCredentials\" ENDED");
231236
this.SetStatusCode(localVarResponse.StatusCode);
232237
return localVarResponse.Data;
@@ -237,9 +242,10 @@ public string PostTokenPaymentCredentials (string tokenId, string profileId = nu
237242
/// </summary>
238243
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
239244
/// <param name="tokenId">The Id of a token representing a Customer, Payment Instrument or Instrument Identifier.</param>
245+
/// <param name="postPaymentCredentialsRequest"></param>
240246
/// <param name="profileId">The Id of a profile containing user specific TMS configuration. (optional)</param>
241247
/// <returns>ApiResponse of string</returns>
242-
public ApiResponse< string > PostTokenPaymentCredentialsWithHttpInfo (string tokenId, string profileId = null)
248+
public ApiResponse< string > PostTokenPaymentCredentialsWithHttpInfo (string tokenId, PostPaymentCredentialsRequest postPaymentCredentialsRequest, string profileId = null)
243249
{
244250
LogUtility logUtility = new LogUtility();
245251

@@ -249,6 +255,12 @@ public ApiResponse< string > PostTokenPaymentCredentialsWithHttpInfo (string tok
249255
logger.Error("ApiException : Missing required parameter 'tokenId' when calling TokenApi->PostTokenPaymentCredentials");
250256
throw new ApiException(400, "Missing required parameter 'tokenId' when calling TokenApi->PostTokenPaymentCredentials");
251257
}
258+
// verify the required parameter 'postPaymentCredentialsRequest' is set
259+
if (postPaymentCredentialsRequest == null)
260+
{
261+
logger.Error("ApiException : Missing required parameter 'postPaymentCredentialsRequest' when calling TokenApi->PostTokenPaymentCredentials");
262+
throw new ApiException(400, "Missing required parameter 'postPaymentCredentialsRequest' when calling TokenApi->PostTokenPaymentCredentials");
263+
}
252264

253265
var localVarPath = $"/tms/v2/tokens/{tokenId}/payment-credentials";
254266
var localVarPathParams = new Dictionary<string, string>();
@@ -283,13 +295,24 @@ public ApiResponse< string > PostTokenPaymentCredentialsWithHttpInfo (string tok
283295
{
284296
localVarHeaderParams.Add("profile-id", Configuration.ApiClient.ParameterToString(profileId)); // header parameter
285297
}
286-
if (Method.Post == Method.Post)
298+
if (postPaymentCredentialsRequest != null && postPaymentCredentialsRequest.GetType() != typeof(byte[]))
299+
{
300+
SdkTracker sdkTracker = new SdkTracker();
301+
postPaymentCredentialsRequest = (PostPaymentCredentialsRequest)sdkTracker.InsertDeveloperIdTracker(postPaymentCredentialsRequest, postPaymentCredentialsRequest.GetType().Name, Configuration.ApiClient.Configuration.MerchantConfigDictionaryObj["runEnvironment"]);
302+
localVarPostBody = Configuration.ApiClient.Serialize(postPaymentCredentialsRequest); // http body (model) parameter
303+
}
304+
else
305+
{
306+
localVarPostBody = postPaymentCredentialsRequest; // byte array
307+
}
308+
309+
if (logUtility.IsMaskingEnabled(logger))
287310
{
288-
localVarPostBody = "{}";
311+
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
289312
}
290313
else
291314
{
292-
localVarPostBody = null;
315+
logger.Debug($"HTTP Request Body :\n{localVarPostBody}");
293316
}
294317

295318

@@ -320,13 +343,14 @@ public ApiResponse< string > PostTokenPaymentCredentialsWithHttpInfo (string tok
320343
/// </summary>
321344
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
322345
/// <param name="tokenId">The Id of a token representing a Customer, Payment Instrument or Instrument Identifier.</param>
346+
/// <param name="postPaymentCredentialsRequest"></param>
323347
/// <param name="profileId">The Id of a profile containing user specific TMS configuration. (optional)</param>
324348
/// <returns>Task of string</returns>
325-
public async System.Threading.Tasks.Task<string> PostTokenPaymentCredentialsAsync (string tokenId, string profileId = null)
349+
public async System.Threading.Tasks.Task<string> PostTokenPaymentCredentialsAsync (string tokenId, PostPaymentCredentialsRequest postPaymentCredentialsRequest, string profileId = null)
326350
{
327351
logger.Debug("CALLING API \"PostTokenPaymentCredentialsAsync\" STARTED");
328352
this.SetStatusCode(null);
329-
ApiResponse<string> localVarResponse = await PostTokenPaymentCredentialsAsyncWithHttpInfo(tokenId, profileId);
353+
ApiResponse<string> localVarResponse = await PostTokenPaymentCredentialsAsyncWithHttpInfo(tokenId, postPaymentCredentialsRequest, profileId);
330354
logger.Debug("CALLING API \"PostTokenPaymentCredentialsAsync\" ENDED");
331355
this.SetStatusCode(localVarResponse.StatusCode);
332356
return localVarResponse.Data;
@@ -338,9 +362,10 @@ public async System.Threading.Tasks.Task<string> PostTokenPaymentCredentialsAsyn
338362
/// </summary>
339363
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
340364
/// <param name="tokenId">The Id of a token representing a Customer, Payment Instrument or Instrument Identifier.</param>
365+
/// <param name="postPaymentCredentialsRequest"></param>
341366
/// <param name="profileId">The Id of a profile containing user specific TMS configuration. (optional)</param>
342367
/// <returns>Task of ApiResponse (string)</returns>
343-
public async System.Threading.Tasks.Task<ApiResponse<string>> PostTokenPaymentCredentialsAsyncWithHttpInfo (string tokenId, string profileId = null)
368+
public async System.Threading.Tasks.Task<ApiResponse<string>> PostTokenPaymentCredentialsAsyncWithHttpInfo (string tokenId, PostPaymentCredentialsRequest postPaymentCredentialsRequest, string profileId = null)
344369
{
345370
LogUtility logUtility = new LogUtility();
346371

@@ -350,6 +375,12 @@ public async System.Threading.Tasks.Task<ApiResponse<string>> PostTokenPaymentCr
350375
logger.Error("ApiException : Missing required parameter 'tokenId' when calling TokenApi->PostTokenPaymentCredentials");
351376
throw new ApiException(400, "Missing required parameter 'tokenId' when calling TokenApi->PostTokenPaymentCredentials");
352377
}
378+
// verify the required parameter 'postPaymentCredentialsRequest' is set
379+
if (postPaymentCredentialsRequest == null)
380+
{
381+
logger.Error("ApiException : Missing required parameter 'postPaymentCredentialsRequest' when calling TokenApi->PostTokenPaymentCredentials");
382+
throw new ApiException(400, "Missing required parameter 'postPaymentCredentialsRequest' when calling TokenApi->PostTokenPaymentCredentials");
383+
}
353384

354385
var localVarPath = $"/tms/v2/tokens/{tokenId}/payment-credentials";
355386
var localVarPathParams = new Dictionary<string, string>();
@@ -384,13 +415,24 @@ public async System.Threading.Tasks.Task<ApiResponse<string>> PostTokenPaymentCr
384415
{
385416
localVarHeaderParams.Add("profile-id", Configuration.ApiClient.ParameterToString(profileId)); // header parameter
386417
}
387-
if (Method.Post == Method.Post)
418+
if (postPaymentCredentialsRequest != null && postPaymentCredentialsRequest.GetType() != typeof(byte[]))
419+
{
420+
SdkTracker sdkTracker = new SdkTracker();
421+
postPaymentCredentialsRequest = (PostPaymentCredentialsRequest)sdkTracker.InsertDeveloperIdTracker(postPaymentCredentialsRequest, postPaymentCredentialsRequest.GetType().Name, Configuration.ApiClient.Configuration.MerchantConfigDictionaryObj["runEnvironment"]);
422+
localVarPostBody = Configuration.ApiClient.Serialize(postPaymentCredentialsRequest); // http body (model) parameter
423+
}
424+
else
425+
{
426+
localVarPostBody = postPaymentCredentialsRequest; // byte array
427+
}
428+
429+
if (logUtility.IsMaskingEnabled(logger))
388430
{
389-
localVarPostBody = "{}";
431+
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
390432
}
391433
else
392434
{
393-
localVarPostBody = null;
435+
logger.Debug($"HTTP Request Body :\n{localVarPostBody}");
394436
}
395437

396438

Model/Boardingv1registrationsOrganizationInformationBusinessInformation.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -942,18 +942,18 @@ public override int GetHashCode()
942942
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
943943
{
944944
// Name (string) pattern
945-
//Regex regexName = new Regex(@"^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-]+$", RegexOptions.CultureInvariant);
946-
//if (false == regexName.Match(this.Name).Success)
947-
//{
948-
// yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, must match a pattern of " + regexName, new [] { "Name" });
949-
//}
945+
Regex regexName = new Regex(@"^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-]+$", RegexOptions.CultureInvariant);
946+
if (false == regexName.Match(this.Name).Success)
947+
{
948+
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, must match a pattern of " + regexName, new [] { "Name" });
949+
}
950950

951951
// DoingBusinessAs (string) pattern
952-
//Regex regexDoingBusinessAs = new Regex(@"^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-]+$", RegexOptions.CultureInvariant);
953-
//if (false == regexDoingBusinessAs.Match(this.DoingBusinessAs).Success)
954-
//{
955-
// yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DoingBusinessAs, must match a pattern of " + regexDoingBusinessAs, new [] { "DoingBusinessAs" });
956-
//}
952+
Regex regexDoingBusinessAs = new Regex(@"^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-]+$", RegexOptions.CultureInvariant);
953+
if (false == regexDoingBusinessAs.Match(this.DoingBusinessAs).Success)
954+
{
955+
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DoingBusinessAs, must match a pattern of " + regexDoingBusinessAs, new [] { "DoingBusinessAs" });
956+
}
957957

958958
// Description (string) pattern
959959
Regex regexDescription = new Regex(@"[À-ÖØ-öø-ǿÀ-ÖØ-öø-ǿ\\n\\ra-zA-Z0-9().\\-_#,;\/\\\\@$:&amp;!?%«»€₣«»€₣ ]{1,}$", RegexOptions.CultureInvariant);
@@ -963,11 +963,11 @@ public override int GetHashCode()
963963
}
964964

965965
// WebsiteUrl (string) pattern
966-
//Regex regexWebsiteUrl = new Regex(@"\\b((?:https?:\/\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))", RegexOptions.CultureInvariant);
967-
//if (false == regexWebsiteUrl.Match(this.WebsiteUrl).Success)
968-
//{
969-
// yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for WebsiteUrl, must match a pattern of " + regexWebsiteUrl, new [] { "WebsiteUrl" });
970-
//}
966+
Regex regexWebsiteUrl = new Regex(@"\\b((?:https?:\/\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))", RegexOptions.CultureInvariant);
967+
if (false == regexWebsiteUrl.Match(this.WebsiteUrl).Success)
968+
{
969+
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for WebsiteUrl, must match a pattern of " + regexWebsiteUrl, new [] { "WebsiteUrl" });
970+
}
971971

972972
// TaxId (string) pattern
973973
Regex regexTaxId = new Regex(@"\\d{9}", RegexOptions.CultureInvariant);

0 commit comments

Comments
 (0)