本文整理汇总了C#中PatchRequest.ConvertToJson方法的典型用法代码示例。如果您正苦于以下问题:C# PatchRequest.ConvertToJson方法的具体用法?C# PatchRequest.ConvertToJson怎么用?C# PatchRequest.ConvertToJson使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PatchRequest
的用法示例。
在下文中一共展示了PatchRequest.ConvertToJson方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
/// <summary>
/// Partially update the Payment resource for the given identifier
/// </summary>
/// <param name="apiContext">APIContext used for the API call.</param>
/// <param name="paymentId">ID of the payment to update.</param>
/// <param name="patchRequest">PatchRequest</param>
public static void Update(APIContext apiContext, string paymentId, PatchRequest patchRequest)
{
// Validate the arguments to be used in the request
ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
ArgumentValidator.Validate(paymentId, "paymentId");
ArgumentValidator.Validate(patchRequest, "patchRequest");
// Configure and send the request
var pattern = "v1/payments/payment/{0}";
var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { paymentId });
PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.PATCH, resourcePath, patchRequest.ConvertToJson());
}
示例2: Update
/// <summary>
/// Updates the Webhook identified by webhook_id for the application associated with access token.
/// </summary>
/// <param name="apiContext">APIContext used for the API call.</param>
/// <param name="webhookId">ID of the webhook to be updated.</param>
/// <param name="patchRequest">PatchRequest</param>
/// <returns>Webhook</returns>
public static Webhook Update(APIContext apiContext, string webhookId, PatchRequest patchRequest)
{
// Validate the arguments to be used in the request
ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
ArgumentValidator.Validate(webhookId, "webhookId");
ArgumentValidator.Validate(patchRequest, "patchRequest");
// Configure and send the request
var pattern = "v1/notifications/webhooks/{0}";
var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { webhookId });
return PayPalResource.ConfigureAndExecute<Webhook>(apiContext, HttpMethod.PATCH, resourcePath, patchRequest.ConvertToJson());
}
示例3: Update
/// <summary>
/// Update information in a previously saved card. Only the modified fields need to be passed in the request.
/// </summary>
/// <param name="apiContext">APIContext used for the API call.</param>
/// <param name="patchRequest">PatchRequest</param>
/// <returns>CreditCard</returns>
public CreditCard Update(APIContext apiContext, PatchRequest patchRequest)
{
// Validate the arguments to be used in the request
ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
ArgumentValidator.Validate(this.id, "Id");
ArgumentValidator.Validate(patchRequest, "patchRequest");
// Configure and send the request
var pattern = "v1/vault/credit-cards/{0}";
var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { this.id });
return PayPalResource.ConfigureAndExecute<CreditCard>(apiContext, HttpMethod.PATCH, resourcePath, patchRequest.ConvertToJson());
}