diff --git a/CHANGELOG.md b/CHANGELOG.md index 579e6c04..351e1ded 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,36 @@ # Changelog +# Change Log + +## Version 5.0.0 (2020-02-26) +## API releases +* **GA release**: All SDKs have been updated to support the new Bank Accounts and CashDrawerShifts APIs. + +* **Beta release**: All SDKs have been updated to support the new Disputes API. + + +## Existing API updates + +All SDKs have been updated to support the following changes: + +* **Catalog API** + * Batch upsert catalog objects endpoint — The `batches` field is now required and the array must have at least one element. + * CatalogModifier — Two fields added: + * `ordinal` to support custom ordering in a modifier list + * `modifier_list_id` to reference the parent modifier list + * CatalogModifierList — New field added: `ordinal` to support custom ordering in a list of **CatalogModifierList** objects. + +* **Customers API changes** + * SearchCustomers endpoint — `limit` size reduced from 1000 to 100 to improve the endpoint performance. + +* **Orders API changes** + * CreateOrderRequest — Previously these request fields were deprecated: `line_items`, `taxes`, `discounts`. These fields are no longer available. Instead you now use the `Order` object in the request. For example, `Order.line_items`, `Order.taxes`, and `Order.discounts`. + * OrderLineItem type — There are two changes: + * The `taxes` field that was previously deprecated is no longer available. Instead, you now use the `OrderLineItem.applied_taxes` field. This also now requires that you set the `OrderLineItemTax.scope` field. + * The `discounts` field that was previously deprecated is no longer available. Instead, you now use the `OrderLineItem.applied_discounts` field. This also now requires that you set the `OrderLineItemDiscount.scope` field. + +* **Shared object updates** + * **Card object** — New fields added: `card_type`, `prepaid_type`. Currently, only the Payments API responses populate these fields. + ## Version 4.1.0 (2020-01-22) * New field: The **Employee** object now has an `is_owner` field. diff --git a/Square.Tests/SanityTest.cs b/Square.Tests/SanityTest.cs index f68b384a..7457328a 100644 --- a/Square.Tests/SanityTest.cs +++ b/Square.Tests/SanityTest.cs @@ -139,13 +139,6 @@ public void TestV1APIException() public void TestCustomersCycle() { var api = client.CustomersApi; - var listCustomersRes = api.ListCustomers(); - - int orignalCustomersCount = 0; - if (listCustomersRes.Customers != null) - { - orignalCustomersCount = listCustomersRes.Customers.Count; - } // Create Customer var createCustomerRes = api.CreateCustomer(TestCreateCustomerRequest); @@ -165,9 +158,7 @@ public void TestCustomersCycle() Assert.AreEqual(retrieveCustomer.FamilyName, TestFamilyName); // List Customer - listCustomersRes = api.ListCustomers(); - var listedCustomers = listCustomersRes.Customers; - Assert.AreEqual(orignalCustomersCount + 1, listedCustomers.Count); + var listCustomersRes = api.ListCustomers(); // Update Customer var updateCustomerRes = api.UpdateCustomer(createdCustomerId, TestUpdateCustomerRequest); @@ -180,15 +171,6 @@ public void TestCustomersCycle() // Delete Customer var deleteCustomerRes = api.DeleteCustomer(createdCustomerId); Assert.AreEqual(deleteCustomerRes.Errors, null); - - listCustomersRes = api.ListCustomers(); - - int finalCustomersCount = 0; - if (listCustomersRes.Customers != null) - { - finalCustomersCount = listCustomersRes.Customers.Count; - } - Assert.AreEqual(orignalCustomersCount, finalCustomersCount); } } } \ No newline at end of file diff --git a/Square.sln b/Square.sln index 0b6e272c..af8ca15a 100644 --- a/Square.sln +++ b/Square.sln @@ -2,9 +2,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26430.14 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square", "Square/Square.csproj", "{4ab9eb37-d74c-4ef7-abf1-8cb193a65d25}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square", "Square/Square.csproj", "{1f3f1640-0a94-43eb-9d67-58d9340e6ee2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Tests", "Square.Tests/Square.Tests.csproj", "{e928dce4-5cdd-4091-b72b-09e6c76ac7cc}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Tests", "Square.Tests/Square.Tests.csproj", "{007fcf57-8234-4fbd-ad5f-05e9b56927fc}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -12,14 +12,14 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4ab9eb37-d74c-4ef7-abf1-8cb193a65d25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4ab9eb37-d74c-4ef7-abf1-8cb193a65d25}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4ab9eb37-d74c-4ef7-abf1-8cb193a65d25}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4ab9eb37-d74c-4ef7-abf1-8cb193a65d25}.Release|Any CPU.Build.0 = Release|Any CPU - {e928dce4-5cdd-4091-b72b-09e6c76ac7cc}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {e928dce4-5cdd-4091-b72b-09e6c76ac7cc}.Debug|Any CPU.Build.0 = Debug|Any CPU - {e928dce4-5cdd-4091-b72b-09e6c76ac7cc}.Release|Any CPU.ActiveCfg = Release|Any CPU - {e928dce4-5cdd-4091-b72b-09e6c76ac7cc}.Release|Any CPU.Build.0 = Release|Any CPU + {1f3f1640-0a94-43eb-9d67-58d9340e6ee2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1f3f1640-0a94-43eb-9d67-58d9340e6ee2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1f3f1640-0a94-43eb-9d67-58d9340e6ee2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1f3f1640-0a94-43eb-9d67-58d9340e6ee2}.Release|Any CPU.Build.0 = Release|Any CPU + {007fcf57-8234-4fbd-ad5f-05e9b56927fc}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {007fcf57-8234-4fbd-ad5f-05e9b56927fc}.Debug|Any CPU.Build.0 = Debug|Any CPU + {007fcf57-8234-4fbd-ad5f-05e9b56927fc}.Release|Any CPU.ActiveCfg = Release|Any CPU + {007fcf57-8234-4fbd-ad5f-05e9b56927fc}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Square/Apis/ApplePayApi.cs b/Square/Apis/ApplePayApi.cs index cfe9200a..b702028a 100644 --- a/Square/Apis/ApplePayApi.cs +++ b/Square/Apis/ApplePayApi.cs @@ -71,7 +71,7 @@ public Models.RegisterDomainResponse RegisterDomain(Models.RegisterDomainRequest { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params diff --git a/Square/Apis/BankAccountsApi.cs b/Square/Apis/BankAccountsApi.cs new file mode 100644 index 00000000..4302188f --- /dev/null +++ b/Square/Apis/BankAccountsApi.cs @@ -0,0 +1,250 @@ +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Newtonsoft.Json.Converters; +using Square; +using Square.Utilities; +using Square.Http.Request; +using Square.Http.Response; +using Square.Http.Client; +using Square.Authentication; +using Square.Exceptions; + +namespace Square.Apis +{ + internal class BankAccountsApi: BaseApi, IBankAccountsApi + { + internal BankAccountsApi(IConfiguration config, IHttpClient httpClient, IDictionary authManagers, HttpCallBack httpCallBack = null) : + base(config, httpClient, authManagers, httpCallBack) + { } + + /// + /// Returns a list of [BankAccount](#type-bankaccount) objects linked to a Square account. + /// For more information, see + /// [Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api). + /// + /// Optional parameter: The pagination cursor returned by a previous call to this endpoint. Use it in the next `ListBankAccounts` request to retrieve the next set of results. See the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information. + /// Optional parameter: Upper limit on the number of bank accounts to return in the response. Currently, 1000 is the largest supported limit. You can specify a limit of up to 1000 bank accounts. This is also the default limit. + /// Optional parameter: Location ID. You can specify this optional filter to retrieve only the linked bank accounts belonging to a specific location. + /// Returns the Models.ListBankAccountsResponse response from the API call + public Models.ListBankAccountsResponse ListBankAccounts(string cursor = null, int? limit = null, string locationId = null) + { + Task t = ListBankAccountsAsync(cursor, limit, locationId); + ApiHelper.RunTaskSynchronously(t); + return t.Result; + } + + /// + /// Returns a list of [BankAccount](#type-bankaccount) objects linked to a Square account. + /// For more information, see + /// [Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api). + /// + /// Optional parameter: The pagination cursor returned by a previous call to this endpoint. Use it in the next `ListBankAccounts` request to retrieve the next set of results. See the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information. + /// Optional parameter: Upper limit on the number of bank accounts to return in the response. Currently, 1000 is the largest supported limit. You can specify a limit of up to 1000 bank accounts. This is also the default limit. + /// Optional parameter: Location ID. You can specify this optional filter to retrieve only the linked bank accounts belonging to a specific location. + /// Returns the Models.ListBankAccountsResponse response from the API call + public async Task ListBankAccountsAsync(string cursor = null, int? limit = null, string locationId = null, CancellationToken cancellationToken = default) + { + //the base uri for api requests + string _baseUri = config.GetBaseUri(); + + //prepare query string for API call + StringBuilder _queryBuilder = new StringBuilder(_baseUri); + _queryBuilder.Append("/v2/bank-accounts"); + + //process optional query parameters + ApiHelper.AppendUrlWithQueryParameters(_queryBuilder, new Dictionary() + { + { "cursor", cursor }, + { "limit", limit }, + { "location_id", locationId } + }, ArrayDeserializationFormat, ParameterSeparator); + + //validate and preprocess url + string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); + + //append request with appropriate headers and parameters + var _headers = new Dictionary() + { + { "user-agent", userAgent }, + { "accept", "application/json" }, + { "Square-Version", "2020-02-26" } + }; + + //prepare the API call request to fetch the response + HttpRequest _request = GetClientInstance().Get(_queryUrl,_headers); + if (HttpCallBack != null) + { + HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); + } + + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); + + //invoke request and get response + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); + HttpContext _context = new HttpContext(_request, _response); + if (HttpCallBack != null) + { + HttpCallBack.OnAfterHttpResponseEventHandler(GetClientInstance(), _response); + } + + //handle errors defined at the API level + base.ValidateResponse(_response, _context); + + var _responseModel = ApiHelper.JsonDeserialize(_response.Body); + _responseModel.Context = _context; + return _responseModel; + } + + /// + /// Returns details of a [BankAccount](#type-bankaccount) identified by V1 bank account ID. + /// For more information, see + /// [Retrieve a bank account by using an ID issued by V1 Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-the-v1-bank-accounts-api). + /// + /// Required parameter: Connect V1 ID of the desired `BankAccount`. For more information, see [Retrieve a bank account by using an ID issued by V1 Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-v1-bank-accounts-api). + /// Returns the Models.GetBankAccountByV1IdResponse response from the API call + public Models.GetBankAccountByV1IdResponse GetBankAccountByV1Id(string v1BankAccountId) + { + Task t = GetBankAccountByV1IdAsync(v1BankAccountId); + ApiHelper.RunTaskSynchronously(t); + return t.Result; + } + + /// + /// Returns details of a [BankAccount](#type-bankaccount) identified by V1 bank account ID. + /// For more information, see + /// [Retrieve a bank account by using an ID issued by V1 Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-the-v1-bank-accounts-api). + /// + /// Required parameter: Connect V1 ID of the desired `BankAccount`. For more information, see [Retrieve a bank account by using an ID issued by V1 Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-v1-bank-accounts-api). + /// Returns the Models.GetBankAccountByV1IdResponse response from the API call + public async Task GetBankAccountByV1IdAsync(string v1BankAccountId, CancellationToken cancellationToken = default) + { + //the base uri for api requests + string _baseUri = config.GetBaseUri(); + + //prepare query string for API call + StringBuilder _queryBuilder = new StringBuilder(_baseUri); + _queryBuilder.Append("/v2/bank-accounts/by-v1-id/{v1_bank_account_id}"); + + //process optional template parameters + ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() + { + { "v1_bank_account_id", v1BankAccountId } + }); + + //validate and preprocess url + string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); + + //append request with appropriate headers and parameters + var _headers = new Dictionary() + { + { "user-agent", userAgent }, + { "accept", "application/json" }, + { "Square-Version", "2020-02-26" } + }; + + //prepare the API call request to fetch the response + HttpRequest _request = GetClientInstance().Get(_queryUrl,_headers); + if (HttpCallBack != null) + { + HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); + } + + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); + + //invoke request and get response + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); + HttpContext _context = new HttpContext(_request, _response); + if (HttpCallBack != null) + { + HttpCallBack.OnAfterHttpResponseEventHandler(GetClientInstance(), _response); + } + + //handle errors defined at the API level + base.ValidateResponse(_response, _context); + + var _responseModel = ApiHelper.JsonDeserialize(_response.Body); + _responseModel.Context = _context; + return _responseModel; + } + + /// + /// Returns details of a [BankAccount](#type-bankaccount) + /// linked to a Square account. For more information, see + /// [Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api). + /// + /// Required parameter: Square-issued ID of the desired `BankAccount`. + /// Returns the Models.GetBankAccountResponse response from the API call + public Models.GetBankAccountResponse GetBankAccount(string bankAccountId) + { + Task t = GetBankAccountAsync(bankAccountId); + ApiHelper.RunTaskSynchronously(t); + return t.Result; + } + + /// + /// Returns details of a [BankAccount](#type-bankaccount) + /// linked to a Square account. For more information, see + /// [Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api). + /// + /// Required parameter: Square-issued ID of the desired `BankAccount`. + /// Returns the Models.GetBankAccountResponse response from the API call + public async Task GetBankAccountAsync(string bankAccountId, CancellationToken cancellationToken = default) + { + //the base uri for api requests + string _baseUri = config.GetBaseUri(); + + //prepare query string for API call + StringBuilder _queryBuilder = new StringBuilder(_baseUri); + _queryBuilder.Append("/v2/bank-accounts/{bank_account_id}"); + + //process optional template parameters + ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() + { + { "bank_account_id", bankAccountId } + }); + + //validate and preprocess url + string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); + + //append request with appropriate headers and parameters + var _headers = new Dictionary() + { + { "user-agent", userAgent }, + { "accept", "application/json" }, + { "Square-Version", "2020-02-26" } + }; + + //prepare the API call request to fetch the response + HttpRequest _request = GetClientInstance().Get(_queryUrl,_headers); + if (HttpCallBack != null) + { + HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); + } + + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); + + //invoke request and get response + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); + HttpContext _context = new HttpContext(_request, _response); + if (HttpCallBack != null) + { + HttpCallBack.OnAfterHttpResponseEventHandler(GetClientInstance(), _response); + } + + //handle errors defined at the API level + base.ValidateResponse(_response, _context); + + var _responseModel = ApiHelper.JsonDeserialize(_response.Body); + _responseModel.Context = _context; + return _responseModel; + } + + } +} \ No newline at end of file diff --git a/Square/Apis/BaseApi.cs b/Square/Apis/BaseApi.cs index a3d64a93..b722393b 100644 --- a/Square/Apis/BaseApi.cs +++ b/Square/Apis/BaseApi.cs @@ -23,7 +23,7 @@ internal class BaseApi /// /// User-Agent header value /// - internal string userAgent = "Square-DotNet-SDK/4.1.0"; + internal string userAgent = "Square-DotNet-SDK/5.0.0"; /// /// HttpClient instance diff --git a/Square/Apis/CashDrawersApi.cs b/Square/Apis/CashDrawersApi.cs index 4d87a37a..cf10713b 100644 --- a/Square/Apis/CashDrawersApi.cs +++ b/Square/Apis/CashDrawersApi.cs @@ -93,7 +93,7 @@ public Models.ListCashDrawerShiftsResponse ListCashDrawerShifts( { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -171,7 +171,7 @@ public Models.RetrieveCashDrawerShiftResponse RetrieveCashDrawerShift(string loc { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -261,7 +261,7 @@ public Models.ListCashDrawerShiftEventsResponse ListCashDrawerShiftEvents( { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response diff --git a/Square/Apis/CatalogApi.cs b/Square/Apis/CatalogApi.cs index 8785de81..276341e3 100644 --- a/Square/Apis/CatalogApi.cs +++ b/Square/Apis/CatalogApi.cs @@ -75,7 +75,7 @@ public Models.BatchDeleteCatalogObjectsResponse BatchDeleteCatalogObjects(Models { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -151,7 +151,7 @@ public Models.BatchRetrieveCatalogObjectsResponse BatchRetrieveCatalogObjects(Mo { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -233,7 +233,7 @@ public Models.BatchUpsertCatalogObjectsResponse BatchUpsertCatalogObjects(Models { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -362,7 +362,7 @@ public Models.CreateCatalogImageResponse CreateCatalogImage(Models.CreateCatalog { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; var requestHeaders = new Dictionary>(StringComparer.OrdinalIgnoreCase) @@ -372,7 +372,7 @@ public Models.CreateCatalogImageResponse CreateCatalogImage(Models.CreateCatalog var imageFileHeaders = new Dictionary>(StringComparer.OrdinalIgnoreCase) { - { "Content-Type", new [] { "image/jpeg" } } + { "Content-Type", new [] { string.IsNullOrEmpty(imageFile.ContentType) ? "image/jpeg" : imageFile.ContentType } } }; //append form/field parameters @@ -444,7 +444,7 @@ public Models.CatalogInfoResponse CatalogInfo() { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -529,7 +529,7 @@ public Models.ListCatalogResponse ListCatalog(string cursor = null, string types { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -592,7 +592,7 @@ public Models.UpsertCatalogObjectResponse UpsertCatalogObject(Models.UpsertCatal { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -673,7 +673,7 @@ public Models.DeleteCatalogObjectResponse DeleteCatalogObject(string objectId) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -761,7 +761,7 @@ public Models.RetrieveCatalogObjectResponse RetrieveCatalogObject(string objectI { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -850,7 +850,7 @@ public Models.SearchCatalogObjectsResponse SearchCatalogObjects(Models.SearchCat { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -920,7 +920,7 @@ public Models.UpdateItemModifierListsResponse UpdateItemModifierLists(Models.Upd { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -990,7 +990,7 @@ public Models.UpdateItemTaxesResponse UpdateItemTaxes(Models.UpdateItemTaxesRequ { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params diff --git a/Square/Apis/CheckoutApi.cs b/Square/Apis/CheckoutApi.cs index 5ee4be7b..8abd308a 100644 --- a/Square/Apis/CheckoutApi.cs +++ b/Square/Apis/CheckoutApi.cs @@ -71,7 +71,7 @@ public Models.CreateCheckoutResponse CreateCheckout(string locationId, Models.Cr { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params diff --git a/Square/Apis/CustomersApi.cs b/Square/Apis/CustomersApi.cs index 4b39b2f5..ffd9eaf4 100644 --- a/Square/Apis/CustomersApi.cs +++ b/Square/Apis/CustomersApi.cs @@ -70,7 +70,7 @@ public Models.ListCustomersResponse ListCustomers(string cursor = null, string s { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -147,7 +147,7 @@ public Models.CreateCustomerResponse CreateCustomer(Models.CreateCustomerRequest { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -219,7 +219,7 @@ public Models.SearchCustomersResponse SearchCustomers(Models.SearchCustomersRequ { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -294,7 +294,7 @@ public Models.DeleteCustomerResponse DeleteCustomer(string customerId) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -362,7 +362,7 @@ public Models.RetrieveCustomerResponse RetrieveCustomer(string customerId) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -445,7 +445,7 @@ public Models.UpdateCustomerResponse UpdateCustomer(string customerId, Models.Up { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -525,7 +525,7 @@ public Models.CreateCustomerCardResponse CreateCustomerCard(string customerId, M { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -599,7 +599,7 @@ public Models.DeleteCustomerCardResponse DeleteCustomerCard(string customerId, s { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response diff --git a/Square/Apis/DisputesApi.cs b/Square/Apis/DisputesApi.cs new file mode 100644 index 00000000..9fe05753 --- /dev/null +++ b/Square/Apis/DisputesApi.cs @@ -0,0 +1,748 @@ +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Newtonsoft.Json.Converters; +using Square; +using Square.Utilities; +using Square.Http.Request; +using Square.Http.Response; +using Square.Http.Client; +using Square.Authentication; +using Square.Exceptions; + +namespace Square.Apis +{ + internal class DisputesApi: BaseApi, IDisputesApi + { + internal DisputesApi(IConfiguration config, IHttpClient httpClient, IDictionary authManagers, HttpCallBack httpCallBack = null) : + base(config, httpClient, authManagers, httpCallBack) + { } + + /// + /// Returns a list of disputes associated + /// with a particular account. + /// + /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see [Paginating](https://developer.squareup.com/docs/basics/api101/pagination). + /// Optional parameter: The dispute states to filter the result. If not specified, the endpoint returns all open disputes (dispute status is not `INQUIRY_CLOSED`, `WON`, or `LOST`). + /// Optional parameter: The ID of the location for which to return a list of disputes. If not specified, the endpoint returns all open disputes (dispute status is not `INQUIRY_CLOSED`, `WON`, or `LOST`) associated with all locations. + /// Returns the Models.ListDisputesResponse response from the API call + public Models.ListDisputesResponse ListDisputes(string cursor = null, string states = null, string locationId = null) + { + Task t = ListDisputesAsync(cursor, states, locationId); + ApiHelper.RunTaskSynchronously(t); + return t.Result; + } + + /// + /// Returns a list of disputes associated + /// with a particular account. + /// + /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see [Paginating](https://developer.squareup.com/docs/basics/api101/pagination). + /// Optional parameter: The dispute states to filter the result. If not specified, the endpoint returns all open disputes (dispute status is not `INQUIRY_CLOSED`, `WON`, or `LOST`). + /// Optional parameter: The ID of the location for which to return a list of disputes. If not specified, the endpoint returns all open disputes (dispute status is not `INQUIRY_CLOSED`, `WON`, or `LOST`) associated with all locations. + /// Returns the Models.ListDisputesResponse response from the API call + public async Task ListDisputesAsync(string cursor = null, string states = null, string locationId = null, CancellationToken cancellationToken = default) + { + //the base uri for api requests + string _baseUri = config.GetBaseUri(); + + //prepare query string for API call + StringBuilder _queryBuilder = new StringBuilder(_baseUri); + _queryBuilder.Append("/v2/disputes"); + + //process optional query parameters + ApiHelper.AppendUrlWithQueryParameters(_queryBuilder, new Dictionary() + { + { "cursor", cursor }, + { "states", states }, + { "location_id", locationId } + }, ArrayDeserializationFormat, ParameterSeparator); + + //validate and preprocess url + string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); + + //append request with appropriate headers and parameters + var _headers = new Dictionary() + { + { "user-agent", userAgent }, + { "accept", "application/json" }, + { "Square-Version", "2020-02-26" } + }; + + //prepare the API call request to fetch the response + HttpRequest _request = GetClientInstance().Get(_queryUrl,_headers); + if (HttpCallBack != null) + { + HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); + } + + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); + + //invoke request and get response + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); + HttpContext _context = new HttpContext(_request, _response); + if (HttpCallBack != null) + { + HttpCallBack.OnAfterHttpResponseEventHandler(GetClientInstance(), _response); + } + + //handle errors defined at the API level + base.ValidateResponse(_response, _context); + + var _responseModel = ApiHelper.JsonDeserialize(_response.Body); + _responseModel.Context = _context; + return _responseModel; + } + + /// + /// Returns details of a specific dispute. + /// + /// Required parameter: The ID of the dispute you want more details about. + /// Returns the Models.RetrieveDisputeResponse response from the API call + public Models.RetrieveDisputeResponse RetrieveDispute(string disputeId) + { + Task t = RetrieveDisputeAsync(disputeId); + ApiHelper.RunTaskSynchronously(t); + return t.Result; + } + + /// + /// Returns details of a specific dispute. + /// + /// Required parameter: The ID of the dispute you want more details about. + /// Returns the Models.RetrieveDisputeResponse response from the API call + public async Task RetrieveDisputeAsync(string disputeId, CancellationToken cancellationToken = default) + { + //the base uri for api requests + string _baseUri = config.GetBaseUri(); + + //prepare query string for API call + StringBuilder _queryBuilder = new StringBuilder(_baseUri); + _queryBuilder.Append("/v2/disputes/{dispute_id}"); + + //process optional template parameters + ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() + { + { "dispute_id", disputeId } + }); + + //validate and preprocess url + string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); + + //append request with appropriate headers and parameters + var _headers = new Dictionary() + { + { "user-agent", userAgent }, + { "accept", "application/json" }, + { "Square-Version", "2020-02-26" } + }; + + //prepare the API call request to fetch the response + HttpRequest _request = GetClientInstance().Get(_queryUrl,_headers); + if (HttpCallBack != null) + { + HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); + } + + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); + + //invoke request and get response + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); + HttpContext _context = new HttpContext(_request, _response); + if (HttpCallBack != null) + { + HttpCallBack.OnAfterHttpResponseEventHandler(GetClientInstance(), _response); + } + + //handle errors defined at the API level + base.ValidateResponse(_response, _context); + + var _responseModel = ApiHelper.JsonDeserialize(_response.Body); + _responseModel.Context = _context; + return _responseModel; + } + + /// + /// Accepts loss on a dispute. Square returns + /// the disputed amount to the cardholder and updates the + /// dispute state to ACCEPTED. + /// Square debits the disputed amount from the seller’s Square + /// account. If the Square account balance does not have + /// sufficient funds, Square debits the associated bank account. + /// For an overview of the Disputes API, see [Overview](https://developer.squareup.com/docs/docs/disputes-api/overview). + /// + /// Required parameter: ID of the dispute you want to accept. + /// Returns the Models.AcceptDisputeResponse response from the API call + public Models.AcceptDisputeResponse AcceptDispute(string disputeId) + { + Task t = AcceptDisputeAsync(disputeId); + ApiHelper.RunTaskSynchronously(t); + return t.Result; + } + + /// + /// Accepts loss on a dispute. Square returns + /// the disputed amount to the cardholder and updates the + /// dispute state to ACCEPTED. + /// Square debits the disputed amount from the seller’s Square + /// account. If the Square account balance does not have + /// sufficient funds, Square debits the associated bank account. + /// For an overview of the Disputes API, see [Overview](https://developer.squareup.com/docs/docs/disputes-api/overview). + /// + /// Required parameter: ID of the dispute you want to accept. + /// Returns the Models.AcceptDisputeResponse response from the API call + public async Task AcceptDisputeAsync(string disputeId, CancellationToken cancellationToken = default) + { + //the base uri for api requests + string _baseUri = config.GetBaseUri(); + + //prepare query string for API call + StringBuilder _queryBuilder = new StringBuilder(_baseUri); + _queryBuilder.Append("/v2/disputes/{dispute_id}/accept"); + + //process optional template parameters + ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() + { + { "dispute_id", disputeId } + }); + + //validate and preprocess url + string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); + + //append request with appropriate headers and parameters + var _headers = new Dictionary() + { + { "user-agent", userAgent }, + { "accept", "application/json" }, + { "Square-Version", "2020-02-26" } + }; + + //prepare the API call request to fetch the response + HttpRequest _request = GetClientInstance().Post(_queryUrl, _headers, null); + if (HttpCallBack != null) + { + HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); + } + + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); + + //invoke request and get response + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); + HttpContext _context = new HttpContext(_request, _response); + if (HttpCallBack != null) + { + HttpCallBack.OnAfterHttpResponseEventHandler(GetClientInstance(), _response); + } + + //handle errors defined at the API level + base.ValidateResponse(_response, _context); + + var _responseModel = ApiHelper.JsonDeserialize(_response.Body); + _responseModel.Context = _context; + return _responseModel; + } + + /// + /// Returns a list of evidence associated with a dispute. + /// + /// Required parameter: The ID of the dispute. + /// Returns the Models.ListDisputeEvidenceResponse response from the API call + public Models.ListDisputeEvidenceResponse ListDisputeEvidence(string disputeId) + { + Task t = ListDisputeEvidenceAsync(disputeId); + ApiHelper.RunTaskSynchronously(t); + return t.Result; + } + + /// + /// Returns a list of evidence associated with a dispute. + /// + /// Required parameter: The ID of the dispute. + /// Returns the Models.ListDisputeEvidenceResponse response from the API call + public async Task ListDisputeEvidenceAsync(string disputeId, CancellationToken cancellationToken = default) + { + //the base uri for api requests + string _baseUri = config.GetBaseUri(); + + //prepare query string for API call + StringBuilder _queryBuilder = new StringBuilder(_baseUri); + _queryBuilder.Append("/v2/disputes/{dispute_id}/evidence"); + + //process optional template parameters + ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() + { + { "dispute_id", disputeId } + }); + + //validate and preprocess url + string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); + + //append request with appropriate headers and parameters + var _headers = new Dictionary() + { + { "user-agent", userAgent }, + { "accept", "application/json" }, + { "Square-Version", "2020-02-26" } + }; + + //prepare the API call request to fetch the response + HttpRequest _request = GetClientInstance().Get(_queryUrl,_headers); + if (HttpCallBack != null) + { + HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); + } + + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); + + //invoke request and get response + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); + HttpContext _context = new HttpContext(_request, _response); + if (HttpCallBack != null) + { + HttpCallBack.OnAfterHttpResponseEventHandler(GetClientInstance(), _response); + } + + //handle errors defined at the API level + base.ValidateResponse(_response, _context); + + var _responseModel = ApiHelper.JsonDeserialize(_response.Body); + _responseModel.Context = _context; + return _responseModel; + } + + /// + /// Removes specified evidence from a dispute. + /// Square does not send the bank any evidence that + /// is removed. Also, you cannot remove evidence after + /// submitting it to the bank using [SubmitEvidence](https://developer.squareup.com/docs/reference/square/disputes-api/submit-evidence). + /// + /// Required parameter: The ID of the dispute you want to remove evidence from. + /// Required parameter: The ID of the evidence you want to remove. + /// Returns the Models.RemoveDisputeEvidenceResponse response from the API call + public Models.RemoveDisputeEvidenceResponse RemoveDisputeEvidence(string disputeId, string evidenceId) + { + Task t = RemoveDisputeEvidenceAsync(disputeId, evidenceId); + ApiHelper.RunTaskSynchronously(t); + return t.Result; + } + + /// + /// Removes specified evidence from a dispute. + /// Square does not send the bank any evidence that + /// is removed. Also, you cannot remove evidence after + /// submitting it to the bank using [SubmitEvidence](https://developer.squareup.com/docs/reference/square/disputes-api/submit-evidence). + /// + /// Required parameter: The ID of the dispute you want to remove evidence from. + /// Required parameter: The ID of the evidence you want to remove. + /// Returns the Models.RemoveDisputeEvidenceResponse response from the API call + public async Task RemoveDisputeEvidenceAsync(string disputeId, string evidenceId, CancellationToken cancellationToken = default) + { + //the base uri for api requests + string _baseUri = config.GetBaseUri(); + + //prepare query string for API call + StringBuilder _queryBuilder = new StringBuilder(_baseUri); + _queryBuilder.Append("/v2/disputes/{dispute_id}/evidence/{evidence_id}"); + + //process optional template parameters + ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() + { + { "dispute_id", disputeId }, + { "evidence_id", evidenceId } + }); + + //validate and preprocess url + string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); + + //append request with appropriate headers and parameters + var _headers = new Dictionary() + { + { "user-agent", userAgent }, + { "accept", "application/json" }, + { "Square-Version", "2020-02-26" } + }; + + //prepare the API call request to fetch the response + HttpRequest _request = GetClientInstance().Delete(_queryUrl, _headers, null); + if (HttpCallBack != null) + { + HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); + } + + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); + + //invoke request and get response + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); + HttpContext _context = new HttpContext(_request, _response); + if (HttpCallBack != null) + { + HttpCallBack.OnAfterHttpResponseEventHandler(GetClientInstance(), _response); + } + + //handle errors defined at the API level + base.ValidateResponse(_response, _context); + + var _responseModel = ApiHelper.JsonDeserialize(_response.Body); + _responseModel.Context = _context; + return _responseModel; + } + + /// + /// Returns the specific evidence metadata associated with a specific dispute. + /// You must maintain a copy of the evidence you upload if you want to + /// reference it later. You cannot download the evidence + /// after you upload it. + /// + /// Required parameter: The ID of the dispute that you want to retrieve evidence from. + /// Required parameter: The ID of the evidence to retrieve. + /// Returns the Models.RetrieveDisputeEvidenceResponse response from the API call + public Models.RetrieveDisputeEvidenceResponse RetrieveDisputeEvidence(string disputeId, string evidenceId) + { + Task t = RetrieveDisputeEvidenceAsync(disputeId, evidenceId); + ApiHelper.RunTaskSynchronously(t); + return t.Result; + } + + /// + /// Returns the specific evidence metadata associated with a specific dispute. + /// You must maintain a copy of the evidence you upload if you want to + /// reference it later. You cannot download the evidence + /// after you upload it. + /// + /// Required parameter: The ID of the dispute that you want to retrieve evidence from. + /// Required parameter: The ID of the evidence to retrieve. + /// Returns the Models.RetrieveDisputeEvidenceResponse response from the API call + public async Task RetrieveDisputeEvidenceAsync(string disputeId, string evidenceId, CancellationToken cancellationToken = default) + { + //the base uri for api requests + string _baseUri = config.GetBaseUri(); + + //prepare query string for API call + StringBuilder _queryBuilder = new StringBuilder(_baseUri); + _queryBuilder.Append("/v2/disputes/{dispute_id}/evidence/{evidence_id}"); + + //process optional template parameters + ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() + { + { "dispute_id", disputeId }, + { "evidence_id", evidenceId } + }); + + //validate and preprocess url + string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); + + //append request with appropriate headers and parameters + var _headers = new Dictionary() + { + { "user-agent", userAgent }, + { "accept", "application/json" }, + { "Square-Version", "2020-02-26" } + }; + + //prepare the API call request to fetch the response + HttpRequest _request = GetClientInstance().Get(_queryUrl,_headers); + if (HttpCallBack != null) + { + HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); + } + + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); + + //invoke request and get response + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); + HttpContext _context = new HttpContext(_request, _response); + if (HttpCallBack != null) + { + HttpCallBack.OnAfterHttpResponseEventHandler(GetClientInstance(), _response); + } + + //handle errors defined at the API level + base.ValidateResponse(_response, _context); + + var _responseModel = ApiHelper.JsonDeserialize(_response.Body); + _responseModel.Context = _context; + return _responseModel; + } + + /// + /// Uploads a file to use as evidence in a dispute challenge. The endpoint accepts + /// HTTP multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, + /// and TIFF formats. The following is an example of such an HTTP request: + /// ``` + /// curl -X POST \ + /// -H 'Accept: application/json' \ + /// -H 'Authorization: Bearer {{ACCESS_TOKEN}}' \ + /// -H 'Content-Type: multipart/form-data' \ + /// -F 'evidence=@/path/to/file/filename.tiff' \ + /// -F 'request={ "idempotency_key":"{{UNIQUE_KEY}}", "evidence_type":"{{EVIDENCE_TYPE}}", "content_type":"image/tiff" }' \ + /// 'https://connect.squareup.com/v2/disputes/{{DISPUTE_ID}}/evidence_file' + /// ``` + /// For more information, see [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + /// + /// Required parameter: ID of the dispute you want to upload evidence for. + /// Optional parameter: Defines parameters for a CreateDisputeEvidenceFile request. + /// Optional parameter: Example: + /// Returns the Models.CreateDisputeEvidenceFileResponse response from the API call + public Models.CreateDisputeEvidenceFileResponse CreateDisputeEvidenceFile(string disputeId, Models.CreateDisputeEvidenceFileRequest request = null, FileStreamInfo imageFile = null) + { + Task t = CreateDisputeEvidenceFileAsync(disputeId, request, imageFile); + ApiHelper.RunTaskSynchronously(t); + return t.Result; + } + + /// + /// Uploads a file to use as evidence in a dispute challenge. The endpoint accepts + /// HTTP multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, + /// and TIFF formats. The following is an example of such an HTTP request: + /// ``` + /// curl -X POST \ + /// -H 'Accept: application/json' \ + /// -H 'Authorization: Bearer {{ACCESS_TOKEN}}' \ + /// -H 'Content-Type: multipart/form-data' \ + /// -F 'evidence=@/path/to/file/filename.tiff' \ + /// -F 'request={ "idempotency_key":"{{UNIQUE_KEY}}", "evidence_type":"{{EVIDENCE_TYPE}}", "content_type":"image/tiff" }' \ + /// 'https://connect.squareup.com/v2/disputes/{{DISPUTE_ID}}/evidence_file' + /// ``` + /// For more information, see [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + /// + /// Required parameter: ID of the dispute you want to upload evidence for. + /// Optional parameter: Defines parameters for a CreateDisputeEvidenceFile request. + /// Optional parameter: Example: + /// Returns the Models.CreateDisputeEvidenceFileResponse response from the API call + public async Task CreateDisputeEvidenceFileAsync(string disputeId, Models.CreateDisputeEvidenceFileRequest request = null, FileStreamInfo imageFile = null, CancellationToken cancellationToken = default) + { + //the base uri for api requests + string _baseUri = config.GetBaseUri(); + + //prepare query string for API call + StringBuilder _queryBuilder = new StringBuilder(_baseUri); + _queryBuilder.Append("/v2/disputes/{dispute_id}/evidence_file"); + + //process optional template parameters + ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() + { + { "dispute_id", disputeId } + }); + + //validate and preprocess url + string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); + + //append request with appropriate headers and parameters + var _headers = new Dictionary() + { + { "user-agent", userAgent }, + { "accept", "application/json" }, + { "Square-Version", "2020-02-26" } + }; + + var requestHeaders = new Dictionary>(StringComparer.OrdinalIgnoreCase) + { + { "Content-Type", new [] { "application/json; charset=utf-8" } } + }; + + var imageFileHeaders = new Dictionary>(StringComparer.OrdinalIgnoreCase) + { + { "Content-Type", new [] { string.IsNullOrEmpty(imageFile.ContentType) ? "image/jpeg" : imageFile.ContentType } } + }; + + //append form/field parameters + var _fields = new List>() + { + new KeyValuePair( "image_file", CreateFileMultipartContent(imageFile, imageFileHeaders)) + }; + _fields.Add(new KeyValuePair("request", CreateJsonEncodedMultipartContent(request, requestHeaders))); + + //remove null parameters + _fields = _fields.Where(kvp => kvp.Value != null).ToList(); + + //prepare the API call request to fetch the response + HttpRequest _request = GetClientInstance().Post(_queryUrl, _headers, _fields); + if (HttpCallBack != null) + { + HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); + } + + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); + + //invoke request and get response + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); + HttpContext _context = new HttpContext(_request, _response); + if (HttpCallBack != null) + { + HttpCallBack.OnAfterHttpResponseEventHandler(GetClientInstance(), _response); + } + + //handle errors defined at the API level + base.ValidateResponse(_response, _context); + + var _responseModel = ApiHelper.JsonDeserialize(_response.Body); + _responseModel.Context = _context; + return _responseModel; + } + + /// + /// Uploads text to use as evidence for a dispute challenge. For more information, see + /// [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + /// + /// Required parameter: The ID of the dispute you want to upload evidence for. + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. + /// Returns the Models.CreateDisputeEvidenceTextResponse response from the API call + public Models.CreateDisputeEvidenceTextResponse CreateDisputeEvidenceText(string disputeId, Models.CreateDisputeEvidenceTextRequest body) + { + Task t = CreateDisputeEvidenceTextAsync(disputeId, body); + ApiHelper.RunTaskSynchronously(t); + return t.Result; + } + + /// + /// Uploads text to use as evidence for a dispute challenge. For more information, see + /// [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + /// + /// Required parameter: The ID of the dispute you want to upload evidence for. + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. + /// Returns the Models.CreateDisputeEvidenceTextResponse response from the API call + public async Task CreateDisputeEvidenceTextAsync(string disputeId, Models.CreateDisputeEvidenceTextRequest body, CancellationToken cancellationToken = default) + { + //the base uri for api requests + string _baseUri = config.GetBaseUri(); + + //prepare query string for API call + StringBuilder _queryBuilder = new StringBuilder(_baseUri); + _queryBuilder.Append("/v2/disputes/{dispute_id}/evidence_text"); + + //process optional template parameters + ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() + { + { "dispute_id", disputeId } + }); + + //validate and preprocess url + string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); + + //append request with appropriate headers and parameters + var _headers = new Dictionary() + { + { "user-agent", userAgent }, + { "accept", "application/json" }, + { "content-type", "application/json; charset=utf-8" }, + { "Square-Version", "2020-02-26" } + }; + + //append body params + var _body = ApiHelper.JsonSerialize(body); + + //prepare the API call request to fetch the response + HttpRequest _request = GetClientInstance().PostBody(_queryUrl, _headers, _body); + if (HttpCallBack != null) + { + HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); + } + + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); + + //invoke request and get response + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); + HttpContext _context = new HttpContext(_request, _response); + if (HttpCallBack != null) + { + HttpCallBack.OnAfterHttpResponseEventHandler(GetClientInstance(), _response); + } + + //handle errors defined at the API level + base.ValidateResponse(_response, _context); + + var _responseModel = ApiHelper.JsonDeserialize(_response.Body); + _responseModel.Context = _context; + return _responseModel; + } + + /// + /// Submits evidence to the cardholder's bank. + /// Before submitting evidence, Square compiles all available evidence. This includes + /// evidence uploaded using the + /// [CreateDisputeEvidenceFile](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-file) and + /// [CreateDisputeEvidenceText](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-text) endpoints, + /// and evidence automatically provided by Square, when + /// available. For more information, see + /// [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + /// + /// Required parameter: The ID of the dispute you want to submit evidence for. + /// Returns the Models.SubmitEvidenceResponse response from the API call + public Models.SubmitEvidenceResponse SubmitEvidence(string disputeId) + { + Task t = SubmitEvidenceAsync(disputeId); + ApiHelper.RunTaskSynchronously(t); + return t.Result; + } + + /// + /// Submits evidence to the cardholder's bank. + /// Before submitting evidence, Square compiles all available evidence. This includes + /// evidence uploaded using the + /// [CreateDisputeEvidenceFile](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-file) and + /// [CreateDisputeEvidenceText](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-text) endpoints, + /// and evidence automatically provided by Square, when + /// available. For more information, see + /// [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + /// + /// Required parameter: The ID of the dispute you want to submit evidence for. + /// Returns the Models.SubmitEvidenceResponse response from the API call + public async Task SubmitEvidenceAsync(string disputeId, CancellationToken cancellationToken = default) + { + //the base uri for api requests + string _baseUri = config.GetBaseUri(); + + //prepare query string for API call + StringBuilder _queryBuilder = new StringBuilder(_baseUri); + _queryBuilder.Append("/v2/disputes/{dispute_id}/submit-evidence"); + + //process optional template parameters + ApiHelper.AppendUrlWithTemplateParameters(_queryBuilder, new Dictionary() + { + { "dispute_id", disputeId } + }); + + //validate and preprocess url + string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); + + //append request with appropriate headers and parameters + var _headers = new Dictionary() + { + { "user-agent", userAgent }, + { "accept", "application/json" }, + { "Square-Version", "2020-02-26" } + }; + + //prepare the API call request to fetch the response + HttpRequest _request = GetClientInstance().Post(_queryUrl, _headers, null); + if (HttpCallBack != null) + { + HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); + } + + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); + + //invoke request and get response + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); + HttpContext _context = new HttpContext(_request, _response); + if (HttpCallBack != null) + { + HttpCallBack.OnAfterHttpResponseEventHandler(GetClientInstance(), _response); + } + + //handle errors defined at the API level + base.ValidateResponse(_response, _context); + + var _responseModel = ApiHelper.JsonDeserialize(_response.Body); + _responseModel.Context = _context; + return _responseModel; + } + + } +} \ No newline at end of file diff --git a/Square/Apis/EmployeesApi.cs b/Square/Apis/EmployeesApi.cs index 47466f7f..3ad8b18d 100644 --- a/Square/Apis/EmployeesApi.cs +++ b/Square/Apis/EmployeesApi.cs @@ -81,7 +81,7 @@ public Models.ListEmployeesResponse ListEmployees( { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -149,7 +149,7 @@ public Models.RetrieveEmployeeResponse RetrieveEmployee(string id) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response diff --git a/Square/Apis/IBankAccountsApi.cs b/Square/Apis/IBankAccountsApi.cs new file mode 100644 index 00000000..6ead0c46 --- /dev/null +++ b/Square/Apis/IBankAccountsApi.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Square; +using Square.Utilities; +using Square.Http.Request; +using Square.Http.Response; +using Square.Http.Client; + +namespace Square.Apis +{ + public interface IBankAccountsApi + { + /// + /// Returns a list of [BankAccount](#type-bankaccount) objects linked to a Square account. + /// For more information, see + /// [Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api). + /// + /// Optional parameter: The pagination cursor returned by a previous call to this endpoint. Use it in the next `ListBankAccounts` request to retrieve the next set of results. See the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information. + /// Optional parameter: Upper limit on the number of bank accounts to return in the response. Currently, 1000 is the largest supported limit. You can specify a limit of up to 1000 bank accounts. This is also the default limit. + /// Optional parameter: Location ID. You can specify this optional filter to retrieve only the linked bank accounts belonging to a specific location. + /// Returns the Models.ListBankAccountsResponse response from the API call + Models.ListBankAccountsResponse ListBankAccounts(string cursor = null, int? limit = null, string locationId = null); + + /// + /// Returns a list of [BankAccount](#type-bankaccount) objects linked to a Square account. + /// For more information, see + /// [Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api). + /// + /// Optional parameter: The pagination cursor returned by a previous call to this endpoint. Use it in the next `ListBankAccounts` request to retrieve the next set of results. See the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information. + /// Optional parameter: Upper limit on the number of bank accounts to return in the response. Currently, 1000 is the largest supported limit. You can specify a limit of up to 1000 bank accounts. This is also the default limit. + /// Optional parameter: Location ID. You can specify this optional filter to retrieve only the linked bank accounts belonging to a specific location. + /// Returns the Models.ListBankAccountsResponse response from the API call + Task ListBankAccountsAsync(string cursor = null, int? limit = null, string locationId = null, CancellationToken cancellationToken = default); + + /// + /// Returns details of a [BankAccount](#type-bankaccount) identified by V1 bank account ID. + /// For more information, see + /// [Retrieve a bank account by using an ID issued by V1 Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-the-v1-bank-accounts-api). + /// + /// Required parameter: Connect V1 ID of the desired `BankAccount`. For more information, see [Retrieve a bank account by using an ID issued by V1 Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-v1-bank-accounts-api). + /// Returns the Models.GetBankAccountByV1IdResponse response from the API call + Models.GetBankAccountByV1IdResponse GetBankAccountByV1Id(string v1BankAccountId); + + /// + /// Returns details of a [BankAccount](#type-bankaccount) identified by V1 bank account ID. + /// For more information, see + /// [Retrieve a bank account by using an ID issued by V1 Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-the-v1-bank-accounts-api). + /// + /// Required parameter: Connect V1 ID of the desired `BankAccount`. For more information, see [Retrieve a bank account by using an ID issued by V1 Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-v1-bank-accounts-api). + /// Returns the Models.GetBankAccountByV1IdResponse response from the API call + Task GetBankAccountByV1IdAsync(string v1BankAccountId, CancellationToken cancellationToken = default); + + /// + /// Returns details of a [BankAccount](#type-bankaccount) + /// linked to a Square account. For more information, see + /// [Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api). + /// + /// Required parameter: Square-issued ID of the desired `BankAccount`. + /// Returns the Models.GetBankAccountResponse response from the API call + Models.GetBankAccountResponse GetBankAccount(string bankAccountId); + + /// + /// Returns details of a [BankAccount](#type-bankaccount) + /// linked to a Square account. For more information, see + /// [Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api). + /// + /// Required parameter: Square-issued ID of the desired `BankAccount`. + /// Returns the Models.GetBankAccountResponse response from the API call + Task GetBankAccountAsync(string bankAccountId, CancellationToken cancellationToken = default); + + } +} \ No newline at end of file diff --git a/Square/Apis/IDisputesApi.cs b/Square/Apis/IDisputesApi.cs new file mode 100644 index 00000000..056aa971 --- /dev/null +++ b/Square/Apis/IDisputesApi.cs @@ -0,0 +1,226 @@ +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Square; +using Square.Utilities; +using Square.Http.Request; +using Square.Http.Response; +using Square.Http.Client; + +namespace Square.Apis +{ + public interface IDisputesApi + { + /// + /// Returns a list of disputes associated + /// with a particular account. + /// + /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see [Paginating](https://developer.squareup.com/docs/basics/api101/pagination). + /// Optional parameter: The dispute states to filter the result. If not specified, the endpoint returns all open disputes (dispute status is not `INQUIRY_CLOSED`, `WON`, or `LOST`). + /// Optional parameter: The ID of the location for which to return a list of disputes. If not specified, the endpoint returns all open disputes (dispute status is not `INQUIRY_CLOSED`, `WON`, or `LOST`) associated with all locations. + /// Returns the Models.ListDisputesResponse response from the API call + Models.ListDisputesResponse ListDisputes(string cursor = null, string states = null, string locationId = null); + + /// + /// Returns a list of disputes associated + /// with a particular account. + /// + /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see [Paginating](https://developer.squareup.com/docs/basics/api101/pagination). + /// Optional parameter: The dispute states to filter the result. If not specified, the endpoint returns all open disputes (dispute status is not `INQUIRY_CLOSED`, `WON`, or `LOST`). + /// Optional parameter: The ID of the location for which to return a list of disputes. If not specified, the endpoint returns all open disputes (dispute status is not `INQUIRY_CLOSED`, `WON`, or `LOST`) associated with all locations. + /// Returns the Models.ListDisputesResponse response from the API call + Task ListDisputesAsync(string cursor = null, string states = null, string locationId = null, CancellationToken cancellationToken = default); + + /// + /// Returns details of a specific dispute. + /// + /// Required parameter: The ID of the dispute you want more details about. + /// Returns the Models.RetrieveDisputeResponse response from the API call + Models.RetrieveDisputeResponse RetrieveDispute(string disputeId); + + /// + /// Returns details of a specific dispute. + /// + /// Required parameter: The ID of the dispute you want more details about. + /// Returns the Models.RetrieveDisputeResponse response from the API call + Task RetrieveDisputeAsync(string disputeId, CancellationToken cancellationToken = default); + + /// + /// Accepts loss on a dispute. Square returns + /// the disputed amount to the cardholder and updates the + /// dispute state to ACCEPTED. + /// Square debits the disputed amount from the seller’s Square + /// account. If the Square account balance does not have + /// sufficient funds, Square debits the associated bank account. + /// For an overview of the Disputes API, see [Overview](https://developer.squareup.com/docs/docs/disputes-api/overview). + /// + /// Required parameter: ID of the dispute you want to accept. + /// Returns the Models.AcceptDisputeResponse response from the API call + Models.AcceptDisputeResponse AcceptDispute(string disputeId); + + /// + /// Accepts loss on a dispute. Square returns + /// the disputed amount to the cardholder and updates the + /// dispute state to ACCEPTED. + /// Square debits the disputed amount from the seller’s Square + /// account. If the Square account balance does not have + /// sufficient funds, Square debits the associated bank account. + /// For an overview of the Disputes API, see [Overview](https://developer.squareup.com/docs/docs/disputes-api/overview). + /// + /// Required parameter: ID of the dispute you want to accept. + /// Returns the Models.AcceptDisputeResponse response from the API call + Task AcceptDisputeAsync(string disputeId, CancellationToken cancellationToken = default); + + /// + /// Returns a list of evidence associated with a dispute. + /// + /// Required parameter: The ID of the dispute. + /// Returns the Models.ListDisputeEvidenceResponse response from the API call + Models.ListDisputeEvidenceResponse ListDisputeEvidence(string disputeId); + + /// + /// Returns a list of evidence associated with a dispute. + /// + /// Required parameter: The ID of the dispute. + /// Returns the Models.ListDisputeEvidenceResponse response from the API call + Task ListDisputeEvidenceAsync(string disputeId, CancellationToken cancellationToken = default); + + /// + /// Removes specified evidence from a dispute. + /// Square does not send the bank any evidence that + /// is removed. Also, you cannot remove evidence after + /// submitting it to the bank using [SubmitEvidence](https://developer.squareup.com/docs/reference/square/disputes-api/submit-evidence). + /// + /// Required parameter: The ID of the dispute you want to remove evidence from. + /// Required parameter: The ID of the evidence you want to remove. + /// Returns the Models.RemoveDisputeEvidenceResponse response from the API call + Models.RemoveDisputeEvidenceResponse RemoveDisputeEvidence(string disputeId, string evidenceId); + + /// + /// Removes specified evidence from a dispute. + /// Square does not send the bank any evidence that + /// is removed. Also, you cannot remove evidence after + /// submitting it to the bank using [SubmitEvidence](https://developer.squareup.com/docs/reference/square/disputes-api/submit-evidence). + /// + /// Required parameter: The ID of the dispute you want to remove evidence from. + /// Required parameter: The ID of the evidence you want to remove. + /// Returns the Models.RemoveDisputeEvidenceResponse response from the API call + Task RemoveDisputeEvidenceAsync(string disputeId, string evidenceId, CancellationToken cancellationToken = default); + + /// + /// Returns the specific evidence metadata associated with a specific dispute. + /// You must maintain a copy of the evidence you upload if you want to + /// reference it later. You cannot download the evidence + /// after you upload it. + /// + /// Required parameter: The ID of the dispute that you want to retrieve evidence from. + /// Required parameter: The ID of the evidence to retrieve. + /// Returns the Models.RetrieveDisputeEvidenceResponse response from the API call + Models.RetrieveDisputeEvidenceResponse RetrieveDisputeEvidence(string disputeId, string evidenceId); + + /// + /// Returns the specific evidence metadata associated with a specific dispute. + /// You must maintain a copy of the evidence you upload if you want to + /// reference it later. You cannot download the evidence + /// after you upload it. + /// + /// Required parameter: The ID of the dispute that you want to retrieve evidence from. + /// Required parameter: The ID of the evidence to retrieve. + /// Returns the Models.RetrieveDisputeEvidenceResponse response from the API call + Task RetrieveDisputeEvidenceAsync(string disputeId, string evidenceId, CancellationToken cancellationToken = default); + + /// + /// Uploads a file to use as evidence in a dispute challenge. The endpoint accepts + /// HTTP multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, + /// and TIFF formats. The following is an example of such an HTTP request: + /// ``` + /// curl -X POST \ + /// -H 'Accept: application/json' \ + /// -H 'Authorization: Bearer {{ACCESS_TOKEN}}' \ + /// -H 'Content-Type: multipart/form-data' \ + /// -F 'evidence=@/path/to/file/filename.tiff' \ + /// -F 'request={ "idempotency_key":"{{UNIQUE_KEY}}", "evidence_type":"{{EVIDENCE_TYPE}}", "content_type":"image/tiff" }' \ + /// 'https://connect.squareup.com/v2/disputes/{{DISPUTE_ID}}/evidence_file' + /// ``` + /// For more information, see [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + /// + /// Required parameter: ID of the dispute you want to upload evidence for. + /// Optional parameter: Defines parameters for a CreateDisputeEvidenceFile request. + /// Optional parameter: Example: + /// Returns the Models.CreateDisputeEvidenceFileResponse response from the API call + Models.CreateDisputeEvidenceFileResponse CreateDisputeEvidenceFile(string disputeId, Models.CreateDisputeEvidenceFileRequest request = null, FileStreamInfo imageFile = null); + + /// + /// Uploads a file to use as evidence in a dispute challenge. The endpoint accepts + /// HTTP multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, + /// and TIFF formats. The following is an example of such an HTTP request: + /// ``` + /// curl -X POST \ + /// -H 'Accept: application/json' \ + /// -H 'Authorization: Bearer {{ACCESS_TOKEN}}' \ + /// -H 'Content-Type: multipart/form-data' \ + /// -F 'evidence=@/path/to/file/filename.tiff' \ + /// -F 'request={ "idempotency_key":"{{UNIQUE_KEY}}", "evidence_type":"{{EVIDENCE_TYPE}}", "content_type":"image/tiff" }' \ + /// 'https://connect.squareup.com/v2/disputes/{{DISPUTE_ID}}/evidence_file' + /// ``` + /// For more information, see [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + /// + /// Required parameter: ID of the dispute you want to upload evidence for. + /// Optional parameter: Defines parameters for a CreateDisputeEvidenceFile request. + /// Optional parameter: Example: + /// Returns the Models.CreateDisputeEvidenceFileResponse response from the API call + Task CreateDisputeEvidenceFileAsync(string disputeId, Models.CreateDisputeEvidenceFileRequest request = null, FileStreamInfo imageFile = null, CancellationToken cancellationToken = default); + + /// + /// Uploads text to use as evidence for a dispute challenge. For more information, see + /// [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + /// + /// Required parameter: The ID of the dispute you want to upload evidence for. + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. + /// Returns the Models.CreateDisputeEvidenceTextResponse response from the API call + Models.CreateDisputeEvidenceTextResponse CreateDisputeEvidenceText(string disputeId, Models.CreateDisputeEvidenceTextRequest body); + + /// + /// Uploads text to use as evidence for a dispute challenge. For more information, see + /// [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + /// + /// Required parameter: The ID of the dispute you want to upload evidence for. + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. + /// Returns the Models.CreateDisputeEvidenceTextResponse response from the API call + Task CreateDisputeEvidenceTextAsync(string disputeId, Models.CreateDisputeEvidenceTextRequest body, CancellationToken cancellationToken = default); + + /// + /// Submits evidence to the cardholder's bank. + /// Before submitting evidence, Square compiles all available evidence. This includes + /// evidence uploaded using the + /// [CreateDisputeEvidenceFile](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-file) and + /// [CreateDisputeEvidenceText](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-text) endpoints, + /// and evidence automatically provided by Square, when + /// available. For more information, see + /// [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + /// + /// Required parameter: The ID of the dispute you want to submit evidence for. + /// Returns the Models.SubmitEvidenceResponse response from the API call + Models.SubmitEvidenceResponse SubmitEvidence(string disputeId); + + /// + /// Submits evidence to the cardholder's bank. + /// Before submitting evidence, Square compiles all available evidence. This includes + /// evidence uploaded using the + /// [CreateDisputeEvidenceFile](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-file) and + /// [CreateDisputeEvidenceText](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-text) endpoints, + /// and evidence automatically provided by Square, when + /// available. For more information, see + /// [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + /// + /// Required parameter: The ID of the dispute you want to submit evidence for. + /// Returns the Models.SubmitEvidenceResponse response from the API call + Task SubmitEvidenceAsync(string disputeId, CancellationToken cancellationToken = default); + + } +} \ No newline at end of file diff --git a/Square/Apis/IPaymentsApi.cs b/Square/Apis/IPaymentsApi.cs index 53267fb1..4c5ebd88 100644 --- a/Square/Apis/IPaymentsApi.cs +++ b/Square/Apis/IPaymentsApi.cs @@ -24,7 +24,7 @@ public interface IPaymentsApi /// Optional parameter: Timestamp for the end of the requested reporting period, in RFC 3339 format. Default: The current time. /// Optional parameter: The order in which results are listed. - `ASC` - oldest to newest - `DESC` - newest to oldest (default). /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. - /// Optional parameter: ID of location associated with payment + /// Optional parameter: Limit results to the location supplied. By default, results are returned for all locations associated with the merchant. /// Optional parameter: The exact amount in the total_money for a `Payment`. /// Optional parameter: The last 4 digits of `Payment` card. /// Optional parameter: The brand of `Payment` card. For example, `VISA` @@ -47,7 +47,7 @@ Models.ListPaymentsResponse ListPayments( /// Optional parameter: Timestamp for the end of the requested reporting period, in RFC 3339 format. Default: The current time. /// Optional parameter: The order in which results are listed. - `ASC` - oldest to newest - `DESC` - newest to oldest (default). /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. - /// Optional parameter: ID of location associated with payment + /// Optional parameter: Limit results to the location supplied. By default, results are returned for all locations associated with the merchant. /// Optional parameter: The exact amount in the total_money for a `Payment`. /// Optional parameter: The last 4 digits of `Payment` card. /// Optional parameter: The brand of `Payment` card. For example, `VISA` @@ -97,14 +97,14 @@ Models.ListPaymentsResponse ListPayments( Task CreatePaymentAsync(Models.CreatePaymentRequest body, CancellationToken cancellationToken = default); /// - /// Cancels (voids) a payment identified by the idempotency key that is specified in the request. - /// Use this method when status of a CreatePayment request is unknown. - /// For example, after you send a CreatePayment - /// request a network error occurs and you don't get a response. In this case, you can direct - /// Square to cancel the payment using this endpoint. In the request, you provide the same idempotency - /// key that you provided in your CreatePayment request you want to cancel. After cancelling the - /// payment, you can submit your CreatePayment request again. - /// Note that if no payment with the specified idempotency key is found, no action is taken, the end + /// Cancels (voids) a payment identified by the idempotency key that is specified in the + /// request. + /// Use this method when status of a CreatePayment request is unknown. For example, after you send a + /// CreatePayment request a network error occurs and you don't get a response. In this case, you can + /// direct Square to cancel the payment using this endpoint. In the request, you provide the same + /// idempotency key that you provided in your CreatePayment request you want to cancel. After + /// cancelling the payment, you can submit your CreatePayment request again. + /// Note that if no payment with the specified idempotency key is found, no action is taken, the end /// point returns successfully. /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -112,14 +112,14 @@ Models.ListPaymentsResponse ListPayments( Models.CancelPaymentByIdempotencyKeyResponse CancelPaymentByIdempotencyKey(Models.CancelPaymentByIdempotencyKeyRequest body); /// - /// Cancels (voids) a payment identified by the idempotency key that is specified in the request. - /// Use this method when status of a CreatePayment request is unknown. - /// For example, after you send a CreatePayment - /// request a network error occurs and you don't get a response. In this case, you can direct - /// Square to cancel the payment using this endpoint. In the request, you provide the same idempotency - /// key that you provided in your CreatePayment request you want to cancel. After cancelling the - /// payment, you can submit your CreatePayment request again. - /// Note that if no payment with the specified idempotency key is found, no action is taken, the end + /// Cancels (voids) a payment identified by the idempotency key that is specified in the + /// request. + /// Use this method when status of a CreatePayment request is unknown. For example, after you send a + /// CreatePayment request a network error occurs and you don't get a response. In this case, you can + /// direct Square to cancel the payment using this endpoint. In the request, you provide the same + /// idempotency key that you provided in your CreatePayment request you want to cancel. After + /// cancelling the payment, you can submit your CreatePayment request again. + /// Note that if no payment with the specified idempotency key is found, no action is taken, the end /// point returns successfully. /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. diff --git a/Square/Apis/ITransactionsApi.cs b/Square/Apis/ITransactionsApi.cs index 767a253b..cf23aa1e 100644 --- a/Square/Apis/ITransactionsApi.cs +++ b/Square/Apis/ITransactionsApi.cs @@ -19,6 +19,11 @@ public interface ITransactionsApi /// /// Lists refunds for one of a business's locations. /// Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// In addition to full or partial tender refunds processed through Square APIs, /// refunds may result from itemized returns or exchanges through Square's /// Point of Sale applications. @@ -43,6 +48,11 @@ Models.ListRefundsResponse ListRefunds( /// /// Lists refunds for one of a business's locations. /// Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// In addition to full or partial tender refunds processed through Square APIs, /// refunds may result from itemized returns or exchanges through Square's /// Point of Sale applications. @@ -67,6 +77,11 @@ Models.ListRefundsResponse ListRefunds( /// /// Lists transactions for a particular location. /// Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// Transactions include payment information from sales and exchanges and refund /// information from returns and exchanges. /// Max results per [page](#paginatingresults): 50 @@ -88,6 +103,11 @@ Models.ListTransactionsResponse ListTransactions( /// /// Lists transactions for a particular location. /// Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// Transactions include payment information from sales and exchanges and refund /// information from returns and exchanges. /// Max results per [page](#paginatingresults): 50 @@ -109,6 +129,11 @@ Models.ListTransactionsResponse ListTransactions( /// /// Charges a card represented by a card nonce or a customer's card on file. /// Deprecated - recommend using [CreatePayment](#endpoint-payments-createpayment) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// Your request to this endpoint must include _either_: /// - A value for the `card_nonce` parameter (to charge a card nonce generated /// with the `SqPaymentForm`) @@ -133,6 +158,11 @@ Models.ListTransactionsResponse ListTransactions( /// /// Charges a card represented by a card nonce or a customer's card on file. /// Deprecated - recommend using [CreatePayment](#endpoint-payments-createpayment) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// Your request to this endpoint must include _either_: /// - A value for the `card_nonce` parameter (to charge a card nonce generated /// with the `SqPaymentForm`) @@ -157,6 +187,11 @@ Models.ListTransactionsResponse ListTransactions( /// /// Retrieves details for a single transaction. /// Deprecated - recommend using [BatchRetrieveOrders](#endpoint-batchretrieveorders) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// /// Required parameter: The ID of the transaction's associated location. /// Required parameter: The ID of the transaction to retrieve. @@ -167,6 +202,11 @@ Models.ListTransactionsResponse ListTransactions( /// /// Retrieves details for a single transaction. /// Deprecated - recommend using [BatchRetrieveOrders](#endpoint-batchretrieveorders) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// /// Required parameter: The ID of the transaction's associated location. /// Required parameter: The ID of the transaction to retrieve. @@ -177,6 +217,11 @@ Models.ListTransactionsResponse ListTransactions( /// /// Captures a transaction that was created with the [Charge](#endpoint-charge) /// endpoint with a `delay_capture` value of `true`. + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) /// for more information. /// @@ -189,6 +234,11 @@ Models.ListTransactionsResponse ListTransactions( /// /// Captures a transaction that was created with the [Charge](#endpoint-charge) /// endpoint with a `delay_capture` value of `true`. + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) /// for more information. /// @@ -201,6 +251,11 @@ Models.ListTransactionsResponse ListTransactions( /// /// Initiates a refund for a previously charged tender. /// Deprecated - recommend using [RefundPayment](#endpoint-refunds-refundpayment) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// You must issue a refund within 120 days of the associated payment. See /// [this article](https://squareup.com/help/us/en/article/5060) for more information /// on refund behavior. @@ -218,6 +273,11 @@ Models.ListTransactionsResponse ListTransactions( /// /// Initiates a refund for a previously charged tender. /// Deprecated - recommend using [RefundPayment](#endpoint-refunds-refundpayment) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// You must issue a refund within 120 days of the associated payment. See /// [this article](https://squareup.com/help/us/en/article/5060) for more information /// on refund behavior. @@ -235,6 +295,11 @@ Models.ListTransactionsResponse ListTransactions( /// /// Cancels a transaction that was created with the [Charge](#endpoint-charge) /// endpoint with a `delay_capture` value of `true`. + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) /// for more information. /// @@ -247,6 +312,11 @@ Models.ListTransactionsResponse ListTransactions( /// /// Cancels a transaction that was created with the [Charge](#endpoint-charge) /// endpoint with a `delay_capture` value of `true`. + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) /// for more information. /// diff --git a/Square/Apis/IV1EmployeesApi.cs b/Square/Apis/IV1EmployeesApi.cs index 3bd75016..aebed097 100644 --- a/Square/Apis/IV1EmployeesApi.cs +++ b/Square/Apis/IV1EmployeesApi.cs @@ -206,6 +206,11 @@ public interface IV1EmployeesApi /// /// Provides summary information for all of a business's employee timecards. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// /// Optional parameter: The order in which timecards are listed in the response, based on their created_at field. /// Optional parameter: If provided, the endpoint returns only timecards for the employee with the specified ID. @@ -219,6 +224,7 @@ public interface IV1EmployeesApi /// Optional parameter: The maximum integer number of employee entities to return in a single response. Default 100, maximum 200. /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint. /// Returns the List response from the API call + [Obsolete] List ListTimecards( string order = null, string employeeId = null, @@ -234,6 +240,11 @@ public interface IV1EmployeesApi /// /// Provides summary information for all of a business's employee timecards. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// /// Optional parameter: The order in which timecards are listed in the response, based on their created_at field. /// Optional parameter: If provided, the endpoint returns only timecards for the employee with the specified ID. @@ -247,6 +258,7 @@ public interface IV1EmployeesApi /// Optional parameter: The maximum integer number of employee entities to return in a single response. Default 100, maximum 200. /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint. /// Returns the List response from the API call + [Obsolete] Task> ListTimecardsAsync( string order = null, string employeeId = null, @@ -263,7 +275,13 @@ public interface IV1EmployeesApi /// /// Creates a timecard for an employee and clocks them in with an /// `API_CREATE` event and a `clockin_time` set to the current time unless - /// the request provides a different value. To import timecards from another + /// the request provides a different value. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- + /// To import timecards from another /// system (rather than clocking someone in). Specify the `clockin_time` /// and* `clockout_time` in the request. /// Timecards correspond to exactly one shift for a given employee, bounded @@ -274,12 +292,19 @@ public interface IV1EmployeesApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Timecard response from the API call + [Obsolete] Models.V1Timecard CreateTimecard(Models.V1Timecard body); /// /// Creates a timecard for an employee and clocks them in with an /// `API_CREATE` event and a `clockin_time` set to the current time unless - /// the request provides a different value. To import timecards from another + /// the request provides a different value. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- + /// To import timecards from another /// system (rather than clocking someone in). Specify the `clockin_time` /// and* `clockout_time` in the request. /// Timecards correspond to exactly one shift for a given employee, bounded @@ -290,6 +315,7 @@ public interface IV1EmployeesApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Timecard response from the API call + [Obsolete] Task CreateTimecardAsync(Models.V1Timecard body, CancellationToken cancellationToken = default); /// @@ -297,6 +323,11 @@ public interface IV1EmployeesApi /// Square Dashboard. Deleted timecards are still accessible through /// Connect API endpoints, but cannot be modified. The `deleted` field of /// the `Timecard` object indicates whether the timecard has been deleted. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// *Note**: By default, deleted timecards appear alongside valid timecards in /// results returned by the [ListTimecards](#endpoint-v1employees-listtimecards) /// endpoint. To filter deleted timecards, include the `deleted` query @@ -309,6 +340,7 @@ public interface IV1EmployeesApi /// /// Required parameter: The ID of the timecard to delete. /// Returns the object response from the API call + [Obsolete] object DeleteTimecard(string timecardId); /// @@ -316,6 +348,11 @@ public interface IV1EmployeesApi /// Square Dashboard. Deleted timecards are still accessible through /// Connect API endpoints, but cannot be modified. The `deleted` field of /// the `Timecard` object indicates whether the timecard has been deleted. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// *Note**: By default, deleted timecards appear alongside valid timecards in /// results returned by the [ListTimecards](#endpoint-v1employees-listtimecards) /// endpoint. To filter deleted timecards, include the `deleted` query @@ -328,10 +365,16 @@ public interface IV1EmployeesApi /// /// Required parameter: The ID of the timecard to delete. /// Returns the object response from the API call + [Obsolete] Task DeleteTimecardAsync(string timecardId, CancellationToken cancellationToken = default); /// /// Provides the details for a single timecard. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// /// Required parameter: The timecard's ID. /// Returns the Models.V1Timecard response from the API call + [Obsolete] Models.V1Timecard RetrieveTimecard(string timecardId); /// /// Provides the details for a single timecard. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// /// Required parameter: The timecard's ID. /// Returns the Models.V1Timecard response from the API call + [Obsolete] Task RetrieveTimecardAsync(string timecardId, CancellationToken cancellationToken = default); /// /// Modifies the details of a timecard with an `API_EDIT` event for /// the timecard. Updating an active timecard with a `clockout_time` /// clocks the employee out. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// /// Required parameter: TThe ID of the timecard to modify. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Timecard response from the API call + [Obsolete] Models.V1Timecard UpdateTimecard(string timecardId, Models.V1Timecard body); /// /// Modifies the details of a timecard with an `API_EDIT` event for /// the timecard. Updating an active timecard with a `clockout_time` /// clocks the employee out. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// /// Required parameter: TThe ID of the timecard to modify. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Timecard response from the API call + [Obsolete] Task UpdateTimecardAsync(string timecardId, Models.V1Timecard body, CancellationToken cancellationToken = default); /// /// Provides summary information for all events associated with a /// particular timecard. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// /// Required parameter: The ID of the timecard to list events for. /// Returns the List response from the API call + [Obsolete] List ListTimecardEvents(string timecardId); /// /// Provides summary information for all events associated with a /// particular timecard. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// /// Required parameter: The ID of the timecard to list events for. /// Returns the List response from the API call + [Obsolete] Task> ListTimecardEventsAsync(string timecardId, CancellationToken cancellationToken = default); /// /// Provides the details for all of a location's cash drawer shifts during a date range. The date range you specify cannot exceed 90 days. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-cashdrawershifts) + /// --- /// /// Required parameter: The ID of the location to list cash drawer shifts for. /// Optional parameter: The order in which cash drawer shifts are listed in the response, based on their created_at field. Default value: ASC /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time minus 90 days. /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time. /// Returns the List response from the API call + [Obsolete] List ListCashDrawerShifts( string locationId, string order = null, @@ -416,12 +496,18 @@ public interface IV1EmployeesApi /// /// Provides the details for all of a location's cash drawer shifts during a date range. The date range you specify cannot exceed 90 days. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-cashdrawershifts) + /// --- /// /// Required parameter: The ID of the location to list cash drawer shifts for. /// Optional parameter: The order in which cash drawer shifts are listed in the response, based on their created_at field. Default value: ASC /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time minus 90 days. /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time. /// Returns the List response from the API call + [Obsolete] Task> ListCashDrawerShiftsAsync( string locationId, string order = null, @@ -430,18 +516,30 @@ public interface IV1EmployeesApi /// /// Provides the details for a single cash drawer shift, including all events that occurred during the shift. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-cashdrawershifts) + /// --- /// /// Required parameter: The ID of the location to list cash drawer shifts for. /// Required parameter: The shift's ID. /// Returns the Models.V1CashDrawerShift response from the API call + [Obsolete] Models.V1CashDrawerShift RetrieveCashDrawerShift(string locationId, string shiftId); /// /// Provides the details for a single cash drawer shift, including all events that occurred during the shift. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-cashdrawershifts) + /// --- /// /// Required parameter: The ID of the location to list cash drawer shifts for. /// Required parameter: The shift's ID. /// Returns the Models.V1CashDrawerShift response from the API call + [Obsolete] Task RetrieveCashDrawerShiftAsync(string locationId, string shiftId, CancellationToken cancellationToken = default); } diff --git a/Square/Apis/IV1TransactionsApi.cs b/Square/Apis/IV1TransactionsApi.cs index eb00ea3d..15ad36f6 100644 --- a/Square/Apis/IV1TransactionsApi.cs +++ b/Square/Apis/IV1TransactionsApi.cs @@ -18,32 +18,56 @@ public interface IV1TransactionsApi { /// /// Provides non-confidential details for all of a location's associated bank accounts. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-bankaccounts) + /// --- /// /// Required parameter: The ID of the location to list bank accounts for. /// Returns the List response from the API call + [Obsolete] List ListBankAccounts(string locationId); /// /// Provides non-confidential details for all of a location's associated bank accounts. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-bankaccounts) + /// --- /// /// Required parameter: The ID of the location to list bank accounts for. /// Returns the List response from the API call + [Obsolete] Task> ListBankAccountsAsync(string locationId, CancellationToken cancellationToken = default); /// /// Provides non-confidential details for a merchant's associated bank account. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-bankaccounts) + /// --- /// /// Required parameter: The ID of the bank account's associated location. /// Required parameter: The bank account's Square-issued ID. You obtain this value from Settlement objects returned. /// Returns the Models.V1BankAccount response from the API call + [Obsolete] Models.V1BankAccount RetrieveBankAccount(string locationId, string bankAccountId); /// /// Provides non-confidential details for a merchant's associated bank account. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-bankaccounts) + /// --- /// /// Required parameter: The ID of the bank account's associated location. /// Required parameter: The bank account's Square-issued ID. You obtain this value from Settlement objects returned. /// Returns the Models.V1BankAccount response from the API call + [Obsolete] Task RetrieveBankAccountAsync(string locationId, string bankAccountId, CancellationToken cancellationToken = default); /// diff --git a/Square/Apis/InventoryApi.cs b/Square/Apis/InventoryApi.cs index e469b2d7..fc11120a 100644 --- a/Square/Apis/InventoryApi.cs +++ b/Square/Apis/InventoryApi.cs @@ -66,7 +66,7 @@ public Models.RetrieveInventoryAdjustmentResponse RetrieveInventoryAdjustment(st { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -135,7 +135,7 @@ public Models.BatchChangeInventoryResponse BatchChangeInventory(Models.BatchChan { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -211,7 +211,7 @@ public Models.BatchRetrieveInventoryChangesResponse BatchRetrieveInventoryChange { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -293,7 +293,7 @@ public Models.BatchRetrieveInventoryCountsResponse BatchRetrieveInventoryCounts( { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -366,7 +366,7 @@ public Models.RetrieveInventoryPhysicalCountResponse RetrieveInventoryPhysicalCo { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -451,7 +451,7 @@ public Models.RetrieveInventoryCountResponse RetrieveInventoryCount(string catal { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -544,7 +544,7 @@ public Models.RetrieveInventoryChangesResponse RetrieveInventoryChanges(string c { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response diff --git a/Square/Apis/LaborApi.cs b/Square/Apis/LaborApi.cs index 3a784b59..94ad023c 100644 --- a/Square/Apis/LaborApi.cs +++ b/Square/Apis/LaborApi.cs @@ -70,7 +70,7 @@ public Models.ListBreakTypesResponse ListBreakTypes(string locationId = null, in { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -153,7 +153,7 @@ public Models.CreateBreakTypeResponse CreateBreakType(Models.CreateBreakTypeRequ { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -226,7 +226,7 @@ public Models.DeleteBreakTypeResponse DeleteBreakType(string id) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -294,7 +294,7 @@ public Models.GetBreakTypeResponse GetBreakType(string id) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -365,7 +365,7 @@ public Models.UpdateBreakTypeResponse UpdateBreakType(string id, Models.UpdateBr { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -442,7 +442,7 @@ public Models.ListEmployeeWagesResponse ListEmployeeWages(string employeeId = nu { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -510,7 +510,7 @@ public Models.GetEmployeeWageResponse GetEmployeeWage(string id) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -601,7 +601,7 @@ public Models.CreateShiftResponse CreateShift(Models.CreateShiftRequest body) { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -691,7 +691,7 @@ public Models.SearchShiftsResponse SearchShifts(Models.SearchShiftsRequest body) { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -762,7 +762,7 @@ public Models.DeleteShiftResponse DeleteShift(string id) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -830,7 +830,7 @@ public Models.GetShiftResponse GetShift(string id) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -909,7 +909,7 @@ public Models.UpdateShiftResponse UpdateShift(string id, Models.UpdateShiftReque { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -983,7 +983,7 @@ public Models.ListWorkweekConfigsResponse ListWorkweekConfigs(int? limit = null, { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -1054,7 +1054,7 @@ public Models.UpdateWorkweekConfigResponse UpdateWorkweekConfig(string id, Model { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params diff --git a/Square/Apis/LocationsApi.cs b/Square/Apis/LocationsApi.cs index d5e574ef..8307a4ef 100644 --- a/Square/Apis/LocationsApi.cs +++ b/Square/Apis/LocationsApi.cs @@ -62,7 +62,7 @@ public Models.ListLocationsResponse ListLocations() { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -127,7 +127,7 @@ public Models.CreateLocationResponse CreateLocation(Models.CreateLocationRequest { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -198,7 +198,7 @@ public Models.RetrieveLocationResponse RetrieveLocation(string locationId) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -269,7 +269,7 @@ public Models.UpdateLocationResponse UpdateLocation(string locationId, Models.Up { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params diff --git a/Square/Apis/MerchantsApi.cs b/Square/Apis/MerchantsApi.cs index c021c82e..7c92f585 100644 --- a/Square/Apis/MerchantsApi.cs +++ b/Square/Apis/MerchantsApi.cs @@ -74,7 +74,7 @@ public Models.ListMerchantsResponse ListMerchants(int? cursor = null) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -142,7 +142,7 @@ public Models.RetrieveMerchantResponse RetrieveMerchant(string merchantId) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response diff --git a/Square/Apis/MobileAuthorizationApi.cs b/Square/Apis/MobileAuthorizationApi.cs index 557feae8..a3767922 100644 --- a/Square/Apis/MobileAuthorizationApi.cs +++ b/Square/Apis/MobileAuthorizationApi.cs @@ -73,7 +73,7 @@ public Models.CreateMobileAuthorizationCodeResponse CreateMobileAuthorizationCod { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params diff --git a/Square/Apis/OAuthApi.cs b/Square/Apis/OAuthApi.cs index 4a418a6f..e22e1bd2 100644 --- a/Square/Apis/OAuthApi.cs +++ b/Square/Apis/OAuthApi.cs @@ -98,7 +98,7 @@ public Models.RenewTokenResponse RenewToken(string clientId, Models.RenewTokenRe { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, { "Authorization", authorization }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -187,7 +187,7 @@ public Models.RevokeTokenResponse RevokeToken(Models.RevokeTokenRequest body, st { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, { "Authorization", authorization }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -269,7 +269,7 @@ public Models.ObtainTokenResponse ObtainToken(Models.ObtainTokenRequest body) { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params diff --git a/Square/Apis/OrdersApi.cs b/Square/Apis/OrdersApi.cs index 629dae81..745be137 100644 --- a/Square/Apis/OrdersApi.cs +++ b/Square/Apis/OrdersApi.cs @@ -79,7 +79,7 @@ public Models.CreateOrderResponse CreateOrder(string locationId, Models.CreateOr { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -155,7 +155,7 @@ public Models.BatchRetrieveOrdersResponse BatchRetrieveOrders(string locationId, { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -256,7 +256,7 @@ public Models.UpdateOrderResponse UpdateOrder(string locationId, string orderId, { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -348,7 +348,7 @@ public Models.SearchOrdersResponse SearchOrders(Models.SearchOrdersRequest body) { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -444,7 +444,7 @@ public Models.PayOrderResponse PayOrder(string orderId, Models.PayOrderRequest b { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params diff --git a/Square/Apis/PaymentsApi.cs b/Square/Apis/PaymentsApi.cs index 63391e02..e037e487 100644 --- a/Square/Apis/PaymentsApi.cs +++ b/Square/Apis/PaymentsApi.cs @@ -32,7 +32,7 @@ internal PaymentsApi(IConfiguration config, IHttpClient httpClient, IDictionary< /// Optional parameter: Timestamp for the end of the requested reporting period, in RFC 3339 format. Default: The current time. /// Optional parameter: The order in which results are listed. - `ASC` - oldest to newest - `DESC` - newest to oldest (default). /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. - /// Optional parameter: ID of location associated with payment + /// Optional parameter: Limit results to the location supplied. By default, results are returned for all locations associated with the merchant. /// Optional parameter: The exact amount in the total_money for a `Payment`. /// Optional parameter: The last 4 digits of `Payment` card. /// Optional parameter: The brand of `Payment` card. For example, `VISA` @@ -60,7 +60,7 @@ public Models.ListPaymentsResponse ListPayments( /// Optional parameter: Timestamp for the end of the requested reporting period, in RFC 3339 format. Default: The current time. /// Optional parameter: The order in which results are listed. - `ASC` - oldest to newest - `DESC` - newest to oldest (default). /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. - /// Optional parameter: ID of location associated with payment + /// Optional parameter: Limit results to the location supplied. By default, results are returned for all locations associated with the merchant. /// Optional parameter: The exact amount in the total_money for a `Payment`. /// Optional parameter: The last 4 digits of `Payment` card. /// Optional parameter: The brand of `Payment` card. For example, `VISA` @@ -103,7 +103,7 @@ public Models.ListPaymentsResponse ListPayments( { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -186,7 +186,7 @@ public Models.CreatePaymentResponse CreatePayment(Models.CreatePaymentRequest bo { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -218,14 +218,14 @@ public Models.CreatePaymentResponse CreatePayment(Models.CreatePaymentRequest bo } /// - /// Cancels (voids) a payment identified by the idempotency key that is specified in the request. - /// Use this method when status of a CreatePayment request is unknown. - /// For example, after you send a CreatePayment - /// request a network error occurs and you don't get a response. In this case, you can direct - /// Square to cancel the payment using this endpoint. In the request, you provide the same idempotency - /// key that you provided in your CreatePayment request you want to cancel. After cancelling the - /// payment, you can submit your CreatePayment request again. - /// Note that if no payment with the specified idempotency key is found, no action is taken, the end + /// Cancels (voids) a payment identified by the idempotency key that is specified in the + /// request. + /// Use this method when status of a CreatePayment request is unknown. For example, after you send a + /// CreatePayment request a network error occurs and you don't get a response. In this case, you can + /// direct Square to cancel the payment using this endpoint. In the request, you provide the same + /// idempotency key that you provided in your CreatePayment request you want to cancel. After + /// cancelling the payment, you can submit your CreatePayment request again. + /// Note that if no payment with the specified idempotency key is found, no action is taken, the end /// point returns successfully. /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -238,14 +238,14 @@ public Models.CancelPaymentByIdempotencyKeyResponse CancelPaymentByIdempotencyKe } /// - /// Cancels (voids) a payment identified by the idempotency key that is specified in the request. - /// Use this method when status of a CreatePayment request is unknown. - /// For example, after you send a CreatePayment - /// request a network error occurs and you don't get a response. In this case, you can direct - /// Square to cancel the payment using this endpoint. In the request, you provide the same idempotency - /// key that you provided in your CreatePayment request you want to cancel. After cancelling the - /// payment, you can submit your CreatePayment request again. - /// Note that if no payment with the specified idempotency key is found, no action is taken, the end + /// Cancels (voids) a payment identified by the idempotency key that is specified in the + /// request. + /// Use this method when status of a CreatePayment request is unknown. For example, after you send a + /// CreatePayment request a network error occurs and you don't get a response. In this case, you can + /// direct Square to cancel the payment using this endpoint. In the request, you provide the same + /// idempotency key that you provided in your CreatePayment request you want to cancel. After + /// cancelling the payment, you can submit your CreatePayment request again. + /// Note that if no payment with the specified idempotency key is found, no action is taken, the end /// point returns successfully. /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -268,7 +268,7 @@ public Models.CancelPaymentByIdempotencyKeyResponse CancelPaymentByIdempotencyKe { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -339,7 +339,7 @@ public Models.GetPaymentResponse GetPayment(string paymentId) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -411,7 +411,7 @@ public Models.CancelPaymentResponse CancelPayment(string paymentId) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -487,7 +487,7 @@ public Models.CompletePaymentResponse CompletePayment(string paymentId) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response diff --git a/Square/Apis/RefundsApi.cs b/Square/Apis/RefundsApi.cs index dfb206c2..7ecab2b0 100644 --- a/Square/Apis/RefundsApi.cs +++ b/Square/Apis/RefundsApi.cs @@ -98,7 +98,7 @@ public Models.ListPaymentRefundsResponse ListPaymentRefunds( { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -165,7 +165,7 @@ public Models.RefundPaymentResponse RefundPayment(Models.RefundPaymentRequest bo { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -236,7 +236,7 @@ public Models.GetPaymentRefundResponse GetPaymentRefund(string refundId) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response diff --git a/Square/Apis/ReportingApi.cs b/Square/Apis/ReportingApi.cs index bf1de0fd..b28885b8 100644 --- a/Square/Apis/ReportingApi.cs +++ b/Square/Apis/ReportingApi.cs @@ -97,7 +97,7 @@ public Models.ListAdditionalRecipientReceivableRefundsResponse ListAdditionalRec { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -198,7 +198,7 @@ public Models.ListAdditionalRecipientReceivablesResponse ListAdditionalRecipient { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response diff --git a/Square/Apis/TransactionsApi.cs b/Square/Apis/TransactionsApi.cs index 97043a62..2f0fcdd4 100644 --- a/Square/Apis/TransactionsApi.cs +++ b/Square/Apis/TransactionsApi.cs @@ -27,6 +27,11 @@ internal TransactionsApi(IConfiguration config, IHttpClient httpClient, IDiction /// /// Lists refunds for one of a business's locations. /// Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// In addition to full or partial tender refunds processed through Square APIs, /// refunds may result from itemized returns or exchanges through Square's /// Point of Sale applications. @@ -56,6 +61,11 @@ public Models.ListRefundsResponse ListRefunds( /// /// Lists refunds for one of a business's locations. /// Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// In addition to full or partial tender refunds processed through Square APIs, /// refunds may result from itemized returns or exchanges through Square's /// Point of Sale applications. @@ -107,7 +117,7 @@ public Models.ListRefundsResponse ListRefunds( { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -138,6 +148,11 @@ public Models.ListRefundsResponse ListRefunds( /// /// Lists transactions for a particular location. /// Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// Transactions include payment information from sales and exchanges and refund /// information from returns and exchanges. /// Max results per [page](#paginatingresults): 50 @@ -164,6 +179,11 @@ public Models.ListTransactionsResponse ListTransactions( /// /// Lists transactions for a particular location. /// Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// Transactions include payment information from sales and exchanges and refund /// information from returns and exchanges. /// Max results per [page](#paginatingresults): 50 @@ -212,7 +232,7 @@ public Models.ListTransactionsResponse ListTransactions( { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -243,6 +263,11 @@ public Models.ListTransactionsResponse ListTransactions( /// /// Charges a card represented by a card nonce or a customer's card on file. /// Deprecated - recommend using [CreatePayment](#endpoint-payments-createpayment) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// Your request to this endpoint must include _either_: /// - A value for the `card_nonce` parameter (to charge a card nonce generated /// with the `SqPaymentForm`) @@ -272,6 +297,11 @@ public Models.ChargeResponse Charge(string locationId, Models.ChargeRequest body /// /// Charges a card represented by a card nonce or a customer's card on file. /// Deprecated - recommend using [CreatePayment](#endpoint-payments-createpayment) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// Your request to this endpoint must include _either_: /// - A value for the `card_nonce` parameter (to charge a card nonce generated /// with the `SqPaymentForm`) @@ -315,7 +345,7 @@ public Models.ChargeResponse Charge(string locationId, Models.ChargeRequest body { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -349,6 +379,11 @@ public Models.ChargeResponse Charge(string locationId, Models.ChargeRequest body /// /// Retrieves details for a single transaction. /// Deprecated - recommend using [BatchRetrieveOrders](#endpoint-batchretrieveorders) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// /// Required parameter: The ID of the transaction's associated location. /// Required parameter: The ID of the transaction to retrieve. @@ -364,6 +399,11 @@ public Models.RetrieveTransactionResponse RetrieveTransaction(string locationId, /// /// Retrieves details for a single transaction. /// Deprecated - recommend using [BatchRetrieveOrders](#endpoint-batchretrieveorders) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// /// Required parameter: The ID of the transaction's associated location. /// Required parameter: The ID of the transaction to retrieve. @@ -393,7 +433,7 @@ public Models.RetrieveTransactionResponse RetrieveTransaction(string locationId, { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -424,6 +464,11 @@ public Models.RetrieveTransactionResponse RetrieveTransaction(string locationId, /// /// Captures a transaction that was created with the [Charge](#endpoint-charge) /// endpoint with a `delay_capture` value of `true`. + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) /// for more information. /// @@ -441,6 +486,11 @@ public Models.CaptureTransactionResponse CaptureTransaction(string locationId, s /// /// Captures a transaction that was created with the [Charge](#endpoint-charge) /// endpoint with a `delay_capture` value of `true`. + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) /// for more information. /// @@ -472,7 +522,7 @@ public Models.CaptureTransactionResponse CaptureTransaction(string locationId, s { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -503,6 +553,11 @@ public Models.CaptureTransactionResponse CaptureTransaction(string locationId, s /// /// Initiates a refund for a previously charged tender. /// Deprecated - recommend using [RefundPayment](#endpoint-refunds-refundpayment) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// You must issue a refund within 120 days of the associated payment. See /// [this article](https://squareup.com/help/us/en/article/5060) for more information /// on refund behavior. @@ -525,6 +580,11 @@ public Models.CreateRefundResponse CreateRefund(string locationId, string transa /// /// Initiates a refund for a previously charged tender. /// Deprecated - recommend using [RefundPayment](#endpoint-refunds-refundpayment) + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// You must issue a refund within 120 days of the associated payment. See /// [this article](https://squareup.com/help/us/en/article/5060) for more information /// on refund behavior. @@ -562,7 +622,7 @@ public Models.CreateRefundResponse CreateRefund(string locationId, string transa { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -596,6 +656,11 @@ public Models.CreateRefundResponse CreateRefund(string locationId, string transa /// /// Cancels a transaction that was created with the [Charge](#endpoint-charge) /// endpoint with a `delay_capture` value of `true`. + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) /// for more information. /// @@ -613,6 +678,11 @@ public Models.VoidTransactionResponse VoidTransaction(string locationId, string /// /// Cancels a transaction that was created with the [Charge](#endpoint-charge) /// endpoint with a `delay_capture` value of `true`. + /// --- + /// - __Deprecation date__: 2019-08-15 + /// - [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2021-09-01 + /// - [Migration guide](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api) + /// --- /// See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) /// for more information. /// @@ -644,7 +714,7 @@ public Models.VoidTransactionResponse VoidTransaction(string locationId, string { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response diff --git a/Square/Apis/V1EmployeesApi.cs b/Square/Apis/V1EmployeesApi.cs index 91a2d5ce..e091e69a 100644 --- a/Square/Apis/V1EmployeesApi.cs +++ b/Square/Apis/V1EmployeesApi.cs @@ -106,7 +106,7 @@ internal V1EmployeesApi(IConfiguration config, IHttpClient httpClient, IDictiona { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -129,7 +129,9 @@ internal V1EmployeesApi(IConfiguration config, IHttpClient httpClient, IDictiona //handle errors defined at the API level base.ValidateResponse(_response, _context); - return ApiHelper.JsonDeserialize>(_response.Body); + var _responseModels = ApiHelper.JsonDeserialize>(_response.Body); + _responseModels.ForEach(r => r.Context = _context); + return _responseModels; } /// @@ -183,7 +185,7 @@ public Models.V1Employee CreateEmployee(Models.V1Employee body) { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -254,7 +256,7 @@ public Models.V1Employee RetrieveEmployee(string employeeId) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -325,7 +327,7 @@ public Models.V1Employee UpdateEmployee(string employeeId, Models.V1Employee bod { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -402,7 +404,7 @@ public Models.V1Employee UpdateEmployee(string employeeId, Models.V1Employee bod { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -425,7 +427,9 @@ public Models.V1Employee UpdateEmployee(string employeeId, Models.V1Employee bod //handle errors defined at the API level base.ValidateResponse(_response, _context); - return ApiHelper.JsonDeserialize>(_response.Body); + var _responseModels = ApiHelper.JsonDeserialize>(_response.Body); + _responseModels.ForEach(r => r.Context = _context); + return _responseModels; } /// @@ -481,7 +485,7 @@ public Models.V1EmployeeRole CreateEmployeeRole(Models.V1EmployeeRole body) { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -552,7 +556,7 @@ public Models.V1EmployeeRole RetrieveEmployeeRole(string roleId) { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -623,7 +627,7 @@ public Models.V1EmployeeRole UpdateEmployeeRole(string roleId, Models.V1Employee { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -656,6 +660,11 @@ public Models.V1EmployeeRole UpdateEmployeeRole(string roleId, Models.V1Employee /// /// Provides summary information for all of a business's employee timecards. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// /// Optional parameter: The order in which timecards are listed in the response, based on their created_at field. /// Optional parameter: If provided, the endpoint returns only timecards for the employee with the specified ID. @@ -669,6 +678,7 @@ public Models.V1EmployeeRole UpdateEmployeeRole(string roleId, Models.V1Employee /// Optional parameter: The maximum integer number of employee entities to return in a single response. Default 100, maximum 200. /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint. /// Returns the List response from the API call + [Obsolete] public List ListTimecards( string order = null, string employeeId = null, @@ -689,6 +699,11 @@ public Models.V1EmployeeRole UpdateEmployeeRole(string roleId, Models.V1Employee /// /// Provides summary information for all of a business's employee timecards. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// /// Optional parameter: The order in which timecards are listed in the response, based on their created_at field. /// Optional parameter: If provided, the endpoint returns only timecards for the employee with the specified ID. @@ -702,6 +717,7 @@ public Models.V1EmployeeRole UpdateEmployeeRole(string roleId, Models.V1Employee /// Optional parameter: The maximum integer number of employee entities to return in a single response. Default 100, maximum 200. /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint. /// Returns the List response from the API call + [Obsolete] public async Task> ListTimecardsAsync( string order = null, string employeeId = null, @@ -746,7 +762,7 @@ public Models.V1EmployeeRole UpdateEmployeeRole(string roleId, Models.V1Employee { { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -769,13 +785,21 @@ public Models.V1EmployeeRole UpdateEmployeeRole(string roleId, Models.V1Employee //handle errors defined at the API level base.ValidateResponse(_response, _context); - return ApiHelper.JsonDeserialize>(_response.Body); + var _responseModels = ApiHelper.JsonDeserialize>(_response.Body); + _responseModels.ForEach(r => r.Context = _context); + return _responseModels; } /// /// Creates a timecard for an employee and clocks them in with an /// `API_CREATE` event and a `clockin_time` set to the current time unless - /// the request provides a different value. To import timecards from another + /// the request provides a different value. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- + /// To import timecards from another /// system (rather than clocking someone in). Specify the `clockin_time` /// and* `clockout_time` in the request. /// Timecards correspond to exactly one shift for a given employee, bounded @@ -786,6 +810,7 @@ public Models.V1EmployeeRole UpdateEmployeeRole(string roleId, Models.V1Employee /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Timecard response from the API call + [Obsolete] public Models.V1Timecard CreateTimecard(Models.V1Timecard body) { Task t = CreateTimecardAsync(body); @@ -796,7 +821,13 @@ public Models.V1Timecard CreateTimecard(Models.V1Timecard body) /// /// Creates a timecard for an employee and clocks them in with an /// `API_CREATE` event and a `clockin_time` set to the current time unless - /// the request provides a different value. To import timecards from another + /// the request provides a different value. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- + /// To import timecards from another /// system (rather than clocking someone in). Specify the `clockin_time` /// and* `clockout_time` in the request. /// Timecards correspond to exactly one shift for a given employee, bounded @@ -807,6 +838,7 @@ public Models.V1Timecard CreateTimecard(Models.V1Timecard body) /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Timecard response from the API call + [Obsolete] public async Task CreateTimecardAsync(Models.V1Timecard body, CancellationToken cancellationToken = default) { //the base uri for api requests @@ -825,7 +857,7 @@ public Models.V1Timecard CreateTimecard(Models.V1Timecard body) { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //append body params @@ -861,6 +893,11 @@ public Models.V1Timecard CreateTimecard(Models.V1Timecard body) /// Square Dashboard. Deleted timecards are still accessible through /// Connect API endpoints, but cannot be modified. The `deleted` field of /// the `Timecard` object indicates whether the timecard has been deleted. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// *Note**: By default, deleted timecards appear alongside valid timecards in /// results returned by the [ListTimecards](#endpoint-v1employees-listtimecards) /// endpoint. To filter deleted timecards, include the `deleted` query @@ -873,6 +910,7 @@ public Models.V1Timecard CreateTimecard(Models.V1Timecard body) /// /// Required parameter: The ID of the timecard to delete. /// Returns the object response from the API call + [Obsolete] public object DeleteTimecard(string timecardId) { Task t = DeleteTimecardAsync(timecardId); @@ -885,6 +923,11 @@ public object DeleteTimecard(string timecardId) /// Square Dashboard. Deleted timecards are still accessible through /// Connect API endpoints, but cannot be modified. The `deleted` field of /// the `Timecard` object indicates whether the timecard has been deleted. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- /// *Note**: By default, deleted timecards appear alongside valid timecards in /// results returned by the [ListTimecards](#endpoint-v1employees-listtimecards) /// endpoint. To filter deleted timecards, include the `deleted` query @@ -897,6 +940,7 @@ public object DeleteTimecard(string timecardId) /// /// Required parameter: The ID of the timecard to delete. /// Returns the object response from the API call + [Obsolete] public async Task DeleteTimecardAsync(string timecardId, CancellationToken cancellationToken = default) { //the base uri for api requests @@ -919,7 +963,7 @@ public async Task DeleteTimecardAsync(string timecardId, CancellationTok var _headers = new Dictionary() { { "user-agent", userAgent }, - { "Square-Version", "2020-01-22" } + { "Square-Version", "2020-02-26" } }; //prepare the API call request to fetch the response @@ -947,6 +991,11 @@ public async Task DeleteTimecardAsync(string timecardId, CancellationTok /// /// Provides the details for a single timecard. + /// --- + /// - __Deprecation date__: 2020-02-26 + /// - [__Retirement date__](https://developer.squareup.com/docs/docs/build-basics/api-lifecycle#deprecated): 2021-02-26 + /// - [Migration guide](https://developer.squareup.com/docs/docs/migrate-from-v1/guides/v1-timecards) + /// --- ///