/// <summary> /// Search for invoice resources. /// </summary> /// <param name="accessToken">Access Token used for the API call.</param> /// <param name="search">Search</param> /// <returns>Invoices</returns> public Invoices Search(string accessToken, Search search) { APIContext apiContext = new APIContext(accessToken); return Search(apiContext, search); }
/// <summary> /// Search for invoice resources. /// </summary> /// <param name="apiContext">APIContext used for the API call.</param> /// <param name="search">Search</param> /// <returns>Invoices</returns> public Invoices Search(APIContext apiContext, Search search) { if (apiContext == null) { throw new ArgumentNullException("APIContext cannot be null"); } if (string.IsNullOrEmpty(apiContext.AccessToken)) { throw new ArgumentNullException("AccessToken cannot be null or empty"); } if (apiContext.HTTPHeaders == null) { apiContext.HTTPHeaders = new Dictionary<string, string>(); } apiContext.HTTPHeaders.Add(BaseConstants.ContentTypeHeader, BaseConstants.ContentTypeHeaderJson); apiContext.SdkVersion = new SDKVersionImpl(); if (search == null) { throw new ArgumentNullException("search cannot be null"); } object[] parameters = new object[] {this.id}; string pattern = "v1/invoicing/search"; string resourcePath = SDKUtil.FormatURIPath(pattern, parameters); string payLoad = search.ConvertToJson(); return PayPalResource.ConfigureAndExecute<Invoices>(apiContext, HttpMethod.POST, resourcePath, payLoad); }
/// <summary> /// Search for invoice resources. /// </summary> /// <param name="accessToken">Access Token used for the API call.</param> /// <param name="search">Search</param> /// <returns>Invoices</returns> public Invoices Search(string accessToken, Search search) { APIContext apiContext = new APIContext(accessToken); return(Search(apiContext, search)); }