diff --git a/Square.Tests/ApiTestBase.cs b/Square.Tests/ApiTestBase.cs index 68e745ef..8025dd7d 100644 --- a/Square.Tests/ApiTestBase.cs +++ b/Square.Tests/ApiTestBase.cs @@ -8,6 +8,7 @@ namespace Square using APIMatic.Core.Types; using NUnit.Framework; using Square; + using Square.Authentication; using Square.Http.Client; using Square.Models; diff --git a/Square.Tests/LocationsApiTest.cs b/Square.Tests/LocationsApiTest.cs index ed60673f..4273872d 100644 --- a/Square.Tests/LocationsApiTest.cs +++ b/Square.Tests/LocationsApiTest.cs @@ -37,7 +37,7 @@ public void SetUpDerived() /// /// Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api), - ///including those with an inactive status.. + ///including those with an inactive status. Locations are listed alphabetically by `name`.. /// /// A representing the asynchronous unit test. [Test] diff --git a/Square.Tests/SanityTest.cs b/Square.Tests/SanityTest.cs index 90c2408f..9c950e6a 100644 --- a/Square.Tests/SanityTest.cs +++ b/Square.Tests/SanityTest.cs @@ -1,5 +1,6 @@ using NUnit.Framework; using Square.Apis; +using Square.Authentication; using Square.Exceptions; using Square.Models; using System.IO; @@ -105,7 +106,11 @@ public void TestV2APIException() { SquareClient badClient = new SquareClient.Builder() .Environment(Environment.Sandbox) - .AccessToken("BAD_TOKEN") + .BearerAuthCredentials( + new BearerAuthModel.Builder( + "BAD_TOKEN" + ) + .Build()) .Build(); var api = badClient.LocationsApi; diff --git a/Square.sln b/Square.sln index 807c39a7..9397cc34 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", "{2f34cfc6-74b5-4071-8a47-71cd5d4160f9}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square", "Square/Square.csproj", "{25811638-c862-4541-80cc-d11218e1dc99}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Tests", "Square.Tests/Square.Tests.csproj", "{f4516c3c-2edf-467d-bcef-37b0aa7a34e5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Tests", "Square.Tests/Square.Tests.csproj", "{2cdb1d52-711c-4821-90fe-c981c624bdcb}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -12,14 +12,14 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2f34cfc6-74b5-4071-8a47-71cd5d4160f9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2f34cfc6-74b5-4071-8a47-71cd5d4160f9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2f34cfc6-74b5-4071-8a47-71cd5d4160f9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2f34cfc6-74b5-4071-8a47-71cd5d4160f9}.Release|Any CPU.Build.0 = Release|Any CPU - {f4516c3c-2edf-467d-bcef-37b0aa7a34e5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {f4516c3c-2edf-467d-bcef-37b0aa7a34e5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {f4516c3c-2edf-467d-bcef-37b0aa7a34e5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {f4516c3c-2edf-467d-bcef-37b0aa7a34e5}.Release|Any CPU.Build.0 = Release|Any CPU + {25811638-c862-4541-80cc-d11218e1dc99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {25811638-c862-4541-80cc-d11218e1dc99}.Debug|Any CPU.Build.0 = Debug|Any CPU + {25811638-c862-4541-80cc-d11218e1dc99}.Release|Any CPU.ActiveCfg = Release|Any CPU + {25811638-c862-4541-80cc-d11218e1dc99}.Release|Any CPU.Build.0 = Release|Any CPU + {2cdb1d52-711c-4821-90fe-c981c624bdcb}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2cdb1d52-711c-4821-90fe-c981c624bdcb}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2cdb1d52-711c-4821-90fe-c981c624bdcb}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2cdb1d52-711c-4821-90fe-c981c624bdcb}.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 73adace8..fa6a9464 100644 --- a/Square/Apis/ApplePayApi.cs +++ b/Square/Apis/ApplePayApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/BankAccountsApi.cs b/Square/Apis/BankAccountsApi.cs index 3fb2b822..3d22cbc4 100644 --- a/Square/Apis/BankAccountsApi.cs +++ b/Square/Apis/BankAccountsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/BaseApi.cs b/Square/Apis/BaseApi.cs index 8f104b0d..972bfa22 100644 --- a/Square/Apis/BaseApi.cs +++ b/Square/Apis/BaseApi.cs @@ -18,7 +18,7 @@ internal class BaseApi private readonly GlobalConfiguration globalConfiguration; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// internal BaseApi(GlobalConfiguration config) => globalConfiguration = config; diff --git a/Square/Apis/BookingCustomAttributesApi.cs b/Square/Apis/BookingCustomAttributesApi.cs index b9a86eba..9daeb5d0 100644 --- a/Square/Apis/BookingCustomAttributesApi.cs +++ b/Square/Apis/BookingCustomAttributesApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/BookingsApi.cs b/Square/Apis/BookingsApi.cs index f5bc8106..bf993ef8 100644 --- a/Square/Apis/BookingsApi.cs +++ b/Square/Apis/BookingsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/CardsApi.cs b/Square/Apis/CardsApi.cs index 33b01f57..4fba5bb9 100644 --- a/Square/Apis/CardsApi.cs +++ b/Square/Apis/CardsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/CashDrawersApi.cs b/Square/Apis/CashDrawersApi.cs index d5767f60..8baedb8f 100644 --- a/Square/Apis/CashDrawersApi.cs +++ b/Square/Apis/CashDrawersApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/CatalogApi.cs b/Square/Apis/CatalogApi.cs index 84065fd4..4503a81f 100644 --- a/Square/Apis/CatalogApi.cs +++ b/Square/Apis/CatalogApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/CheckoutApi.cs b/Square/Apis/CheckoutApi.cs index f9dadbe5..b8ee632a 100644 --- a/Square/Apis/CheckoutApi.cs +++ b/Square/Apis/CheckoutApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; @@ -189,7 +188,7 @@ public Models.UpdateMerchantSettingsResponse UpdateMerchantSettings( /// /// Lists all payment links. /// - /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for the original query. If a cursor is not provided, the endpoint returns the first page of the results. For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination).. + /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for the original query. If a cursor is not provided, the endpoint returns the first page of the results. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).. /// Optional parameter: A limit on the number of results to return per page. The limit is advisory and the implementation might return more or less results. If the supplied limit is negative, zero, or greater than the maximum limit of 1000, it is ignored. Default value: `100`. /// Returns the Models.ListPaymentLinksResponse response from the API call. public Models.ListPaymentLinksResponse ListPaymentLinks( @@ -200,7 +199,7 @@ public Models.ListPaymentLinksResponse ListPaymentLinks( /// /// Lists all payment links. /// - /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for the original query. If a cursor is not provided, the endpoint returns the first page of the results. For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination).. + /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for the original query. If a cursor is not provided, the endpoint returns the first page of the results. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).. /// Optional parameter: A limit on the number of results to return per page. The limit is advisory and the implementation might return more or less results. If the supplied limit is negative, zero, or greater than the maximum limit of 1000, it is ignored. Default value: `100`. /// cancellationToken. /// Returns the Models.ListPaymentLinksResponse response from the API call. diff --git a/Square/Apis/CustomerCustomAttributesApi.cs b/Square/Apis/CustomerCustomAttributesApi.cs index b4a8e2b8..6ef7c535 100644 --- a/Square/Apis/CustomerCustomAttributesApi.cs +++ b/Square/Apis/CustomerCustomAttributesApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/CustomerGroupsApi.cs b/Square/Apis/CustomerGroupsApi.cs index 42fb533d..2440de47 100644 --- a/Square/Apis/CustomerGroupsApi.cs +++ b/Square/Apis/CustomerGroupsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/CustomerSegmentsApi.cs b/Square/Apis/CustomerSegmentsApi.cs index 1abb1857..46c959bb 100644 --- a/Square/Apis/CustomerSegmentsApi.cs +++ b/Square/Apis/CustomerSegmentsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/CustomersApi.cs b/Square/Apis/CustomersApi.cs index e5fef855..b0166cd7 100644 --- a/Square/Apis/CustomersApi.cs +++ b/Square/Apis/CustomersApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; @@ -127,6 +126,144 @@ public Models.CreateCustomerResponse CreateCustomer( .ContextAdder((_result, _context) => _result.ContextSetter(_context))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// + /// Creates multiple [customer profiles]($m/Customer) for a business. + /// This endpoint takes a map of individual create requests and returns a map of responses. + /// You must provide at least one of the following values in each create request:. + /// - `given_name`. + /// - `family_name`. + /// - `company_name`. + /// - `email_address`. + /// - `phone_number`. + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// Returns the Models.BulkCreateCustomersResponse response from the API call. + public Models.BulkCreateCustomersResponse BulkCreateCustomers( + Models.BulkCreateCustomersRequest body) + => CoreHelper.RunTask(BulkCreateCustomersAsync(body)); + + /// + /// Creates multiple [customer profiles]($m/Customer) for a business. + /// This endpoint takes a map of individual create requests and returns a map of responses. + /// You must provide at least one of the following values in each create request:. + /// - `given_name`. + /// - `family_name`. + /// - `company_name`. + /// - `email_address`. + /// - `phone_number`. + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// cancellationToken. + /// Returns the Models.BulkCreateCustomersResponse response from the API call. + public async Task BulkCreateCustomersAsync( + Models.BulkCreateCustomersRequest body, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Post, "/v2/customers/bulk-create") + .WithAuth("global") + .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(body)) + .Header(_header => _header.Setup("Content-Type", "application/json")))) + .ResponseHandler(_responseHandler => _responseHandler + .ContextAdder((_result, _context) => _result.ContextSetter(_context))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Deletes multiple customer profiles. + /// The endpoint takes a list of customer IDs and returns a map of responses. + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// Returns the Models.BulkDeleteCustomersResponse response from the API call. + public Models.BulkDeleteCustomersResponse BulkDeleteCustomers( + Models.BulkDeleteCustomersRequest body) + => CoreHelper.RunTask(BulkDeleteCustomersAsync(body)); + + /// + /// Deletes multiple customer profiles. + /// The endpoint takes a list of customer IDs and returns a map of responses. + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// cancellationToken. + /// Returns the Models.BulkDeleteCustomersResponse response from the API call. + public async Task BulkDeleteCustomersAsync( + Models.BulkDeleteCustomersRequest body, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Post, "/v2/customers/bulk-delete") + .WithAuth("global") + .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(body)) + .Header(_header => _header.Setup("Content-Type", "application/json")))) + .ResponseHandler(_responseHandler => _responseHandler + .ContextAdder((_result, _context) => _result.ContextSetter(_context))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Retrieves multiple customer profiles. + /// This endpoint takes a list of customer IDs and returns a map of responses. + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// Returns the Models.BulkRetrieveCustomersResponse response from the API call. + public Models.BulkRetrieveCustomersResponse BulkRetrieveCustomers( + Models.BulkRetrieveCustomersRequest body) + => CoreHelper.RunTask(BulkRetrieveCustomersAsync(body)); + + /// + /// Retrieves multiple customer profiles. + /// This endpoint takes a list of customer IDs and returns a map of responses. + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// cancellationToken. + /// Returns the Models.BulkRetrieveCustomersResponse response from the API call. + public async Task BulkRetrieveCustomersAsync( + Models.BulkRetrieveCustomersRequest body, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Post, "/v2/customers/bulk-retrieve") + .WithAuth("global") + .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(body)) + .Header(_header => _header.Setup("Content-Type", "application/json")))) + .ResponseHandler(_responseHandler => _responseHandler + .ContextAdder((_result, _context) => _result.ContextSetter(_context))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + + /// + /// Updates multiple customer profiles. + /// This endpoint takes a map of individual update requests and returns a map of responses. + /// You cannot use this endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// Returns the Models.BulkUpdateCustomersResponse response from the API call. + public Models.BulkUpdateCustomersResponse BulkUpdateCustomers( + Models.BulkUpdateCustomersRequest body) + => CoreHelper.RunTask(BulkUpdateCustomersAsync(body)); + + /// + /// Updates multiple customer profiles. + /// This endpoint takes a map of individual update requests and returns a map of responses. + /// You cannot use this endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// cancellationToken. + /// Returns the Models.BulkUpdateCustomersResponse response from the API call. + public async Task BulkUpdateCustomersAsync( + Models.BulkUpdateCustomersRequest body, + CancellationToken cancellationToken = default) + => await CreateApiCall() + .RequestBuilder(_requestBuilder => _requestBuilder + .Setup(HttpMethod.Post, "/v2/customers/bulk-update") + .WithAuth("global") + .Parameters(_parameters => _parameters + .Body(_bodyParameter => _bodyParameter.Setup(body)) + .Header(_header => _header.Setup("Content-Type", "application/json")))) + .ResponseHandler(_responseHandler => _responseHandler + .ContextAdder((_result, _context) => _result.ContextSetter(_context))) + .ExecuteAsync(cancellationToken).ConfigureAwait(false); + /// /// Searches the customer profiles associated with a Square account using one or more supported query filters. /// Calling `SearchCustomers` without any explicit query filter returns all. @@ -170,8 +307,6 @@ public Models.SearchCustomersResponse SearchCustomers( /// /// Deletes a customer profile from a business. This operation also unlinks any associated cards on file. - /// As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. - /// If included, the value must be set to the current version of the customer profile. /// To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. /// /// Required parameter: The ID of the customer to delete.. @@ -184,8 +319,6 @@ public Models.DeleteCustomerResponse DeleteCustomer( /// /// Deletes a customer profile from a business. This operation also unlinks any associated cards on file. - /// As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. - /// If included, the value must be set to the current version of the customer profile. /// To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. /// /// Required parameter: The ID of the customer to delete.. @@ -238,9 +371,6 @@ public Models.RetrieveCustomerResponse RetrieveCustomer( /// /// Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request. /// To add or update a field, specify the new value. To remove a field, specify `null`. - /// (recommended) or specify an empty string (string fields only). - /// As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. - /// If included, the value must be set to the current version of the customer profile. /// To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. /// You cannot use this endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). /// @@ -255,9 +385,6 @@ public Models.UpdateCustomerResponse UpdateCustomer( /// /// Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request. /// To add or update a field, specify the new value. To remove a field, specify `null`. - /// (recommended) or specify an empty string (string fields only). - /// As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. - /// If included, the value must be set to the current version of the customer profile. /// To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. /// You cannot use this endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). /// diff --git a/Square/Apis/DevicesApi.cs b/Square/Apis/DevicesApi.cs index 266e30bf..8a40a0a8 100644 --- a/Square/Apis/DevicesApi.cs +++ b/Square/Apis/DevicesApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/DisputesApi.cs b/Square/Apis/DisputesApi.cs index 4259e7ba..1709f082 100644 --- a/Square/Apis/DisputesApi.cs +++ b/Square/Apis/DisputesApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/EmployeesApi.cs b/Square/Apis/EmployeesApi.cs index 6387442a..51693779 100644 --- a/Square/Apis/EmployeesApi.cs +++ b/Square/Apis/EmployeesApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/GiftCardActivitiesApi.cs b/Square/Apis/GiftCardActivitiesApi.cs index c38ca722..d3d80f07 100644 --- a/Square/Apis/GiftCardActivitiesApi.cs +++ b/Square/Apis/GiftCardActivitiesApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/GiftCardsApi.cs b/Square/Apis/GiftCardsApi.cs index 0a482c49..33d0704b 100644 --- a/Square/Apis/GiftCardsApi.cs +++ b/Square/Apis/GiftCardsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/ICheckoutApi.cs b/Square/Apis/ICheckoutApi.cs index 68047fff..eaab7000 100644 --- a/Square/Apis/ICheckoutApi.cs +++ b/Square/Apis/ICheckoutApi.cs @@ -125,7 +125,7 @@ Models.UpdateMerchantSettingsResponse UpdateMerchantSettings( /// /// Lists all payment links. /// - /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for the original query. If a cursor is not provided, the endpoint returns the first page of the results. For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination).. + /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for the original query. If a cursor is not provided, the endpoint returns the first page of the results. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).. /// Optional parameter: A limit on the number of results to return per page. The limit is advisory and the implementation might return more or less results. If the supplied limit is negative, zero, or greater than the maximum limit of 1000, it is ignored. Default value: `100`. /// Returns the Models.ListPaymentLinksResponse response from the API call. Models.ListPaymentLinksResponse ListPaymentLinks( @@ -135,7 +135,7 @@ Models.ListPaymentLinksResponse ListPaymentLinks( /// /// Lists all payment links. /// - /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for the original query. If a cursor is not provided, the endpoint returns the first page of the results. For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination).. + /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for the original query. If a cursor is not provided, the endpoint returns the first page of the results. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).. /// Optional parameter: A limit on the number of results to return per page. The limit is advisory and the implementation might return more or less results. If the supplied limit is negative, zero, or greater than the maximum limit of 1000, it is ignored. Default value: `100`. /// cancellationToken. /// Returns the Models.ListPaymentLinksResponse response from the API call. diff --git a/Square/Apis/ICustomersApi.cs b/Square/Apis/ICustomersApi.cs index cdaea68f..9bbd88cc 100644 --- a/Square/Apis/ICustomersApi.cs +++ b/Square/Apis/ICustomersApi.cs @@ -91,6 +91,100 @@ Models.CreateCustomerResponse CreateCustomer( Models.CreateCustomerRequest body, CancellationToken cancellationToken = default); + /// + /// Creates multiple [customer profiles]($m/Customer) for a business. + /// This endpoint takes a map of individual create requests and returns a map of responses. + /// You must provide at least one of the following values in each create request:. + /// - `given_name`. + /// - `family_name`. + /// - `company_name`. + /// - `email_address`. + /// - `phone_number`. + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// Returns the Models.BulkCreateCustomersResponse response from the API call. + Models.BulkCreateCustomersResponse BulkCreateCustomers( + Models.BulkCreateCustomersRequest body); + + /// + /// Creates multiple [customer profiles]($m/Customer) for a business. + /// This endpoint takes a map of individual create requests and returns a map of responses. + /// You must provide at least one of the following values in each create request:. + /// - `given_name`. + /// - `family_name`. + /// - `company_name`. + /// - `email_address`. + /// - `phone_number`. + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// cancellationToken. + /// Returns the Models.BulkCreateCustomersResponse response from the API call. + Task BulkCreateCustomersAsync( + Models.BulkCreateCustomersRequest body, + CancellationToken cancellationToken = default); + + /// + /// Deletes multiple customer profiles. + /// The endpoint takes a list of customer IDs and returns a map of responses. + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// Returns the Models.BulkDeleteCustomersResponse response from the API call. + Models.BulkDeleteCustomersResponse BulkDeleteCustomers( + Models.BulkDeleteCustomersRequest body); + + /// + /// Deletes multiple customer profiles. + /// The endpoint takes a list of customer IDs and returns a map of responses. + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// cancellationToken. + /// Returns the Models.BulkDeleteCustomersResponse response from the API call. + Task BulkDeleteCustomersAsync( + Models.BulkDeleteCustomersRequest body, + CancellationToken cancellationToken = default); + + /// + /// Retrieves multiple customer profiles. + /// This endpoint takes a list of customer IDs and returns a map of responses. + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// Returns the Models.BulkRetrieveCustomersResponse response from the API call. + Models.BulkRetrieveCustomersResponse BulkRetrieveCustomers( + Models.BulkRetrieveCustomersRequest body); + + /// + /// Retrieves multiple customer profiles. + /// This endpoint takes a list of customer IDs and returns a map of responses. + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// cancellationToken. + /// Returns the Models.BulkRetrieveCustomersResponse response from the API call. + Task BulkRetrieveCustomersAsync( + Models.BulkRetrieveCustomersRequest body, + CancellationToken cancellationToken = default); + + /// + /// Updates multiple customer profiles. + /// This endpoint takes a map of individual update requests and returns a map of responses. + /// You cannot use this endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// Returns the Models.BulkUpdateCustomersResponse response from the API call. + Models.BulkUpdateCustomersResponse BulkUpdateCustomers( + Models.BulkUpdateCustomersRequest body); + + /// + /// Updates multiple customer profiles. + /// This endpoint takes a map of individual update requests and returns a map of responses. + /// You cannot use this endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). + /// + /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. + /// cancellationToken. + /// Returns the Models.BulkUpdateCustomersResponse response from the API call. + Task BulkUpdateCustomersAsync( + Models.BulkUpdateCustomersRequest body, + CancellationToken cancellationToken = default); + /// /// Searches the customer profiles associated with a Square account using one or more supported query filters. /// Calling `SearchCustomers` without any explicit query filter returns all. @@ -123,8 +217,6 @@ Models.SearchCustomersResponse SearchCustomers( /// /// Deletes a customer profile from a business. This operation also unlinks any associated cards on file. - /// As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. - /// If included, the value must be set to the current version of the customer profile. /// To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. /// /// Required parameter: The ID of the customer to delete.. @@ -136,8 +228,6 @@ Models.DeleteCustomerResponse DeleteCustomer( /// /// Deletes a customer profile from a business. This operation also unlinks any associated cards on file. - /// As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. - /// If included, the value must be set to the current version of the customer profile. /// To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. /// /// Required parameter: The ID of the customer to delete.. @@ -170,9 +260,6 @@ Models.RetrieveCustomerResponse RetrieveCustomer( /// /// Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request. /// To add or update a field, specify the new value. To remove a field, specify `null`. - /// (recommended) or specify an empty string (string fields only). - /// As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. - /// If included, the value must be set to the current version of the customer profile. /// To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. /// You cannot use this endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). /// @@ -186,9 +273,6 @@ Models.UpdateCustomerResponse UpdateCustomer( /// /// Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request. /// To add or update a field, specify the new value. To remove a field, specify `null`. - /// (recommended) or specify an empty string (string fields only). - /// As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. - /// If included, the value must be set to the current version of the customer profile. /// To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. /// You cannot use this endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). /// diff --git a/Square/Apis/IInvoicesApi.cs b/Square/Apis/IInvoicesApi.cs index fbf330d8..60482ca8 100644 --- a/Square/Apis/IInvoicesApi.cs +++ b/Square/Apis/IInvoicesApi.cs @@ -265,8 +265,10 @@ Models.CancelInvoiceResponse CancelInvoice( /// nothing. Square also makes the invoice available on a Square-hosted invoice page. . /// The invoice `status` also changes from `DRAFT` to a status . /// based on the invoice configuration. For example, the status changes to `UNPAID` if . - /// Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion of the . + /// Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the . /// invoice amount. + /// In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ`. + /// and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments. /// /// Required parameter: The ID of the invoice to publish.. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. @@ -283,8 +285,10 @@ Models.PublishInvoiceResponse PublishInvoice( /// nothing. Square also makes the invoice available on a Square-hosted invoice page. . /// The invoice `status` also changes from `DRAFT` to a status . /// based on the invoice configuration. For example, the status changes to `UNPAID` if . - /// Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion of the . + /// Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the . /// invoice amount. + /// In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ`. + /// and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments. /// /// Required parameter: The ID of the invoice to publish.. /// 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/ILocationsApi.cs b/Square/Apis/ILocationsApi.cs index 9c98b957..0dec71a4 100644 --- a/Square/Apis/ILocationsApi.cs +++ b/Square/Apis/ILocationsApi.cs @@ -21,14 +21,14 @@ public interface ILocationsApi { /// /// Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api),. - /// including those with an inactive status. + /// including those with an inactive status. Locations are listed alphabetically by `name`. /// /// Returns the Models.ListLocationsResponse response from the API call. Models.ListLocationsResponse ListLocations(); /// /// Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api),. - /// including those with an inactive status. + /// including those with an inactive status. Locations are listed alphabetically by `name`. /// /// cancellationToken. /// Returns the Models.ListLocationsResponse response from the API call. diff --git a/Square/Apis/IV1TransactionsApi.cs b/Square/Apis/IV1TransactionsApi.cs index 86368a7d..58525dba 100644 --- a/Square/Apis/IV1TransactionsApi.cs +++ b/Square/Apis/IV1TransactionsApi.cs @@ -26,7 +26,7 @@ public interface IV1TransactionsApi /// Optional parameter: The order in which payments are listed in the response.. /// Optional parameter: The maximum number of payments to return in a single response. This value cannot exceed 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. + /// response from the API call.]]> [Obsolete] List V1ListOrders( string locationId, @@ -42,7 +42,7 @@ public interface IV1TransactionsApi /// Optional parameter: The maximum number of payments to return in a single response. This value cannot exceed 200.. /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint.. /// cancellationToken. - /// Returns the List response from the API call. + /// response from the API call.]]> [Obsolete] Task> V1ListOrdersAsync( string locationId, @@ -102,275 +102,5 @@ Models.V1Order V1UpdateOrder( string orderId, Models.V1UpdateOrderRequest body, CancellationToken cancellationToken = default); - - /// - /// Provides summary information for all payments taken for a given. - /// Square account during a date range. Date ranges cannot exceed 1 year in. - /// length. See Date ranges for details of inclusive and exclusive dates. - /// *Note**: Details for payments processed with Square Point of Sale while. - /// in offline mode may not be transmitted to Square for up to 72 hours. - /// Offline payments have a `created_at` value that reflects the time the. - /// payment was originally processed, not the time it was subsequently. - /// transmitted to Square. Consequently, the ListPayments endpoint might. - /// list an offline payment chronologically between online payments that. - /// were seen in a previous request. - /// - /// Required parameter: The ID of the location to list payments for. If you specify me, this endpoint returns payments aggregated from all of the business's locations.. - /// Optional parameter: The order in which payments are listed in the response.. - /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.. - /// Optional parameter: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.. - /// Optional parameter: The maximum number of payments to return in a single response. This value cannot exceed 200.. - /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint.. - /// Optional parameter: Indicates whether or not to include partial payments in the response. Partial payments will have the tenders collected so far, but the itemizations will be empty until the payment is completed.. - /// Returns the List response from the API call. - [Obsolete] - List V1ListPayments( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null, - bool? includePartial = false); - - /// - /// Provides summary information for all payments taken for a given. - /// Square account during a date range. Date ranges cannot exceed 1 year in. - /// length. See Date ranges for details of inclusive and exclusive dates. - /// *Note**: Details for payments processed with Square Point of Sale while. - /// in offline mode may not be transmitted to Square for up to 72 hours. - /// Offline payments have a `created_at` value that reflects the time the. - /// payment was originally processed, not the time it was subsequently. - /// transmitted to Square. Consequently, the ListPayments endpoint might. - /// list an offline payment chronologically between online payments that. - /// were seen in a previous request. - /// - /// Required parameter: The ID of the location to list payments for. If you specify me, this endpoint returns payments aggregated from all of the business's locations.. - /// Optional parameter: The order in which payments are listed in the response.. - /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.. - /// Optional parameter: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.. - /// Optional parameter: The maximum number of payments to return in a single response. This value cannot exceed 200.. - /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint.. - /// Optional parameter: Indicates whether or not to include partial payments in the response. Partial payments will have the tenders collected so far, but the itemizations will be empty until the payment is completed.. - /// cancellationToken. - /// Returns the List response from the API call. - [Obsolete] - Task> V1ListPaymentsAsync( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null, - bool? includePartial = false, - CancellationToken cancellationToken = default); - - /// - /// Provides comprehensive information for a single payment. - /// - /// Required parameter: The ID of the payment's associated location.. - /// Required parameter: The Square-issued payment ID. payment_id comes from Payment objects returned by the List Payments endpoint, Settlement objects returned by the List Settlements endpoint, or Refund objects returned by the List Refunds endpoint.. - /// Returns the Models.V1Payment response from the API call. - [Obsolete] - Models.V1Payment V1RetrievePayment( - string locationId, - string paymentId); - - /// - /// Provides comprehensive information for a single payment. - /// - /// Required parameter: The ID of the payment's associated location.. - /// Required parameter: The Square-issued payment ID. payment_id comes from Payment objects returned by the List Payments endpoint, Settlement objects returned by the List Settlements endpoint, or Refund objects returned by the List Refunds endpoint.. - /// cancellationToken. - /// Returns the Models.V1Payment response from the API call. - [Obsolete] - Task V1RetrievePaymentAsync( - string locationId, - string paymentId, - CancellationToken cancellationToken = default); - - /// - /// Provides the details for all refunds initiated by a merchant or any of the merchant's mobile staff during a date range. Date ranges cannot exceed one year in length. - /// - /// Required parameter: The ID of the location to list refunds for.. - /// Optional parameter: The order in which payments are listed in the response.. - /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.. - /// Optional parameter: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.. - /// Optional parameter: The approximate number of refunds to return in a single response. Default: 100. Max: 200. Response may contain more results than the prescribed limit when refunds are made simultaneously to multiple tenders in a payment or when refunds are generated in an exchange to account for the value of returned goods.. - /// 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 V1ListRefunds( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null); - - /// - /// Provides the details for all refunds initiated by a merchant or any of the merchant's mobile staff during a date range. Date ranges cannot exceed one year in length. - /// - /// Required parameter: The ID of the location to list refunds for.. - /// Optional parameter: The order in which payments are listed in the response.. - /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.. - /// Optional parameter: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.. - /// Optional parameter: The approximate number of refunds to return in a single response. Default: 100. Max: 200. Response may contain more results than the prescribed limit when refunds are made simultaneously to multiple tenders in a payment or when refunds are generated in an exchange to account for the value of returned goods.. - /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint.. - /// cancellationToken. - /// Returns the List response from the API call. - [Obsolete] - Task> V1ListRefundsAsync( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null, - CancellationToken cancellationToken = default); - - /// - /// Issues a refund for a previously processed payment. You must issue. - /// a refund within 60 days of the associated payment. - /// You cannot issue a partial refund for a split tender payment. You must. - /// instead issue a full or partial refund for a particular tender, by. - /// providing the applicable tender id to the V1CreateRefund endpoint. - /// Issuing a full refund for a split tender payment refunds all tenders. - /// associated with the payment. - /// Issuing a refund for a card payment is not reversible. For development. - /// purposes, you can create fake cash payments in Square Point of Sale and. - /// refund them. - /// - /// Required parameter: The ID of the original payment's associated location.. - /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. - /// Returns the Models.V1Refund response from the API call. - [Obsolete] - Models.V1Refund V1CreateRefund( - string locationId, - Models.V1CreateRefundRequest body); - - /// - /// Issues a refund for a previously processed payment. You must issue. - /// a refund within 60 days of the associated payment. - /// You cannot issue a partial refund for a split tender payment. You must. - /// instead issue a full or partial refund for a particular tender, by. - /// providing the applicable tender id to the V1CreateRefund endpoint. - /// Issuing a full refund for a split tender payment refunds all tenders. - /// associated with the payment. - /// Issuing a refund for a card payment is not reversible. For development. - /// purposes, you can create fake cash payments in Square Point of Sale and. - /// refund them. - /// - /// Required parameter: The ID of the original payment's associated location.. - /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. - /// cancellationToken. - /// Returns the Models.V1Refund response from the API call. - [Obsolete] - Task V1CreateRefundAsync( - string locationId, - Models.V1CreateRefundRequest body, - CancellationToken cancellationToken = default); - - /// - /// Provides summary information for all deposits and withdrawals. - /// initiated by Square to a linked bank account during a date range. Date. - /// ranges cannot exceed one year in length. - /// *Note**: the ListSettlements endpoint does not provide entry. - /// information. - /// - /// Required parameter: The ID of the location to list settlements for. If you specify me, this endpoint returns settlements aggregated from all of the business's locations.. - /// Optional parameter: The order in which settlements are listed in the response.. - /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.. - /// Optional parameter: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.. - /// Optional parameter: The maximum number of settlements to return in a single response. This value cannot exceed 200.. - /// Optional parameter: Provide this parameter to retrieve only settlements with a particular status (SENT or FAILED).. - /// 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 V1ListSettlements( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string status = null, - string batchToken = null); - - /// - /// Provides summary information for all deposits and withdrawals. - /// initiated by Square to a linked bank account during a date range. Date. - /// ranges cannot exceed one year in length. - /// *Note**: the ListSettlements endpoint does not provide entry. - /// information. - /// - /// Required parameter: The ID of the location to list settlements for. If you specify me, this endpoint returns settlements aggregated from all of the business's locations.. - /// Optional parameter: The order in which settlements are listed in the response.. - /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.. - /// Optional parameter: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.. - /// Optional parameter: The maximum number of settlements to return in a single response. This value cannot exceed 200.. - /// Optional parameter: Provide this parameter to retrieve only settlements with a particular status (SENT or FAILED).. - /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint.. - /// cancellationToken. - /// Returns the List response from the API call. - [Obsolete] - Task> V1ListSettlementsAsync( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string status = null, - string batchToken = null, - CancellationToken cancellationToken = default); - - /// - /// Provides comprehensive information for a single settlement. - /// The returned `Settlement` objects include an `entries` field that lists. - /// the transactions that contribute to the settlement total. Most. - /// settlement entries correspond to a payment payout, but settlement. - /// entries are also generated for less common events, like refunds, manual. - /// adjustments, or chargeback holds. - /// Square initiates its regular deposits as indicated in the. - /// [Deposit Options with Square](https://squareup.com/help/us/en/article/3807). - /// help article. Details for a regular deposit are usually not available. - /// from Connect API endpoints before 10 p.m. PST the same day. - /// Square does not know when an initiated settlement **completes**, only. - /// whether it has failed. A completed settlement is typically reflected in. - /// a bank account within 3 business days, but in exceptional cases it may. - /// take longer. - /// - /// Required parameter: The ID of the settlements's associated location.. - /// Required parameter: The settlement's Square-issued ID. You obtain this value from Settlement objects returned by the List Settlements endpoint.. - /// Returns the Models.V1Settlement response from the API call. - [Obsolete] - Models.V1Settlement V1RetrieveSettlement( - string locationId, - string settlementId); - - /// - /// Provides comprehensive information for a single settlement. - /// The returned `Settlement` objects include an `entries` field that lists. - /// the transactions that contribute to the settlement total. Most. - /// settlement entries correspond to a payment payout, but settlement. - /// entries are also generated for less common events, like refunds, manual. - /// adjustments, or chargeback holds. - /// Square initiates its regular deposits as indicated in the. - /// [Deposit Options with Square](https://squareup.com/help/us/en/article/3807). - /// help article. Details for a regular deposit are usually not available. - /// from Connect API endpoints before 10 p.m. PST the same day. - /// Square does not know when an initiated settlement **completes**, only. - /// whether it has failed. A completed settlement is typically reflected in. - /// a bank account within 3 business days, but in exceptional cases it may. - /// take longer. - /// - /// Required parameter: The ID of the settlements's associated location.. - /// Required parameter: The settlement's Square-issued ID. You obtain this value from Settlement objects returned by the List Settlements endpoint.. - /// cancellationToken. - /// Returns the Models.V1Settlement response from the API call. - [Obsolete] - Task V1RetrieveSettlementAsync( - string locationId, - string settlementId, - CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Square/Apis/InventoryApi.cs b/Square/Apis/InventoryApi.cs index 2d8b4dff..298f74ed 100644 --- a/Square/Apis/InventoryApi.cs +++ b/Square/Apis/InventoryApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/InvoicesApi.cs b/Square/Apis/InvoicesApi.cs index 788aec75..4412160b 100644 --- a/Square/Apis/InvoicesApi.cs +++ b/Square/Apis/InvoicesApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; @@ -378,8 +377,10 @@ public Models.CancelInvoiceResponse CancelInvoice( /// nothing. Square also makes the invoice available on a Square-hosted invoice page. . /// The invoice `status` also changes from `DRAFT` to a status . /// based on the invoice configuration. For example, the status changes to `UNPAID` if . - /// Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion of the . + /// Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the . /// invoice amount. + /// In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ`. + /// and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments. /// /// Required parameter: The ID of the invoice to publish.. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. @@ -397,8 +398,10 @@ public Models.PublishInvoiceResponse PublishInvoice( /// nothing. Square also makes the invoice available on a Square-hosted invoice page. . /// The invoice `status` also changes from `DRAFT` to a status . /// based on the invoice configuration. For example, the status changes to `UNPAID` if . - /// Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion of the . + /// Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the . /// invoice amount. + /// In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ`. + /// and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments. /// /// Required parameter: The ID of the invoice to publish.. /// 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/LaborApi.cs b/Square/Apis/LaborApi.cs index 8df10441..f1daa7ff 100644 --- a/Square/Apis/LaborApi.cs +++ b/Square/Apis/LaborApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/LocationCustomAttributesApi.cs b/Square/Apis/LocationCustomAttributesApi.cs index 13780784..e3a283e7 100644 --- a/Square/Apis/LocationCustomAttributesApi.cs +++ b/Square/Apis/LocationCustomAttributesApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/LocationsApi.cs b/Square/Apis/LocationsApi.cs index a4c60cd8..f047da63 100644 --- a/Square/Apis/LocationsApi.cs +++ b/Square/Apis/LocationsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; @@ -32,7 +31,7 @@ internal LocationsApi(GlobalConfiguration globalConfiguration) : base(globalConf /// /// Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api),. - /// including those with an inactive status. + /// including those with an inactive status. Locations are listed alphabetically by `name`. /// /// Returns the Models.ListLocationsResponse response from the API call. public Models.ListLocationsResponse ListLocations() @@ -40,7 +39,7 @@ public Models.ListLocationsResponse ListLocations() /// /// Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api),. - /// including those with an inactive status. + /// including those with an inactive status. Locations are listed alphabetically by `name`. /// /// cancellationToken. /// Returns the Models.ListLocationsResponse response from the API call. diff --git a/Square/Apis/LoyaltyApi.cs b/Square/Apis/LoyaltyApi.cs index e68e046f..7f518419 100644 --- a/Square/Apis/LoyaltyApi.cs +++ b/Square/Apis/LoyaltyApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/MerchantCustomAttributesApi.cs b/Square/Apis/MerchantCustomAttributesApi.cs index a9a60699..22d60eaf 100644 --- a/Square/Apis/MerchantCustomAttributesApi.cs +++ b/Square/Apis/MerchantCustomAttributesApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/MerchantsApi.cs b/Square/Apis/MerchantsApi.cs index 595ef1bd..01f8489f 100644 --- a/Square/Apis/MerchantsApi.cs +++ b/Square/Apis/MerchantsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/MobileAuthorizationApi.cs b/Square/Apis/MobileAuthorizationApi.cs index 753a905f..c87a6ece 100644 --- a/Square/Apis/MobileAuthorizationApi.cs +++ b/Square/Apis/MobileAuthorizationApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/OAuthApi.cs b/Square/Apis/OAuthApi.cs index 6cce0c21..3c31dfb6 100644 --- a/Square/Apis/OAuthApi.cs +++ b/Square/Apis/OAuthApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/OrderCustomAttributesApi.cs b/Square/Apis/OrderCustomAttributesApi.cs index 62b4a315..bec2d676 100644 --- a/Square/Apis/OrderCustomAttributesApi.cs +++ b/Square/Apis/OrderCustomAttributesApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/OrdersApi.cs b/Square/Apis/OrdersApi.cs index 82ddff1a..aaba91c8 100644 --- a/Square/Apis/OrdersApi.cs +++ b/Square/Apis/OrdersApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/PaymentsApi.cs b/Square/Apis/PaymentsApi.cs index c5d2f5a8..3301be23 100644 --- a/Square/Apis/PaymentsApi.cs +++ b/Square/Apis/PaymentsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/PayoutsApi.cs b/Square/Apis/PayoutsApi.cs index 357af7a4..93252b83 100644 --- a/Square/Apis/PayoutsApi.cs +++ b/Square/Apis/PayoutsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/RefundsApi.cs b/Square/Apis/RefundsApi.cs index 528986af..10ad38c9 100644 --- a/Square/Apis/RefundsApi.cs +++ b/Square/Apis/RefundsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/SitesApi.cs b/Square/Apis/SitesApi.cs index ad3bcca2..3038328a 100644 --- a/Square/Apis/SitesApi.cs +++ b/Square/Apis/SitesApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/SnippetsApi.cs b/Square/Apis/SnippetsApi.cs index 58731ec5..2d05600e 100644 --- a/Square/Apis/SnippetsApi.cs +++ b/Square/Apis/SnippetsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/SubscriptionsApi.cs b/Square/Apis/SubscriptionsApi.cs index e2c32544..4585928b 100644 --- a/Square/Apis/SubscriptionsApi.cs +++ b/Square/Apis/SubscriptionsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/TeamApi.cs b/Square/Apis/TeamApi.cs index d9985517..afd85c22 100644 --- a/Square/Apis/TeamApi.cs +++ b/Square/Apis/TeamApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/TerminalApi.cs b/Square/Apis/TerminalApi.cs index b5acc92d..f94f42aa 100644 --- a/Square/Apis/TerminalApi.cs +++ b/Square/Apis/TerminalApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/TransactionsApi.cs b/Square/Apis/TransactionsApi.cs index 3332c395..7885e988 100644 --- a/Square/Apis/TransactionsApi.cs +++ b/Square/Apis/TransactionsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/V1TransactionsApi.cs b/Square/Apis/V1TransactionsApi.cs index 1a6f5a9c..ac79e0cd 100644 --- a/Square/Apis/V1TransactionsApi.cs +++ b/Square/Apis/V1TransactionsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; @@ -154,368 +153,5 @@ public Models.V1Order V1UpdateOrder( .ResponseHandler(_responseHandler => _responseHandler .ContextAdder((_result, _context) => _result.ContextSetter(_context))) .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Provides summary information for all payments taken for a given. - /// Square account during a date range. Date ranges cannot exceed 1 year in. - /// length. See Date ranges for details of inclusive and exclusive dates. - /// *Note**: Details for payments processed with Square Point of Sale while. - /// in offline mode may not be transmitted to Square for up to 72 hours. - /// Offline payments have a `created_at` value that reflects the time the. - /// payment was originally processed, not the time it was subsequently. - /// transmitted to Square. Consequently, the ListPayments endpoint might. - /// list an offline payment chronologically between online payments that. - /// were seen in a previous request. - /// - /// Required parameter: The ID of the location to list payments for. If you specify me, this endpoint returns payments aggregated from all of the business's locations.. - /// Optional parameter: The order in which payments are listed in the response.. - /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.. - /// Optional parameter: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.. - /// Optional parameter: The maximum number of payments to return in a single response. This value cannot exceed 200.. - /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint.. - /// Optional parameter: Indicates whether or not to include partial payments in the response. Partial payments will have the tenders collected so far, but the itemizations will be empty until the payment is completed.. - /// Returns the List of Models.V1Payment response from the API call. - [Obsolete] - public List V1ListPayments( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null, - bool? includePartial = false) - => CoreHelper.RunTask(V1ListPaymentsAsync(locationId, order, beginTime, endTime, limit, batchToken, includePartial)); - - /// - /// Provides summary information for all payments taken for a given. - /// Square account during a date range. Date ranges cannot exceed 1 year in. - /// length. See Date ranges for details of inclusive and exclusive dates. - /// *Note**: Details for payments processed with Square Point of Sale while. - /// in offline mode may not be transmitted to Square for up to 72 hours. - /// Offline payments have a `created_at` value that reflects the time the. - /// payment was originally processed, not the time it was subsequently. - /// transmitted to Square. Consequently, the ListPayments endpoint might. - /// list an offline payment chronologically between online payments that. - /// were seen in a previous request. - /// - /// Required parameter: The ID of the location to list payments for. If you specify me, this endpoint returns payments aggregated from all of the business's locations.. - /// Optional parameter: The order in which payments are listed in the response.. - /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.. - /// Optional parameter: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.. - /// Optional parameter: The maximum number of payments to return in a single response. This value cannot exceed 200.. - /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint.. - /// Optional parameter: Indicates whether or not to include partial payments in the response. Partial payments will have the tenders collected so far, but the itemizations will be empty until the payment is completed.. - /// cancellationToken. - /// Returns the List of Models.V1Payment response from the API call. - [Obsolete] - public async Task> V1ListPaymentsAsync( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null, - bool? includePartial = false, - CancellationToken cancellationToken = default) - => await CreateApiCall>() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/v1/{location_id}/payments") - .WithAuth("global") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("location_id", locationId)) - .Query(_query => _query.Setup("order", order)) - .Query(_query => _query.Setup("begin_time", beginTime)) - .Query(_query => _query.Setup("end_time", endTime)) - .Query(_query => _query.Setup("limit", limit)) - .Query(_query => _query.Setup("batch_token", batchToken)) - .Query(_query => _query.Setup("include_partial", (includePartial != null) ? includePartial : false)))) - .ResponseHandler(_responseHandler => _responseHandler - .ContextAdder((_result, _context) => - { - _result.ForEach(model => model.ContextSetter(_context)); - return _result; - })) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Provides comprehensive information for a single payment. - /// - /// Required parameter: The ID of the payment's associated location.. - /// Required parameter: The Square-issued payment ID. payment_id comes from Payment objects returned by the List Payments endpoint, Settlement objects returned by the List Settlements endpoint, or Refund objects returned by the List Refunds endpoint.. - /// Returns the Models.V1Payment response from the API call. - [Obsolete] - public Models.V1Payment V1RetrievePayment( - string locationId, - string paymentId) - => CoreHelper.RunTask(V1RetrievePaymentAsync(locationId, paymentId)); - - /// - /// Provides comprehensive information for a single payment. - /// - /// Required parameter: The ID of the payment's associated location.. - /// Required parameter: The Square-issued payment ID. payment_id comes from Payment objects returned by the List Payments endpoint, Settlement objects returned by the List Settlements endpoint, or Refund objects returned by the List Refunds endpoint.. - /// cancellationToken. - /// Returns the Models.V1Payment response from the API call. - [Obsolete] - public async Task V1RetrievePaymentAsync( - string locationId, - string paymentId, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/v1/{location_id}/payments/{payment_id}") - .WithAuth("global") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("location_id", locationId)) - .Template(_template => _template.Setup("payment_id", paymentId)))) - .ResponseHandler(_responseHandler => _responseHandler - .ContextAdder((_result, _context) => _result.ContextSetter(_context))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Provides the details for all refunds initiated by a merchant or any of the merchant's mobile staff during a date range. Date ranges cannot exceed one year in length. - /// - /// Required parameter: The ID of the location to list refunds for.. - /// Optional parameter: The order in which payments are listed in the response.. - /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.. - /// Optional parameter: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.. - /// Optional parameter: The approximate number of refunds to return in a single response. Default: 100. Max: 200. Response may contain more results than the prescribed limit when refunds are made simultaneously to multiple tenders in a payment or when refunds are generated in an exchange to account for the value of returned goods.. - /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint.. - /// Returns the List of Models.V1Refund response from the API call. - [Obsolete] - public List V1ListRefunds( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null) - => CoreHelper.RunTask(V1ListRefundsAsync(locationId, order, beginTime, endTime, limit, batchToken)); - - /// - /// Provides the details for all refunds initiated by a merchant or any of the merchant's mobile staff during a date range. Date ranges cannot exceed one year in length. - /// - /// Required parameter: The ID of the location to list refunds for.. - /// Optional parameter: The order in which payments are listed in the response.. - /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.. - /// Optional parameter: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.. - /// Optional parameter: The approximate number of refunds to return in a single response. Default: 100. Max: 200. Response may contain more results than the prescribed limit when refunds are made simultaneously to multiple tenders in a payment or when refunds are generated in an exchange to account for the value of returned goods.. - /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint.. - /// cancellationToken. - /// Returns the List of Models.V1Refund response from the API call. - [Obsolete] - public async Task> V1ListRefundsAsync( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null, - CancellationToken cancellationToken = default) - => await CreateApiCall>() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/v1/{location_id}/refunds") - .WithAuth("global") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("location_id", locationId)) - .Query(_query => _query.Setup("order", order)) - .Query(_query => _query.Setup("begin_time", beginTime)) - .Query(_query => _query.Setup("end_time", endTime)) - .Query(_query => _query.Setup("limit", limit)) - .Query(_query => _query.Setup("batch_token", batchToken)))) - .ResponseHandler(_responseHandler => _responseHandler - .ContextAdder((_result, _context) => - { - _result.ForEach(model => model.ContextSetter(_context)); - return _result; - })) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Issues a refund for a previously processed payment. You must issue. - /// a refund within 60 days of the associated payment. - /// You cannot issue a partial refund for a split tender payment. You must. - /// instead issue a full or partial refund for a particular tender, by. - /// providing the applicable tender id to the V1CreateRefund endpoint. - /// Issuing a full refund for a split tender payment refunds all tenders. - /// associated with the payment. - /// Issuing a refund for a card payment is not reversible. For development. - /// purposes, you can create fake cash payments in Square Point of Sale and. - /// refund them. - /// - /// Required parameter: The ID of the original payment's associated location.. - /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. - /// Returns the Models.V1Refund response from the API call. - [Obsolete] - public Models.V1Refund V1CreateRefund( - string locationId, - Models.V1CreateRefundRequest body) - => CoreHelper.RunTask(V1CreateRefundAsync(locationId, body)); - - /// - /// Issues a refund for a previously processed payment. You must issue. - /// a refund within 60 days of the associated payment. - /// You cannot issue a partial refund for a split tender payment. You must. - /// instead issue a full or partial refund for a particular tender, by. - /// providing the applicable tender id to the V1CreateRefund endpoint. - /// Issuing a full refund for a split tender payment refunds all tenders. - /// associated with the payment. - /// Issuing a refund for a card payment is not reversible. For development. - /// purposes, you can create fake cash payments in Square Point of Sale and. - /// refund them. - /// - /// Required parameter: The ID of the original payment's associated location.. - /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.. - /// cancellationToken. - /// Returns the Models.V1Refund response from the API call. - [Obsolete] - public async Task V1CreateRefundAsync( - string locationId, - Models.V1CreateRefundRequest body, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Post, "/v1/{location_id}/refunds") - .WithAuth("global") - .Parameters(_parameters => _parameters - .Body(_bodyParameter => _bodyParameter.Setup(body)) - .Template(_template => _template.Setup("location_id", locationId)) - .Header(_header => _header.Setup("Content-Type", "application/json")))) - .ResponseHandler(_responseHandler => _responseHandler - .ContextAdder((_result, _context) => _result.ContextSetter(_context))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Provides summary information for all deposits and withdrawals. - /// initiated by Square to a linked bank account during a date range. Date. - /// ranges cannot exceed one year in length. - /// *Note**: the ListSettlements endpoint does not provide entry. - /// information. - /// - /// Required parameter: The ID of the location to list settlements for. If you specify me, this endpoint returns settlements aggregated from all of the business's locations.. - /// Optional parameter: The order in which settlements are listed in the response.. - /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.. - /// Optional parameter: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.. - /// Optional parameter: The maximum number of settlements to return in a single response. This value cannot exceed 200.. - /// Optional parameter: Provide this parameter to retrieve only settlements with a particular status (SENT or FAILED).. - /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint.. - /// Returns the List of Models.V1Settlement response from the API call. - [Obsolete] - public List V1ListSettlements( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string status = null, - string batchToken = null) - => CoreHelper.RunTask(V1ListSettlementsAsync(locationId, order, beginTime, endTime, limit, status, batchToken)); - - /// - /// Provides summary information for all deposits and withdrawals. - /// initiated by Square to a linked bank account during a date range. Date. - /// ranges cannot exceed one year in length. - /// *Note**: the ListSettlements endpoint does not provide entry. - /// information. - /// - /// Required parameter: The ID of the location to list settlements for. If you specify me, this endpoint returns settlements aggregated from all of the business's locations.. - /// Optional parameter: The order in which settlements are listed in the response.. - /// Optional parameter: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.. - /// Optional parameter: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.. - /// Optional parameter: The maximum number of settlements to return in a single response. This value cannot exceed 200.. - /// Optional parameter: Provide this parameter to retrieve only settlements with a particular status (SENT or FAILED).. - /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint.. - /// cancellationToken. - /// Returns the List of Models.V1Settlement response from the API call. - [Obsolete] - public async Task> V1ListSettlementsAsync( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string status = null, - string batchToken = null, - CancellationToken cancellationToken = default) - => await CreateApiCall>() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/v1/{location_id}/settlements") - .WithAuth("global") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("location_id", locationId)) - .Query(_query => _query.Setup("order", order)) - .Query(_query => _query.Setup("begin_time", beginTime)) - .Query(_query => _query.Setup("end_time", endTime)) - .Query(_query => _query.Setup("limit", limit)) - .Query(_query => _query.Setup("status", status)) - .Query(_query => _query.Setup("batch_token", batchToken)))) - .ResponseHandler(_responseHandler => _responseHandler - .ContextAdder((_result, _context) => - { - _result.ForEach(model => model.ContextSetter(_context)); - return _result; - })) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); - - /// - /// Provides comprehensive information for a single settlement. - /// The returned `Settlement` objects include an `entries` field that lists. - /// the transactions that contribute to the settlement total. Most. - /// settlement entries correspond to a payment payout, but settlement. - /// entries are also generated for less common events, like refunds, manual. - /// adjustments, or chargeback holds. - /// Square initiates its regular deposits as indicated in the. - /// [Deposit Options with Square](https://squareup.com/help/us/en/article/3807). - /// help article. Details for a regular deposit are usually not available. - /// from Connect API endpoints before 10 p.m. PST the same day. - /// Square does not know when an initiated settlement **completes**, only. - /// whether it has failed. A completed settlement is typically reflected in. - /// a bank account within 3 business days, but in exceptional cases it may. - /// take longer. - /// - /// Required parameter: The ID of the settlements's associated location.. - /// Required parameter: The settlement's Square-issued ID. You obtain this value from Settlement objects returned by the List Settlements endpoint.. - /// Returns the Models.V1Settlement response from the API call. - [Obsolete] - public Models.V1Settlement V1RetrieveSettlement( - string locationId, - string settlementId) - => CoreHelper.RunTask(V1RetrieveSettlementAsync(locationId, settlementId)); - - /// - /// Provides comprehensive information for a single settlement. - /// The returned `Settlement` objects include an `entries` field that lists. - /// the transactions that contribute to the settlement total. Most. - /// settlement entries correspond to a payment payout, but settlement. - /// entries are also generated for less common events, like refunds, manual. - /// adjustments, or chargeback holds. - /// Square initiates its regular deposits as indicated in the. - /// [Deposit Options with Square](https://squareup.com/help/us/en/article/3807). - /// help article. Details for a regular deposit are usually not available. - /// from Connect API endpoints before 10 p.m. PST the same day. - /// Square does not know when an initiated settlement **completes**, only. - /// whether it has failed. A completed settlement is typically reflected in. - /// a bank account within 3 business days, but in exceptional cases it may. - /// take longer. - /// - /// Required parameter: The ID of the settlements's associated location.. - /// Required parameter: The settlement's Square-issued ID. You obtain this value from Settlement objects returned by the List Settlements endpoint.. - /// cancellationToken. - /// Returns the Models.V1Settlement response from the API call. - [Obsolete] - public async Task V1RetrieveSettlementAsync( - string locationId, - string settlementId, - CancellationToken cancellationToken = default) - => await CreateApiCall() - .RequestBuilder(_requestBuilder => _requestBuilder - .Setup(HttpMethod.Get, "/v1/{location_id}/settlements/{settlement_id}") - .WithAuth("global") - .Parameters(_parameters => _parameters - .Template(_template => _template.Setup("location_id", locationId)) - .Template(_template => _template.Setup("settlement_id", settlementId)))) - .ResponseHandler(_responseHandler => _responseHandler - .ContextAdder((_result, _context) => _result.ContextSetter(_context))) - .ExecuteAsync(cancellationToken).ConfigureAwait(false); } } \ No newline at end of file diff --git a/Square/Apis/VendorsApi.cs b/Square/Apis/VendorsApi.cs index 1a9c06ff..74690bd6 100644 --- a/Square/Apis/VendorsApi.cs +++ b/Square/Apis/VendorsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Apis/WebhookSubscriptionsApi.cs b/Square/Apis/WebhookSubscriptionsApi.cs index 9abcabc9..27a0293d 100644 --- a/Square/Apis/WebhookSubscriptionsApi.cs +++ b/Square/Apis/WebhookSubscriptionsApi.cs @@ -15,7 +15,6 @@ namespace Square.Apis using APIMatic.Core.Utilities.Date.Xml; using Newtonsoft.Json.Converters; using Square; - using Square.Authentication; using Square.Http.Client; using Square.Utilities; using System.Net.Http; diff --git a/Square/Authentication/BearerAuthManager.cs b/Square/Authentication/BearerAuthManager.cs index bc117566..a5488d72 100644 --- a/Square/Authentication/BearerAuthManager.cs +++ b/Square/Authentication/BearerAuthManager.cs @@ -15,11 +15,13 @@ internal class BearerAuthManager : AuthManager, IBearerAuthCredentials /// Initializes a new instance of the class. /// /// accessToken. - public BearerAuthManager(string accessToken) + public BearerAuthManager(BearerAuthModel bearerAuthModel) { - this.AccessToken = accessToken; + this.AccessToken = bearerAuthModel?.AccessToken; Parameters(paramBuilder => paramBuilder - .Header(header => header.Setup("Authorization", "Bearer " + this.AccessToken))); + .Header(header => header.Setup("Authorization", + this.AccessToken == null ? null : $"Bearer {this.AccessToken}" + ).Required())); } /// @@ -38,4 +40,59 @@ public bool Equals(string accessToken) } } + + public sealed class BearerAuthModel + { + internal BearerAuthModel() + { + } + + internal string AccessToken { get; set; } + + /// + /// Creates an object of the BearerAuthModel using the values provided for the builder. + /// + /// Builder. + public Builder ToBuilder() + { + return new Builder(AccessToken); + } + + /// + /// Builder class for BearerAuthModel. + /// + public class Builder + { + private string accessToken; + + public Builder(string accessToken) + { + this.accessToken = accessToken ?? throw new ArgumentNullException(nameof(accessToken)); + } + + /// + /// Sets AccessToken. + /// + /// AccessToken. + /// Builder. + public Builder AccessToken(string accessToken) + { + this.accessToken = accessToken ?? throw new ArgumentNullException(nameof(accessToken)); + return this; + } + + + /// + /// Creates an object of the BearerAuthModel using the values provided for the builder. + /// + /// BearerAuthModel. + public BearerAuthModel Build() + { + return new BearerAuthModel() + { + AccessToken = this.accessToken + }; + } + } + } } \ No newline at end of file diff --git a/Square/Authentication/IBearerAuthCredentials.cs b/Square/Authentication/IBearerAuthCredentials.cs index 6db34788..ec8038d1 100644 --- a/Square/Authentication/IBearerAuthCredentials.cs +++ b/Square/Authentication/IBearerAuthCredentials.cs @@ -2,6 +2,9 @@ namespace Square.Authentication { using System; + /// + /// Authentication configuration interface for BearerAuth. + /// public interface IBearerAuthCredentials { /// diff --git a/Square/Http/Request/HttpRequest.cs b/Square/Http/Request/HttpRequest.cs index 08d3add8..fe04c84d 100644 --- a/Square/Http/Request/HttpRequest.cs +++ b/Square/Http/Request/HttpRequest.cs @@ -81,6 +81,7 @@ public HttpRequest( /// Http verb to use for the http request. /// The query url for the http request. /// Headers to send with the request. + /// The string to use as raw body of the http request. /// Form parameters collection for the request. /// Basic auth username. /// Basic auth password. diff --git a/Square/Http/Response/HttpResponse.cs b/Square/Http/Response/HttpResponse.cs index cd878ecc..ab5eb592 100644 --- a/Square/Http/Response/HttpResponse.cs +++ b/Square/Http/Response/HttpResponse.cs @@ -15,6 +15,7 @@ public class HttpResponse : CoreResponse /// statusCode. /// headers. /// rawBody. + /// body. public HttpResponse(int statusCode, Dictionary headers, Stream rawBody, string body = null) : base(statusCode, headers, rawBody, body) { } } diff --git a/Square/Models/AccumulateLoyaltyPointsRequest.cs b/Square/Models/AccumulateLoyaltyPointsRequest.cs index d80ae79e..bb921bfd 100644 --- a/Square/Models/AccumulateLoyaltyPointsRequest.cs +++ b/Square/Models/AccumulateLoyaltyPointsRequest.cs @@ -121,6 +121,12 @@ public class Builder private string idempotencyKey; private string locationId; + /// + /// Initialize Builder for AccumulateLoyaltyPointsRequest. + /// + /// accumulatePoints. + /// idempotencyKey. + /// locationId. public Builder( Models.LoyaltyEventAccumulatePoints accumulatePoints, string idempotencyKey, diff --git a/Square/Models/AdditionalRecipient.cs b/Square/Models/AdditionalRecipient.cs index 9de359f3..32453598 100644 --- a/Square/Models/AdditionalRecipient.cs +++ b/Square/Models/AdditionalRecipient.cs @@ -191,6 +191,11 @@ public class Builder private string description; private string receivableId; + /// + /// Initialize Builder for AdditionalRecipient. + /// + /// locationId. + /// amountMoney. public Builder( string locationId, Models.Money amountMoney) diff --git a/Square/Models/AdjustLoyaltyPointsRequest.cs b/Square/Models/AdjustLoyaltyPointsRequest.cs index 6083ea45..dd2faecf 100644 --- a/Square/Models/AdjustLoyaltyPointsRequest.cs +++ b/Square/Models/AdjustLoyaltyPointsRequest.cs @@ -158,6 +158,11 @@ public class Builder private Models.LoyaltyEventAdjustPoints adjustPoints; private bool? allowNegativeBalance; + /// + /// Initialize Builder for AdjustLoyaltyPointsRequest. + /// + /// idempotencyKey. + /// adjustPoints. public Builder( string idempotencyKey, Models.LoyaltyEventAdjustPoints adjustPoints) diff --git a/Square/Models/AppointmentSegment.cs b/Square/Models/AppointmentSegment.cs index 564b0a70..3aedd753 100644 --- a/Square/Models/AppointmentSegment.cs +++ b/Square/Models/AppointmentSegment.cs @@ -247,6 +247,10 @@ public class Builder private bool? anyTeamMember; private IList resourceIds; + /// + /// Initialize Builder for AppointmentSegment. + /// + /// teamMemberId. public Builder( string teamMemberId) { diff --git a/Square/Models/BankAccount.cs b/Square/Models/BankAccount.cs index 62a04b6c..c9cea42e 100644 --- a/Square/Models/BankAccount.cs +++ b/Square/Models/BankAccount.cs @@ -460,6 +460,19 @@ public class Builder private int? version; private string bankName; + /// + /// Initialize Builder for BankAccount. + /// + /// id. + /// accountNumberSuffix. + /// country. + /// currency. + /// accountType. + /// holderName. + /// primaryBankIdentificationNumber. + /// status. + /// creditable. + /// debitable. public Builder( string id, string accountNumberSuffix, diff --git a/Square/Models/BatchChangeInventoryRequest.cs b/Square/Models/BatchChangeInventoryRequest.cs index 79fe4de6..dd722b0f 100644 --- a/Square/Models/BatchChangeInventoryRequest.cs +++ b/Square/Models/BatchChangeInventoryRequest.cs @@ -178,6 +178,10 @@ public class Builder private IList changes; private bool? ignoreUnchangedCounts; + /// + /// Initialize Builder for BatchChangeInventoryRequest. + /// + /// idempotencyKey. public Builder( string idempotencyKey) { diff --git a/Square/Models/BatchRetrieveCatalogObjectsRequest.cs b/Square/Models/BatchRetrieveCatalogObjectsRequest.cs index 2634ce11..20621304 100644 --- a/Square/Models/BatchRetrieveCatalogObjectsRequest.cs +++ b/Square/Models/BatchRetrieveCatalogObjectsRequest.cs @@ -250,6 +250,10 @@ public class Builder private bool? includeDeletedObjects; private bool? includeCategoryPathToRoot; + /// + /// Initialize Builder for BatchRetrieveCatalogObjectsRequest. + /// + /// objectIds. public Builder( IList objectIds) { diff --git a/Square/Models/BatchRetrieveOrdersRequest.cs b/Square/Models/BatchRetrieveOrdersRequest.cs index 3e09ff1d..64cf0786 100644 --- a/Square/Models/BatchRetrieveOrdersRequest.cs +++ b/Square/Models/BatchRetrieveOrdersRequest.cs @@ -141,6 +141,10 @@ public class Builder private IList orderIds; private string locationId; + /// + /// Initialize Builder for BatchRetrieveOrdersRequest. + /// + /// orderIds. public Builder( IList orderIds) { diff --git a/Square/Models/BatchUpsertCatalogObjectsRequest.cs b/Square/Models/BatchUpsertCatalogObjectsRequest.cs index dcb5a223..5f5087cf 100644 --- a/Square/Models/BatchUpsertCatalogObjectsRequest.cs +++ b/Square/Models/BatchUpsertCatalogObjectsRequest.cs @@ -129,6 +129,11 @@ public class Builder private string idempotencyKey; private IList batches; + /// + /// Initialize Builder for BatchUpsertCatalogObjectsRequest. + /// + /// idempotencyKey. + /// batches. public Builder( string idempotencyKey, IList batches) diff --git a/Square/Models/BookingCustomAttributeDeleteRequest.cs b/Square/Models/BookingCustomAttributeDeleteRequest.cs index 7151b746..23dbe00a 100644 --- a/Square/Models/BookingCustomAttributeDeleteRequest.cs +++ b/Square/Models/BookingCustomAttributeDeleteRequest.cs @@ -109,6 +109,11 @@ public class Builder private string bookingId; private string key; + /// + /// Initialize Builder for BookingCustomAttributeDeleteRequest. + /// + /// bookingId. + /// key. public Builder( string bookingId, string key) diff --git a/Square/Models/BookingCustomAttributeUpsertRequest.cs b/Square/Models/BookingCustomAttributeUpsertRequest.cs index 09f7a575..fa0378ba 100644 --- a/Square/Models/BookingCustomAttributeUpsertRequest.cs +++ b/Square/Models/BookingCustomAttributeUpsertRequest.cs @@ -157,6 +157,11 @@ public class Builder private Models.CustomAttribute customAttribute; private string idempotencyKey; + /// + /// Initialize Builder for BookingCustomAttributeUpsertRequest. + /// + /// bookingId. + /// customAttribute. public Builder( string bookingId, Models.CustomAttribute customAttribute) diff --git a/Square/Models/Break.cs b/Square/Models/Break.cs index 0f7da899..4c657a8c 100644 --- a/Square/Models/Break.cs +++ b/Square/Models/Break.cs @@ -219,6 +219,14 @@ public class Builder private string id; private string endAt; + /// + /// Initialize Builder for Break. + /// + /// startAt. + /// breakTypeId. + /// name. + /// expectedDuration. + /// isPaid. public Builder( string startAt, string breakTypeId, diff --git a/Square/Models/BreakType.cs b/Square/Models/BreakType.cs index df630805..a05baec3 100644 --- a/Square/Models/BreakType.cs +++ b/Square/Models/BreakType.cs @@ -194,6 +194,13 @@ public class Builder private string createdAt; private string updatedAt; + /// + /// Initialize Builder for BreakType. + /// + /// locationId. + /// breakName. + /// expectedDuration. + /// isPaid. public Builder( string locationId, string breakName, diff --git a/Square/Models/BulkCreateCustomerData.cs b/Square/Models/BulkCreateCustomerData.cs new file mode 100644 index 00000000..43964e27 --- /dev/null +++ b/Square/Models/BulkCreateCustomerData.cs @@ -0,0 +1,640 @@ +namespace Square.Models +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using APIMatic.Core.Utilities.Converters; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using Square; + using Square.Utilities; + + /// + /// BulkCreateCustomerData. + /// + public class BulkCreateCustomerData + { + private readonly Dictionary shouldSerialize; + /// + /// Initializes a new instance of the class. + /// + /// given_name. + /// family_name. + /// company_name. + /// nickname. + /// email_address. + /// address. + /// phone_number. + /// reference_id. + /// note. + /// birthday. + /// tax_ids. + public BulkCreateCustomerData( + string givenName = null, + string familyName = null, + string companyName = null, + string nickname = null, + string emailAddress = null, + Models.Address address = null, + string phoneNumber = null, + string referenceId = null, + string note = null, + string birthday = null, + Models.CustomerTaxIds taxIds = null) + { + shouldSerialize = new Dictionary + { + { "given_name", false }, + { "family_name", false }, + { "company_name", false }, + { "nickname", false }, + { "email_address", false }, + { "phone_number", false }, + { "reference_id", false }, + { "note", false }, + { "birthday", false } + }; + + if (givenName != null) + { + shouldSerialize["given_name"] = true; + this.GivenName = givenName; + } + + if (familyName != null) + { + shouldSerialize["family_name"] = true; + this.FamilyName = familyName; + } + + if (companyName != null) + { + shouldSerialize["company_name"] = true; + this.CompanyName = companyName; + } + + if (nickname != null) + { + shouldSerialize["nickname"] = true; + this.Nickname = nickname; + } + + if (emailAddress != null) + { + shouldSerialize["email_address"] = true; + this.EmailAddress = emailAddress; + } + + this.Address = address; + if (phoneNumber != null) + { + shouldSerialize["phone_number"] = true; + this.PhoneNumber = phoneNumber; + } + + if (referenceId != null) + { + shouldSerialize["reference_id"] = true; + this.ReferenceId = referenceId; + } + + if (note != null) + { + shouldSerialize["note"] = true; + this.Note = note; + } + + if (birthday != null) + { + shouldSerialize["birthday"] = true; + this.Birthday = birthday; + } + + this.TaxIds = taxIds; + } + internal BulkCreateCustomerData(Dictionary shouldSerialize, + string givenName = null, + string familyName = null, + string companyName = null, + string nickname = null, + string emailAddress = null, + Models.Address address = null, + string phoneNumber = null, + string referenceId = null, + string note = null, + string birthday = null, + Models.CustomerTaxIds taxIds = null) + { + this.shouldSerialize = shouldSerialize; + GivenName = givenName; + FamilyName = familyName; + CompanyName = companyName; + Nickname = nickname; + EmailAddress = emailAddress; + Address = address; + PhoneNumber = phoneNumber; + ReferenceId = referenceId; + Note = note; + Birthday = birthday; + TaxIds = taxIds; + } + + /// + /// The given name (that is, the first name) associated with the customer profile. + /// + [JsonProperty("given_name")] + public string GivenName { get; } + + /// + /// The family name (that is, the last name) associated with the customer profile. + /// + [JsonProperty("family_name")] + public string FamilyName { get; } + + /// + /// A business name associated with the customer profile. + /// + [JsonProperty("company_name")] + public string CompanyName { get; } + + /// + /// A nickname for the customer profile. + /// + [JsonProperty("nickname")] + public string Nickname { get; } + + /// + /// The email address associated with the customer profile. + /// + [JsonProperty("email_address")] + public string EmailAddress { get; } + + /// + /// Represents a postal address in a country. + /// For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + /// + [JsonProperty("address", NullValueHandling = NullValueHandling.Ignore)] + public Models.Address Address { get; } + + /// + /// The phone number associated with the customer profile. The phone number must be valid + /// and can contain 9–16 digits, with an optional `+` prefix and country code. For more information, + /// see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + /// + [JsonProperty("phone_number")] + public string PhoneNumber { get; } + + /// + /// An optional second ID used to associate the customer profile with an + /// entity in another system. + /// + [JsonProperty("reference_id")] + public string ReferenceId { get; } + + /// + /// A custom note associated with the customer profile. + /// + [JsonProperty("note")] + public string Note { get; } + + /// + /// The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. + /// For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. + /// Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or + /// `0000` if a birth year is not specified. + /// + [JsonProperty("birthday")] + public string Birthday { get; } + + /// + /// Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom. + /// For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + /// + [JsonProperty("tax_ids", NullValueHandling = NullValueHandling.Ignore)] + public Models.CustomerTaxIds TaxIds { get; } + + /// + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BulkCreateCustomerData : ({string.Join(", ", toStringOutput)})"; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeGivenName() + { + return this.shouldSerialize["given_name"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeFamilyName() + { + return this.shouldSerialize["family_name"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeCompanyName() + { + return this.shouldSerialize["company_name"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeNickname() + { + return this.shouldSerialize["nickname"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeEmailAddress() + { + return this.shouldSerialize["email_address"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializePhoneNumber() + { + return this.shouldSerialize["phone_number"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeReferenceId() + { + return this.shouldSerialize["reference_id"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeNote() + { + return this.shouldSerialize["note"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeBirthday() + { + return this.shouldSerialize["birthday"]; + } + + /// + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + return obj is BulkCreateCustomerData other && ((this.GivenName == null && other.GivenName == null) || (this.GivenName?.Equals(other.GivenName) == true)) && + ((this.FamilyName == null && other.FamilyName == null) || (this.FamilyName?.Equals(other.FamilyName) == true)) && + ((this.CompanyName == null && other.CompanyName == null) || (this.CompanyName?.Equals(other.CompanyName) == true)) && + ((this.Nickname == null && other.Nickname == null) || (this.Nickname?.Equals(other.Nickname) == true)) && + ((this.EmailAddress == null && other.EmailAddress == null) || (this.EmailAddress?.Equals(other.EmailAddress) == true)) && + ((this.Address == null && other.Address == null) || (this.Address?.Equals(other.Address) == true)) && + ((this.PhoneNumber == null && other.PhoneNumber == null) || (this.PhoneNumber?.Equals(other.PhoneNumber) == true)) && + ((this.ReferenceId == null && other.ReferenceId == null) || (this.ReferenceId?.Equals(other.ReferenceId) == true)) && + ((this.Note == null && other.Note == null) || (this.Note?.Equals(other.Note) == true)) && + ((this.Birthday == null && other.Birthday == null) || (this.Birthday?.Equals(other.Birthday) == true)) && + ((this.TaxIds == null && other.TaxIds == null) || (this.TaxIds?.Equals(other.TaxIds) == true)); + } + + /// + public override int GetHashCode() + { + int hashCode = -785217377; + hashCode = HashCode.Combine(this.GivenName, this.FamilyName, this.CompanyName, this.Nickname, this.EmailAddress, this.Address, this.PhoneNumber); + + hashCode = HashCode.Combine(hashCode, this.ReferenceId, this.Note, this.Birthday, this.TaxIds); + + return hashCode; + } + /// + /// ToString overload. + /// + /// List of strings. + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"this.GivenName = {(this.GivenName == null ? "null" : this.GivenName)}"); + toStringOutput.Add($"this.FamilyName = {(this.FamilyName == null ? "null" : this.FamilyName)}"); + toStringOutput.Add($"this.CompanyName = {(this.CompanyName == null ? "null" : this.CompanyName)}"); + toStringOutput.Add($"this.Nickname = {(this.Nickname == null ? "null" : this.Nickname)}"); + toStringOutput.Add($"this.EmailAddress = {(this.EmailAddress == null ? "null" : this.EmailAddress)}"); + toStringOutput.Add($"this.Address = {(this.Address == null ? "null" : this.Address.ToString())}"); + toStringOutput.Add($"this.PhoneNumber = {(this.PhoneNumber == null ? "null" : this.PhoneNumber)}"); + toStringOutput.Add($"this.ReferenceId = {(this.ReferenceId == null ? "null" : this.ReferenceId)}"); + toStringOutput.Add($"this.Note = {(this.Note == null ? "null" : this.Note)}"); + toStringOutput.Add($"this.Birthday = {(this.Birthday == null ? "null" : this.Birthday)}"); + toStringOutput.Add($"this.TaxIds = {(this.TaxIds == null ? "null" : this.TaxIds.ToString())}"); + } + + /// + /// Converts to builder object. + /// + /// Builder. + public Builder ToBuilder() + { + var builder = new Builder() + .GivenName(this.GivenName) + .FamilyName(this.FamilyName) + .CompanyName(this.CompanyName) + .Nickname(this.Nickname) + .EmailAddress(this.EmailAddress) + .Address(this.Address) + .PhoneNumber(this.PhoneNumber) + .ReferenceId(this.ReferenceId) + .Note(this.Note) + .Birthday(this.Birthday) + .TaxIds(this.TaxIds); + return builder; + } + + /// + /// Builder class. + /// + public class Builder + { + private Dictionary shouldSerialize = new Dictionary + { + { "given_name", false }, + { "family_name", false }, + { "company_name", false }, + { "nickname", false }, + { "email_address", false }, + { "phone_number", false }, + { "reference_id", false }, + { "note", false }, + { "birthday", false }, + }; + + private string givenName; + private string familyName; + private string companyName; + private string nickname; + private string emailAddress; + private Models.Address address; + private string phoneNumber; + private string referenceId; + private string note; + private string birthday; + private Models.CustomerTaxIds taxIds; + + /// + /// GivenName. + /// + /// givenName. + /// Builder. + public Builder GivenName(string givenName) + { + shouldSerialize["given_name"] = true; + this.givenName = givenName; + return this; + } + + /// + /// FamilyName. + /// + /// familyName. + /// Builder. + public Builder FamilyName(string familyName) + { + shouldSerialize["family_name"] = true; + this.familyName = familyName; + return this; + } + + /// + /// CompanyName. + /// + /// companyName. + /// Builder. + public Builder CompanyName(string companyName) + { + shouldSerialize["company_name"] = true; + this.companyName = companyName; + return this; + } + + /// + /// Nickname. + /// + /// nickname. + /// Builder. + public Builder Nickname(string nickname) + { + shouldSerialize["nickname"] = true; + this.nickname = nickname; + return this; + } + + /// + /// EmailAddress. + /// + /// emailAddress. + /// Builder. + public Builder EmailAddress(string emailAddress) + { + shouldSerialize["email_address"] = true; + this.emailAddress = emailAddress; + return this; + } + + /// + /// Address. + /// + /// address. + /// Builder. + public Builder Address(Models.Address address) + { + this.address = address; + return this; + } + + /// + /// PhoneNumber. + /// + /// phoneNumber. + /// Builder. + public Builder PhoneNumber(string phoneNumber) + { + shouldSerialize["phone_number"] = true; + this.phoneNumber = phoneNumber; + return this; + } + + /// + /// ReferenceId. + /// + /// referenceId. + /// Builder. + public Builder ReferenceId(string referenceId) + { + shouldSerialize["reference_id"] = true; + this.referenceId = referenceId; + return this; + } + + /// + /// Note. + /// + /// note. + /// Builder. + public Builder Note(string note) + { + shouldSerialize["note"] = true; + this.note = note; + return this; + } + + /// + /// Birthday. + /// + /// birthday. + /// Builder. + public Builder Birthday(string birthday) + { + shouldSerialize["birthday"] = true; + this.birthday = birthday; + return this; + } + + /// + /// TaxIds. + /// + /// taxIds. + /// Builder. + public Builder TaxIds(Models.CustomerTaxIds taxIds) + { + this.taxIds = taxIds; + return this; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetGivenName() + { + this.shouldSerialize["given_name"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetFamilyName() + { + this.shouldSerialize["family_name"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetCompanyName() + { + this.shouldSerialize["company_name"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetNickname() + { + this.shouldSerialize["nickname"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetEmailAddress() + { + this.shouldSerialize["email_address"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetPhoneNumber() + { + this.shouldSerialize["phone_number"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetReferenceId() + { + this.shouldSerialize["reference_id"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetNote() + { + this.shouldSerialize["note"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetBirthday() + { + this.shouldSerialize["birthday"] = false; + } + + + /// + /// Builds class object. + /// + /// BulkCreateCustomerData. + public BulkCreateCustomerData Build() + { + return new BulkCreateCustomerData(shouldSerialize, + this.givenName, + this.familyName, + this.companyName, + this.nickname, + this.emailAddress, + this.address, + this.phoneNumber, + this.referenceId, + this.note, + this.birthday, + this.taxIds); + } + } + } +} \ No newline at end of file diff --git a/Square/Models/BulkCreateCustomersRequest.cs b/Square/Models/BulkCreateCustomersRequest.cs new file mode 100644 index 00000000..3f19acc1 --- /dev/null +++ b/Square/Models/BulkCreateCustomersRequest.cs @@ -0,0 +1,133 @@ +namespace Square.Models +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using APIMatic.Core.Utilities.Converters; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using Square; + using Square.Utilities; + + /// + /// BulkCreateCustomersRequest. + /// + public class BulkCreateCustomersRequest + { + /// + /// Initializes a new instance of the class. + /// + /// customers. + public BulkCreateCustomersRequest( + IDictionary customers) + { + this.Customers = customers; + } + + /// + /// A map of 1 to 100 individual create requests, represented by `idempotency key: { customer data }` + /// key-value pairs. + /// Each key is an [idempotency key](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + /// that uniquely identifies the create request. Each value contains the customer data used to create the + /// customer profile. + /// + [JsonProperty("customers")] + public IDictionary Customers { get; } + + /// + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BulkCreateCustomersRequest : ({string.Join(", ", toStringOutput)})"; + } + + /// + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + return obj is BulkCreateCustomersRequest other && ((this.Customers == null && other.Customers == null) || (this.Customers?.Equals(other.Customers) == true)); + } + + /// + public override int GetHashCode() + { + int hashCode = 573294327; + hashCode = HashCode.Combine(this.Customers); + + return hashCode; + } + /// + /// ToString overload. + /// + /// List of strings. + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Customers = {(this.Customers == null ? "null" : this.Customers.ToString())}"); + } + + /// + /// Converts to builder object. + /// + /// Builder. + public Builder ToBuilder() + { + var builder = new Builder( + this.Customers); + return builder; + } + + /// + /// Builder class. + /// + public class Builder + { + private IDictionary customers; + + /// + /// Initialize Builder for BulkCreateCustomersRequest. + /// + /// customers. + public Builder( + IDictionary customers) + { + this.customers = customers; + } + + /// + /// Customers. + /// + /// customers. + /// Builder. + public Builder Customers(IDictionary customers) + { + this.customers = customers; + return this; + } + + /// + /// Builds class object. + /// + /// BulkCreateCustomersRequest. + public BulkCreateCustomersRequest Build() + { + return new BulkCreateCustomersRequest( + this.customers); + } + } + } +} \ No newline at end of file diff --git a/Square/Models/BulkCreateCustomersResponse.cs b/Square/Models/BulkCreateCustomersResponse.cs new file mode 100644 index 00000000..0a436b29 --- /dev/null +++ b/Square/Models/BulkCreateCustomersResponse.cs @@ -0,0 +1,168 @@ +namespace Square.Models +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using APIMatic.Core.Utilities.Converters; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using Square; + using Square.Http.Client; + using Square.Utilities; + + /// + /// BulkCreateCustomersResponse. + /// + public class BulkCreateCustomersResponse + { + /// + /// Initializes a new instance of the class. + /// + /// responses. + /// errors. + public BulkCreateCustomersResponse( + IDictionary responses = null, + IList errors = null) + { + this.Responses = responses; + this.Errors = errors; + } + + /// + /// Gets http context. + /// + [JsonIgnore] + public HttpContext Context { get; internal set; } + + /// + /// A map of responses that correspond to individual create requests, represented by + /// key-value pairs. + /// Each key is the idempotency key that was provided for a create request and each value + /// is the corresponding response. + /// If the request succeeds, the value is the new customer profile. + /// If the request fails, the value contains any errors that occurred during the request. + /// + [JsonProperty("responses", NullValueHandling = NullValueHandling.Ignore)] + public IDictionary Responses { get; } + + /// + /// Any top-level errors that prevented the bulk operation from running. + /// + [JsonProperty("errors", NullValueHandling = NullValueHandling.Ignore)] + public IList Errors { get; } + + /// + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BulkCreateCustomersResponse : ({string.Join(", ", toStringOutput)})"; + } + + /// + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + return obj is BulkCreateCustomersResponse other && ((this.Context == null && other.Context == null) || (this.Context?.Equals(other.Context) == true)) && + ((this.Responses == null && other.Responses == null) || (this.Responses?.Equals(other.Responses) == true)) && + ((this.Errors == null && other.Errors == null) || (this.Errors?.Equals(other.Errors) == true)); + } + + /// + public override int GetHashCode() + { + int hashCode = -658812287; + + if (this.Context != null) + { + hashCode += this.Context.GetHashCode(); + } + hashCode = HashCode.Combine(this.Responses, this.Errors); + + return hashCode; + } + internal BulkCreateCustomersResponse ContextSetter(HttpContext context) + { + this.Context = context; + return this; + } + + /// + /// ToString overload. + /// + /// List of strings. + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Responses = {(this.Responses == null ? "null" : this.Responses.ToString())}"); + toStringOutput.Add($"this.Errors = {(this.Errors == null ? "null" : $"[{string.Join(", ", this.Errors)} ]")}"); + } + + /// + /// Converts to builder object. + /// + /// Builder. + public Builder ToBuilder() + { + var builder = new Builder() + .Responses(this.Responses) + .Errors(this.Errors); + return builder; + } + + /// + /// Builder class. + /// + public class Builder + { + private IDictionary responses; + private IList errors; + + /// + /// Responses. + /// + /// responses. + /// Builder. + public Builder Responses(IDictionary responses) + { + this.responses = responses; + return this; + } + + /// + /// Errors. + /// + /// errors. + /// Builder. + public Builder Errors(IList errors) + { + this.errors = errors; + return this; + } + + /// + /// Builds class object. + /// + /// BulkCreateCustomersResponse. + public BulkCreateCustomersResponse Build() + { + return new BulkCreateCustomersResponse( + this.responses, + this.errors); + } + } + } +} \ No newline at end of file diff --git a/Square/Models/BulkCreateTeamMembersRequest.cs b/Square/Models/BulkCreateTeamMembersRequest.cs index ced6c23e..6fd35812 100644 --- a/Square/Models/BulkCreateTeamMembersRequest.cs +++ b/Square/Models/BulkCreateTeamMembersRequest.cs @@ -94,6 +94,10 @@ public class Builder { private IDictionary teamMembers; + /// + /// Initialize Builder for BulkCreateTeamMembersRequest. + /// + /// teamMembers. public Builder( IDictionary teamMembers) { diff --git a/Square/Models/BulkCreateVendorsRequest.cs b/Square/Models/BulkCreateVendorsRequest.cs index ce815b2f..97e37a82 100644 --- a/Square/Models/BulkCreateVendorsRequest.cs +++ b/Square/Models/BulkCreateVendorsRequest.cs @@ -94,6 +94,10 @@ public class Builder { private IDictionary vendors; + /// + /// Initialize Builder for BulkCreateVendorsRequest. + /// + /// vendors. public Builder( IDictionary vendors) { diff --git a/Square/Models/BulkDeleteBookingCustomAttributesRequest.cs b/Square/Models/BulkDeleteBookingCustomAttributesRequest.cs index 4dde375c..3f08448e 100644 --- a/Square/Models/BulkDeleteBookingCustomAttributesRequest.cs +++ b/Square/Models/BulkDeleteBookingCustomAttributesRequest.cs @@ -96,6 +96,10 @@ public class Builder { private IDictionary values; + /// + /// Initialize Builder for BulkDeleteBookingCustomAttributesRequest. + /// + /// values. public Builder( IDictionary values) { diff --git a/Square/Models/BulkDeleteCustomersRequest.cs b/Square/Models/BulkDeleteCustomersRequest.cs new file mode 100644 index 00000000..73a6fc0f --- /dev/null +++ b/Square/Models/BulkDeleteCustomersRequest.cs @@ -0,0 +1,129 @@ +namespace Square.Models +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using APIMatic.Core.Utilities.Converters; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using Square; + using Square.Utilities; + + /// + /// BulkDeleteCustomersRequest. + /// + public class BulkDeleteCustomersRequest + { + /// + /// Initializes a new instance of the class. + /// + /// customer_ids. + public BulkDeleteCustomersRequest( + IList customerIds) + { + this.CustomerIds = customerIds; + } + + /// + /// The IDs of the [customer profiles](entity:Customer) to delete. + /// + [JsonProperty("customer_ids")] + public IList CustomerIds { get; } + + /// + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BulkDeleteCustomersRequest : ({string.Join(", ", toStringOutput)})"; + } + + /// + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + return obj is BulkDeleteCustomersRequest other && ((this.CustomerIds == null && other.CustomerIds == null) || (this.CustomerIds?.Equals(other.CustomerIds) == true)); + } + + /// + public override int GetHashCode() + { + int hashCode = 1157396994; + hashCode = HashCode.Combine(this.CustomerIds); + + return hashCode; + } + /// + /// ToString overload. + /// + /// List of strings. + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"this.CustomerIds = {(this.CustomerIds == null ? "null" : $"[{string.Join(", ", this.CustomerIds)} ]")}"); + } + + /// + /// Converts to builder object. + /// + /// Builder. + public Builder ToBuilder() + { + var builder = new Builder( + this.CustomerIds); + return builder; + } + + /// + /// Builder class. + /// + public class Builder + { + private IList customerIds; + + /// + /// Initialize Builder for BulkDeleteCustomersRequest. + /// + /// customerIds. + public Builder( + IList customerIds) + { + this.customerIds = customerIds; + } + + /// + /// CustomerIds. + /// + /// customerIds. + /// Builder. + public Builder CustomerIds(IList customerIds) + { + this.customerIds = customerIds; + return this; + } + + /// + /// Builds class object. + /// + /// BulkDeleteCustomersRequest. + public BulkDeleteCustomersRequest Build() + { + return new BulkDeleteCustomersRequest( + this.customerIds); + } + } + } +} \ No newline at end of file diff --git a/Square/Models/BulkDeleteCustomersResponse.cs b/Square/Models/BulkDeleteCustomersResponse.cs new file mode 100644 index 00000000..88ba184e --- /dev/null +++ b/Square/Models/BulkDeleteCustomersResponse.cs @@ -0,0 +1,168 @@ +namespace Square.Models +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using APIMatic.Core.Utilities.Converters; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using Square; + using Square.Http.Client; + using Square.Utilities; + + /// + /// BulkDeleteCustomersResponse. + /// + public class BulkDeleteCustomersResponse + { + /// + /// Initializes a new instance of the class. + /// + /// responses. + /// errors. + public BulkDeleteCustomersResponse( + IDictionary responses = null, + IList errors = null) + { + this.Responses = responses; + this.Errors = errors; + } + + /// + /// Gets http context. + /// + [JsonIgnore] + public HttpContext Context { get; internal set; } + + /// + /// A map of responses that correspond to individual delete requests, represented by + /// key-value pairs. + /// Each key is the customer ID that was specified for a delete request and each value + /// is the corresponding response. + /// If the request succeeds, the value is an empty object (`{ }`). + /// If the request fails, the value contains any errors that occurred during the request. + /// + [JsonProperty("responses", NullValueHandling = NullValueHandling.Ignore)] + public IDictionary Responses { get; } + + /// + /// Any top-level errors that prevented the bulk operation from running. + /// + [JsonProperty("errors", NullValueHandling = NullValueHandling.Ignore)] + public IList Errors { get; } + + /// + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BulkDeleteCustomersResponse : ({string.Join(", ", toStringOutput)})"; + } + + /// + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + return obj is BulkDeleteCustomersResponse other && ((this.Context == null && other.Context == null) || (this.Context?.Equals(other.Context) == true)) && + ((this.Responses == null && other.Responses == null) || (this.Responses?.Equals(other.Responses) == true)) && + ((this.Errors == null && other.Errors == null) || (this.Errors?.Equals(other.Errors) == true)); + } + + /// + public override int GetHashCode() + { + int hashCode = -549851509; + + if (this.Context != null) + { + hashCode += this.Context.GetHashCode(); + } + hashCode = HashCode.Combine(this.Responses, this.Errors); + + return hashCode; + } + internal BulkDeleteCustomersResponse ContextSetter(HttpContext context) + { + this.Context = context; + return this; + } + + /// + /// ToString overload. + /// + /// List of strings. + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Responses = {(this.Responses == null ? "null" : this.Responses.ToString())}"); + toStringOutput.Add($"this.Errors = {(this.Errors == null ? "null" : $"[{string.Join(", ", this.Errors)} ]")}"); + } + + /// + /// Converts to builder object. + /// + /// Builder. + public Builder ToBuilder() + { + var builder = new Builder() + .Responses(this.Responses) + .Errors(this.Errors); + return builder; + } + + /// + /// Builder class. + /// + public class Builder + { + private IDictionary responses; + private IList errors; + + /// + /// Responses. + /// + /// responses. + /// Builder. + public Builder Responses(IDictionary responses) + { + this.responses = responses; + return this; + } + + /// + /// Errors. + /// + /// errors. + /// Builder. + public Builder Errors(IList errors) + { + this.errors = errors; + return this; + } + + /// + /// Builds class object. + /// + /// BulkDeleteCustomersResponse. + public BulkDeleteCustomersResponse Build() + { + return new BulkDeleteCustomersResponse( + this.responses, + this.errors); + } + } + } +} \ No newline at end of file diff --git a/Square/Models/BulkDeleteLocationCustomAttributesRequest.cs b/Square/Models/BulkDeleteLocationCustomAttributesRequest.cs index 0e1af835..20594917 100644 --- a/Square/Models/BulkDeleteLocationCustomAttributesRequest.cs +++ b/Square/Models/BulkDeleteLocationCustomAttributesRequest.cs @@ -95,6 +95,10 @@ public class Builder { private IDictionary values; + /// + /// Initialize Builder for BulkDeleteLocationCustomAttributesRequest. + /// + /// values. public Builder( IDictionary values) { diff --git a/Square/Models/BulkDeleteLocationCustomAttributesResponse.cs b/Square/Models/BulkDeleteLocationCustomAttributesResponse.cs index a47b67a1..fe591c89 100644 --- a/Square/Models/BulkDeleteLocationCustomAttributesResponse.cs +++ b/Square/Models/BulkDeleteLocationCustomAttributesResponse.cs @@ -127,6 +127,10 @@ public class Builder private IDictionary values; private IList errors; + /// + /// Initialize Builder for BulkDeleteLocationCustomAttributesResponse. + /// + /// values. public Builder( IDictionary values) { diff --git a/Square/Models/BulkDeleteMerchantCustomAttributesRequest.cs b/Square/Models/BulkDeleteMerchantCustomAttributesRequest.cs index 0da0be9a..74b81f44 100644 --- a/Square/Models/BulkDeleteMerchantCustomAttributesRequest.cs +++ b/Square/Models/BulkDeleteMerchantCustomAttributesRequest.cs @@ -95,6 +95,10 @@ public class Builder { private IDictionary values; + /// + /// Initialize Builder for BulkDeleteMerchantCustomAttributesRequest. + /// + /// values. public Builder( IDictionary values) { diff --git a/Square/Models/BulkDeleteMerchantCustomAttributesResponse.cs b/Square/Models/BulkDeleteMerchantCustomAttributesResponse.cs index 0a9447bf..6965a7e9 100644 --- a/Square/Models/BulkDeleteMerchantCustomAttributesResponse.cs +++ b/Square/Models/BulkDeleteMerchantCustomAttributesResponse.cs @@ -127,6 +127,10 @@ public class Builder private IDictionary values; private IList errors; + /// + /// Initialize Builder for BulkDeleteMerchantCustomAttributesResponse. + /// + /// values. public Builder( IDictionary values) { diff --git a/Square/Models/BulkDeleteOrderCustomAttributesRequest.cs b/Square/Models/BulkDeleteOrderCustomAttributesRequest.cs index 218ca56b..f1e0bd42 100644 --- a/Square/Models/BulkDeleteOrderCustomAttributesRequest.cs +++ b/Square/Models/BulkDeleteOrderCustomAttributesRequest.cs @@ -94,6 +94,10 @@ public class Builder { private IDictionary values; + /// + /// Initialize Builder for BulkDeleteOrderCustomAttributesRequest. + /// + /// values. public Builder( IDictionary values) { diff --git a/Square/Models/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.cs b/Square/Models/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.cs index c72275fe..8ab41a24 100644 --- a/Square/Models/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.cs +++ b/Square/Models/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.cs @@ -108,6 +108,10 @@ public class Builder private string orderId; private string key; + /// + /// Initialize Builder for BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute. + /// + /// orderId. public Builder( string orderId) { diff --git a/Square/Models/BulkDeleteOrderCustomAttributesResponse.cs b/Square/Models/BulkDeleteOrderCustomAttributesResponse.cs index 4315e1c3..400083cb 100644 --- a/Square/Models/BulkDeleteOrderCustomAttributesResponse.cs +++ b/Square/Models/BulkDeleteOrderCustomAttributesResponse.cs @@ -127,6 +127,10 @@ public class Builder private IDictionary values; private IList errors; + /// + /// Initialize Builder for BulkDeleteOrderCustomAttributesResponse. + /// + /// values. public Builder( IDictionary values) { diff --git a/Square/Models/BulkRetrieveBookingsRequest.cs b/Square/Models/BulkRetrieveBookingsRequest.cs index f96162e9..d12e8970 100644 --- a/Square/Models/BulkRetrieveBookingsRequest.cs +++ b/Square/Models/BulkRetrieveBookingsRequest.cs @@ -94,6 +94,10 @@ public class Builder { private IList bookingIds; + /// + /// Initialize Builder for BulkRetrieveBookingsRequest. + /// + /// bookingIds. public Builder( IList bookingIds) { diff --git a/Square/Models/BulkRetrieveCustomersRequest.cs b/Square/Models/BulkRetrieveCustomersRequest.cs new file mode 100644 index 00000000..cda4c128 --- /dev/null +++ b/Square/Models/BulkRetrieveCustomersRequest.cs @@ -0,0 +1,129 @@ +namespace Square.Models +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using APIMatic.Core.Utilities.Converters; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using Square; + using Square.Utilities; + + /// + /// BulkRetrieveCustomersRequest. + /// + public class BulkRetrieveCustomersRequest + { + /// + /// Initializes a new instance of the class. + /// + /// customer_ids. + public BulkRetrieveCustomersRequest( + IList customerIds) + { + this.CustomerIds = customerIds; + } + + /// + /// The IDs of the [customer profiles](entity:Customer) to retrieve. + /// + [JsonProperty("customer_ids")] + public IList CustomerIds { get; } + + /// + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BulkRetrieveCustomersRequest : ({string.Join(", ", toStringOutput)})"; + } + + /// + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + return obj is BulkRetrieveCustomersRequest other && ((this.CustomerIds == null && other.CustomerIds == null) || (this.CustomerIds?.Equals(other.CustomerIds) == true)); + } + + /// + public override int GetHashCode() + { + int hashCode = -1237075055; + hashCode = HashCode.Combine(this.CustomerIds); + + return hashCode; + } + /// + /// ToString overload. + /// + /// List of strings. + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"this.CustomerIds = {(this.CustomerIds == null ? "null" : $"[{string.Join(", ", this.CustomerIds)} ]")}"); + } + + /// + /// Converts to builder object. + /// + /// Builder. + public Builder ToBuilder() + { + var builder = new Builder( + this.CustomerIds); + return builder; + } + + /// + /// Builder class. + /// + public class Builder + { + private IList customerIds; + + /// + /// Initialize Builder for BulkRetrieveCustomersRequest. + /// + /// customerIds. + public Builder( + IList customerIds) + { + this.customerIds = customerIds; + } + + /// + /// CustomerIds. + /// + /// customerIds. + /// Builder. + public Builder CustomerIds(IList customerIds) + { + this.customerIds = customerIds; + return this; + } + + /// + /// Builds class object. + /// + /// BulkRetrieveCustomersRequest. + public BulkRetrieveCustomersRequest Build() + { + return new BulkRetrieveCustomersRequest( + this.customerIds); + } + } + } +} \ No newline at end of file diff --git a/Square/Models/BulkRetrieveCustomersResponse.cs b/Square/Models/BulkRetrieveCustomersResponse.cs new file mode 100644 index 00000000..baeef95c --- /dev/null +++ b/Square/Models/BulkRetrieveCustomersResponse.cs @@ -0,0 +1,168 @@ +namespace Square.Models +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using APIMatic.Core.Utilities.Converters; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using Square; + using Square.Http.Client; + using Square.Utilities; + + /// + /// BulkRetrieveCustomersResponse. + /// + public class BulkRetrieveCustomersResponse + { + /// + /// Initializes a new instance of the class. + /// + /// responses. + /// errors. + public BulkRetrieveCustomersResponse( + IDictionary responses = null, + IList errors = null) + { + this.Responses = responses; + this.Errors = errors; + } + + /// + /// Gets http context. + /// + [JsonIgnore] + public HttpContext Context { get; internal set; } + + /// + /// A map of responses that correspond to individual retrieve requests, represented by + /// key-value pairs. + /// Each key is the customer ID that was specified for a retrieve request and each value + /// is the corresponding response. + /// If the request succeeds, the value is the requested customer profile. + /// If the request fails, the value contains any errors that occurred during the request. + /// + [JsonProperty("responses", NullValueHandling = NullValueHandling.Ignore)] + public IDictionary Responses { get; } + + /// + /// Any top-level errors that prevented the bulk operation from running. + /// + [JsonProperty("errors", NullValueHandling = NullValueHandling.Ignore)] + public IList Errors { get; } + + /// + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BulkRetrieveCustomersResponse : ({string.Join(", ", toStringOutput)})"; + } + + /// + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + return obj is BulkRetrieveCustomersResponse other && ((this.Context == null && other.Context == null) || (this.Context?.Equals(other.Context) == true)) && + ((this.Responses == null && other.Responses == null) || (this.Responses?.Equals(other.Responses) == true)) && + ((this.Errors == null && other.Errors == null) || (this.Errors?.Equals(other.Errors) == true)); + } + + /// + public override int GetHashCode() + { + int hashCode = -624365229; + + if (this.Context != null) + { + hashCode += this.Context.GetHashCode(); + } + hashCode = HashCode.Combine(this.Responses, this.Errors); + + return hashCode; + } + internal BulkRetrieveCustomersResponse ContextSetter(HttpContext context) + { + this.Context = context; + return this; + } + + /// + /// ToString overload. + /// + /// List of strings. + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Responses = {(this.Responses == null ? "null" : this.Responses.ToString())}"); + toStringOutput.Add($"this.Errors = {(this.Errors == null ? "null" : $"[{string.Join(", ", this.Errors)} ]")}"); + } + + /// + /// Converts to builder object. + /// + /// Builder. + public Builder ToBuilder() + { + var builder = new Builder() + .Responses(this.Responses) + .Errors(this.Errors); + return builder; + } + + /// + /// Builder class. + /// + public class Builder + { + private IDictionary responses; + private IList errors; + + /// + /// Responses. + /// + /// responses. + /// Builder. + public Builder Responses(IDictionary responses) + { + this.responses = responses; + return this; + } + + /// + /// Errors. + /// + /// errors. + /// Builder. + public Builder Errors(IList errors) + { + this.errors = errors; + return this; + } + + /// + /// Builds class object. + /// + /// BulkRetrieveCustomersResponse. + public BulkRetrieveCustomersResponse Build() + { + return new BulkRetrieveCustomersResponse( + this.responses, + this.errors); + } + } + } +} \ No newline at end of file diff --git a/Square/Models/BulkRetrieveTeamMemberBookingProfilesRequest.cs b/Square/Models/BulkRetrieveTeamMemberBookingProfilesRequest.cs index db7877c1..06bada71 100644 --- a/Square/Models/BulkRetrieveTeamMemberBookingProfilesRequest.cs +++ b/Square/Models/BulkRetrieveTeamMemberBookingProfilesRequest.cs @@ -94,6 +94,10 @@ public class Builder { private IList teamMemberIds; + /// + /// Initialize Builder for BulkRetrieveTeamMemberBookingProfilesRequest. + /// + /// teamMemberIds. public Builder( IList teamMemberIds) { diff --git a/Square/Models/BulkSwapPlanRequest.cs b/Square/Models/BulkSwapPlanRequest.cs index bfcd38cc..b67ebec9 100644 --- a/Square/Models/BulkSwapPlanRequest.cs +++ b/Square/Models/BulkSwapPlanRequest.cs @@ -123,6 +123,12 @@ public class Builder private string oldPlanVariationId; private string locationId; + /// + /// Initialize Builder for BulkSwapPlanRequest. + /// + /// newPlanVariationId. + /// oldPlanVariationId. + /// locationId. public Builder( string newPlanVariationId, string oldPlanVariationId, diff --git a/Square/Models/BulkUpdateCustomerData.cs b/Square/Models/BulkUpdateCustomerData.cs new file mode 100644 index 00000000..ba17eb5f --- /dev/null +++ b/Square/Models/BulkUpdateCustomerData.cs @@ -0,0 +1,670 @@ +namespace Square.Models +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using APIMatic.Core.Utilities.Converters; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using Square; + using Square.Utilities; + + /// + /// BulkUpdateCustomerData. + /// + public class BulkUpdateCustomerData + { + private readonly Dictionary shouldSerialize; + /// + /// Initializes a new instance of the class. + /// + /// given_name. + /// family_name. + /// company_name. + /// nickname. + /// email_address. + /// address. + /// phone_number. + /// reference_id. + /// note. + /// birthday. + /// tax_ids. + /// version. + public BulkUpdateCustomerData( + string givenName = null, + string familyName = null, + string companyName = null, + string nickname = null, + string emailAddress = null, + Models.Address address = null, + string phoneNumber = null, + string referenceId = null, + string note = null, + string birthday = null, + Models.CustomerTaxIds taxIds = null, + long? version = null) + { + shouldSerialize = new Dictionary + { + { "given_name", false }, + { "family_name", false }, + { "company_name", false }, + { "nickname", false }, + { "email_address", false }, + { "phone_number", false }, + { "reference_id", false }, + { "note", false }, + { "birthday", false } + }; + + if (givenName != null) + { + shouldSerialize["given_name"] = true; + this.GivenName = givenName; + } + + if (familyName != null) + { + shouldSerialize["family_name"] = true; + this.FamilyName = familyName; + } + + if (companyName != null) + { + shouldSerialize["company_name"] = true; + this.CompanyName = companyName; + } + + if (nickname != null) + { + shouldSerialize["nickname"] = true; + this.Nickname = nickname; + } + + if (emailAddress != null) + { + shouldSerialize["email_address"] = true; + this.EmailAddress = emailAddress; + } + + this.Address = address; + if (phoneNumber != null) + { + shouldSerialize["phone_number"] = true; + this.PhoneNumber = phoneNumber; + } + + if (referenceId != null) + { + shouldSerialize["reference_id"] = true; + this.ReferenceId = referenceId; + } + + if (note != null) + { + shouldSerialize["note"] = true; + this.Note = note; + } + + if (birthday != null) + { + shouldSerialize["birthday"] = true; + this.Birthday = birthday; + } + + this.TaxIds = taxIds; + this.Version = version; + } + internal BulkUpdateCustomerData(Dictionary shouldSerialize, + string givenName = null, + string familyName = null, + string companyName = null, + string nickname = null, + string emailAddress = null, + Models.Address address = null, + string phoneNumber = null, + string referenceId = null, + string note = null, + string birthday = null, + Models.CustomerTaxIds taxIds = null, + long? version = null) + { + this.shouldSerialize = shouldSerialize; + GivenName = givenName; + FamilyName = familyName; + CompanyName = companyName; + Nickname = nickname; + EmailAddress = emailAddress; + Address = address; + PhoneNumber = phoneNumber; + ReferenceId = referenceId; + Note = note; + Birthday = birthday; + TaxIds = taxIds; + Version = version; + } + + /// + /// The given name (that is, the first name) associated with the customer profile. + /// + [JsonProperty("given_name")] + public string GivenName { get; } + + /// + /// The family name (that is, the last name) associated with the customer profile. + /// + [JsonProperty("family_name")] + public string FamilyName { get; } + + /// + /// A business name associated with the customer profile. + /// + [JsonProperty("company_name")] + public string CompanyName { get; } + + /// + /// A nickname for the customer profile. + /// + [JsonProperty("nickname")] + public string Nickname { get; } + + /// + /// The email address associated with the customer profile. + /// + [JsonProperty("email_address")] + public string EmailAddress { get; } + + /// + /// Represents a postal address in a country. + /// For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + /// + [JsonProperty("address", NullValueHandling = NullValueHandling.Ignore)] + public Models.Address Address { get; } + + /// + /// The phone number associated with the customer profile. The phone number must be valid + /// and can contain 9–16 digits, with an optional `+` prefix and country code. For more information, + /// see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + /// + [JsonProperty("phone_number")] + public string PhoneNumber { get; } + + /// + /// An optional second ID used to associate the customer profile with an + /// entity in another system. + /// + [JsonProperty("reference_id")] + public string ReferenceId { get; } + + /// + /// An custom note associates with the customer profile. + /// + [JsonProperty("note")] + public string Note { get; } + + /// + /// The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. + /// For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. + /// Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or + /// `0000` if a birth year is not specified. + /// + [JsonProperty("birthday")] + public string Birthday { get; } + + /// + /// Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom. + /// For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + /// + [JsonProperty("tax_ids", NullValueHandling = NullValueHandling.Ignore)] + public Models.CustomerTaxIds TaxIds { get; } + + /// + /// The current version of the customer profile. + /// As a best practice, you should include this field to enable + /// [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + /// control. + /// + [JsonProperty("version", NullValueHandling = NullValueHandling.Ignore)] + public long? Version { get; } + + /// + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BulkUpdateCustomerData : ({string.Join(", ", toStringOutput)})"; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeGivenName() + { + return this.shouldSerialize["given_name"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeFamilyName() + { + return this.shouldSerialize["family_name"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeCompanyName() + { + return this.shouldSerialize["company_name"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeNickname() + { + return this.shouldSerialize["nickname"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeEmailAddress() + { + return this.shouldSerialize["email_address"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializePhoneNumber() + { + return this.shouldSerialize["phone_number"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeReferenceId() + { + return this.shouldSerialize["reference_id"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeNote() + { + return this.shouldSerialize["note"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeBirthday() + { + return this.shouldSerialize["birthday"]; + } + + /// + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + return obj is BulkUpdateCustomerData other && ((this.GivenName == null && other.GivenName == null) || (this.GivenName?.Equals(other.GivenName) == true)) && + ((this.FamilyName == null && other.FamilyName == null) || (this.FamilyName?.Equals(other.FamilyName) == true)) && + ((this.CompanyName == null && other.CompanyName == null) || (this.CompanyName?.Equals(other.CompanyName) == true)) && + ((this.Nickname == null && other.Nickname == null) || (this.Nickname?.Equals(other.Nickname) == true)) && + ((this.EmailAddress == null && other.EmailAddress == null) || (this.EmailAddress?.Equals(other.EmailAddress) == true)) && + ((this.Address == null && other.Address == null) || (this.Address?.Equals(other.Address) == true)) && + ((this.PhoneNumber == null && other.PhoneNumber == null) || (this.PhoneNumber?.Equals(other.PhoneNumber) == true)) && + ((this.ReferenceId == null && other.ReferenceId == null) || (this.ReferenceId?.Equals(other.ReferenceId) == true)) && + ((this.Note == null && other.Note == null) || (this.Note?.Equals(other.Note) == true)) && + ((this.Birthday == null && other.Birthday == null) || (this.Birthday?.Equals(other.Birthday) == true)) && + ((this.TaxIds == null && other.TaxIds == null) || (this.TaxIds?.Equals(other.TaxIds) == true)) && + ((this.Version == null && other.Version == null) || (this.Version?.Equals(other.Version) == true)); + } + + /// + public override int GetHashCode() + { + int hashCode = -430816437; + hashCode = HashCode.Combine(this.GivenName, this.FamilyName, this.CompanyName, this.Nickname, this.EmailAddress, this.Address, this.PhoneNumber); + + hashCode = HashCode.Combine(hashCode, this.ReferenceId, this.Note, this.Birthday, this.TaxIds, this.Version); + + return hashCode; + } + /// + /// ToString overload. + /// + /// List of strings. + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"this.GivenName = {(this.GivenName == null ? "null" : this.GivenName)}"); + toStringOutput.Add($"this.FamilyName = {(this.FamilyName == null ? "null" : this.FamilyName)}"); + toStringOutput.Add($"this.CompanyName = {(this.CompanyName == null ? "null" : this.CompanyName)}"); + toStringOutput.Add($"this.Nickname = {(this.Nickname == null ? "null" : this.Nickname)}"); + toStringOutput.Add($"this.EmailAddress = {(this.EmailAddress == null ? "null" : this.EmailAddress)}"); + toStringOutput.Add($"this.Address = {(this.Address == null ? "null" : this.Address.ToString())}"); + toStringOutput.Add($"this.PhoneNumber = {(this.PhoneNumber == null ? "null" : this.PhoneNumber)}"); + toStringOutput.Add($"this.ReferenceId = {(this.ReferenceId == null ? "null" : this.ReferenceId)}"); + toStringOutput.Add($"this.Note = {(this.Note == null ? "null" : this.Note)}"); + toStringOutput.Add($"this.Birthday = {(this.Birthday == null ? "null" : this.Birthday)}"); + toStringOutput.Add($"this.TaxIds = {(this.TaxIds == null ? "null" : this.TaxIds.ToString())}"); + toStringOutput.Add($"this.Version = {(this.Version == null ? "null" : this.Version.ToString())}"); + } + + /// + /// Converts to builder object. + /// + /// Builder. + public Builder ToBuilder() + { + var builder = new Builder() + .GivenName(this.GivenName) + .FamilyName(this.FamilyName) + .CompanyName(this.CompanyName) + .Nickname(this.Nickname) + .EmailAddress(this.EmailAddress) + .Address(this.Address) + .PhoneNumber(this.PhoneNumber) + .ReferenceId(this.ReferenceId) + .Note(this.Note) + .Birthday(this.Birthday) + .TaxIds(this.TaxIds) + .Version(this.Version); + return builder; + } + + /// + /// Builder class. + /// + public class Builder + { + private Dictionary shouldSerialize = new Dictionary + { + { "given_name", false }, + { "family_name", false }, + { "company_name", false }, + { "nickname", false }, + { "email_address", false }, + { "phone_number", false }, + { "reference_id", false }, + { "note", false }, + { "birthday", false }, + }; + + private string givenName; + private string familyName; + private string companyName; + private string nickname; + private string emailAddress; + private Models.Address address; + private string phoneNumber; + private string referenceId; + private string note; + private string birthday; + private Models.CustomerTaxIds taxIds; + private long? version; + + /// + /// GivenName. + /// + /// givenName. + /// Builder. + public Builder GivenName(string givenName) + { + shouldSerialize["given_name"] = true; + this.givenName = givenName; + return this; + } + + /// + /// FamilyName. + /// + /// familyName. + /// Builder. + public Builder FamilyName(string familyName) + { + shouldSerialize["family_name"] = true; + this.familyName = familyName; + return this; + } + + /// + /// CompanyName. + /// + /// companyName. + /// Builder. + public Builder CompanyName(string companyName) + { + shouldSerialize["company_name"] = true; + this.companyName = companyName; + return this; + } + + /// + /// Nickname. + /// + /// nickname. + /// Builder. + public Builder Nickname(string nickname) + { + shouldSerialize["nickname"] = true; + this.nickname = nickname; + return this; + } + + /// + /// EmailAddress. + /// + /// emailAddress. + /// Builder. + public Builder EmailAddress(string emailAddress) + { + shouldSerialize["email_address"] = true; + this.emailAddress = emailAddress; + return this; + } + + /// + /// Address. + /// + /// address. + /// Builder. + public Builder Address(Models.Address address) + { + this.address = address; + return this; + } + + /// + /// PhoneNumber. + /// + /// phoneNumber. + /// Builder. + public Builder PhoneNumber(string phoneNumber) + { + shouldSerialize["phone_number"] = true; + this.phoneNumber = phoneNumber; + return this; + } + + /// + /// ReferenceId. + /// + /// referenceId. + /// Builder. + public Builder ReferenceId(string referenceId) + { + shouldSerialize["reference_id"] = true; + this.referenceId = referenceId; + return this; + } + + /// + /// Note. + /// + /// note. + /// Builder. + public Builder Note(string note) + { + shouldSerialize["note"] = true; + this.note = note; + return this; + } + + /// + /// Birthday. + /// + /// birthday. + /// Builder. + public Builder Birthday(string birthday) + { + shouldSerialize["birthday"] = true; + this.birthday = birthday; + return this; + } + + /// + /// TaxIds. + /// + /// taxIds. + /// Builder. + public Builder TaxIds(Models.CustomerTaxIds taxIds) + { + this.taxIds = taxIds; + return this; + } + + /// + /// Version. + /// + /// version. + /// Builder. + public Builder Version(long? version) + { + this.version = version; + return this; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetGivenName() + { + this.shouldSerialize["given_name"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetFamilyName() + { + this.shouldSerialize["family_name"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetCompanyName() + { + this.shouldSerialize["company_name"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetNickname() + { + this.shouldSerialize["nickname"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetEmailAddress() + { + this.shouldSerialize["email_address"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetPhoneNumber() + { + this.shouldSerialize["phone_number"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetReferenceId() + { + this.shouldSerialize["reference_id"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetNote() + { + this.shouldSerialize["note"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetBirthday() + { + this.shouldSerialize["birthday"] = false; + } + + + /// + /// Builds class object. + /// + /// BulkUpdateCustomerData. + public BulkUpdateCustomerData Build() + { + return new BulkUpdateCustomerData(shouldSerialize, + this.givenName, + this.familyName, + this.companyName, + this.nickname, + this.emailAddress, + this.address, + this.phoneNumber, + this.referenceId, + this.note, + this.birthday, + this.taxIds, + this.version); + } + } + } +} \ No newline at end of file diff --git a/Square/Models/BulkUpdateCustomersRequest.cs b/Square/Models/BulkUpdateCustomersRequest.cs new file mode 100644 index 00000000..97f91ea6 --- /dev/null +++ b/Square/Models/BulkUpdateCustomersRequest.cs @@ -0,0 +1,134 @@ +namespace Square.Models +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using APIMatic.Core.Utilities.Converters; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using Square; + using Square.Utilities; + + /// + /// BulkUpdateCustomersRequest. + /// + public class BulkUpdateCustomersRequest + { + /// + /// Initializes a new instance of the class. + /// + /// customers. + public BulkUpdateCustomersRequest( + IDictionary customers) + { + this.Customers = customers; + } + + /// + /// A map of 1 to 100 individual update requests, represented by `customer ID: { customer data }` + /// key-value pairs. + /// Each key is the ID of the [customer profile](entity:Customer) to update. To update a customer profile + /// that was created by merging existing profiles, provide the ID of the newly created profile. + /// Each value contains the updated customer data. Only new or changed fields are required. To add or + /// update a field, specify the new value. To remove a field, specify `null`. + /// + [JsonProperty("customers")] + public IDictionary Customers { get; } + + /// + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BulkUpdateCustomersRequest : ({string.Join(", ", toStringOutput)})"; + } + + /// + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + return obj is BulkUpdateCustomersRequest other && ((this.Customers == null && other.Customers == null) || (this.Customers?.Equals(other.Customers) == true)); + } + + /// + public override int GetHashCode() + { + int hashCode = 101362901; + hashCode = HashCode.Combine(this.Customers); + + return hashCode; + } + /// + /// ToString overload. + /// + /// List of strings. + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Customers = {(this.Customers == null ? "null" : this.Customers.ToString())}"); + } + + /// + /// Converts to builder object. + /// + /// Builder. + public Builder ToBuilder() + { + var builder = new Builder( + this.Customers); + return builder; + } + + /// + /// Builder class. + /// + public class Builder + { + private IDictionary customers; + + /// + /// Initialize Builder for BulkUpdateCustomersRequest. + /// + /// customers. + public Builder( + IDictionary customers) + { + this.customers = customers; + } + + /// + /// Customers. + /// + /// customers. + /// Builder. + public Builder Customers(IDictionary customers) + { + this.customers = customers; + return this; + } + + /// + /// Builds class object. + /// + /// BulkUpdateCustomersRequest. + public BulkUpdateCustomersRequest Build() + { + return new BulkUpdateCustomersRequest( + this.customers); + } + } + } +} \ No newline at end of file diff --git a/Square/Models/BulkUpdateCustomersResponse.cs b/Square/Models/BulkUpdateCustomersResponse.cs new file mode 100644 index 00000000..02161e3c --- /dev/null +++ b/Square/Models/BulkUpdateCustomersResponse.cs @@ -0,0 +1,168 @@ +namespace Square.Models +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using APIMatic.Core.Utilities.Converters; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using Square; + using Square.Http.Client; + using Square.Utilities; + + /// + /// BulkUpdateCustomersResponse. + /// + public class BulkUpdateCustomersResponse + { + /// + /// Initializes a new instance of the class. + /// + /// responses. + /// errors. + public BulkUpdateCustomersResponse( + IDictionary responses = null, + IList errors = null) + { + this.Responses = responses; + this.Errors = errors; + } + + /// + /// Gets http context. + /// + [JsonIgnore] + public HttpContext Context { get; internal set; } + + /// + /// A map of responses that correspond to individual update requests, represented by + /// key-value pairs. + /// Each key is the customer ID that was specified for an update request and each value + /// is the corresponding response. + /// If the request succeeds, the value is the updated customer profile. + /// If the request fails, the value contains any errors that occurred during the request. + /// + [JsonProperty("responses", NullValueHandling = NullValueHandling.Ignore)] + public IDictionary Responses { get; } + + /// + /// Any top-level errors that prevented the bulk operation from running. + /// + [JsonProperty("errors", NullValueHandling = NullValueHandling.Ignore)] + public IList Errors { get; } + + /// + public override string ToString() + { + var toStringOutput = new List(); + + this.ToString(toStringOutput); + + return $"BulkUpdateCustomersResponse : ({string.Join(", ", toStringOutput)})"; + } + + /// + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj == this) + { + return true; + } + return obj is BulkUpdateCustomersResponse other && ((this.Context == null && other.Context == null) || (this.Context?.Equals(other.Context) == true)) && + ((this.Responses == null && other.Responses == null) || (this.Responses?.Equals(other.Responses) == true)) && + ((this.Errors == null && other.Errors == null) || (this.Errors?.Equals(other.Errors) == true)); + } + + /// + public override int GetHashCode() + { + int hashCode = -1782802515; + + if (this.Context != null) + { + hashCode += this.Context.GetHashCode(); + } + hashCode = HashCode.Combine(this.Responses, this.Errors); + + return hashCode; + } + internal BulkUpdateCustomersResponse ContextSetter(HttpContext context) + { + this.Context = context; + return this; + } + + /// + /// ToString overload. + /// + /// List of strings. + protected void ToString(List toStringOutput) + { + toStringOutput.Add($"Responses = {(this.Responses == null ? "null" : this.Responses.ToString())}"); + toStringOutput.Add($"this.Errors = {(this.Errors == null ? "null" : $"[{string.Join(", ", this.Errors)} ]")}"); + } + + /// + /// Converts to builder object. + /// + /// Builder. + public Builder ToBuilder() + { + var builder = new Builder() + .Responses(this.Responses) + .Errors(this.Errors); + return builder; + } + + /// + /// Builder class. + /// + public class Builder + { + private IDictionary responses; + private IList errors; + + /// + /// Responses. + /// + /// responses. + /// Builder. + public Builder Responses(IDictionary responses) + { + this.responses = responses; + return this; + } + + /// + /// Errors. + /// + /// errors. + /// Builder. + public Builder Errors(IList errors) + { + this.errors = errors; + return this; + } + + /// + /// Builds class object. + /// + /// BulkUpdateCustomersResponse. + public BulkUpdateCustomersResponse Build() + { + return new BulkUpdateCustomersResponse( + this.responses, + this.errors); + } + } + } +} \ No newline at end of file diff --git a/Square/Models/BulkUpdateTeamMembersRequest.cs b/Square/Models/BulkUpdateTeamMembersRequest.cs index 18df71af..744a9616 100644 --- a/Square/Models/BulkUpdateTeamMembersRequest.cs +++ b/Square/Models/BulkUpdateTeamMembersRequest.cs @@ -94,6 +94,10 @@ public class Builder { private IDictionary teamMembers; + /// + /// Initialize Builder for BulkUpdateTeamMembersRequest. + /// + /// teamMembers. public Builder( IDictionary teamMembers) { diff --git a/Square/Models/BulkUpdateVendorsRequest.cs b/Square/Models/BulkUpdateVendorsRequest.cs index 9ad137eb..4d36b9f1 100644 --- a/Square/Models/BulkUpdateVendorsRequest.cs +++ b/Square/Models/BulkUpdateVendorsRequest.cs @@ -95,6 +95,10 @@ public class Builder { private IDictionary vendors; + /// + /// Initialize Builder for BulkUpdateVendorsRequest. + /// + /// vendors. public Builder( IDictionary vendors) { diff --git a/Square/Models/BulkUpsertBookingCustomAttributesRequest.cs b/Square/Models/BulkUpsertBookingCustomAttributesRequest.cs index aca5245c..527b15da 100644 --- a/Square/Models/BulkUpsertBookingCustomAttributesRequest.cs +++ b/Square/Models/BulkUpsertBookingCustomAttributesRequest.cs @@ -96,6 +96,10 @@ public class Builder { private IDictionary values; + /// + /// Initialize Builder for BulkUpsertBookingCustomAttributesRequest. + /// + /// values. public Builder( IDictionary values) { diff --git a/Square/Models/BulkUpsertCustomerCustomAttributesRequest.cs b/Square/Models/BulkUpsertCustomerCustomAttributesRequest.cs index 77206222..1192a0c2 100644 --- a/Square/Models/BulkUpsertCustomerCustomAttributesRequest.cs +++ b/Square/Models/BulkUpsertCustomerCustomAttributesRequest.cs @@ -96,6 +96,10 @@ public class Builder { private IDictionary values; + /// + /// Initialize Builder for BulkUpsertCustomerCustomAttributesRequest. + /// + /// values. public Builder( IDictionary values) { diff --git a/Square/Models/BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.cs b/Square/Models/BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.cs index f278c0d4..87633464 100644 --- a/Square/Models/BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.cs +++ b/Square/Models/BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.cs @@ -157,6 +157,11 @@ public class Builder private Models.CustomAttribute customAttribute; private string idempotencyKey; + /// + /// Initialize Builder for BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest. + /// + /// customerId. + /// customAttribute. public Builder( string customerId, Models.CustomAttribute customAttribute) diff --git a/Square/Models/BulkUpsertLocationCustomAttributesRequest.cs b/Square/Models/BulkUpsertLocationCustomAttributesRequest.cs index 4675df04..90560146 100644 --- a/Square/Models/BulkUpsertLocationCustomAttributesRequest.cs +++ b/Square/Models/BulkUpsertLocationCustomAttributesRequest.cs @@ -96,6 +96,10 @@ public class Builder { private IDictionary values; + /// + /// Initialize Builder for BulkUpsertLocationCustomAttributesRequest. + /// + /// values. public Builder( IDictionary values) { diff --git a/Square/Models/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.cs b/Square/Models/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.cs index 252e6051..82fbfbdf 100644 --- a/Square/Models/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.cs +++ b/Square/Models/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.cs @@ -157,6 +157,11 @@ public class Builder private Models.CustomAttribute customAttribute; private string idempotencyKey; + /// + /// Initialize Builder for BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest. + /// + /// locationId. + /// customAttribute. public Builder( string locationId, Models.CustomAttribute customAttribute) diff --git a/Square/Models/BulkUpsertMerchantCustomAttributesRequest.cs b/Square/Models/BulkUpsertMerchantCustomAttributesRequest.cs index f5ee2cce..922415bd 100644 --- a/Square/Models/BulkUpsertMerchantCustomAttributesRequest.cs +++ b/Square/Models/BulkUpsertMerchantCustomAttributesRequest.cs @@ -96,6 +96,10 @@ public class Builder { private IDictionary values; + /// + /// Initialize Builder for BulkUpsertMerchantCustomAttributesRequest. + /// + /// values. public Builder( IDictionary values) { diff --git a/Square/Models/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.cs b/Square/Models/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.cs index 4058193a..6d0c3e26 100644 --- a/Square/Models/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.cs +++ b/Square/Models/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.cs @@ -157,6 +157,11 @@ public class Builder private Models.CustomAttribute customAttribute; private string idempotencyKey; + /// + /// Initialize Builder for BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest. + /// + /// merchantId. + /// customAttribute. public Builder( string merchantId, Models.CustomAttribute customAttribute) diff --git a/Square/Models/BulkUpsertOrderCustomAttributesRequest.cs b/Square/Models/BulkUpsertOrderCustomAttributesRequest.cs index 07dc219a..f54cbc92 100644 --- a/Square/Models/BulkUpsertOrderCustomAttributesRequest.cs +++ b/Square/Models/BulkUpsertOrderCustomAttributesRequest.cs @@ -94,6 +94,10 @@ public class Builder { private IDictionary values; + /// + /// Initialize Builder for BulkUpsertOrderCustomAttributesRequest. + /// + /// values. public Builder( IDictionary values) { diff --git a/Square/Models/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.cs b/Square/Models/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.cs index e1c8b955..077fe1ac 100644 --- a/Square/Models/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.cs +++ b/Square/Models/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.cs @@ -157,6 +157,11 @@ public class Builder private string orderId; private string idempotencyKey; + /// + /// Initialize Builder for BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute. + /// + /// customAttribute. + /// orderId. public Builder( Models.CustomAttribute customAttribute, string orderId) diff --git a/Square/Models/BulkUpsertOrderCustomAttributesResponse.cs b/Square/Models/BulkUpsertOrderCustomAttributesResponse.cs index 199e409a..911dac5e 100644 --- a/Square/Models/BulkUpsertOrderCustomAttributesResponse.cs +++ b/Square/Models/BulkUpsertOrderCustomAttributesResponse.cs @@ -126,6 +126,10 @@ public class Builder private IDictionary values; private IList errors; + /// + /// Initialize Builder for BulkUpsertOrderCustomAttributesResponse. + /// + /// values. public Builder( IDictionary values) { diff --git a/Square/Models/CalculateOrderRequest.cs b/Square/Models/CalculateOrderRequest.cs index a00dbaaf..2a8652b6 100644 --- a/Square/Models/CalculateOrderRequest.cs +++ b/Square/Models/CalculateOrderRequest.cs @@ -148,6 +148,10 @@ public class Builder private Models.Order order; private IList proposedRewards; + /// + /// Initialize Builder for CalculateOrderRequest. + /// + /// order. public Builder( Models.Order order) { diff --git a/Square/Models/CancelInvoiceRequest.cs b/Square/Models/CancelInvoiceRequest.cs index 4c4d9a0d..b90d7a8c 100644 --- a/Square/Models/CancelInvoiceRequest.cs +++ b/Square/Models/CancelInvoiceRequest.cs @@ -96,6 +96,10 @@ public class Builder { private int version; + /// + /// Initialize Builder for CancelInvoiceRequest. + /// + /// version. public Builder( int version) { diff --git a/Square/Models/CancelPaymentByIdempotencyKeyRequest.cs b/Square/Models/CancelPaymentByIdempotencyKeyRequest.cs index 9005e1bd..b8d30ec2 100644 --- a/Square/Models/CancelPaymentByIdempotencyKeyRequest.cs +++ b/Square/Models/CancelPaymentByIdempotencyKeyRequest.cs @@ -94,6 +94,10 @@ public class Builder { private string idempotencyKey; + /// + /// Initialize Builder for CancelPaymentByIdempotencyKeyRequest. + /// + /// idempotencyKey. public Builder( string idempotencyKey) { diff --git a/Square/Models/CashPaymentDetails.cs b/Square/Models/CashPaymentDetails.cs index 5b4b3404..0c7b01eb 100644 --- a/Square/Models/CashPaymentDetails.cs +++ b/Square/Models/CashPaymentDetails.cs @@ -117,6 +117,10 @@ public class Builder private Models.Money buyerSuppliedMoney; private Models.Money changeBackMoney; + /// + /// Initialize Builder for CashPaymentDetails. + /// + /// buyerSuppliedMoney. public Builder( Models.Money buyerSuppliedMoney) { diff --git a/Square/Models/CatalogCustomAttributeDefinition.cs b/Square/Models/CatalogCustomAttributeDefinition.cs index ddbb6177..53c23853 100644 --- a/Square/Models/CatalogCustomAttributeDefinition.cs +++ b/Square/Models/CatalogCustomAttributeDefinition.cs @@ -322,6 +322,12 @@ public class Builder private int? customAttributeUsageCount; private string key; + /// + /// Initialize Builder for CatalogCustomAttributeDefinition. + /// + /// type. + /// name. + /// allowedObjectTypes. public Builder( string type, string name, diff --git a/Square/Models/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.cs b/Square/Models/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.cs index c5e16f07..9244ae51 100644 --- a/Square/Models/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.cs +++ b/Square/Models/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.cs @@ -140,6 +140,10 @@ public class Builder private string name; private string uid; + /// + /// Initialize Builder for CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection. + /// + /// name. public Builder( string name) { diff --git a/Square/Models/CatalogItemModifierListInfo.cs b/Square/Models/CatalogItemModifierListInfo.cs index 37feef3b..a703ba30 100644 --- a/Square/Models/CatalogItemModifierListInfo.cs +++ b/Square/Models/CatalogItemModifierListInfo.cs @@ -27,19 +27,22 @@ public class CatalogItemModifierListInfo /// min_selected_modifiers. /// max_selected_modifiers. /// enabled. + /// ordinal. public CatalogItemModifierListInfo( string modifierListId, IList modifierOverrides = null, int? minSelectedModifiers = null, int? maxSelectedModifiers = null, - bool? enabled = null) + bool? enabled = null, + int? ordinal = null) { shouldSerialize = new Dictionary { { "modifier_overrides", false }, { "min_selected_modifiers", false }, { "max_selected_modifiers", false }, - { "enabled", false } + { "enabled", false }, + { "ordinal", false } }; this.ModifierListId = modifierListId; @@ -67,13 +70,20 @@ public CatalogItemModifierListInfo( this.Enabled = enabled; } + if (ordinal != null) + { + shouldSerialize["ordinal"] = true; + this.Ordinal = ordinal; + } + } internal CatalogItemModifierListInfo(Dictionary shouldSerialize, string modifierListId, IList modifierOverrides = null, int? minSelectedModifiers = null, int? maxSelectedModifiers = null, - bool? enabled = null) + bool? enabled = null, + int? ordinal = null) { this.shouldSerialize = shouldSerialize; ModifierListId = modifierListId; @@ -81,6 +91,7 @@ internal CatalogItemModifierListInfo(Dictionary shouldSerialize, MinSelectedModifiers = minSelectedModifiers; MaxSelectedModifiers = maxSelectedModifiers; Enabled = enabled; + Ordinal = ordinal; } /// @@ -113,6 +124,13 @@ internal CatalogItemModifierListInfo(Dictionary shouldSerialize, [JsonProperty("enabled")] public bool? Enabled { get; } + /// + /// The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` list applied + /// to a `CatalogItem` instance. + /// + [JsonProperty("ordinal")] + public int? Ordinal { get; } + /// public override string ToString() { @@ -159,6 +177,15 @@ public bool ShouldSerializeEnabled() return this.shouldSerialize["enabled"]; } + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeOrdinal() + { + return this.shouldSerialize["ordinal"]; + } + /// public override bool Equals(object obj) { @@ -175,14 +202,15 @@ public override bool Equals(object obj) ((this.ModifierOverrides == null && other.ModifierOverrides == null) || (this.ModifierOverrides?.Equals(other.ModifierOverrides) == true)) && ((this.MinSelectedModifiers == null && other.MinSelectedModifiers == null) || (this.MinSelectedModifiers?.Equals(other.MinSelectedModifiers) == true)) && ((this.MaxSelectedModifiers == null && other.MaxSelectedModifiers == null) || (this.MaxSelectedModifiers?.Equals(other.MaxSelectedModifiers) == true)) && - ((this.Enabled == null && other.Enabled == null) || (this.Enabled?.Equals(other.Enabled) == true)); + ((this.Enabled == null && other.Enabled == null) || (this.Enabled?.Equals(other.Enabled) == true)) && + ((this.Ordinal == null && other.Ordinal == null) || (this.Ordinal?.Equals(other.Ordinal) == true)); } /// public override int GetHashCode() { - int hashCode = 1904387422; - hashCode = HashCode.Combine(this.ModifierListId, this.ModifierOverrides, this.MinSelectedModifiers, this.MaxSelectedModifiers, this.Enabled); + int hashCode = -351709295; + hashCode = HashCode.Combine(this.ModifierListId, this.ModifierOverrides, this.MinSelectedModifiers, this.MaxSelectedModifiers, this.Enabled, this.Ordinal); return hashCode; } @@ -197,6 +225,7 @@ protected void ToString(List toStringOutput) toStringOutput.Add($"this.MinSelectedModifiers = {(this.MinSelectedModifiers == null ? "null" : this.MinSelectedModifiers.ToString())}"); toStringOutput.Add($"this.MaxSelectedModifiers = {(this.MaxSelectedModifiers == null ? "null" : this.MaxSelectedModifiers.ToString())}"); toStringOutput.Add($"this.Enabled = {(this.Enabled == null ? "null" : this.Enabled.ToString())}"); + toStringOutput.Add($"this.Ordinal = {(this.Ordinal == null ? "null" : this.Ordinal.ToString())}"); } /// @@ -210,7 +239,8 @@ public Builder ToBuilder() .ModifierOverrides(this.ModifierOverrides) .MinSelectedModifiers(this.MinSelectedModifiers) .MaxSelectedModifiers(this.MaxSelectedModifiers) - .Enabled(this.Enabled); + .Enabled(this.Enabled) + .Ordinal(this.Ordinal); return builder; } @@ -225,6 +255,7 @@ public class Builder { "min_selected_modifiers", false }, { "max_selected_modifiers", false }, { "enabled", false }, + { "ordinal", false }, }; private string modifierListId; @@ -232,7 +263,12 @@ public class Builder private int? minSelectedModifiers; private int? maxSelectedModifiers; private bool? enabled; + private int? ordinal; + /// + /// Initialize Builder for CatalogItemModifierListInfo. + /// + /// modifierListId. public Builder( string modifierListId) { @@ -298,6 +334,18 @@ public Builder Enabled(bool? enabled) return this; } + /// + /// Ordinal. + /// + /// ordinal. + /// Builder. + public Builder Ordinal(int? ordinal) + { + shouldSerialize["ordinal"] = true; + this.ordinal = ordinal; + return this; + } + /// /// Marks the field to not be serailized. /// @@ -330,6 +378,14 @@ public void UnsetEnabled() this.shouldSerialize["enabled"] = false; } + /// + /// Marks the field to not be serailized. + /// + public void UnsetOrdinal() + { + this.shouldSerialize["ordinal"] = false; + } + /// /// Builds class object. @@ -342,7 +398,8 @@ public CatalogItemModifierListInfo Build() this.modifierOverrides, this.minSelectedModifiers, this.maxSelectedModifiers, - this.enabled); + this.enabled, + this.ordinal); } } } diff --git a/Square/Models/CatalogModifierList.cs b/Square/Models/CatalogModifierList.cs index bd61a5ad..786a89f3 100644 --- a/Square/Models/CatalogModifierList.cs +++ b/Square/Models/CatalogModifierList.cs @@ -27,19 +27,30 @@ public class CatalogModifierList /// selection_type. /// modifiers. /// image_ids. + /// modifier_type. + /// max_length. + /// text_required. + /// internal_name. public CatalogModifierList( string name = null, int? ordinal = null, string selectionType = null, IList modifiers = null, - IList imageIds = null) + IList imageIds = null, + string modifierType = null, + int? maxLength = null, + bool? textRequired = null, + string internalName = null) { shouldSerialize = new Dictionary { { "name", false }, { "ordinal", false }, { "modifiers", false }, - { "image_ids", false } + { "image_ids", false }, + { "max_length", false }, + { "text_required", false }, + { "internal_name", false } }; if (name != null) @@ -67,13 +78,36 @@ public CatalogModifierList( this.ImageIds = imageIds; } + this.ModifierType = modifierType; + if (maxLength != null) + { + shouldSerialize["max_length"] = true; + this.MaxLength = maxLength; + } + + if (textRequired != null) + { + shouldSerialize["text_required"] = true; + this.TextRequired = textRequired; + } + + if (internalName != null) + { + shouldSerialize["internal_name"] = true; + this.InternalName = internalName; + } + } internal CatalogModifierList(Dictionary shouldSerialize, string name = null, int? ordinal = null, string selectionType = null, IList modifiers = null, - IList imageIds = null) + IList imageIds = null, + string modifierType = null, + int? maxLength = null, + bool? textRequired = null, + string internalName = null) { this.shouldSerialize = shouldSerialize; Name = name; @@ -81,16 +115,21 @@ internal CatalogModifierList(Dictionary shouldSerialize, SelectionType = selectionType; Modifiers = modifiers; ImageIds = imageIds; + ModifierType = modifierType; + MaxLength = maxLength; + TextRequired = textRequired; + InternalName = internalName; } /// - /// The name for the `CatalogModifierList` instance. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points. + /// The name of the `CatalogModifierList` instance. This is a searchable attribute for use in applicable query filters, and its value length is of + /// Unicode code points. /// [JsonProperty("name")] public string Name { get; } /// - /// Determines where this modifier list appears in a list of `CatalogModifierList` values. + /// The position of this `CatalogModifierList` within a list of `CatalogModifierList` instances. /// [JsonProperty("ordinal")] public int? Ordinal { get; } @@ -102,21 +141,58 @@ internal CatalogModifierList(Dictionary shouldSerialize, public string SelectionType { get; } /// - /// The options included in the `CatalogModifierList`. - /// You must include at least one `CatalogModifier`. - /// Each CatalogObject must have type `MODIFIER` and contain - /// `CatalogModifier` data. + /// A non-empty list of `CatalogModifier` objects to be included in the `CatalogModifierList`, + /// for non text-based modifiers when the `modifier_type` attribute is `LIST`. Each element of this list + /// is a `CatalogObject` instance of the `MODIFIER` type, containing the following attributes: + /// ``` + /// { + /// "id": "{{catalog_modifier_id}}", + /// "type": "MODIFIER", + /// "modifier_data": {{a CatalogModifier instance>}} + /// } + /// ``` /// [JsonProperty("modifiers")] public IList Modifiers { get; } /// /// The IDs of images associated with this `CatalogModifierList` instance. - /// Currently these images are not displayed by Square, but are free to be displayed in 3rd party applications. + /// Currently these images are not displayed on Square products, but may be displayed in 3rd-party applications. /// [JsonProperty("image_ids")] public IList ImageIds { get; } + /// + /// Defines the type of `CatalogModifierList`. + /// + [JsonProperty("modifier_type", NullValueHandling = NullValueHandling.Ignore)] + public string ModifierType { get; } + + /// + /// The maximum length, in Unicode points, of the text string of the text-based modifier as represented by + /// this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. + /// + [JsonProperty("max_length")] + public int? MaxLength { get; } + + /// + /// Whether the text string must be a non-empty string (`true`) or not (`false`) for a text-based modifier + /// as represented by this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. + /// + [JsonProperty("text_required")] + public bool? TextRequired { get; } + + /// + /// A note for internal use by the business. + /// For example, for a text-based modifier applied to a T-shirt item, if the buyer-supplied text of "Hello, Kitty!" + /// is to be printed on the T-shirt, this `internal_name` attribute can be "Use italic face" as + /// an instruction for the business to follow. + /// For non text-based modifiers, this `internal_name` attribute can be + /// used to include SKUs, internal codes, or supplemental descriptions for internal use. + /// + [JsonProperty("internal_name")] + public string InternalName { get; } + /// public override string ToString() { @@ -163,6 +239,33 @@ public bool ShouldSerializeImageIds() return this.shouldSerialize["image_ids"]; } + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeMaxLength() + { + return this.shouldSerialize["max_length"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeTextRequired() + { + return this.shouldSerialize["text_required"]; + } + + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeInternalName() + { + return this.shouldSerialize["internal_name"]; + } + /// public override bool Equals(object obj) { @@ -179,14 +282,20 @@ public override bool Equals(object obj) ((this.Ordinal == null && other.Ordinal == null) || (this.Ordinal?.Equals(other.Ordinal) == true)) && ((this.SelectionType == null && other.SelectionType == null) || (this.SelectionType?.Equals(other.SelectionType) == true)) && ((this.Modifiers == null && other.Modifiers == null) || (this.Modifiers?.Equals(other.Modifiers) == true)) && - ((this.ImageIds == null && other.ImageIds == null) || (this.ImageIds?.Equals(other.ImageIds) == true)); + ((this.ImageIds == null && other.ImageIds == null) || (this.ImageIds?.Equals(other.ImageIds) == true)) && + ((this.ModifierType == null && other.ModifierType == null) || (this.ModifierType?.Equals(other.ModifierType) == true)) && + ((this.MaxLength == null && other.MaxLength == null) || (this.MaxLength?.Equals(other.MaxLength) == true)) && + ((this.TextRequired == null && other.TextRequired == null) || (this.TextRequired?.Equals(other.TextRequired) == true)) && + ((this.InternalName == null && other.InternalName == null) || (this.InternalName?.Equals(other.InternalName) == true)); } /// public override int GetHashCode() { - int hashCode = -1226843592; - hashCode = HashCode.Combine(this.Name, this.Ordinal, this.SelectionType, this.Modifiers, this.ImageIds); + int hashCode = 35199234; + hashCode = HashCode.Combine(this.Name, this.Ordinal, this.SelectionType, this.Modifiers, this.ImageIds, this.ModifierType, this.MaxLength); + + hashCode = HashCode.Combine(hashCode, this.TextRequired, this.InternalName); return hashCode; } @@ -201,6 +310,10 @@ protected void ToString(List toStringOutput) toStringOutput.Add($"this.SelectionType = {(this.SelectionType == null ? "null" : this.SelectionType.ToString())}"); toStringOutput.Add($"this.Modifiers = {(this.Modifiers == null ? "null" : $"[{string.Join(", ", this.Modifiers)} ]")}"); toStringOutput.Add($"this.ImageIds = {(this.ImageIds == null ? "null" : $"[{string.Join(", ", this.ImageIds)} ]")}"); + toStringOutput.Add($"this.ModifierType = {(this.ModifierType == null ? "null" : this.ModifierType.ToString())}"); + toStringOutput.Add($"this.MaxLength = {(this.MaxLength == null ? "null" : this.MaxLength.ToString())}"); + toStringOutput.Add($"this.TextRequired = {(this.TextRequired == null ? "null" : this.TextRequired.ToString())}"); + toStringOutput.Add($"this.InternalName = {(this.InternalName == null ? "null" : this.InternalName)}"); } /// @@ -214,7 +327,11 @@ public Builder ToBuilder() .Ordinal(this.Ordinal) .SelectionType(this.SelectionType) .Modifiers(this.Modifiers) - .ImageIds(this.ImageIds); + .ImageIds(this.ImageIds) + .ModifierType(this.ModifierType) + .MaxLength(this.MaxLength) + .TextRequired(this.TextRequired) + .InternalName(this.InternalName); return builder; } @@ -229,6 +346,9 @@ public class Builder { "ordinal", false }, { "modifiers", false }, { "image_ids", false }, + { "max_length", false }, + { "text_required", false }, + { "internal_name", false }, }; private string name; @@ -236,6 +356,10 @@ public class Builder private string selectionType; private IList modifiers; private IList imageIds; + private string modifierType; + private int? maxLength; + private bool? textRequired; + private string internalName; /// /// Name. @@ -296,6 +420,53 @@ public Builder ImageIds(IList imageIds) return this; } + /// + /// ModifierType. + /// + /// modifierType. + /// Builder. + public Builder ModifierType(string modifierType) + { + this.modifierType = modifierType; + return this; + } + + /// + /// MaxLength. + /// + /// maxLength. + /// Builder. + public Builder MaxLength(int? maxLength) + { + shouldSerialize["max_length"] = true; + this.maxLength = maxLength; + return this; + } + + /// + /// TextRequired. + /// + /// textRequired. + /// Builder. + public Builder TextRequired(bool? textRequired) + { + shouldSerialize["text_required"] = true; + this.textRequired = textRequired; + return this; + } + + /// + /// InternalName. + /// + /// internalName. + /// Builder. + public Builder InternalName(string internalName) + { + shouldSerialize["internal_name"] = true; + this.internalName = internalName; + return this; + } + /// /// Marks the field to not be serailized. /// @@ -328,6 +499,30 @@ public void UnsetImageIds() this.shouldSerialize["image_ids"] = false; } + /// + /// Marks the field to not be serailized. + /// + public void UnsetMaxLength() + { + this.shouldSerialize["max_length"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetTextRequired() + { + this.shouldSerialize["text_required"] = false; + } + + /// + /// Marks the field to not be serailized. + /// + public void UnsetInternalName() + { + this.shouldSerialize["internal_name"] = false; + } + /// /// Builds class object. @@ -340,7 +535,11 @@ public CatalogModifierList Build() this.ordinal, this.selectionType, this.modifiers, - this.imageIds); + this.imageIds, + this.modifierType, + this.maxLength, + this.textRequired, + this.internalName); } } } diff --git a/Square/Models/CatalogModifierOverride.cs b/Square/Models/CatalogModifierOverride.cs index f6c992f0..579d6b56 100644 --- a/Square/Models/CatalogModifierOverride.cs +++ b/Square/Models/CatalogModifierOverride.cs @@ -140,6 +140,10 @@ public class Builder private string modifierId; private bool? onByDefault; + /// + /// Initialize Builder for CatalogModifierOverride. + /// + /// modifierId. public Builder( string modifierId) { diff --git a/Square/Models/CatalogObject.cs b/Square/Models/CatalogObject.cs index abdfc75c..b047e5da 100644 --- a/Square/Models/CatalogObject.cs +++ b/Square/Models/CatalogObject.cs @@ -342,11 +342,16 @@ internal CatalogObject(Dictionary shouldSerialize, public Models.CatalogDiscount DiscountData { get; } /// - /// A list of modifiers applicable to items at the time of sale. + /// For a text-based modifier, this encapsulates the modifier's text when its `modifier_type` is `TEXT`. + /// For example, to sell T-shirts with custom prints, a text-based modifier can be used to capture the buyer-supplied + /// text string to be selected for the T-shirt at the time of sale. + /// For non text-based modifiers, this encapsulates a non-empty list of modifiers applicable to items + /// at the time of sale. Each element of the modifier list is a `CatalogObject` instance of the `MODIFIER` type. /// For example, a "Condiments" modifier list applicable to a "Hot Dog" item /// may contain "Ketchup", "Mustard", and "Relish" modifiers. - /// Use the `selection_type` field to specify whether or not multiple selections from - /// the modifier list are allowed. + /// A non text-based modifier can be applied to the modified item once or multiple times, if the `selection_type` field + /// is set to `SINGLE` or `MULTIPLE`, respectively. On the other hand, a text-based modifier can be applied to the item + /// only once and the `selection_type` field is always set to `SINGLE`. /// [JsonProperty("modifier_list_data", NullValueHandling = NullValueHandling.Ignore)] public Models.CatalogModifierList ModifierListData { get; } @@ -692,6 +697,11 @@ public class Builder private Models.CatalogSubscriptionPlanVariation subscriptionPlanVariationData; private Models.CatalogAvailabilityPeriod availabilityPeriodData; + /// + /// Initialize Builder for CatalogObject. + /// + /// type. + /// id. public Builder( string type, string id) diff --git a/Square/Models/CatalogObjectBatch.cs b/Square/Models/CatalogObjectBatch.cs index 1b4faecb..07d230d0 100644 --- a/Square/Models/CatalogObjectBatch.cs +++ b/Square/Models/CatalogObjectBatch.cs @@ -94,6 +94,10 @@ public class Builder { private IList objects; + /// + /// Initialize Builder for CatalogObjectBatch. + /// + /// objects. public Builder( IList objects) { diff --git a/Square/Models/CatalogQueryExact.cs b/Square/Models/CatalogQueryExact.cs index c79cbaff..b7e17441 100644 --- a/Square/Models/CatalogQueryExact.cs +++ b/Square/Models/CatalogQueryExact.cs @@ -108,6 +108,11 @@ public class Builder private string attributeName; private string attributeValue; + /// + /// Initialize Builder for CatalogQueryExact. + /// + /// attributeName. + /// attributeValue. public Builder( string attributeName, string attributeValue) diff --git a/Square/Models/CatalogQueryItemsForModifierList.cs b/Square/Models/CatalogQueryItemsForModifierList.cs index 8ce66b3e..18444256 100644 --- a/Square/Models/CatalogQueryItemsForModifierList.cs +++ b/Square/Models/CatalogQueryItemsForModifierList.cs @@ -94,6 +94,10 @@ public class Builder { private IList modifierListIds; + /// + /// Initialize Builder for CatalogQueryItemsForModifierList. + /// + /// modifierListIds. public Builder( IList modifierListIds) { diff --git a/Square/Models/CatalogQueryItemsForTax.cs b/Square/Models/CatalogQueryItemsForTax.cs index f6fcfd3a..01e32490 100644 --- a/Square/Models/CatalogQueryItemsForTax.cs +++ b/Square/Models/CatalogQueryItemsForTax.cs @@ -94,6 +94,10 @@ public class Builder { private IList taxIds; + /// + /// Initialize Builder for CatalogQueryItemsForTax. + /// + /// taxIds. public Builder( IList taxIds) { diff --git a/Square/Models/CatalogQueryPrefix.cs b/Square/Models/CatalogQueryPrefix.cs index 2e382134..9347f3e2 100644 --- a/Square/Models/CatalogQueryPrefix.cs +++ b/Square/Models/CatalogQueryPrefix.cs @@ -107,6 +107,11 @@ public class Builder private string attributeName; private string attributePrefix; + /// + /// Initialize Builder for CatalogQueryPrefix. + /// + /// attributeName. + /// attributePrefix. public Builder( string attributeName, string attributePrefix) diff --git a/Square/Models/CatalogQueryRange.cs b/Square/Models/CatalogQueryRange.cs index eb5937e7..fefb4ef3 100644 --- a/Square/Models/CatalogQueryRange.cs +++ b/Square/Models/CatalogQueryRange.cs @@ -171,6 +171,10 @@ public class Builder private long? attributeMinValue; private long? attributeMaxValue; + /// + /// Initialize Builder for CatalogQueryRange. + /// + /// attributeName. public Builder( string attributeName) { diff --git a/Square/Models/CatalogQuerySet.cs b/Square/Models/CatalogQuerySet.cs index 8a834725..e81bc9de 100644 --- a/Square/Models/CatalogQuerySet.cs +++ b/Square/Models/CatalogQuerySet.cs @@ -108,6 +108,11 @@ public class Builder private string attributeName; private IList attributeValues; + /// + /// Initialize Builder for CatalogQuerySet. + /// + /// attributeName. + /// attributeValues. public Builder( string attributeName, IList attributeValues) diff --git a/Square/Models/CatalogQuerySortedAttribute.cs b/Square/Models/CatalogQuerySortedAttribute.cs index f6e9073f..484a55b2 100644 --- a/Square/Models/CatalogQuerySortedAttribute.cs +++ b/Square/Models/CatalogQuerySortedAttribute.cs @@ -157,6 +157,10 @@ public class Builder private string initialAttributeValue; private string sortOrder; + /// + /// Initialize Builder for CatalogQuerySortedAttribute. + /// + /// attributeName. public Builder( string attributeName) { diff --git a/Square/Models/CatalogQueryText.cs b/Square/Models/CatalogQueryText.cs index a5f53ea8..f7349af3 100644 --- a/Square/Models/CatalogQueryText.cs +++ b/Square/Models/CatalogQueryText.cs @@ -94,6 +94,10 @@ public class Builder { private IList keywords; + /// + /// Initialize Builder for CatalogQueryText. + /// + /// keywords. public Builder( IList keywords) { diff --git a/Square/Models/CatalogQuickAmount.cs b/Square/Models/CatalogQuickAmount.cs index 8012c316..bc067727 100644 --- a/Square/Models/CatalogQuickAmount.cs +++ b/Square/Models/CatalogQuickAmount.cs @@ -192,6 +192,11 @@ public class Builder private long? score; private long? ordinal; + /// + /// Initialize Builder for CatalogQuickAmount. + /// + /// type. + /// amount. public Builder( string type, Models.Money amount) diff --git a/Square/Models/CatalogQuickAmountsSettings.cs b/Square/Models/CatalogQuickAmountsSettings.cs index faa68ca4..e35fcb76 100644 --- a/Square/Models/CatalogQuickAmountsSettings.cs +++ b/Square/Models/CatalogQuickAmountsSettings.cs @@ -172,6 +172,10 @@ public class Builder private bool? eligibleForAutoAmounts; private IList amounts; + /// + /// Initialize Builder for CatalogQuickAmountsSettings. + /// + /// option. public Builder( string option) { diff --git a/Square/Models/CatalogStockConversion.cs b/Square/Models/CatalogStockConversion.cs index 86dc2dcb..f90b39e9 100644 --- a/Square/Models/CatalogStockConversion.cs +++ b/Square/Models/CatalogStockConversion.cs @@ -131,6 +131,12 @@ public class Builder private string stockableQuantity; private string nonstockableQuantity; + /// + /// Initialize Builder for CatalogStockConversion. + /// + /// stockableItemVariationId. + /// stockableQuantity. + /// nonstockableQuantity. public Builder( string stockableItemVariationId, string stockableQuantity, diff --git a/Square/Models/CatalogSubscriptionPlan.cs b/Square/Models/CatalogSubscriptionPlan.cs index 17ff2ce6..b17c1847 100644 --- a/Square/Models/CatalogSubscriptionPlan.cs +++ b/Square/Models/CatalogSubscriptionPlan.cs @@ -265,6 +265,10 @@ public class Builder private IList eligibleCategoryIds; private bool? allItems; + /// + /// Initialize Builder for CatalogSubscriptionPlan. + /// + /// name. public Builder( string name) { diff --git a/Square/Models/CatalogSubscriptionPlanVariation.cs b/Square/Models/CatalogSubscriptionPlanVariation.cs index 9bb737ea..e665ab11 100644 --- a/Square/Models/CatalogSubscriptionPlanVariation.cs +++ b/Square/Models/CatalogSubscriptionPlanVariation.cs @@ -250,6 +250,11 @@ public class Builder private bool? canProrate; private string successorPlanVariationId; + /// + /// Initialize Builder for CatalogSubscriptionPlanVariation. + /// + /// name. + /// phases. public Builder( string name, IList phases) diff --git a/Square/Models/ChargeRequest.cs b/Square/Models/ChargeRequest.cs index ab020a1f..6724ff9d 100644 --- a/Square/Models/ChargeRequest.cs +++ b/Square/Models/ChargeRequest.cs @@ -508,6 +508,11 @@ public class Builder private IList additionalRecipients; private string verificationToken; + /// + /// Initialize Builder for ChargeRequest. + /// + /// idempotencyKey. + /// amountMoney. public Builder( string idempotencyKey, Models.Money amountMoney) diff --git a/Square/Models/ChargeRequestAdditionalRecipient.cs b/Square/Models/ChargeRequestAdditionalRecipient.cs index 2d6904aa..698e050d 100644 --- a/Square/Models/ChargeRequestAdditionalRecipient.cs +++ b/Square/Models/ChargeRequestAdditionalRecipient.cs @@ -125,6 +125,12 @@ public class Builder private string description; private Models.Money amountMoney; + /// + /// Initialize Builder for ChargeRequestAdditionalRecipient. + /// + /// locationId. + /// description. + /// amountMoney. public Builder( string locationId, string description, diff --git a/Square/Models/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.cs b/Square/Models/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.cs index cc82e333..afc40e72 100644 --- a/Square/Models/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.cs +++ b/Square/Models/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.cs @@ -117,6 +117,11 @@ public class Builder private Models.Money min; private Models.Money max; + /// + /// Initialize Builder for CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange. + /// + /// min. + /// max. public Builder( Models.Money min, Models.Money max) diff --git a/Square/Models/CloneOrderRequest.cs b/Square/Models/CloneOrderRequest.cs index dac6771e..50e12d9c 100644 --- a/Square/Models/CloneOrderRequest.cs +++ b/Square/Models/CloneOrderRequest.cs @@ -162,6 +162,10 @@ public class Builder private int? version; private string idempotencyKey; + /// + /// Initialize Builder for CloneOrderRequest. + /// + /// orderId. public Builder( string orderId) { diff --git a/Square/Models/Component.cs b/Square/Models/Component.cs index 0b2c91ab..21bf96f2 100644 --- a/Square/Models/Component.cs +++ b/Square/Models/Component.cs @@ -159,6 +159,10 @@ public class Builder private Models.DeviceComponentDetailsWiFiDetails wifiDetails; private Models.DeviceComponentDetailsEthernetDetails ethernetDetails; + /// + /// Initialize Builder for Component. + /// + /// type. public Builder( string type) { diff --git a/Square/Models/ConfirmationOptions.cs b/Square/Models/ConfirmationOptions.cs index 516eec3a..b6debf28 100644 --- a/Square/Models/ConfirmationOptions.cs +++ b/Square/Models/ConfirmationOptions.cs @@ -185,6 +185,12 @@ public class Builder private string disagreeButtonText; private Models.ConfirmationDecision decision; + /// + /// Initialize Builder for ConfirmationOptions. + /// + /// title. + /// body. + /// agreeButtonText. public Builder( string title, string body, diff --git a/Square/Models/CreateBookingCustomAttributeDefinitionRequest.cs b/Square/Models/CreateBookingCustomAttributeDefinitionRequest.cs index 6fdf4175..95c33cfc 100644 --- a/Square/Models/CreateBookingCustomAttributeDefinitionRequest.cs +++ b/Square/Models/CreateBookingCustomAttributeDefinitionRequest.cs @@ -109,6 +109,10 @@ public class Builder private Models.CustomAttributeDefinition customAttributeDefinition; private string idempotencyKey; + /// + /// Initialize Builder for CreateBookingCustomAttributeDefinitionRequest. + /// + /// customAttributeDefinition. public Builder( Models.CustomAttributeDefinition customAttributeDefinition) { diff --git a/Square/Models/CreateBookingRequest.cs b/Square/Models/CreateBookingRequest.cs index b8c75271..7f7efffd 100644 --- a/Square/Models/CreateBookingRequest.cs +++ b/Square/Models/CreateBookingRequest.cs @@ -108,6 +108,10 @@ public class Builder private Models.Booking booking; private string idempotencyKey; + /// + /// Initialize Builder for CreateBookingRequest. + /// + /// booking. public Builder( Models.Booking booking) { diff --git a/Square/Models/CreateBreakTypeRequest.cs b/Square/Models/CreateBreakTypeRequest.cs index d1185d21..6491afb7 100644 --- a/Square/Models/CreateBreakTypeRequest.cs +++ b/Square/Models/CreateBreakTypeRequest.cs @@ -108,6 +108,10 @@ public class Builder private Models.BreakType breakType; private string idempotencyKey; + /// + /// Initialize Builder for CreateBreakTypeRequest. + /// + /// breakType. public Builder( Models.BreakType breakType) { diff --git a/Square/Models/CreateCardRequest.cs b/Square/Models/CreateCardRequest.cs index 979c607d..727456bb 100644 --- a/Square/Models/CreateCardRequest.cs +++ b/Square/Models/CreateCardRequest.cs @@ -140,6 +140,12 @@ public class Builder private Models.Card card; private string verificationToken; + /// + /// Initialize Builder for CreateCardRequest. + /// + /// idempotencyKey. + /// sourceId. + /// card. public Builder( string idempotencyKey, string sourceId, diff --git a/Square/Models/CreateCatalogImageRequest.cs b/Square/Models/CreateCatalogImageRequest.cs index 8daa35db..cdaa8513 100644 --- a/Square/Models/CreateCatalogImageRequest.cs +++ b/Square/Models/CreateCatalogImageRequest.cs @@ -54,12 +54,14 @@ public CreateCatalogImageRequest( public string ObjectId { get; } /// + /// `, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. /// For a more detailed discussion of the Catalog data model, please see the /// [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + /// ]]> /// [JsonProperty("image")] public Models.CatalogObject Image { get; } @@ -145,6 +147,11 @@ public class Builder private string objectId; private bool? isPrimary; + /// + /// Initialize Builder for CreateCatalogImageRequest. + /// + /// idempotencyKey. + /// image. public Builder( string idempotencyKey, Models.CatalogObject image) diff --git a/Square/Models/CreateCatalogImageResponse.cs b/Square/Models/CreateCatalogImageResponse.cs index 1440a456..ac999509 100644 --- a/Square/Models/CreateCatalogImageResponse.cs +++ b/Square/Models/CreateCatalogImageResponse.cs @@ -45,12 +45,14 @@ public CreateCatalogImageResponse( public IList Errors { get; } /// + /// `, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. /// For a more detailed discussion of the Catalog data model, please see the /// [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + /// ]]> /// [JsonProperty("image", NullValueHandling = NullValueHandling.Ignore)] public Models.CatalogObject Image { get; } diff --git a/Square/Models/CreateCheckoutRequest.cs b/Square/Models/CreateCheckoutRequest.cs index 87e21867..27f9e866 100644 --- a/Square/Models/CreateCheckoutRequest.cs +++ b/Square/Models/CreateCheckoutRequest.cs @@ -232,6 +232,11 @@ public class Builder private IList additionalRecipients; private string note; + /// + /// Initialize Builder for CreateCheckoutRequest. + /// + /// idempotencyKey. + /// order. public Builder( string idempotencyKey, Models.CreateOrderRequest order) diff --git a/Square/Models/CreateCustomerCardRequest.cs b/Square/Models/CreateCustomerCardRequest.cs index f14707e2..0ebde9ca 100644 --- a/Square/Models/CreateCustomerCardRequest.cs +++ b/Square/Models/CreateCustomerCardRequest.cs @@ -141,6 +141,10 @@ public class Builder private string cardholderName; private string verificationToken; + /// + /// Initialize Builder for CreateCustomerCardRequest. + /// + /// cardNonce. public Builder( string cardNonce) { diff --git a/Square/Models/CreateCustomerCustomAttributeDefinitionRequest.cs b/Square/Models/CreateCustomerCustomAttributeDefinitionRequest.cs index 3eccd513..e0ed5f76 100644 --- a/Square/Models/CreateCustomerCustomAttributeDefinitionRequest.cs +++ b/Square/Models/CreateCustomerCustomAttributeDefinitionRequest.cs @@ -109,6 +109,10 @@ public class Builder private Models.CustomAttributeDefinition customAttributeDefinition; private string idempotencyKey; + /// + /// Initialize Builder for CreateCustomerCustomAttributeDefinitionRequest. + /// + /// customAttributeDefinition. public Builder( Models.CustomAttributeDefinition customAttributeDefinition) { diff --git a/Square/Models/CreateCustomerGroupRequest.cs b/Square/Models/CreateCustomerGroupRequest.cs index 439cdad6..6a537334 100644 --- a/Square/Models/CreateCustomerGroupRequest.cs +++ b/Square/Models/CreateCustomerGroupRequest.cs @@ -109,6 +109,10 @@ public class Builder private Models.CustomerGroup mGroup; private string idempotencyKey; + /// + /// Initialize Builder for CreateCustomerGroupRequest. + /// + /// mGroup. public Builder( Models.CustomerGroup mGroup) { diff --git a/Square/Models/CreateDeviceCodeRequest.cs b/Square/Models/CreateDeviceCodeRequest.cs index 6914f66a..a88525aa 100644 --- a/Square/Models/CreateDeviceCodeRequest.cs +++ b/Square/Models/CreateDeviceCodeRequest.cs @@ -109,6 +109,11 @@ public class Builder private string idempotencyKey; private Models.DeviceCode deviceCode; + /// + /// Initialize Builder for CreateDeviceCodeRequest. + /// + /// idempotencyKey. + /// deviceCode. public Builder( string idempotencyKey, Models.DeviceCode deviceCode) diff --git a/Square/Models/CreateDisputeEvidenceFileRequest.cs b/Square/Models/CreateDisputeEvidenceFileRequest.cs index 31b4fd1f..36e48d2f 100644 --- a/Square/Models/CreateDisputeEvidenceFileRequest.cs +++ b/Square/Models/CreateDisputeEvidenceFileRequest.cs @@ -121,6 +121,10 @@ public class Builder private string evidenceType; private string contentType; + /// + /// Initialize Builder for CreateDisputeEvidenceFileRequest. + /// + /// idempotencyKey. public Builder( string idempotencyKey) { diff --git a/Square/Models/CreateDisputeEvidenceTextRequest.cs b/Square/Models/CreateDisputeEvidenceTextRequest.cs index 8625fa77..a020ebe5 100644 --- a/Square/Models/CreateDisputeEvidenceTextRequest.cs +++ b/Square/Models/CreateDisputeEvidenceTextRequest.cs @@ -120,6 +120,11 @@ public class Builder private string evidenceText; private string evidenceType; + /// + /// Initialize Builder for CreateDisputeEvidenceTextRequest. + /// + /// idempotencyKey. + /// evidenceText. public Builder( string idempotencyKey, string evidenceText) diff --git a/Square/Models/CreateGiftCardActivityRequest.cs b/Square/Models/CreateGiftCardActivityRequest.cs index 18778001..461ac42c 100644 --- a/Square/Models/CreateGiftCardActivityRequest.cs +++ b/Square/Models/CreateGiftCardActivityRequest.cs @@ -109,6 +109,11 @@ public class Builder private string idempotencyKey; private Models.GiftCardActivity giftCardActivity; + /// + /// Initialize Builder for CreateGiftCardActivityRequest. + /// + /// idempotencyKey. + /// giftCardActivity. public Builder( string idempotencyKey, Models.GiftCardActivity giftCardActivity) diff --git a/Square/Models/CreateGiftCardRequest.cs b/Square/Models/CreateGiftCardRequest.cs index 1a58811c..1957691d 100644 --- a/Square/Models/CreateGiftCardRequest.cs +++ b/Square/Models/CreateGiftCardRequest.cs @@ -122,6 +122,12 @@ public class Builder private string locationId; private Models.GiftCard giftCard; + /// + /// Initialize Builder for CreateGiftCardRequest. + /// + /// idempotencyKey. + /// locationId. + /// giftCard. public Builder( string idempotencyKey, string locationId, diff --git a/Square/Models/CreateInvoiceRequest.cs b/Square/Models/CreateInvoiceRequest.cs index c302f42d..5ef8de78 100644 --- a/Square/Models/CreateInvoiceRequest.cs +++ b/Square/Models/CreateInvoiceRequest.cs @@ -111,6 +111,10 @@ public class Builder private Models.Invoice invoice; private string idempotencyKey; + /// + /// Initialize Builder for CreateInvoiceRequest. + /// + /// invoice. public Builder( Models.Invoice invoice) { diff --git a/Square/Models/CreateLocationCustomAttributeDefinitionRequest.cs b/Square/Models/CreateLocationCustomAttributeDefinitionRequest.cs index bccb302b..ceffa8bc 100644 --- a/Square/Models/CreateLocationCustomAttributeDefinitionRequest.cs +++ b/Square/Models/CreateLocationCustomAttributeDefinitionRequest.cs @@ -109,6 +109,10 @@ public class Builder private Models.CustomAttributeDefinition customAttributeDefinition; private string idempotencyKey; + /// + /// Initialize Builder for CreateLocationCustomAttributeDefinitionRequest. + /// + /// customAttributeDefinition. public Builder( Models.CustomAttributeDefinition customAttributeDefinition) { diff --git a/Square/Models/CreateLoyaltyAccountRequest.cs b/Square/Models/CreateLoyaltyAccountRequest.cs index 4951aa12..c69daff0 100644 --- a/Square/Models/CreateLoyaltyAccountRequest.cs +++ b/Square/Models/CreateLoyaltyAccountRequest.cs @@ -109,6 +109,11 @@ public class Builder private Models.LoyaltyAccount loyaltyAccount; private string idempotencyKey; + /// + /// Initialize Builder for CreateLoyaltyAccountRequest. + /// + /// loyaltyAccount. + /// idempotencyKey. public Builder( Models.LoyaltyAccount loyaltyAccount, string idempotencyKey) diff --git a/Square/Models/CreateLoyaltyPromotionRequest.cs b/Square/Models/CreateLoyaltyPromotionRequest.cs index 08b5cb43..a94b61e8 100644 --- a/Square/Models/CreateLoyaltyPromotionRequest.cs +++ b/Square/Models/CreateLoyaltyPromotionRequest.cs @@ -110,6 +110,11 @@ public class Builder private Models.LoyaltyPromotion loyaltyPromotion; private string idempotencyKey; + /// + /// Initialize Builder for CreateLoyaltyPromotionRequest. + /// + /// loyaltyPromotion. + /// idempotencyKey. public Builder( Models.LoyaltyPromotion loyaltyPromotion, string idempotencyKey) diff --git a/Square/Models/CreateLoyaltyRewardRequest.cs b/Square/Models/CreateLoyaltyRewardRequest.cs index 88061829..d8ed7d14 100644 --- a/Square/Models/CreateLoyaltyRewardRequest.cs +++ b/Square/Models/CreateLoyaltyRewardRequest.cs @@ -109,6 +109,11 @@ public class Builder private Models.LoyaltyReward reward; private string idempotencyKey; + /// + /// Initialize Builder for CreateLoyaltyRewardRequest. + /// + /// reward. + /// idempotencyKey. public Builder( Models.LoyaltyReward reward, string idempotencyKey) diff --git a/Square/Models/CreateMerchantCustomAttributeDefinitionRequest.cs b/Square/Models/CreateMerchantCustomAttributeDefinitionRequest.cs index a2f94b0c..d3acd68e 100644 --- a/Square/Models/CreateMerchantCustomAttributeDefinitionRequest.cs +++ b/Square/Models/CreateMerchantCustomAttributeDefinitionRequest.cs @@ -109,6 +109,10 @@ public class Builder private Models.CustomAttributeDefinition customAttributeDefinition; private string idempotencyKey; + /// + /// Initialize Builder for CreateMerchantCustomAttributeDefinitionRequest. + /// + /// customAttributeDefinition. public Builder( Models.CustomAttributeDefinition customAttributeDefinition) { diff --git a/Square/Models/CreateOrderCustomAttributeDefinitionRequest.cs b/Square/Models/CreateOrderCustomAttributeDefinitionRequest.cs index 1ef6f282..5f1f60c1 100644 --- a/Square/Models/CreateOrderCustomAttributeDefinitionRequest.cs +++ b/Square/Models/CreateOrderCustomAttributeDefinitionRequest.cs @@ -109,6 +109,10 @@ public class Builder private Models.CustomAttributeDefinition customAttributeDefinition; private string idempotencyKey; + /// + /// Initialize Builder for CreateOrderCustomAttributeDefinitionRequest. + /// + /// customAttributeDefinition. public Builder( Models.CustomAttributeDefinition customAttributeDefinition) { diff --git a/Square/Models/CreatePaymentRequest.cs b/Square/Models/CreatePaymentRequest.cs index 23e133cc..17b2b327 100644 --- a/Square/Models/CreatePaymentRequest.cs +++ b/Square/Models/CreatePaymentRequest.cs @@ -452,6 +452,11 @@ public class Builder private Models.ExternalPaymentDetails externalDetails; private Models.CustomerDetails customerDetails; + /// + /// Initialize Builder for CreatePaymentRequest. + /// + /// sourceId. + /// idempotencyKey. public Builder( string sourceId, string idempotencyKey) diff --git a/Square/Models/CreateRefundRequest.cs b/Square/Models/CreateRefundRequest.cs index fa93c355..64aed348 100644 --- a/Square/Models/CreateRefundRequest.cs +++ b/Square/Models/CreateRefundRequest.cs @@ -147,6 +147,12 @@ public class Builder private Models.Money amountMoney; private string reason; + /// + /// Initialize Builder for CreateRefundRequest. + /// + /// idempotencyKey. + /// tenderId. + /// amountMoney. public Builder( string idempotencyKey, string tenderId, diff --git a/Square/Models/CreateShiftRequest.cs b/Square/Models/CreateShiftRequest.cs index 14adfca8..edf62e9e 100644 --- a/Square/Models/CreateShiftRequest.cs +++ b/Square/Models/CreateShiftRequest.cs @@ -109,6 +109,10 @@ public class Builder private Models.Shift shift; private string idempotencyKey; + /// + /// Initialize Builder for CreateShiftRequest. + /// + /// shift. public Builder( Models.Shift shift) { diff --git a/Square/Models/CreateSubscriptionRequest.cs b/Square/Models/CreateSubscriptionRequest.cs index 09b04128..06e18155 100644 --- a/Square/Models/CreateSubscriptionRequest.cs +++ b/Square/Models/CreateSubscriptionRequest.cs @@ -274,6 +274,11 @@ public class Builder private int? monthlyBillingAnchorDate; private IList phases; + /// + /// Initialize Builder for CreateSubscriptionRequest. + /// + /// locationId. + /// customerId. public Builder( string locationId, string customerId) diff --git a/Square/Models/CreateTerminalActionRequest.cs b/Square/Models/CreateTerminalActionRequest.cs index 691b99ff..381b183f 100644 --- a/Square/Models/CreateTerminalActionRequest.cs +++ b/Square/Models/CreateTerminalActionRequest.cs @@ -110,6 +110,11 @@ public class Builder private string idempotencyKey; private Models.TerminalAction action; + /// + /// Initialize Builder for CreateTerminalActionRequest. + /// + /// idempotencyKey. + /// action. public Builder( string idempotencyKey, Models.TerminalAction action) diff --git a/Square/Models/CreateTerminalCheckoutRequest.cs b/Square/Models/CreateTerminalCheckoutRequest.cs index 8c6f62ae..587ab5d6 100644 --- a/Square/Models/CreateTerminalCheckoutRequest.cs +++ b/Square/Models/CreateTerminalCheckoutRequest.cs @@ -109,6 +109,11 @@ public class Builder private string idempotencyKey; private Models.TerminalCheckout checkout; + /// + /// Initialize Builder for CreateTerminalCheckoutRequest. + /// + /// idempotencyKey. + /// checkout. public Builder( string idempotencyKey, Models.TerminalCheckout checkout) diff --git a/Square/Models/CreateTerminalRefundRequest.cs b/Square/Models/CreateTerminalRefundRequest.cs index 1e107b62..9a712e55 100644 --- a/Square/Models/CreateTerminalRefundRequest.cs +++ b/Square/Models/CreateTerminalRefundRequest.cs @@ -109,6 +109,10 @@ public class Builder private string idempotencyKey; private Models.TerminalRefund refund; + /// + /// Initialize Builder for CreateTerminalRefundRequest. + /// + /// idempotencyKey. public Builder( string idempotencyKey) { diff --git a/Square/Models/CreateVendorRequest.cs b/Square/Models/CreateVendorRequest.cs index 8ed50328..163bc713 100644 --- a/Square/Models/CreateVendorRequest.cs +++ b/Square/Models/CreateVendorRequest.cs @@ -110,6 +110,10 @@ public class Builder private string idempotencyKey; private Models.Vendor vendor; + /// + /// Initialize Builder for CreateVendorRequest. + /// + /// idempotencyKey. public Builder( string idempotencyKey) { diff --git a/Square/Models/CreateWebhookSubscriptionRequest.cs b/Square/Models/CreateWebhookSubscriptionRequest.cs index 5aa18e9b..373fa6e7 100644 --- a/Square/Models/CreateWebhookSubscriptionRequest.cs +++ b/Square/Models/CreateWebhookSubscriptionRequest.cs @@ -108,6 +108,10 @@ public class Builder private Models.WebhookSubscription subscription; private string idempotencyKey; + /// + /// Initialize Builder for CreateWebhookSubscriptionRequest. + /// + /// subscription. public Builder( Models.WebhookSubscription subscription) { diff --git a/Square/Models/CustomField.cs b/Square/Models/CustomField.cs index 2690e8ba..5f535615 100644 --- a/Square/Models/CustomField.cs +++ b/Square/Models/CustomField.cs @@ -94,6 +94,10 @@ public class Builder { private string title; + /// + /// Initialize Builder for CustomField. + /// + /// title. public Builder( string title) { diff --git a/Square/Models/CustomerCustomAttributeFilter.cs b/Square/Models/CustomerCustomAttributeFilter.cs index 8a4f9ff1..1a3db225 100644 --- a/Square/Models/CustomerCustomAttributeFilter.cs +++ b/Square/Models/CustomerCustomAttributeFilter.cs @@ -126,6 +126,10 @@ public class Builder private Models.CustomerCustomAttributeFilterValue filter; private Models.TimeRange updatedAt; + /// + /// Initialize Builder for CustomerCustomAttributeFilter. + /// + /// key. public Builder( string key) { diff --git a/Square/Models/CustomerGroup.cs b/Square/Models/CustomerGroup.cs index 9b6eb336..e11aa81c 100644 --- a/Square/Models/CustomerGroup.cs +++ b/Square/Models/CustomerGroup.cs @@ -133,6 +133,10 @@ public class Builder private string createdAt; private string updatedAt; + /// + /// Initialize Builder for CustomerGroup. + /// + /// name. public Builder( string name) { diff --git a/Square/Models/CustomerSegment.cs b/Square/Models/CustomerSegment.cs index 80573fa1..aca2594e 100644 --- a/Square/Models/CustomerSegment.cs +++ b/Square/Models/CustomerSegment.cs @@ -133,6 +133,10 @@ public class Builder private string createdAt; private string updatedAt; + /// + /// Initialize Builder for CustomerSegment. + /// + /// name. public Builder( string name) { diff --git a/Square/Models/DataCollectionOptions.cs b/Square/Models/DataCollectionOptions.cs index 43d6b87d..31c17921 100644 --- a/Square/Models/DataCollectionOptions.cs +++ b/Square/Models/DataCollectionOptions.cs @@ -134,6 +134,12 @@ public class Builder private string inputType; private Models.CollectedData collectedData; + /// + /// Initialize Builder for DataCollectionOptions. + /// + /// title. + /// body. + /// inputType. public Builder( string title, string body, diff --git a/Square/Models/DeprecatedCreateDisputeEvidenceFileRequest.cs b/Square/Models/DeprecatedCreateDisputeEvidenceFileRequest.cs index a9893d87..88256c1c 100644 --- a/Square/Models/DeprecatedCreateDisputeEvidenceFileRequest.cs +++ b/Square/Models/DeprecatedCreateDisputeEvidenceFileRequest.cs @@ -156,6 +156,10 @@ public class Builder private string evidenceType; private string contentType; + /// + /// Initialize Builder for DeprecatedCreateDisputeEvidenceFileRequest. + /// + /// idempotencyKey. public Builder( string idempotencyKey) { diff --git a/Square/Models/DeprecatedCreateDisputeEvidenceTextRequest.cs b/Square/Models/DeprecatedCreateDisputeEvidenceTextRequest.cs index fa2056b5..25d77690 100644 --- a/Square/Models/DeprecatedCreateDisputeEvidenceTextRequest.cs +++ b/Square/Models/DeprecatedCreateDisputeEvidenceTextRequest.cs @@ -120,6 +120,11 @@ public class Builder private string evidenceText; private string evidenceType; + /// + /// Initialize Builder for DeprecatedCreateDisputeEvidenceTextRequest. + /// + /// idempotencyKey. + /// evidenceText. public Builder( string idempotencyKey, string evidenceText) diff --git a/Square/Models/Device.cs b/Square/Models/Device.cs index bf303994..2fb7a558 100644 --- a/Square/Models/Device.cs +++ b/Square/Models/Device.cs @@ -171,6 +171,10 @@ public class Builder private IList components; private Models.DeviceStatus status; + /// + /// Initialize Builder for Device. + /// + /// attributes. public Builder( Models.DeviceAttributes attributes) { diff --git a/Square/Models/DeviceAttributes.cs b/Square/Models/DeviceAttributes.cs index 4eb869e5..57c69024 100644 --- a/Square/Models/DeviceAttributes.cs +++ b/Square/Models/DeviceAttributes.cs @@ -282,6 +282,11 @@ public class Builder private string version; private string merchantToken; + /// + /// Initialize Builder for DeviceAttributes. + /// + /// type. + /// manufacturer. public Builder( string type, string manufacturer) diff --git a/Square/Models/DeviceCheckoutOptions.cs b/Square/Models/DeviceCheckoutOptions.cs index ecb993dc..ed52a957 100644 --- a/Square/Models/DeviceCheckoutOptions.cs +++ b/Square/Models/DeviceCheckoutOptions.cs @@ -220,6 +220,10 @@ public class Builder private Models.TipSettings tipSettings; private bool? showItemizedCart; + /// + /// Initialize Builder for DeviceCheckoutOptions. + /// + /// deviceId. public Builder( string deviceId) { diff --git a/Square/Models/DeviceCode.cs b/Square/Models/DeviceCode.cs index 291bc9a8..8bdf0583 100644 --- a/Square/Models/DeviceCode.cs +++ b/Square/Models/DeviceCode.cs @@ -293,6 +293,10 @@ public class Builder private string statusChangedAt; private string pairedAt; + /// + /// Initialize Builder for DeviceCode. + /// + /// productType. public Builder( string productType) { diff --git a/Square/Models/Error.cs b/Square/Models/Error.cs index 4dd43ed4..1d05f7a6 100644 --- a/Square/Models/Error.cs +++ b/Square/Models/Error.cs @@ -136,6 +136,11 @@ public class Builder private string detail; private string field; + /// + /// Initialize Builder for Error. + /// + /// category. + /// code. public Builder( string category, string code) diff --git a/Square/Models/ExternalPaymentDetails.cs b/Square/Models/ExternalPaymentDetails.cs index bcabde42..7d7ae5c0 100644 --- a/Square/Models/ExternalPaymentDetails.cs +++ b/Square/Models/ExternalPaymentDetails.cs @@ -188,6 +188,11 @@ public class Builder private string sourceId; private Models.Money sourceFeeMoney; + /// + /// Initialize Builder for ExternalPaymentDetails. + /// + /// type. + /// source. public Builder( string type, string source) diff --git a/Square/Models/FulfillmentFulfillmentEntry.cs b/Square/Models/FulfillmentFulfillmentEntry.cs index fc4e1928..10e80dc0 100644 --- a/Square/Models/FulfillmentFulfillmentEntry.cs +++ b/Square/Models/FulfillmentFulfillmentEntry.cs @@ -201,6 +201,11 @@ public class Builder private string uid; private IDictionary metadata; + /// + /// Initialize Builder for FulfillmentFulfillmentEntry. + /// + /// lineItemUid. + /// quantity. public Builder( string lineItemUid, string quantity) diff --git a/Square/Models/GiftCard.cs b/Square/Models/GiftCard.cs index d7c3ca42..7980b5d1 100644 --- a/Square/Models/GiftCard.cs +++ b/Square/Models/GiftCard.cs @@ -243,6 +243,10 @@ public class Builder private string createdAt; private IList customerIds; + /// + /// Initialize Builder for GiftCard. + /// + /// type. public Builder( string type) { diff --git a/Square/Models/GiftCardActivity.cs b/Square/Models/GiftCardActivity.cs index d3386ee5..8b3f43f9 100644 --- a/Square/Models/GiftCardActivity.cs +++ b/Square/Models/GiftCardActivity.cs @@ -471,6 +471,11 @@ public class Builder private Models.GiftCardActivityTransferBalanceTo transferBalanceToActivityDetails; private Models.GiftCardActivityTransferBalanceFrom transferBalanceFromActivityDetails; + /// + /// Initialize Builder for GiftCardActivity. + /// + /// type. + /// locationId. public Builder( string type, string locationId) diff --git a/Square/Models/GiftCardActivityAdjustDecrement.cs b/Square/Models/GiftCardActivityAdjustDecrement.cs index 48055dcb..fa335667 100644 --- a/Square/Models/GiftCardActivityAdjustDecrement.cs +++ b/Square/Models/GiftCardActivityAdjustDecrement.cs @@ -112,6 +112,11 @@ public class Builder private Models.Money amountMoney; private string reason; + /// + /// Initialize Builder for GiftCardActivityAdjustDecrement. + /// + /// amountMoney. + /// reason. public Builder( Models.Money amountMoney, string reason) diff --git a/Square/Models/GiftCardActivityAdjustIncrement.cs b/Square/Models/GiftCardActivityAdjustIncrement.cs index 026b1902..f36b5783 100644 --- a/Square/Models/GiftCardActivityAdjustIncrement.cs +++ b/Square/Models/GiftCardActivityAdjustIncrement.cs @@ -112,6 +112,11 @@ public class Builder private Models.Money amountMoney; private string reason; + /// + /// Initialize Builder for GiftCardActivityAdjustIncrement. + /// + /// amountMoney. + /// reason. public Builder( Models.Money amountMoney, string reason) diff --git a/Square/Models/GiftCardActivityBlock.cs b/Square/Models/GiftCardActivityBlock.cs index ba2c914a..9771caff 100644 --- a/Square/Models/GiftCardActivityBlock.cs +++ b/Square/Models/GiftCardActivityBlock.cs @@ -94,6 +94,10 @@ public class Builder { private string reason; + /// + /// Initialize Builder for GiftCardActivityBlock. + /// + /// reason. public Builder( string reason) { diff --git a/Square/Models/GiftCardActivityClearBalance.cs b/Square/Models/GiftCardActivityClearBalance.cs index 11e5d8c2..099410d2 100644 --- a/Square/Models/GiftCardActivityClearBalance.cs +++ b/Square/Models/GiftCardActivityClearBalance.cs @@ -94,6 +94,10 @@ public class Builder { private string reason; + /// + /// Initialize Builder for GiftCardActivityClearBalance. + /// + /// reason. public Builder( string reason) { diff --git a/Square/Models/GiftCardActivityDeactivate.cs b/Square/Models/GiftCardActivityDeactivate.cs index 159e988d..0fe0aeec 100644 --- a/Square/Models/GiftCardActivityDeactivate.cs +++ b/Square/Models/GiftCardActivityDeactivate.cs @@ -94,6 +94,10 @@ public class Builder { private string reason; + /// + /// Initialize Builder for GiftCardActivityDeactivate. + /// + /// reason. public Builder( string reason) { diff --git a/Square/Models/GiftCardActivityImport.cs b/Square/Models/GiftCardActivityImport.cs index 333a8ab6..3843daba 100644 --- a/Square/Models/GiftCardActivityImport.cs +++ b/Square/Models/GiftCardActivityImport.cs @@ -99,6 +99,10 @@ public class Builder { private Models.Money amountMoney; + /// + /// Initialize Builder for GiftCardActivityImport. + /// + /// amountMoney. public Builder( Models.Money amountMoney) { diff --git a/Square/Models/GiftCardActivityImportReversal.cs b/Square/Models/GiftCardActivityImportReversal.cs index e4963e4f..d49ac187 100644 --- a/Square/Models/GiftCardActivityImportReversal.cs +++ b/Square/Models/GiftCardActivityImportReversal.cs @@ -99,6 +99,10 @@ public class Builder { private Models.Money amountMoney; + /// + /// Initialize Builder for GiftCardActivityImportReversal. + /// + /// amountMoney. public Builder( Models.Money amountMoney) { diff --git a/Square/Models/GiftCardActivityRedeem.cs b/Square/Models/GiftCardActivityRedeem.cs index d5ff1b26..1b80d299 100644 --- a/Square/Models/GiftCardActivityRedeem.cs +++ b/Square/Models/GiftCardActivityRedeem.cs @@ -180,6 +180,10 @@ public class Builder private string referenceId; private string status; + /// + /// Initialize Builder for GiftCardActivityRedeem. + /// + /// amountMoney. public Builder( Models.Money amountMoney) { diff --git a/Square/Models/GiftCardActivityTransferBalanceFrom.cs b/Square/Models/GiftCardActivityTransferBalanceFrom.cs index f0d11bcc..3080655e 100644 --- a/Square/Models/GiftCardActivityTransferBalanceFrom.cs +++ b/Square/Models/GiftCardActivityTransferBalanceFrom.cs @@ -112,6 +112,11 @@ public class Builder private string transferToGiftCardId; private Models.Money amountMoney; + /// + /// Initialize Builder for GiftCardActivityTransferBalanceFrom. + /// + /// transferToGiftCardId. + /// amountMoney. public Builder( string transferToGiftCardId, Models.Money amountMoney) diff --git a/Square/Models/GiftCardActivityTransferBalanceTo.cs b/Square/Models/GiftCardActivityTransferBalanceTo.cs index 3498fba6..b5adfeff 100644 --- a/Square/Models/GiftCardActivityTransferBalanceTo.cs +++ b/Square/Models/GiftCardActivityTransferBalanceTo.cs @@ -112,6 +112,11 @@ public class Builder private string transferFromGiftCardId; private Models.Money amountMoney; + /// + /// Initialize Builder for GiftCardActivityTransferBalanceTo. + /// + /// transferFromGiftCardId. + /// amountMoney. public Builder( string transferFromGiftCardId, Models.Money amountMoney) diff --git a/Square/Models/GiftCardActivityUnblock.cs b/Square/Models/GiftCardActivityUnblock.cs index 2d9aabd9..1f4f69b1 100644 --- a/Square/Models/GiftCardActivityUnblock.cs +++ b/Square/Models/GiftCardActivityUnblock.cs @@ -94,6 +94,10 @@ public class Builder { private string reason; + /// + /// Initialize Builder for GiftCardActivityUnblock. + /// + /// reason. public Builder( string reason) { diff --git a/Square/Models/GiftCardActivityUnlinkedActivityRefund.cs b/Square/Models/GiftCardActivityUnlinkedActivityRefund.cs index f63c9cbb..3d51678f 100644 --- a/Square/Models/GiftCardActivityUnlinkedActivityRefund.cs +++ b/Square/Models/GiftCardActivityUnlinkedActivityRefund.cs @@ -160,6 +160,10 @@ public class Builder private string referenceId; private string paymentId; + /// + /// Initialize Builder for GiftCardActivityUnlinkedActivityRefund. + /// + /// amountMoney. public Builder( Models.Money amountMoney) { diff --git a/Square/Models/InvoiceFilter.cs b/Square/Models/InvoiceFilter.cs index 57ef15bd..a9c6ba3a 100644 --- a/Square/Models/InvoiceFilter.cs +++ b/Square/Models/InvoiceFilter.cs @@ -143,6 +143,10 @@ public class Builder private IList locationIds; private IList customerIds; + /// + /// Initialize Builder for InvoiceFilter. + /// + /// locationIds. public Builder( IList locationIds) { diff --git a/Square/Models/InvoiceQuery.cs b/Square/Models/InvoiceQuery.cs index e4d40662..f70da8bb 100644 --- a/Square/Models/InvoiceQuery.cs +++ b/Square/Models/InvoiceQuery.cs @@ -107,6 +107,10 @@ public class Builder private Models.InvoiceFilter filter; private Models.InvoiceSort sort; + /// + /// Initialize Builder for InvoiceQuery. + /// + /// filter. public Builder( Models.InvoiceFilter filter) { diff --git a/Square/Models/InvoiceSort.cs b/Square/Models/InvoiceSort.cs index 40355274..31f17ac3 100644 --- a/Square/Models/InvoiceSort.cs +++ b/Square/Models/InvoiceSort.cs @@ -107,6 +107,10 @@ public class Builder private string field; private string order; + /// + /// Initialize Builder for InvoiceSort. + /// + /// field. public Builder( string field) { diff --git a/Square/Models/JobAssignment.cs b/Square/Models/JobAssignment.cs index 2abc6ee7..d95edc42 100644 --- a/Square/Models/JobAssignment.cs +++ b/Square/Models/JobAssignment.cs @@ -195,6 +195,11 @@ public class Builder private Models.Money annualRate; private int? weeklyHours; + /// + /// Initialize Builder for JobAssignment. + /// + /// jobTitle. + /// payType. public Builder( string jobTitle, string payType) diff --git a/Square/Models/LinkCustomerToGiftCardRequest.cs b/Square/Models/LinkCustomerToGiftCardRequest.cs index df67b259..9ce8ce95 100644 --- a/Square/Models/LinkCustomerToGiftCardRequest.cs +++ b/Square/Models/LinkCustomerToGiftCardRequest.cs @@ -94,6 +94,10 @@ public class Builder { private string customerId; + /// + /// Initialize Builder for LinkCustomerToGiftCardRequest. + /// + /// customerId. public Builder( string customerId) { diff --git a/Square/Models/ListCashDrawerShiftEventsRequest.cs b/Square/Models/ListCashDrawerShiftEventsRequest.cs index cc370077..e02aa8ea 100644 --- a/Square/Models/ListCashDrawerShiftEventsRequest.cs +++ b/Square/Models/ListCashDrawerShiftEventsRequest.cs @@ -172,6 +172,10 @@ public class Builder private int? limit; private string cursor; + /// + /// Initialize Builder for ListCashDrawerShiftEventsRequest. + /// + /// locationId. public Builder( string locationId) { diff --git a/Square/Models/ListCashDrawerShiftsRequest.cs b/Square/Models/ListCashDrawerShiftsRequest.cs index ca17a432..b589bde5 100644 --- a/Square/Models/ListCashDrawerShiftsRequest.cs +++ b/Square/Models/ListCashDrawerShiftsRequest.cs @@ -249,6 +249,10 @@ public class Builder private int? limit; private string cursor; + /// + /// Initialize Builder for ListCashDrawerShiftsRequest. + /// + /// locationId. public Builder( string locationId) { diff --git a/Square/Models/ListInvoicesRequest.cs b/Square/Models/ListInvoicesRequest.cs index ff29f44c..8e98e4ac 100644 --- a/Square/Models/ListInvoicesRequest.cs +++ b/Square/Models/ListInvoicesRequest.cs @@ -174,6 +174,10 @@ public class Builder private string cursor; private int? limit; + /// + /// Initialize Builder for ListInvoicesRequest. + /// + /// locationId. public Builder( string locationId) { diff --git a/Square/Models/ListOrderCustomAttributeDefinitionsResponse.cs b/Square/Models/ListOrderCustomAttributeDefinitionsResponse.cs index 7cc4c806..93c283df 100644 --- a/Square/Models/ListOrderCustomAttributeDefinitionsResponse.cs +++ b/Square/Models/ListOrderCustomAttributeDefinitionsResponse.cs @@ -141,6 +141,10 @@ public class Builder private string cursor; private IList errors; + /// + /// Initialize Builder for ListOrderCustomAttributeDefinitionsResponse. + /// + /// customAttributeDefinitions. public Builder( IList customAttributeDefinitions) { diff --git a/Square/Models/ListPaymentLinksRequest.cs b/Square/Models/ListPaymentLinksRequest.cs index 28830fd9..407efb2b 100644 --- a/Square/Models/ListPaymentLinksRequest.cs +++ b/Square/Models/ListPaymentLinksRequest.cs @@ -60,7 +60,7 @@ internal ListPaymentLinksRequest(Dictionary shouldSerialize, /// A pagination cursor returned by a previous call to this endpoint. /// Provide this cursor to retrieve the next set of results for the original query. /// If a cursor is not provided, the endpoint returns the first page of the results. - /// For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). + /// For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). /// [JsonProperty("cursor")] public string Cursor { get; } diff --git a/Square/Models/ListPaymentLinksResponse.cs b/Square/Models/ListPaymentLinksResponse.cs index b3cc3164..e81c2a14 100644 --- a/Square/Models/ListPaymentLinksResponse.cs +++ b/Square/Models/ListPaymentLinksResponse.cs @@ -56,7 +56,7 @@ public ListPaymentLinksResponse( /// /// When a response is truncated, it includes a cursor that you can use in a subsequent request /// to retrieve the next set of gift cards. If a cursor is not present, this is the final response. - /// For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). + /// For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). /// [JsonProperty("cursor", NullValueHandling = NullValueHandling.Ignore)] public string Cursor { get; } diff --git a/Square/Models/LoyaltyAccount.cs b/Square/Models/LoyaltyAccount.cs index c3a0f772..a781aec7 100644 --- a/Square/Models/LoyaltyAccount.cs +++ b/Square/Models/LoyaltyAccount.cs @@ -302,6 +302,10 @@ public class Builder private Models.LoyaltyAccountMapping mapping; private IList expiringPointDeadlines; + /// + /// Initialize Builder for LoyaltyAccount. + /// + /// programId. public Builder( string programId) { diff --git a/Square/Models/LoyaltyAccountExpiringPointDeadline.cs b/Square/Models/LoyaltyAccountExpiringPointDeadline.cs index 26e4129e..b7de6280 100644 --- a/Square/Models/LoyaltyAccountExpiringPointDeadline.cs +++ b/Square/Models/LoyaltyAccountExpiringPointDeadline.cs @@ -107,6 +107,11 @@ public class Builder private int points; private string expiresAt; + /// + /// Initialize Builder for LoyaltyAccountExpiringPointDeadline. + /// + /// points. + /// expiresAt. public Builder( int points, string expiresAt) diff --git a/Square/Models/LoyaltyEvent.cs b/Square/Models/LoyaltyEvent.cs index d47d48a1..2e33bd5b 100644 --- a/Square/Models/LoyaltyEvent.cs +++ b/Square/Models/LoyaltyEvent.cs @@ -265,6 +265,14 @@ public class Builder private Models.LoyaltyEventOther otherEvent; private Models.LoyaltyEventAccumulatePromotionPoints accumulatePromotionPoints; + /// + /// Initialize Builder for LoyaltyEvent. + /// + /// id. + /// type. + /// createdAt. + /// loyaltyAccountId. + /// source. public Builder( string id, string type, diff --git a/Square/Models/LoyaltyEventAccumulatePromotionPoints.cs b/Square/Models/LoyaltyEventAccumulatePromotionPoints.cs index 3a608d0c..939e3753 100644 --- a/Square/Models/LoyaltyEventAccumulatePromotionPoints.cs +++ b/Square/Models/LoyaltyEventAccumulatePromotionPoints.cs @@ -134,6 +134,11 @@ public class Builder private string loyaltyProgramId; private string loyaltyPromotionId; + /// + /// Initialize Builder for LoyaltyEventAccumulatePromotionPoints. + /// + /// points. + /// orderId. public Builder( int points, string orderId) diff --git a/Square/Models/LoyaltyEventAdjustPoints.cs b/Square/Models/LoyaltyEventAdjustPoints.cs index 1520a7d8..86d53b4c 100644 --- a/Square/Models/LoyaltyEventAdjustPoints.cs +++ b/Square/Models/LoyaltyEventAdjustPoints.cs @@ -155,6 +155,10 @@ public class Builder private string loyaltyProgramId; private string reason; + /// + /// Initialize Builder for LoyaltyEventAdjustPoints. + /// + /// points. public Builder( int points) { diff --git a/Square/Models/LoyaltyEventCreateReward.cs b/Square/Models/LoyaltyEventCreateReward.cs index 696c7e17..05ccb22c 100644 --- a/Square/Models/LoyaltyEventCreateReward.cs +++ b/Square/Models/LoyaltyEventCreateReward.cs @@ -121,6 +121,11 @@ public class Builder private int points; private string rewardId; + /// + /// Initialize Builder for LoyaltyEventCreateReward. + /// + /// loyaltyProgramId. + /// points. public Builder( string loyaltyProgramId, int points) diff --git a/Square/Models/LoyaltyEventDateTimeFilter.cs b/Square/Models/LoyaltyEventDateTimeFilter.cs index b4982f75..2a9d1b43 100644 --- a/Square/Models/LoyaltyEventDateTimeFilter.cs +++ b/Square/Models/LoyaltyEventDateTimeFilter.cs @@ -98,6 +98,10 @@ public class Builder { private Models.TimeRange createdAt; + /// + /// Initialize Builder for LoyaltyEventDateTimeFilter. + /// + /// createdAt. public Builder( Models.TimeRange createdAt) { diff --git a/Square/Models/LoyaltyEventDeleteReward.cs b/Square/Models/LoyaltyEventDeleteReward.cs index bbdbe358..c3802c40 100644 --- a/Square/Models/LoyaltyEventDeleteReward.cs +++ b/Square/Models/LoyaltyEventDeleteReward.cs @@ -121,6 +121,11 @@ public class Builder private int points; private string rewardId; + /// + /// Initialize Builder for LoyaltyEventDeleteReward. + /// + /// loyaltyProgramId. + /// points. public Builder( string loyaltyProgramId, int points) diff --git a/Square/Models/LoyaltyEventExpirePoints.cs b/Square/Models/LoyaltyEventExpirePoints.cs index e89ffcae..52332390 100644 --- a/Square/Models/LoyaltyEventExpirePoints.cs +++ b/Square/Models/LoyaltyEventExpirePoints.cs @@ -107,6 +107,11 @@ public class Builder private string loyaltyProgramId; private int points; + /// + /// Initialize Builder for LoyaltyEventExpirePoints. + /// + /// loyaltyProgramId. + /// points. public Builder( string loyaltyProgramId, int points) diff --git a/Square/Models/LoyaltyEventLocationFilter.cs b/Square/Models/LoyaltyEventLocationFilter.cs index e19bd0a7..14d4fbee 100644 --- a/Square/Models/LoyaltyEventLocationFilter.cs +++ b/Square/Models/LoyaltyEventLocationFilter.cs @@ -96,6 +96,10 @@ public class Builder { private IList locationIds; + /// + /// Initialize Builder for LoyaltyEventLocationFilter. + /// + /// locationIds. public Builder( IList locationIds) { diff --git a/Square/Models/LoyaltyEventLoyaltyAccountFilter.cs b/Square/Models/LoyaltyEventLoyaltyAccountFilter.cs index 702714f2..4ab86c64 100644 --- a/Square/Models/LoyaltyEventLoyaltyAccountFilter.cs +++ b/Square/Models/LoyaltyEventLoyaltyAccountFilter.cs @@ -94,6 +94,10 @@ public class Builder { private string loyaltyAccountId; + /// + /// Initialize Builder for LoyaltyEventLoyaltyAccountFilter. + /// + /// loyaltyAccountId. public Builder( string loyaltyAccountId) { diff --git a/Square/Models/LoyaltyEventOrderFilter.cs b/Square/Models/LoyaltyEventOrderFilter.cs index 82668734..71e4d663 100644 --- a/Square/Models/LoyaltyEventOrderFilter.cs +++ b/Square/Models/LoyaltyEventOrderFilter.cs @@ -94,6 +94,10 @@ public class Builder { private string orderId; + /// + /// Initialize Builder for LoyaltyEventOrderFilter. + /// + /// orderId. public Builder( string orderId) { diff --git a/Square/Models/LoyaltyEventOther.cs b/Square/Models/LoyaltyEventOther.cs index abf4c107..a8a31006 100644 --- a/Square/Models/LoyaltyEventOther.cs +++ b/Square/Models/LoyaltyEventOther.cs @@ -107,6 +107,11 @@ public class Builder private string loyaltyProgramId; private int points; + /// + /// Initialize Builder for LoyaltyEventOther. + /// + /// loyaltyProgramId. + /// points. public Builder( string loyaltyProgramId, int points) diff --git a/Square/Models/LoyaltyEventRedeemReward.cs b/Square/Models/LoyaltyEventRedeemReward.cs index 9c4d33ae..47fb7baa 100644 --- a/Square/Models/LoyaltyEventRedeemReward.cs +++ b/Square/Models/LoyaltyEventRedeemReward.cs @@ -122,6 +122,10 @@ public class Builder private string rewardId; private string orderId; + /// + /// Initialize Builder for LoyaltyEventRedeemReward. + /// + /// loyaltyProgramId. public Builder( string loyaltyProgramId) { diff --git a/Square/Models/LoyaltyEventTypeFilter.cs b/Square/Models/LoyaltyEventTypeFilter.cs index d6ec1d85..802dfd45 100644 --- a/Square/Models/LoyaltyEventTypeFilter.cs +++ b/Square/Models/LoyaltyEventTypeFilter.cs @@ -97,6 +97,10 @@ public class Builder { private IList types; + /// + /// Initialize Builder for LoyaltyEventTypeFilter. + /// + /// types. public Builder( IList types) { diff --git a/Square/Models/LoyaltyProgramAccrualRule.cs b/Square/Models/LoyaltyProgramAccrualRule.cs index cae336bf..31f63099 100644 --- a/Square/Models/LoyaltyProgramAccrualRule.cs +++ b/Square/Models/LoyaltyProgramAccrualRule.cs @@ -201,6 +201,10 @@ public class Builder private Models.LoyaltyProgramAccrualRuleItemVariationData itemVariationData; private Models.LoyaltyProgramAccrualRuleCategoryData categoryData; + /// + /// Initialize Builder for LoyaltyProgramAccrualRule. + /// + /// accrualType. public Builder( string accrualType) { diff --git a/Square/Models/LoyaltyProgramAccrualRuleCategoryData.cs b/Square/Models/LoyaltyProgramAccrualRuleCategoryData.cs index d911589d..fd231869 100644 --- a/Square/Models/LoyaltyProgramAccrualRuleCategoryData.cs +++ b/Square/Models/LoyaltyProgramAccrualRuleCategoryData.cs @@ -95,6 +95,10 @@ public class Builder { private string categoryId; + /// + /// Initialize Builder for LoyaltyProgramAccrualRuleCategoryData. + /// + /// categoryId. public Builder( string categoryId) { diff --git a/Square/Models/LoyaltyProgramAccrualRuleItemVariationData.cs b/Square/Models/LoyaltyProgramAccrualRuleItemVariationData.cs index 44c92329..cd1df2be 100644 --- a/Square/Models/LoyaltyProgramAccrualRuleItemVariationData.cs +++ b/Square/Models/LoyaltyProgramAccrualRuleItemVariationData.cs @@ -95,6 +95,10 @@ public class Builder { private string itemVariationId; + /// + /// Initialize Builder for LoyaltyProgramAccrualRuleItemVariationData. + /// + /// itemVariationId. public Builder( string itemVariationId) { diff --git a/Square/Models/LoyaltyProgramAccrualRuleSpendData.cs b/Square/Models/LoyaltyProgramAccrualRuleSpendData.cs index fdd3c530..ce07c0d5 100644 --- a/Square/Models/LoyaltyProgramAccrualRuleSpendData.cs +++ b/Square/Models/LoyaltyProgramAccrualRuleSpendData.cs @@ -196,6 +196,11 @@ public class Builder private IList excludedCategoryIds; private IList excludedItemVariationIds; + /// + /// Initialize Builder for LoyaltyProgramAccrualRuleSpendData. + /// + /// amountMoney. + /// taxMode. public Builder( Models.Money amountMoney, string taxMode) diff --git a/Square/Models/LoyaltyProgramAccrualRuleVisitData.cs b/Square/Models/LoyaltyProgramAccrualRuleVisitData.cs index 15381e29..32da408f 100644 --- a/Square/Models/LoyaltyProgramAccrualRuleVisitData.cs +++ b/Square/Models/LoyaltyProgramAccrualRuleVisitData.cs @@ -113,6 +113,10 @@ public class Builder private string taxMode; private Models.Money minimumAmountMoney; + /// + /// Initialize Builder for LoyaltyProgramAccrualRuleVisitData. + /// + /// taxMode. public Builder( string taxMode) { diff --git a/Square/Models/LoyaltyProgramExpirationPolicy.cs b/Square/Models/LoyaltyProgramExpirationPolicy.cs index fa2247e1..d04cc689 100644 --- a/Square/Models/LoyaltyProgramExpirationPolicy.cs +++ b/Square/Models/LoyaltyProgramExpirationPolicy.cs @@ -95,6 +95,10 @@ public class Builder { private string expirationDuration; + /// + /// Initialize Builder for LoyaltyProgramExpirationPolicy. + /// + /// expirationDuration. public Builder( string expirationDuration) { diff --git a/Square/Models/LoyaltyProgramRewardDefinition.cs b/Square/Models/LoyaltyProgramRewardDefinition.cs index 0f8ee09f..6f60e1bf 100644 --- a/Square/Models/LoyaltyProgramRewardDefinition.cs +++ b/Square/Models/LoyaltyProgramRewardDefinition.cs @@ -177,6 +177,11 @@ public class Builder private Models.Money fixedDiscountMoney; private Models.Money maxDiscountMoney; + /// + /// Initialize Builder for LoyaltyProgramRewardDefinition. + /// + /// scope. + /// discountType. public Builder( string scope, string discountType) diff --git a/Square/Models/LoyaltyProgramRewardTier.cs b/Square/Models/LoyaltyProgramRewardTier.cs index 3316b486..f95e8c78 100644 --- a/Square/Models/LoyaltyProgramRewardTier.cs +++ b/Square/Models/LoyaltyProgramRewardTier.cs @@ -163,6 +163,11 @@ public class Builder private Models.LoyaltyProgramRewardDefinition definition; private string createdAt; + /// + /// Initialize Builder for LoyaltyProgramRewardTier. + /// + /// points. + /// pricingRuleReference. public Builder( int points, Models.CatalogObjectReference pricingRuleReference) diff --git a/Square/Models/LoyaltyProgramTerminology.cs b/Square/Models/LoyaltyProgramTerminology.cs index 656c4ef0..1b123440 100644 --- a/Square/Models/LoyaltyProgramTerminology.cs +++ b/Square/Models/LoyaltyProgramTerminology.cs @@ -107,6 +107,11 @@ public class Builder private string one; private string other; + /// + /// Initialize Builder for LoyaltyProgramTerminology. + /// + /// one. + /// other. public Builder( string one, string other) diff --git a/Square/Models/LoyaltyPromotion.cs b/Square/Models/LoyaltyPromotion.cs index 6f5ee0b8..10d3f21b 100644 --- a/Square/Models/LoyaltyPromotion.cs +++ b/Square/Models/LoyaltyPromotion.cs @@ -342,6 +342,12 @@ public class Builder private IList qualifyingItemVariationIds; private IList qualifyingCategoryIds; + /// + /// Initialize Builder for LoyaltyPromotion. + /// + /// name. + /// incentive. + /// availableTime. public Builder( string name, Models.LoyaltyPromotionIncentive incentive, diff --git a/Square/Models/LoyaltyPromotionAvailableTimeData.cs b/Square/Models/LoyaltyPromotionAvailableTimeData.cs index f7fc8524..944fb032 100644 --- a/Square/Models/LoyaltyPromotionAvailableTimeData.cs +++ b/Square/Models/LoyaltyPromotionAvailableTimeData.cs @@ -131,6 +131,10 @@ public class Builder private string startDate; private string endDate; + /// + /// Initialize Builder for LoyaltyPromotionAvailableTimeData. + /// + /// timePeriods. public Builder( IList timePeriods) { diff --git a/Square/Models/LoyaltyPromotionIncentive.cs b/Square/Models/LoyaltyPromotionIncentive.cs index 8e3a1603..eb81a9ca 100644 --- a/Square/Models/LoyaltyPromotionIncentive.cs +++ b/Square/Models/LoyaltyPromotionIncentive.cs @@ -121,6 +121,10 @@ public class Builder private Models.LoyaltyPromotionIncentivePointsMultiplierData pointsMultiplierData; private Models.LoyaltyPromotionIncentivePointsAdditionData pointsAdditionData; + /// + /// Initialize Builder for LoyaltyPromotionIncentive. + /// + /// type. public Builder( string type) { diff --git a/Square/Models/LoyaltyPromotionIncentivePointsAdditionData.cs b/Square/Models/LoyaltyPromotionIncentivePointsAdditionData.cs index 1f3bbfed..681de400 100644 --- a/Square/Models/LoyaltyPromotionIncentivePointsAdditionData.cs +++ b/Square/Models/LoyaltyPromotionIncentivePointsAdditionData.cs @@ -97,6 +97,10 @@ public class Builder { private int pointsAddition; + /// + /// Initialize Builder for LoyaltyPromotionIncentivePointsAdditionData. + /// + /// pointsAddition. public Builder( int pointsAddition) { diff --git a/Square/Models/LoyaltyPromotionTriggerLimit.cs b/Square/Models/LoyaltyPromotionTriggerLimit.cs index 2f98d3ed..2d8423e2 100644 --- a/Square/Models/LoyaltyPromotionTriggerLimit.cs +++ b/Square/Models/LoyaltyPromotionTriggerLimit.cs @@ -108,6 +108,10 @@ public class Builder private int times; private string interval; + /// + /// Initialize Builder for LoyaltyPromotionTriggerLimit. + /// + /// times. public Builder( int times) { diff --git a/Square/Models/LoyaltyReward.cs b/Square/Models/LoyaltyReward.cs index 81b6e499..f6c3e2ac 100644 --- a/Square/Models/LoyaltyReward.cs +++ b/Square/Models/LoyaltyReward.cs @@ -247,6 +247,11 @@ public class Builder private string updatedAt; private string redeemedAt; + /// + /// Initialize Builder for LoyaltyReward. + /// + /// loyaltyAccountId. + /// rewardTierId. public Builder( string loyaltyAccountId, string rewardTierId) diff --git a/Square/Models/MeasurementUnitCustom.cs b/Square/Models/MeasurementUnitCustom.cs index f5359a55..227aab9a 100644 --- a/Square/Models/MeasurementUnitCustom.cs +++ b/Square/Models/MeasurementUnitCustom.cs @@ -108,6 +108,11 @@ public class Builder private string name; private string abbreviation; + /// + /// Initialize Builder for MeasurementUnitCustom. + /// + /// name. + /// abbreviation. public Builder( string name, string abbreviation) diff --git a/Square/Models/Merchant.cs b/Square/Models/Merchant.cs index 39e8e49c..3cf51137 100644 --- a/Square/Models/Merchant.cs +++ b/Square/Models/Merchant.cs @@ -267,6 +267,10 @@ public class Builder private string mainLocationId; private string createdAt; + /// + /// Initialize Builder for Merchant. + /// + /// country. public Builder( string country) { diff --git a/Square/Models/ObtainTokenRequest.cs b/Square/Models/ObtainTokenRequest.cs index bcb63c5c..2c0c21ca 100644 --- a/Square/Models/ObtainTokenRequest.cs +++ b/Square/Models/ObtainTokenRequest.cs @@ -395,6 +395,11 @@ public class Builder private bool? shortLived; private string codeVerifier; + /// + /// Initialize Builder for ObtainTokenRequest. + /// + /// clientId. + /// grantType. public Builder( string clientId, string grantType) diff --git a/Square/Models/Order.cs b/Square/Models/Order.cs index 3524042f..e4730c9f 100644 --- a/Square/Models/Order.cs +++ b/Square/Models/Order.cs @@ -782,6 +782,10 @@ public class Builder private IList rewards; private Models.Money netAmountDueMoney; + /// + /// Initialize Builder for Order. + /// + /// locationId. public Builder( string locationId) { diff --git a/Square/Models/OrderFulfillmentFulfillmentEntry.cs b/Square/Models/OrderFulfillmentFulfillmentEntry.cs index a34b7898..dac1f5fd 100644 --- a/Square/Models/OrderFulfillmentFulfillmentEntry.cs +++ b/Square/Models/OrderFulfillmentFulfillmentEntry.cs @@ -201,6 +201,11 @@ public class Builder private string uid; private IDictionary metadata; + /// + /// Initialize Builder for OrderFulfillmentFulfillmentEntry. + /// + /// lineItemUid. + /// quantity. public Builder( string lineItemUid, string quantity) diff --git a/Square/Models/OrderLineItem.cs b/Square/Models/OrderLineItem.cs index b7b294d2..0c6d290c 100644 --- a/Square/Models/OrderLineItem.cs +++ b/Square/Models/OrderLineItem.cs @@ -681,6 +681,10 @@ public class Builder private Models.OrderLineItemPricingBlocklists pricingBlocklists; private Models.Money totalServiceChargeMoney; + /// + /// Initialize Builder for OrderLineItem. + /// + /// quantity. public Builder( string quantity) { diff --git a/Square/Models/OrderLineItemAppliedDiscount.cs b/Square/Models/OrderLineItemAppliedDiscount.cs index 428891f5..0b7e96f6 100644 --- a/Square/Models/OrderLineItemAppliedDiscount.cs +++ b/Square/Models/OrderLineItemAppliedDiscount.cs @@ -163,6 +163,10 @@ public class Builder private string uid; private Models.Money appliedMoney; + /// + /// Initialize Builder for OrderLineItemAppliedDiscount. + /// + /// discountUid. public Builder( string discountUid) { diff --git a/Square/Models/OrderLineItemAppliedServiceCharge.cs b/Square/Models/OrderLineItemAppliedServiceCharge.cs index 569352e0..7ac2c5f0 100644 --- a/Square/Models/OrderLineItemAppliedServiceCharge.cs +++ b/Square/Models/OrderLineItemAppliedServiceCharge.cs @@ -163,6 +163,10 @@ public class Builder private string uid; private Models.Money appliedMoney; + /// + /// Initialize Builder for OrderLineItemAppliedServiceCharge. + /// + /// serviceChargeUid. public Builder( string serviceChargeUid) { diff --git a/Square/Models/OrderLineItemAppliedTax.cs b/Square/Models/OrderLineItemAppliedTax.cs index 3b9b733e..38831aa1 100644 --- a/Square/Models/OrderLineItemAppliedTax.cs +++ b/Square/Models/OrderLineItemAppliedTax.cs @@ -163,6 +163,10 @@ public class Builder private string uid; private Models.Money appliedMoney; + /// + /// Initialize Builder for OrderLineItemAppliedTax. + /// + /// taxUid. public Builder( string taxUid) { diff --git a/Square/Models/OrderLineItemTax.cs b/Square/Models/OrderLineItemTax.cs index f6da0939..c2422f19 100644 --- a/Square/Models/OrderLineItemTax.cs +++ b/Square/Models/OrderLineItemTax.cs @@ -154,6 +154,7 @@ internal OrderLineItemTax(Dictionary shouldSerialize, /// The percentage of the tax, as a string representation of a decimal /// number. For example, a value of `"7.25"` corresponds to a percentage of /// 7.25%. + /// Either `percentage` or `amount_money` should be set, but not both. /// [JsonProperty("percentage")] public string Percentage { get; } diff --git a/Square/Models/OrderReturnLineItem.cs b/Square/Models/OrderReturnLineItem.cs index fe7036c5..f8158213 100644 --- a/Square/Models/OrderReturnLineItem.cs +++ b/Square/Models/OrderReturnLineItem.cs @@ -637,6 +637,10 @@ public class Builder private IList appliedServiceCharges; private Models.Money totalServiceChargeMoney; + /// + /// Initialize Builder for OrderReturnLineItem. + /// + /// quantity. public Builder( string quantity) { diff --git a/Square/Models/OrderReward.cs b/Square/Models/OrderReward.cs index 7a7027c9..b4c13e49 100644 --- a/Square/Models/OrderReward.cs +++ b/Square/Models/OrderReward.cs @@ -107,6 +107,11 @@ public class Builder private string id; private string rewardTierId; + /// + /// Initialize Builder for OrderReward. + /// + /// id. + /// rewardTierId. public Builder( string id, string rewardTierId) diff --git a/Square/Models/PayOrderRequest.cs b/Square/Models/PayOrderRequest.cs index bbe36d5c..e31240c7 100644 --- a/Square/Models/PayOrderRequest.cs +++ b/Square/Models/PayOrderRequest.cs @@ -175,6 +175,10 @@ public class Builder private int? orderVersion; private IList paymentIds; + /// + /// Initialize Builder for PayOrderRequest. + /// + /// idempotencyKey. public Builder( string idempotencyKey) { diff --git a/Square/Models/PaymentBalanceActivityFeeDetail.cs b/Square/Models/PaymentBalanceActivityFeeDetail.cs index 176eec5f..0268b838 100644 --- a/Square/Models/PaymentBalanceActivityFeeDetail.cs +++ b/Square/Models/PaymentBalanceActivityFeeDetail.cs @@ -46,7 +46,10 @@ internal PaymentBalanceActivityFeeDetail(Dictionary shouldSerializ } /// - /// The ID of the payment associated with this activity. + /// The ID of the payment associated with this activity + /// This will only be populated when a principal LedgerEntryToken is also populated. + /// If the fee is independent (there is no principal LedgerEntryToken) then this will likely not + /// be populated. /// [JsonProperty("payment_id")] public string PaymentId { get; } diff --git a/Square/Models/PaymentLink.cs b/Square/Models/PaymentLink.cs index eb3e88f9..62ef8a14 100644 --- a/Square/Models/PaymentLink.cs +++ b/Square/Models/PaymentLink.cs @@ -297,6 +297,10 @@ public class Builder private string updatedAt; private string paymentNote; + /// + /// Initialize Builder for PaymentLink. + /// + /// version. public Builder( int version) { diff --git a/Square/Models/PaymentRefund.cs b/Square/Models/PaymentRefund.cs index 8fdb8126..50bd58ce 100644 --- a/Square/Models/PaymentRefund.cs +++ b/Square/Models/PaymentRefund.cs @@ -181,8 +181,8 @@ internal PaymentRefund(Dictionary shouldSerialize, /// /// The destination type for this refund. - /// Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`, and - /// `EXTERNAL`. + /// Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`, + /// `EXTERNAL`, and `SQUARE_ACCOUNT`. /// [JsonProperty("destination_type")] public string DestinationType { get; } @@ -451,6 +451,11 @@ public class Builder private string updatedAt; private string teamMemberId; + /// + /// Initialize Builder for PaymentRefund. + /// + /// id. + /// amountMoney. public Builder( string id, Models.Money amountMoney) diff --git a/Square/Models/Payout.cs b/Square/Models/Payout.cs index 0c25eda2..6b7cfd4e 100644 --- a/Square/Models/Payout.cs +++ b/Square/Models/Payout.cs @@ -333,6 +333,11 @@ public class Builder private string arrivalDate; private string endToEndId; + /// + /// Initialize Builder for Payout. + /// + /// id. + /// locationId. public Builder( string id, string locationId) diff --git a/Square/Models/PayoutEntry.cs b/Square/Models/PayoutEntry.cs index 70c3cd19..b0a24513 100644 --- a/Square/Models/PayoutEntry.cs +++ b/Square/Models/PayoutEntry.cs @@ -568,6 +568,11 @@ public class Builder private Models.PaymentBalanceActivityThirdPartyFeeDetail typeThirdPartyFeeDetails; private Models.PaymentBalanceActivityThirdPartyFeeRefundDetail typeThirdPartyFeeRefundDetails; + /// + /// Initialize Builder for PayoutEntry. + /// + /// id. + /// payoutId. public Builder( string id, string payoutId) diff --git a/Square/Models/PhaseInput.cs b/Square/Models/PhaseInput.cs index ae754783..5f9d093c 100644 --- a/Square/Models/PhaseInput.cs +++ b/Square/Models/PhaseInput.cs @@ -140,6 +140,10 @@ public class Builder private long ordinal; private string orderTemplateId; + /// + /// Initialize Builder for PhaseInput. + /// + /// ordinal. public Builder( long ordinal) { diff --git a/Square/Models/PublishInvoiceRequest.cs b/Square/Models/PublishInvoiceRequest.cs index b33dd714..57686951 100644 --- a/Square/Models/PublishInvoiceRequest.cs +++ b/Square/Models/PublishInvoiceRequest.cs @@ -144,6 +144,10 @@ public class Builder private int version; private string idempotencyKey; + /// + /// Initialize Builder for PublishInvoiceRequest. + /// + /// version. public Builder( int version) { diff --git a/Square/Models/QrCodeOptions.cs b/Square/Models/QrCodeOptions.cs index c4b3eab6..039f957a 100644 --- a/Square/Models/QrCodeOptions.cs +++ b/Square/Models/QrCodeOptions.cs @@ -121,6 +121,12 @@ public class Builder private string body; private string barcodeContents; + /// + /// Initialize Builder for QrCodeOptions. + /// + /// title. + /// body. + /// barcodeContents. public Builder( string title, string body, diff --git a/Square/Models/QuickPay.cs b/Square/Models/QuickPay.cs index a1d520e6..e405f26e 100644 --- a/Square/Models/QuickPay.cs +++ b/Square/Models/QuickPay.cs @@ -125,6 +125,12 @@ public class Builder private Models.Money priceMoney; private string locationId; + /// + /// Initialize Builder for QuickPay. + /// + /// name. + /// priceMoney. + /// locationId. public Builder( string name, Models.Money priceMoney, diff --git a/Square/Models/ReceiptOptions.cs b/Square/Models/ReceiptOptions.cs index d44ecf05..5ec25b29 100644 --- a/Square/Models/ReceiptOptions.cs +++ b/Square/Models/ReceiptOptions.cs @@ -174,6 +174,10 @@ public class Builder private bool? printOnly; private bool? isDuplicate; + /// + /// Initialize Builder for ReceiptOptions. + /// + /// paymentId. public Builder( string paymentId) { diff --git a/Square/Models/RedeemLoyaltyRewardRequest.cs b/Square/Models/RedeemLoyaltyRewardRequest.cs index 6fb6ac56..8219598f 100644 --- a/Square/Models/RedeemLoyaltyRewardRequest.cs +++ b/Square/Models/RedeemLoyaltyRewardRequest.cs @@ -108,6 +108,11 @@ public class Builder private string idempotencyKey; private string locationId; + /// + /// Initialize Builder for RedeemLoyaltyRewardRequest. + /// + /// idempotencyKey. + /// locationId. public Builder( string idempotencyKey, string locationId) diff --git a/Square/Models/Refund.cs b/Square/Models/Refund.cs index e5ed447a..76f802ea 100644 --- a/Square/Models/Refund.cs +++ b/Square/Models/Refund.cs @@ -289,6 +289,15 @@ public class Builder private Models.Money processingFeeMoney; private IList additionalRecipients; + /// + /// Initialize Builder for Refund. + /// + /// id. + /// locationId. + /// tenderId. + /// reason. + /// amountMoney. + /// status. public Builder( string id, string locationId, diff --git a/Square/Models/RefundPaymentRequest.cs b/Square/Models/RefundPaymentRequest.cs index 407dff4f..a5568f3d 100644 --- a/Square/Models/RefundPaymentRequest.cs +++ b/Square/Models/RefundPaymentRequest.cs @@ -417,6 +417,11 @@ public class Builder private string paymentVersionToken; private string teamMemberId; + /// + /// Initialize Builder for RefundPaymentRequest. + /// + /// idempotencyKey. + /// amountMoney. public Builder( string idempotencyKey, Models.Money amountMoney) diff --git a/Square/Models/RegisterDomainRequest.cs b/Square/Models/RegisterDomainRequest.cs index 002c3358..02c27d99 100644 --- a/Square/Models/RegisterDomainRequest.cs +++ b/Square/Models/RegisterDomainRequest.cs @@ -94,6 +94,10 @@ public class Builder { private string domainName; + /// + /// Initialize Builder for RegisterDomainRequest. + /// + /// domainName. public Builder( string domainName) { diff --git a/Square/Models/RetrieveCashDrawerShiftRequest.cs b/Square/Models/RetrieveCashDrawerShiftRequest.cs index 33b5f554..c8badc18 100644 --- a/Square/Models/RetrieveCashDrawerShiftRequest.cs +++ b/Square/Models/RetrieveCashDrawerShiftRequest.cs @@ -94,6 +94,10 @@ public class Builder { private string locationId; + /// + /// Initialize Builder for RetrieveCashDrawerShiftRequest. + /// + /// locationId. public Builder( string locationId) { diff --git a/Square/Models/RetrieveCatalogObjectResponse.cs b/Square/Models/RetrieveCatalogObjectResponse.cs index fe9bf865..f6543cb5 100644 --- a/Square/Models/RetrieveCatalogObjectResponse.cs +++ b/Square/Models/RetrieveCatalogObjectResponse.cs @@ -48,12 +48,14 @@ public RetrieveCatalogObjectResponse( public IList Errors { get; } /// + /// `, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. /// For a more detailed discussion of the Catalog data model, please see the /// [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + /// ]]> /// [JsonProperty("object", NullValueHandling = NullValueHandling.Ignore)] public Models.CatalogObject MObject { get; } diff --git a/Square/Models/RetrieveGiftCardFromGANRequest.cs b/Square/Models/RetrieveGiftCardFromGANRequest.cs index dde9a975..06ad360a 100644 --- a/Square/Models/RetrieveGiftCardFromGANRequest.cs +++ b/Square/Models/RetrieveGiftCardFromGANRequest.cs @@ -96,6 +96,10 @@ public class Builder { private string gan; + /// + /// Initialize Builder for RetrieveGiftCardFromGANRequest. + /// + /// gan. public Builder( string gan) { diff --git a/Square/Models/RetrieveGiftCardFromNonceRequest.cs b/Square/Models/RetrieveGiftCardFromNonceRequest.cs index 1c2e9d2b..cf99ade3 100644 --- a/Square/Models/RetrieveGiftCardFromNonceRequest.cs +++ b/Square/Models/RetrieveGiftCardFromNonceRequest.cs @@ -95,6 +95,10 @@ public class Builder { private string nonce; + /// + /// Initialize Builder for RetrieveGiftCardFromNonceRequest. + /// + /// nonce. public Builder( string nonce) { diff --git a/Square/Models/SaveCardOptions.cs b/Square/Models/SaveCardOptions.cs index 93a816c0..9088d0cb 100644 --- a/Square/Models/SaveCardOptions.cs +++ b/Square/Models/SaveCardOptions.cs @@ -157,6 +157,10 @@ public class Builder private string cardId; private string referenceId; + /// + /// Initialize Builder for SaveCardOptions. + /// + /// customerId. public Builder( string customerId) { diff --git a/Square/Models/SearchAvailabilityFilter.cs b/Square/Models/SearchAvailabilityFilter.cs index ef504b9d..53189400 100644 --- a/Square/Models/SearchAvailabilityFilter.cs +++ b/Square/Models/SearchAvailabilityFilter.cs @@ -211,6 +211,10 @@ public class Builder private IList segmentFilters; private string bookingId; + /// + /// Initialize Builder for SearchAvailabilityFilter. + /// + /// startAtRange. public Builder( Models.TimeRange startAtRange) { diff --git a/Square/Models/SearchAvailabilityQuery.cs b/Square/Models/SearchAvailabilityQuery.cs index 920a7440..031557ca 100644 --- a/Square/Models/SearchAvailabilityQuery.cs +++ b/Square/Models/SearchAvailabilityQuery.cs @@ -94,6 +94,10 @@ public class Builder { private Models.SearchAvailabilityFilter filter; + /// + /// Initialize Builder for SearchAvailabilityQuery. + /// + /// filter. public Builder( Models.SearchAvailabilityFilter filter) { diff --git a/Square/Models/SearchAvailabilityRequest.cs b/Square/Models/SearchAvailabilityRequest.cs index 6b6b12ed..f849eb2b 100644 --- a/Square/Models/SearchAvailabilityRequest.cs +++ b/Square/Models/SearchAvailabilityRequest.cs @@ -94,6 +94,10 @@ public class Builder { private Models.SearchAvailabilityQuery query; + /// + /// Initialize Builder for SearchAvailabilityRequest. + /// + /// query. public Builder( Models.SearchAvailabilityQuery query) { diff --git a/Square/Models/SearchInvoicesRequest.cs b/Square/Models/SearchInvoicesRequest.cs index b7f68800..4b0a41a4 100644 --- a/Square/Models/SearchInvoicesRequest.cs +++ b/Square/Models/SearchInvoicesRequest.cs @@ -123,6 +123,10 @@ public class Builder private int? limit; private string cursor; + /// + /// Initialize Builder for SearchInvoicesRequest. + /// + /// query. public Builder( Models.InvoiceQuery query) { diff --git a/Square/Models/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.cs b/Square/Models/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.cs index 54f38e62..d1045ba0 100644 --- a/Square/Models/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.cs +++ b/Square/Models/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.cs @@ -107,6 +107,10 @@ public class Builder private string loyaltyAccountId; private string status; + /// + /// Initialize Builder for SearchLoyaltyRewardsRequestLoyaltyRewardQuery. + /// + /// loyaltyAccountId. public Builder( string loyaltyAccountId) { diff --git a/Square/Models/SearchOrdersResponse.cs b/Square/Models/SearchOrdersResponse.cs index 77d98fb7..a90d9f68 100644 --- a/Square/Models/SearchOrdersResponse.cs +++ b/Square/Models/SearchOrdersResponse.cs @@ -62,7 +62,7 @@ public SearchOrdersResponse( /// /// The pagination cursor to be used in a subsequent request. If unset, /// this is the final response. - /// For more information, see [Pagination](https://developer.squareup.com/docs/basics/build-basics/common-api-patterns/pagination). + /// For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). /// [JsonProperty("cursor", NullValueHandling = NullValueHandling.Ignore)] public string Cursor { get; } diff --git a/Square/Models/SearchOrdersSort.cs b/Square/Models/SearchOrdersSort.cs index 1c6d78d2..b8fd48f8 100644 --- a/Square/Models/SearchOrdersSort.cs +++ b/Square/Models/SearchOrdersSort.cs @@ -107,6 +107,10 @@ public class Builder private string sortField; private string sortOrder; + /// + /// Initialize Builder for SearchOrdersSort. + /// + /// sortField. public Builder( string sortField) { diff --git a/Square/Models/SearchOrdersStateFilter.cs b/Square/Models/SearchOrdersStateFilter.cs index 971c35b1..359d53f0 100644 --- a/Square/Models/SearchOrdersStateFilter.cs +++ b/Square/Models/SearchOrdersStateFilter.cs @@ -95,6 +95,10 @@ public class Builder { private IList states; + /// + /// Initialize Builder for SearchOrdersStateFilter. + /// + /// states. public Builder( IList states) { diff --git a/Square/Models/SegmentFilter.cs b/Square/Models/SegmentFilter.cs index c805ea5c..8d51ceae 100644 --- a/Square/Models/SegmentFilter.cs +++ b/Square/Models/SegmentFilter.cs @@ -110,6 +110,10 @@ public class Builder private string serviceVariationId; private Models.FilterValue teamMemberIdFilter; + /// + /// Initialize Builder for SegmentFilter. + /// + /// serviceVariationId. public Builder( string serviceVariationId) { diff --git a/Square/Models/SelectOption.cs b/Square/Models/SelectOption.cs index 1b9dccc0..5578ccea 100644 --- a/Square/Models/SelectOption.cs +++ b/Square/Models/SelectOption.cs @@ -107,6 +107,11 @@ public class Builder private string referenceId; private string title; + /// + /// Initialize Builder for SelectOption. + /// + /// referenceId. + /// title. public Builder( string referenceId, string title) diff --git a/Square/Models/SelectOptions.cs b/Square/Models/SelectOptions.cs index 7f9cd163..87e5e240 100644 --- a/Square/Models/SelectOptions.cs +++ b/Square/Models/SelectOptions.cs @@ -133,6 +133,12 @@ public class Builder private IList options; private Models.SelectOption selectedOption; + /// + /// Initialize Builder for SelectOptions. + /// + /// title. + /// body. + /// options. public Builder( string title, string body, diff --git a/Square/Models/Shift.cs b/Square/Models/Shift.cs index 2bc951b4..9f0893fa 100644 --- a/Square/Models/Shift.cs +++ b/Square/Models/Shift.cs @@ -399,6 +399,11 @@ public class Builder private string teamMemberId; private Models.Money declaredCashTipMoney; + /// + /// Initialize Builder for Shift. + /// + /// locationId. + /// startAt. public Builder( string locationId, string startAt) diff --git a/Square/Models/ShippingFee.cs b/Square/Models/ShippingFee.cs index 636aa435..65d86ae7 100644 --- a/Square/Models/ShippingFee.cs +++ b/Square/Models/ShippingFee.cs @@ -145,6 +145,10 @@ public class Builder private Models.Money charge; private string name; + /// + /// Initialize Builder for ShippingFee. + /// + /// charge. public Builder( Models.Money charge) { diff --git a/Square/Models/SignatureOptions.cs b/Square/Models/SignatureOptions.cs index 27447270..96d76679 100644 --- a/Square/Models/SignatureOptions.cs +++ b/Square/Models/SignatureOptions.cs @@ -120,6 +120,11 @@ public class Builder private string body; private IList signature; + /// + /// Initialize Builder for SignatureOptions. + /// + /// title. + /// body. public Builder( string title, string body) diff --git a/Square/Models/Snippet.cs b/Square/Models/Snippet.cs index c26b1364..713b7256 100644 --- a/Square/Models/Snippet.cs +++ b/Square/Models/Snippet.cs @@ -146,6 +146,10 @@ public class Builder private string createdAt; private string updatedAt; + /// + /// Initialize Builder for Snippet. + /// + /// content. public Builder( string content) { diff --git a/Square/Models/SubscriptionEvent.cs b/Square/Models/SubscriptionEvent.cs index f20c18bf..7041a2d7 100644 --- a/Square/Models/SubscriptionEvent.cs +++ b/Square/Models/SubscriptionEvent.cs @@ -215,6 +215,13 @@ public class Builder private Models.SubscriptionEventInfo info; private IList phases; + /// + /// Initialize Builder for SubscriptionEvent. + /// + /// id. + /// subscriptionEventType. + /// effectiveDate. + /// planVariationId. public Builder( string id, string subscriptionEventType, diff --git a/Square/Models/SubscriptionPhase.cs b/Square/Models/SubscriptionPhase.cs index 73365ae2..81b1dc7f 100644 --- a/Square/Models/SubscriptionPhase.cs +++ b/Square/Models/SubscriptionPhase.cs @@ -237,6 +237,10 @@ public class Builder private long? ordinal; private Models.SubscriptionPricing pricing; + /// + /// Initialize Builder for SubscriptionPhase. + /// + /// cadence. public Builder( string cadence) { diff --git a/Square/Models/Tender.cs b/Square/Models/Tender.cs index 03f7b776..3ff95130 100644 --- a/Square/Models/Tender.cs +++ b/Square/Models/Tender.cs @@ -469,6 +469,10 @@ public class Builder private IList additionalRecipients; private string paymentId; + /// + /// Initialize Builder for Tender. + /// + /// type. public Builder( string type) { diff --git a/Square/Models/TerminalCheckout.cs b/Square/Models/TerminalCheckout.cs index c6705c7a..196c6541 100644 --- a/Square/Models/TerminalCheckout.cs +++ b/Square/Models/TerminalCheckout.cs @@ -551,6 +551,11 @@ public class Builder private string statementDescriptionIdentifier; private Models.Money tipMoney; + /// + /// Initialize Builder for TerminalCheckout. + /// + /// amountMoney. + /// deviceOptions. public Builder( Models.Money amountMoney, Models.DeviceCheckoutOptions deviceOptions) diff --git a/Square/Models/TerminalRefund.cs b/Square/Models/TerminalRefund.cs index 6c55e9a8..3c7d7e1c 100644 --- a/Square/Models/TerminalRefund.cs +++ b/Square/Models/TerminalRefund.cs @@ -333,6 +333,13 @@ public class Builder private string appId; private string locationId; + /// + /// Initialize Builder for TerminalRefund. + /// + /// paymentId. + /// amountMoney. + /// reason. + /// deviceId. public Builder( string paymentId, Models.Money amountMoney, diff --git a/Square/Models/UnlinkCustomerFromGiftCardRequest.cs b/Square/Models/UnlinkCustomerFromGiftCardRequest.cs index 58c95fd6..c77daca9 100644 --- a/Square/Models/UnlinkCustomerFromGiftCardRequest.cs +++ b/Square/Models/UnlinkCustomerFromGiftCardRequest.cs @@ -94,6 +94,10 @@ public class Builder { private string customerId; + /// + /// Initialize Builder for UnlinkCustomerFromGiftCardRequest. + /// + /// customerId. public Builder( string customerId) { diff --git a/Square/Models/UpdateBookingCustomAttributeDefinitionRequest.cs b/Square/Models/UpdateBookingCustomAttributeDefinitionRequest.cs index d8ee86da..3ab7cd44 100644 --- a/Square/Models/UpdateBookingCustomAttributeDefinitionRequest.cs +++ b/Square/Models/UpdateBookingCustomAttributeDefinitionRequest.cs @@ -142,6 +142,10 @@ public class Builder private Models.CustomAttributeDefinition customAttributeDefinition; private string idempotencyKey; + /// + /// Initialize Builder for UpdateBookingCustomAttributeDefinitionRequest. + /// + /// customAttributeDefinition. public Builder( Models.CustomAttributeDefinition customAttributeDefinition) { diff --git a/Square/Models/UpdateBookingRequest.cs b/Square/Models/UpdateBookingRequest.cs index 0a282021..680eef06 100644 --- a/Square/Models/UpdateBookingRequest.cs +++ b/Square/Models/UpdateBookingRequest.cs @@ -141,6 +141,10 @@ public class Builder private Models.Booking booking; private string idempotencyKey; + /// + /// Initialize Builder for UpdateBookingRequest. + /// + /// booking. public Builder( Models.Booking booking) { diff --git a/Square/Models/UpdateBreakTypeRequest.cs b/Square/Models/UpdateBreakTypeRequest.cs index 7d3b8378..4138e594 100644 --- a/Square/Models/UpdateBreakTypeRequest.cs +++ b/Square/Models/UpdateBreakTypeRequest.cs @@ -95,6 +95,10 @@ public class Builder { private Models.BreakType breakType; + /// + /// Initialize Builder for UpdateBreakTypeRequest. + /// + /// breakType. public Builder( Models.BreakType breakType) { diff --git a/Square/Models/UpdateCatalogImageRequest.cs b/Square/Models/UpdateCatalogImageRequest.cs index 2f01ac61..27ff35ab 100644 --- a/Square/Models/UpdateCatalogImageRequest.cs +++ b/Square/Models/UpdateCatalogImageRequest.cs @@ -96,6 +96,10 @@ public class Builder { private string idempotencyKey; + /// + /// Initialize Builder for UpdateCatalogImageRequest. + /// + /// idempotencyKey. public Builder( string idempotencyKey) { diff --git a/Square/Models/UpdateCatalogImageResponse.cs b/Square/Models/UpdateCatalogImageResponse.cs index 57a9258e..a05987e4 100644 --- a/Square/Models/UpdateCatalogImageResponse.cs +++ b/Square/Models/UpdateCatalogImageResponse.cs @@ -45,12 +45,14 @@ public UpdateCatalogImageResponse( public IList Errors { get; } /// + /// `, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. /// For a more detailed discussion of the Catalog data model, please see the /// [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + /// ]]> /// [JsonProperty("image", NullValueHandling = NullValueHandling.Ignore)] public Models.CatalogObject Image { get; } diff --git a/Square/Models/UpdateCustomerCustomAttributeDefinitionRequest.cs b/Square/Models/UpdateCustomerCustomAttributeDefinitionRequest.cs index 6e42c563..4e4cfac3 100644 --- a/Square/Models/UpdateCustomerCustomAttributeDefinitionRequest.cs +++ b/Square/Models/UpdateCustomerCustomAttributeDefinitionRequest.cs @@ -142,6 +142,10 @@ public class Builder private Models.CustomAttributeDefinition customAttributeDefinition; private string idempotencyKey; + /// + /// Initialize Builder for UpdateCustomerCustomAttributeDefinitionRequest. + /// + /// customAttributeDefinition. public Builder( Models.CustomAttributeDefinition customAttributeDefinition) { diff --git a/Square/Models/UpdateCustomerGroupRequest.cs b/Square/Models/UpdateCustomerGroupRequest.cs index 628cd880..200a7e53 100644 --- a/Square/Models/UpdateCustomerGroupRequest.cs +++ b/Square/Models/UpdateCustomerGroupRequest.cs @@ -96,6 +96,10 @@ public class Builder { private Models.CustomerGroup mGroup; + /// + /// Initialize Builder for UpdateCustomerGroupRequest. + /// + /// mGroup. public Builder( Models.CustomerGroup mGroup) { diff --git a/Square/Models/UpdateInvoiceRequest.cs b/Square/Models/UpdateInvoiceRequest.cs index 2b4df301..a1415699 100644 --- a/Square/Models/UpdateInvoiceRequest.cs +++ b/Square/Models/UpdateInvoiceRequest.cs @@ -176,6 +176,10 @@ public class Builder private string idempotencyKey; private IList fieldsToClear; + /// + /// Initialize Builder for UpdateInvoiceRequest. + /// + /// invoice. public Builder( Models.Invoice invoice) { diff --git a/Square/Models/UpdateItemModifierListsRequest.cs b/Square/Models/UpdateItemModifierListsRequest.cs index 749c299f..4026fbd8 100644 --- a/Square/Models/UpdateItemModifierListsRequest.cs +++ b/Square/Models/UpdateItemModifierListsRequest.cs @@ -173,6 +173,10 @@ public class Builder private IList modifierListsToEnable; private IList modifierListsToDisable; + /// + /// Initialize Builder for UpdateItemModifierListsRequest. + /// + /// itemIds. public Builder( IList itemIds) { diff --git a/Square/Models/UpdateItemTaxesRequest.cs b/Square/Models/UpdateItemTaxesRequest.cs index 8d3f1e5a..6851d50b 100644 --- a/Square/Models/UpdateItemTaxesRequest.cs +++ b/Square/Models/UpdateItemTaxesRequest.cs @@ -174,6 +174,10 @@ public class Builder private IList taxesToEnable; private IList taxesToDisable; + /// + /// Initialize Builder for UpdateItemTaxesRequest. + /// + /// itemIds. public Builder( IList itemIds) { diff --git a/Square/Models/UpdateLocationCustomAttributeDefinitionRequest.cs b/Square/Models/UpdateLocationCustomAttributeDefinitionRequest.cs index 5fbb5631..e44c57e5 100644 --- a/Square/Models/UpdateLocationCustomAttributeDefinitionRequest.cs +++ b/Square/Models/UpdateLocationCustomAttributeDefinitionRequest.cs @@ -142,6 +142,10 @@ public class Builder private Models.CustomAttributeDefinition customAttributeDefinition; private string idempotencyKey; + /// + /// Initialize Builder for UpdateLocationCustomAttributeDefinitionRequest. + /// + /// customAttributeDefinition. public Builder( Models.CustomAttributeDefinition customAttributeDefinition) { diff --git a/Square/Models/UpdateLocationSettingsRequest.cs b/Square/Models/UpdateLocationSettingsRequest.cs index 76531392..e8102b79 100644 --- a/Square/Models/UpdateLocationSettingsRequest.cs +++ b/Square/Models/UpdateLocationSettingsRequest.cs @@ -94,6 +94,10 @@ public class Builder { private Models.CheckoutLocationSettings locationSettings; + /// + /// Initialize Builder for UpdateLocationSettingsRequest. + /// + /// locationSettings. public Builder( Models.CheckoutLocationSettings locationSettings) { diff --git a/Square/Models/UpdateMerchantCustomAttributeDefinitionRequest.cs b/Square/Models/UpdateMerchantCustomAttributeDefinitionRequest.cs index d9cf7b1b..a5169f27 100644 --- a/Square/Models/UpdateMerchantCustomAttributeDefinitionRequest.cs +++ b/Square/Models/UpdateMerchantCustomAttributeDefinitionRequest.cs @@ -142,6 +142,10 @@ public class Builder private Models.CustomAttributeDefinition customAttributeDefinition; private string idempotencyKey; + /// + /// Initialize Builder for UpdateMerchantCustomAttributeDefinitionRequest. + /// + /// customAttributeDefinition. public Builder( Models.CustomAttributeDefinition customAttributeDefinition) { diff --git a/Square/Models/UpdateMerchantSettingsRequest.cs b/Square/Models/UpdateMerchantSettingsRequest.cs index 9900b86b..c6c6a1f6 100644 --- a/Square/Models/UpdateMerchantSettingsRequest.cs +++ b/Square/Models/UpdateMerchantSettingsRequest.cs @@ -94,6 +94,10 @@ public class Builder { private Models.CheckoutMerchantSettings merchantSettings; + /// + /// Initialize Builder for UpdateMerchantSettingsRequest. + /// + /// merchantSettings. public Builder( Models.CheckoutMerchantSettings merchantSettings) { diff --git a/Square/Models/UpdateOrderCustomAttributeDefinitionRequest.cs b/Square/Models/UpdateOrderCustomAttributeDefinitionRequest.cs index c69fa996..320ab704 100644 --- a/Square/Models/UpdateOrderCustomAttributeDefinitionRequest.cs +++ b/Square/Models/UpdateOrderCustomAttributeDefinitionRequest.cs @@ -142,6 +142,10 @@ public class Builder private Models.CustomAttributeDefinition customAttributeDefinition; private string idempotencyKey; + /// + /// Initialize Builder for UpdateOrderCustomAttributeDefinitionRequest. + /// + /// customAttributeDefinition. public Builder( Models.CustomAttributeDefinition customAttributeDefinition) { diff --git a/Square/Models/UpdatePaymentLinkRequest.cs b/Square/Models/UpdatePaymentLinkRequest.cs index ac084dea..95a27663 100644 --- a/Square/Models/UpdatePaymentLinkRequest.cs +++ b/Square/Models/UpdatePaymentLinkRequest.cs @@ -94,6 +94,10 @@ public class Builder { private Models.PaymentLink paymentLink; + /// + /// Initialize Builder for UpdatePaymentLinkRequest. + /// + /// paymentLink. public Builder( Models.PaymentLink paymentLink) { diff --git a/Square/Models/UpdatePaymentRequest.cs b/Square/Models/UpdatePaymentRequest.cs index 2d629d18..83e8b00f 100644 --- a/Square/Models/UpdatePaymentRequest.cs +++ b/Square/Models/UpdatePaymentRequest.cs @@ -109,6 +109,10 @@ public class Builder private string idempotencyKey; private Models.Payment payment; + /// + /// Initialize Builder for UpdatePaymentRequest. + /// + /// idempotencyKey. public Builder( string idempotencyKey) { diff --git a/Square/Models/UpdateShiftRequest.cs b/Square/Models/UpdateShiftRequest.cs index 3f6bf384..8b55a335 100644 --- a/Square/Models/UpdateShiftRequest.cs +++ b/Square/Models/UpdateShiftRequest.cs @@ -96,6 +96,10 @@ public class Builder { private Models.Shift shift; + /// + /// Initialize Builder for UpdateShiftRequest. + /// + /// shift. public Builder( Models.Shift shift) { diff --git a/Square/Models/UpdateVendorRequest.cs b/Square/Models/UpdateVendorRequest.cs index 4e2ad3c6..ddcab8bd 100644 --- a/Square/Models/UpdateVendorRequest.cs +++ b/Square/Models/UpdateVendorRequest.cs @@ -144,6 +144,10 @@ public class Builder private Models.Vendor vendor; private string idempotencyKey; + /// + /// Initialize Builder for UpdateVendorRequest. + /// + /// vendor. public Builder( Models.Vendor vendor) { diff --git a/Square/Models/UpdateWageSettingRequest.cs b/Square/Models/UpdateWageSettingRequest.cs index ba4bb806..775c7fcd 100644 --- a/Square/Models/UpdateWageSettingRequest.cs +++ b/Square/Models/UpdateWageSettingRequest.cs @@ -94,6 +94,10 @@ public class Builder { private Models.WageSetting wageSetting; + /// + /// Initialize Builder for UpdateWageSettingRequest. + /// + /// wageSetting. public Builder( Models.WageSetting wageSetting) { diff --git a/Square/Models/UpdateWorkweekConfigRequest.cs b/Square/Models/UpdateWorkweekConfigRequest.cs index 96571232..4959754f 100644 --- a/Square/Models/UpdateWorkweekConfigRequest.cs +++ b/Square/Models/UpdateWorkweekConfigRequest.cs @@ -95,6 +95,10 @@ public class Builder { private Models.WorkweekConfig workweekConfig; + /// + /// Initialize Builder for UpdateWorkweekConfigRequest. + /// + /// workweekConfig. public Builder( Models.WorkweekConfig workweekConfig) { diff --git a/Square/Models/UpsertBookingCustomAttributeRequest.cs b/Square/Models/UpsertBookingCustomAttributeRequest.cs index d443c2bb..090ad1ee 100644 --- a/Square/Models/UpsertBookingCustomAttributeRequest.cs +++ b/Square/Models/UpsertBookingCustomAttributeRequest.cs @@ -142,6 +142,10 @@ public class Builder private Models.CustomAttribute customAttribute; private string idempotencyKey; + /// + /// Initialize Builder for UpsertBookingCustomAttributeRequest. + /// + /// customAttribute. public Builder( Models.CustomAttribute customAttribute) { diff --git a/Square/Models/UpsertCatalogObjectRequest.cs b/Square/Models/UpsertCatalogObjectRequest.cs index 90955921..b051083c 100644 --- a/Square/Models/UpsertCatalogObjectRequest.cs +++ b/Square/Models/UpsertCatalogObjectRequest.cs @@ -45,12 +45,14 @@ public UpsertCatalogObjectRequest( public string IdempotencyKey { get; } /// + /// `, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. /// For a more detailed discussion of the Catalog data model, please see the /// [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + /// ]]> /// [JsonProperty("object")] public Models.CatalogObject MObject { get; } @@ -119,6 +121,11 @@ public class Builder private string idempotencyKey; private Models.CatalogObject mObject; + /// + /// Initialize Builder for UpsertCatalogObjectRequest. + /// + /// idempotencyKey. + /// mObject. public Builder( string idempotencyKey, Models.CatalogObject mObject) diff --git a/Square/Models/UpsertCatalogObjectResponse.cs b/Square/Models/UpsertCatalogObjectResponse.cs index af38bb30..b0213a5d 100644 --- a/Square/Models/UpsertCatalogObjectResponse.cs +++ b/Square/Models/UpsertCatalogObjectResponse.cs @@ -48,12 +48,14 @@ public UpsertCatalogObjectResponse( public IList Errors { get; } /// + /// `, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. /// For a more detailed discussion of the Catalog data model, please see the /// [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + /// ]]> /// [JsonProperty("catalog_object", NullValueHandling = NullValueHandling.Ignore)] public Models.CatalogObject CatalogObject { get; } diff --git a/Square/Models/UpsertCustomerCustomAttributeRequest.cs b/Square/Models/UpsertCustomerCustomAttributeRequest.cs index a92841d6..7fd78f74 100644 --- a/Square/Models/UpsertCustomerCustomAttributeRequest.cs +++ b/Square/Models/UpsertCustomerCustomAttributeRequest.cs @@ -142,6 +142,10 @@ public class Builder private Models.CustomAttribute customAttribute; private string idempotencyKey; + /// + /// Initialize Builder for UpsertCustomerCustomAttributeRequest. + /// + /// customAttribute. public Builder( Models.CustomAttribute customAttribute) { diff --git a/Square/Models/UpsertLocationCustomAttributeRequest.cs b/Square/Models/UpsertLocationCustomAttributeRequest.cs index e2d9e0e8..8fd4421d 100644 --- a/Square/Models/UpsertLocationCustomAttributeRequest.cs +++ b/Square/Models/UpsertLocationCustomAttributeRequest.cs @@ -142,6 +142,10 @@ public class Builder private Models.CustomAttribute customAttribute; private string idempotencyKey; + /// + /// Initialize Builder for UpsertLocationCustomAttributeRequest. + /// + /// customAttribute. public Builder( Models.CustomAttribute customAttribute) { diff --git a/Square/Models/UpsertMerchantCustomAttributeRequest.cs b/Square/Models/UpsertMerchantCustomAttributeRequest.cs index ee10396c..533031f4 100644 --- a/Square/Models/UpsertMerchantCustomAttributeRequest.cs +++ b/Square/Models/UpsertMerchantCustomAttributeRequest.cs @@ -142,6 +142,10 @@ public class Builder private Models.CustomAttribute customAttribute; private string idempotencyKey; + /// + /// Initialize Builder for UpsertMerchantCustomAttributeRequest. + /// + /// customAttribute. public Builder( Models.CustomAttribute customAttribute) { diff --git a/Square/Models/UpsertOrderCustomAttributeRequest.cs b/Square/Models/UpsertOrderCustomAttributeRequest.cs index 5c4dc382..9bdb2ebb 100644 --- a/Square/Models/UpsertOrderCustomAttributeRequest.cs +++ b/Square/Models/UpsertOrderCustomAttributeRequest.cs @@ -142,6 +142,10 @@ public class Builder private Models.CustomAttribute customAttribute; private string idempotencyKey; + /// + /// Initialize Builder for UpsertOrderCustomAttributeRequest. + /// + /// customAttribute. public Builder( Models.CustomAttribute customAttribute) { diff --git a/Square/Models/UpsertSnippetRequest.cs b/Square/Models/UpsertSnippetRequest.cs index cecf4e66..95e07858 100644 --- a/Square/Models/UpsertSnippetRequest.cs +++ b/Square/Models/UpsertSnippetRequest.cs @@ -94,6 +94,10 @@ public class Builder { private Models.Snippet snippet; + /// + /// Initialize Builder for UpsertSnippetRequest. + /// + /// snippet. public Builder( Models.Snippet snippet) { diff --git a/Square/Models/V1CreateRefundRequest.cs b/Square/Models/V1CreateRefundRequest.cs deleted file mode 100644 index c9d3d423..00000000 --- a/Square/Models/V1CreateRefundRequest.cs +++ /dev/null @@ -1,280 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1CreateRefundRequest. - /// - public class V1CreateRefundRequest - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// payment_id. - /// type. - /// reason. - /// refunded_money. - /// request_idempotence_key. - public V1CreateRefundRequest( - string paymentId, - string type, - string reason, - Models.V1Money refundedMoney = null, - string requestIdempotenceKey = null) - { - shouldSerialize = new Dictionary - { - { "request_idempotence_key", false } - }; - - this.PaymentId = paymentId; - this.Type = type; - this.Reason = reason; - this.RefundedMoney = refundedMoney; - if (requestIdempotenceKey != null) - { - shouldSerialize["request_idempotence_key"] = true; - this.RequestIdempotenceKey = requestIdempotenceKey; - } - - } - internal V1CreateRefundRequest(Dictionary shouldSerialize, - string paymentId, - string type, - string reason, - Models.V1Money refundedMoney = null, - string requestIdempotenceKey = null) - { - this.shouldSerialize = shouldSerialize; - PaymentId = paymentId; - Type = type; - Reason = reason; - RefundedMoney = refundedMoney; - RequestIdempotenceKey = requestIdempotenceKey; - } - - /// - /// The ID of the payment to refund. If you are creating a `PARTIAL` - /// refund for a split tender payment, instead provide the id of the - /// particular tender you want to refund. - /// - [JsonProperty("payment_id")] - public string PaymentId { get; } - - /// - /// Gets or sets Type. - /// - [JsonProperty("type")] - public string Type { get; } - - /// - /// The reason for the refund. - /// - [JsonProperty("reason")] - public string Reason { get; } - - /// - /// Gets or sets RefundedMoney. - /// - [JsonProperty("refunded_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money RefundedMoney { get; } - - /// - /// An optional key to ensure idempotence if you issue the same PARTIAL refund request more than once. - /// - [JsonProperty("request_idempotence_key")] - public string RequestIdempotenceKey { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1CreateRefundRequest : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeRequestIdempotenceKey() - { - return this.shouldSerialize["request_idempotence_key"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1CreateRefundRequest other && ((this.PaymentId == null && other.PaymentId == null) || (this.PaymentId?.Equals(other.PaymentId) == true)) && - ((this.Type == null && other.Type == null) || (this.Type?.Equals(other.Type) == true)) && - ((this.Reason == null && other.Reason == null) || (this.Reason?.Equals(other.Reason) == true)) && - ((this.RefundedMoney == null && other.RefundedMoney == null) || (this.RefundedMoney?.Equals(other.RefundedMoney) == true)) && - ((this.RequestIdempotenceKey == null && other.RequestIdempotenceKey == null) || (this.RequestIdempotenceKey?.Equals(other.RequestIdempotenceKey) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 1278947048; - hashCode = HashCode.Combine(this.PaymentId, this.Type, this.Reason, this.RefundedMoney, this.RequestIdempotenceKey); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.PaymentId = {(this.PaymentId == null ? "null" : this.PaymentId)}"); - toStringOutput.Add($"this.Type = {(this.Type == null ? "null" : this.Type.ToString())}"); - toStringOutput.Add($"this.Reason = {(this.Reason == null ? "null" : this.Reason)}"); - toStringOutput.Add($"this.RefundedMoney = {(this.RefundedMoney == null ? "null" : this.RefundedMoney.ToString())}"); - toStringOutput.Add($"this.RequestIdempotenceKey = {(this.RequestIdempotenceKey == null ? "null" : this.RequestIdempotenceKey)}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder( - this.PaymentId, - this.Type, - this.Reason) - .RefundedMoney(this.RefundedMoney) - .RequestIdempotenceKey(this.RequestIdempotenceKey); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "request_idempotence_key", false }, - }; - - private string paymentId; - private string type; - private string reason; - private Models.V1Money refundedMoney; - private string requestIdempotenceKey; - - public Builder( - string paymentId, - string type, - string reason) - { - this.paymentId = paymentId; - this.type = type; - this.reason = reason; - } - - /// - /// PaymentId. - /// - /// paymentId. - /// Builder. - public Builder PaymentId(string paymentId) - { - this.paymentId = paymentId; - return this; - } - - /// - /// Type. - /// - /// type. - /// Builder. - public Builder Type(string type) - { - this.type = type; - return this; - } - - /// - /// Reason. - /// - /// reason. - /// Builder. - public Builder Reason(string reason) - { - this.reason = reason; - return this; - } - - /// - /// RefundedMoney. - /// - /// refundedMoney. - /// Builder. - public Builder RefundedMoney(Models.V1Money refundedMoney) - { - this.refundedMoney = refundedMoney; - return this; - } - - /// - /// RequestIdempotenceKey. - /// - /// requestIdempotenceKey. - /// Builder. - public Builder RequestIdempotenceKey(string requestIdempotenceKey) - { - shouldSerialize["request_idempotence_key"] = true; - this.requestIdempotenceKey = requestIdempotenceKey; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetRequestIdempotenceKey() - { - this.shouldSerialize["request_idempotence_key"] = false; - } - - - /// - /// Builds class object. - /// - /// V1CreateRefundRequest. - public V1CreateRefundRequest Build() - { - return new V1CreateRefundRequest(shouldSerialize, - this.paymentId, - this.type, - this.reason, - this.refundedMoney, - this.requestIdempotenceKey); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1ListPaymentsRequest.cs b/Square/Models/V1ListPaymentsRequest.cs deleted file mode 100644 index 39b50a49..00000000 --- a/Square/Models/V1ListPaymentsRequest.cs +++ /dev/null @@ -1,396 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1ListPaymentsRequest. - /// - public class V1ListPaymentsRequest - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// order. - /// begin_time. - /// end_time. - /// limit. - /// batch_token. - /// include_partial. - public V1ListPaymentsRequest( - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null, - bool? includePartial = null) - { - shouldSerialize = new Dictionary - { - { "begin_time", false }, - { "end_time", false }, - { "limit", false }, - { "batch_token", false }, - { "include_partial", false } - }; - - this.Order = order; - if (beginTime != null) - { - shouldSerialize["begin_time"] = true; - this.BeginTime = beginTime; - } - - if (endTime != null) - { - shouldSerialize["end_time"] = true; - this.EndTime = endTime; - } - - if (limit != null) - { - shouldSerialize["limit"] = true; - this.Limit = limit; - } - - if (batchToken != null) - { - shouldSerialize["batch_token"] = true; - this.BatchToken = batchToken; - } - - if (includePartial != null) - { - shouldSerialize["include_partial"] = true; - this.IncludePartial = includePartial; - } - - } - internal V1ListPaymentsRequest(Dictionary shouldSerialize, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null, - bool? includePartial = null) - { - this.shouldSerialize = shouldSerialize; - Order = order; - BeginTime = beginTime; - EndTime = endTime; - Limit = limit; - BatchToken = batchToken; - IncludePartial = includePartial; - } - - /// - /// The order (e.g., chronological or alphabetical) in which results from a request are returned. - /// - [JsonProperty("order", NullValueHandling = NullValueHandling.Ignore)] - public string Order { get; } - - /// - /// The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year. - /// - [JsonProperty("begin_time")] - public string BeginTime { get; } - - /// - /// The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. - /// - [JsonProperty("end_time")] - public string EndTime { get; } - - /// - /// The maximum number of payments to return in a single response. This value cannot exceed 200. - /// - [JsonProperty("limit")] - public int? Limit { get; } - - /// - /// A pagination cursor to retrieve the next set of results for your - /// original query to the endpoint. - /// - [JsonProperty("batch_token")] - public string BatchToken { get; } - - /// - /// Indicates whether or not to include partial payments in the response. Partial payments will have the tenders collected so far, but the itemizations will be empty until the payment is completed. - /// - [JsonProperty("include_partial")] - public bool? IncludePartial { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1ListPaymentsRequest : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeBeginTime() - { - return this.shouldSerialize["begin_time"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeEndTime() - { - return this.shouldSerialize["end_time"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeLimit() - { - return this.shouldSerialize["limit"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeBatchToken() - { - return this.shouldSerialize["batch_token"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeIncludePartial() - { - return this.shouldSerialize["include_partial"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1ListPaymentsRequest other && ((this.Order == null && other.Order == null) || (this.Order?.Equals(other.Order) == true)) && - ((this.BeginTime == null && other.BeginTime == null) || (this.BeginTime?.Equals(other.BeginTime) == true)) && - ((this.EndTime == null && other.EndTime == null) || (this.EndTime?.Equals(other.EndTime) == true)) && - ((this.Limit == null && other.Limit == null) || (this.Limit?.Equals(other.Limit) == true)) && - ((this.BatchToken == null && other.BatchToken == null) || (this.BatchToken?.Equals(other.BatchToken) == true)) && - ((this.IncludePartial == null && other.IncludePartial == null) || (this.IncludePartial?.Equals(other.IncludePartial) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 358877715; - hashCode = HashCode.Combine(this.Order, this.BeginTime, this.EndTime, this.Limit, this.BatchToken, this.IncludePartial); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Order = {(this.Order == null ? "null" : this.Order.ToString())}"); - toStringOutput.Add($"this.BeginTime = {(this.BeginTime == null ? "null" : this.BeginTime)}"); - toStringOutput.Add($"this.EndTime = {(this.EndTime == null ? "null" : this.EndTime)}"); - toStringOutput.Add($"this.Limit = {(this.Limit == null ? "null" : this.Limit.ToString())}"); - toStringOutput.Add($"this.BatchToken = {(this.BatchToken == null ? "null" : this.BatchToken)}"); - toStringOutput.Add($"this.IncludePartial = {(this.IncludePartial == null ? "null" : this.IncludePartial.ToString())}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Order(this.Order) - .BeginTime(this.BeginTime) - .EndTime(this.EndTime) - .Limit(this.Limit) - .BatchToken(this.BatchToken) - .IncludePartial(this.IncludePartial); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "begin_time", false }, - { "end_time", false }, - { "limit", false }, - { "batch_token", false }, - { "include_partial", false }, - }; - - private string order; - private string beginTime; - private string endTime; - private int? limit; - private string batchToken; - private bool? includePartial; - - /// - /// Order. - /// - /// order. - /// Builder. - public Builder Order(string order) - { - this.order = order; - return this; - } - - /// - /// BeginTime. - /// - /// beginTime. - /// Builder. - public Builder BeginTime(string beginTime) - { - shouldSerialize["begin_time"] = true; - this.beginTime = beginTime; - return this; - } - - /// - /// EndTime. - /// - /// endTime. - /// Builder. - public Builder EndTime(string endTime) - { - shouldSerialize["end_time"] = true; - this.endTime = endTime; - return this; - } - - /// - /// Limit. - /// - /// limit. - /// Builder. - public Builder Limit(int? limit) - { - shouldSerialize["limit"] = true; - this.limit = limit; - return this; - } - - /// - /// BatchToken. - /// - /// batchToken. - /// Builder. - public Builder BatchToken(string batchToken) - { - shouldSerialize["batch_token"] = true; - this.batchToken = batchToken; - return this; - } - - /// - /// IncludePartial. - /// - /// includePartial. - /// Builder. - public Builder IncludePartial(bool? includePartial) - { - shouldSerialize["include_partial"] = true; - this.includePartial = includePartial; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetBeginTime() - { - this.shouldSerialize["begin_time"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetEndTime() - { - this.shouldSerialize["end_time"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetLimit() - { - this.shouldSerialize["limit"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetBatchToken() - { - this.shouldSerialize["batch_token"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetIncludePartial() - { - this.shouldSerialize["include_partial"] = false; - } - - - /// - /// Builds class object. - /// - /// V1ListPaymentsRequest. - public V1ListPaymentsRequest Build() - { - return new V1ListPaymentsRequest(shouldSerialize, - this.order, - this.beginTime, - this.endTime, - this.limit, - this.batchToken, - this.includePartial); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1ListPaymentsResponse.cs b/Square/Models/V1ListPaymentsResponse.cs deleted file mode 100644 index 5401168d..00000000 --- a/Square/Models/V1ListPaymentsResponse.cs +++ /dev/null @@ -1,119 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1ListPaymentsResponse. - /// - public class V1ListPaymentsResponse - { - /// - /// Initializes a new instance of the class. - /// - /// items. - public V1ListPaymentsResponse( - IList items = null) - { - this.Items = items; - } - - /// - /// Gets or sets Items. - /// - [JsonProperty("items", NullValueHandling = NullValueHandling.Ignore)] - public IList Items { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1ListPaymentsResponse : ({string.Join(", ", toStringOutput)})"; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1ListPaymentsResponse other && ((this.Items == null && other.Items == null) || (this.Items?.Equals(other.Items) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = -722526871; - hashCode = HashCode.Combine(this.Items); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Items = {(this.Items == null ? "null" : $"[{string.Join(", ", this.Items)} ]")}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Items(this.Items); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private IList items; - - /// - /// Items. - /// - /// items. - /// Builder. - public Builder Items(IList items) - { - this.items = items; - return this; - } - - /// - /// Builds class object. - /// - /// V1ListPaymentsResponse. - public V1ListPaymentsResponse Build() - { - return new V1ListPaymentsResponse( - this.items); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1ListRefundsRequest.cs b/Square/Models/V1ListRefundsRequest.cs deleted file mode 100644 index f0b60532..00000000 --- a/Square/Models/V1ListRefundsRequest.cs +++ /dev/null @@ -1,344 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1ListRefundsRequest. - /// - public class V1ListRefundsRequest - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// order. - /// begin_time. - /// end_time. - /// limit. - /// batch_token. - public V1ListRefundsRequest( - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null) - { - shouldSerialize = new Dictionary - { - { "begin_time", false }, - { "end_time", false }, - { "limit", false }, - { "batch_token", false } - }; - - this.Order = order; - if (beginTime != null) - { - shouldSerialize["begin_time"] = true; - this.BeginTime = beginTime; - } - - if (endTime != null) - { - shouldSerialize["end_time"] = true; - this.EndTime = endTime; - } - - if (limit != null) - { - shouldSerialize["limit"] = true; - this.Limit = limit; - } - - if (batchToken != null) - { - shouldSerialize["batch_token"] = true; - this.BatchToken = batchToken; - } - - } - internal V1ListRefundsRequest(Dictionary shouldSerialize, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null) - { - this.shouldSerialize = shouldSerialize; - Order = order; - BeginTime = beginTime; - EndTime = endTime; - Limit = limit; - BatchToken = batchToken; - } - - /// - /// The order (e.g., chronological or alphabetical) in which results from a request are returned. - /// - [JsonProperty("order", NullValueHandling = NullValueHandling.Ignore)] - public string Order { get; } - - /// - /// The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year. - /// - [JsonProperty("begin_time")] - public string BeginTime { get; } - - /// - /// The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. - /// - [JsonProperty("end_time")] - public string EndTime { get; } - - /// - /// The approximate number of refunds to return in a single response. Default: 100. Max: 200. Response may contain more results than the prescribed limit when refunds are made simultaneously to multiple tenders in a payment or when refunds are generated in an exchange to account for the value of returned goods. - /// - [JsonProperty("limit")] - public int? Limit { get; } - - /// - /// A pagination cursor to retrieve the next set of results for your - /// original query to the endpoint. - /// - [JsonProperty("batch_token")] - public string BatchToken { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1ListRefundsRequest : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeBeginTime() - { - return this.shouldSerialize["begin_time"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeEndTime() - { - return this.shouldSerialize["end_time"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeLimit() - { - return this.shouldSerialize["limit"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeBatchToken() - { - return this.shouldSerialize["batch_token"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1ListRefundsRequest other && ((this.Order == null && other.Order == null) || (this.Order?.Equals(other.Order) == true)) && - ((this.BeginTime == null && other.BeginTime == null) || (this.BeginTime?.Equals(other.BeginTime) == true)) && - ((this.EndTime == null && other.EndTime == null) || (this.EndTime?.Equals(other.EndTime) == true)) && - ((this.Limit == null && other.Limit == null) || (this.Limit?.Equals(other.Limit) == true)) && - ((this.BatchToken == null && other.BatchToken == null) || (this.BatchToken?.Equals(other.BatchToken) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 572382122; - hashCode = HashCode.Combine(this.Order, this.BeginTime, this.EndTime, this.Limit, this.BatchToken); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Order = {(this.Order == null ? "null" : this.Order.ToString())}"); - toStringOutput.Add($"this.BeginTime = {(this.BeginTime == null ? "null" : this.BeginTime)}"); - toStringOutput.Add($"this.EndTime = {(this.EndTime == null ? "null" : this.EndTime)}"); - toStringOutput.Add($"this.Limit = {(this.Limit == null ? "null" : this.Limit.ToString())}"); - toStringOutput.Add($"this.BatchToken = {(this.BatchToken == null ? "null" : this.BatchToken)}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Order(this.Order) - .BeginTime(this.BeginTime) - .EndTime(this.EndTime) - .Limit(this.Limit) - .BatchToken(this.BatchToken); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "begin_time", false }, - { "end_time", false }, - { "limit", false }, - { "batch_token", false }, - }; - - private string order; - private string beginTime; - private string endTime; - private int? limit; - private string batchToken; - - /// - /// Order. - /// - /// order. - /// Builder. - public Builder Order(string order) - { - this.order = order; - return this; - } - - /// - /// BeginTime. - /// - /// beginTime. - /// Builder. - public Builder BeginTime(string beginTime) - { - shouldSerialize["begin_time"] = true; - this.beginTime = beginTime; - return this; - } - - /// - /// EndTime. - /// - /// endTime. - /// Builder. - public Builder EndTime(string endTime) - { - shouldSerialize["end_time"] = true; - this.endTime = endTime; - return this; - } - - /// - /// Limit. - /// - /// limit. - /// Builder. - public Builder Limit(int? limit) - { - shouldSerialize["limit"] = true; - this.limit = limit; - return this; - } - - /// - /// BatchToken. - /// - /// batchToken. - /// Builder. - public Builder BatchToken(string batchToken) - { - shouldSerialize["batch_token"] = true; - this.batchToken = batchToken; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetBeginTime() - { - this.shouldSerialize["begin_time"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetEndTime() - { - this.shouldSerialize["end_time"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetLimit() - { - this.shouldSerialize["limit"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetBatchToken() - { - this.shouldSerialize["batch_token"] = false; - } - - - /// - /// Builds class object. - /// - /// V1ListRefundsRequest. - public V1ListRefundsRequest Build() - { - return new V1ListRefundsRequest(shouldSerialize, - this.order, - this.beginTime, - this.endTime, - this.limit, - this.batchToken); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1ListRefundsResponse.cs b/Square/Models/V1ListRefundsResponse.cs deleted file mode 100644 index 4455cfa9..00000000 --- a/Square/Models/V1ListRefundsResponse.cs +++ /dev/null @@ -1,119 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1ListRefundsResponse. - /// - public class V1ListRefundsResponse - { - /// - /// Initializes a new instance of the class. - /// - /// items. - public V1ListRefundsResponse( - IList items = null) - { - this.Items = items; - } - - /// - /// Gets or sets Items. - /// - [JsonProperty("items", NullValueHandling = NullValueHandling.Ignore)] - public IList Items { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1ListRefundsResponse : ({string.Join(", ", toStringOutput)})"; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1ListRefundsResponse other && ((this.Items == null && other.Items == null) || (this.Items?.Equals(other.Items) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 475312657; - hashCode = HashCode.Combine(this.Items); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Items = {(this.Items == null ? "null" : $"[{string.Join(", ", this.Items)} ]")}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Items(this.Items); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private IList items; - - /// - /// Items. - /// - /// items. - /// Builder. - public Builder Items(IList items) - { - this.items = items; - return this; - } - - /// - /// Builds class object. - /// - /// V1ListRefundsResponse. - public V1ListRefundsResponse Build() - { - return new V1ListRefundsResponse( - this.items); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1ListSettlementsRequest.cs b/Square/Models/V1ListSettlementsRequest.cs deleted file mode 100644 index 30c42c45..00000000 --- a/Square/Models/V1ListSettlementsRequest.cs +++ /dev/null @@ -1,371 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1ListSettlementsRequest. - /// - public class V1ListSettlementsRequest - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// order. - /// begin_time. - /// end_time. - /// limit. - /// status. - /// batch_token. - public V1ListSettlementsRequest( - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string status = null, - string batchToken = null) - { - shouldSerialize = new Dictionary - { - { "begin_time", false }, - { "end_time", false }, - { "limit", false }, - { "batch_token", false } - }; - - this.Order = order; - if (beginTime != null) - { - shouldSerialize["begin_time"] = true; - this.BeginTime = beginTime; - } - - if (endTime != null) - { - shouldSerialize["end_time"] = true; - this.EndTime = endTime; - } - - if (limit != null) - { - shouldSerialize["limit"] = true; - this.Limit = limit; - } - - this.Status = status; - if (batchToken != null) - { - shouldSerialize["batch_token"] = true; - this.BatchToken = batchToken; - } - - } - internal V1ListSettlementsRequest(Dictionary shouldSerialize, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string status = null, - string batchToken = null) - { - this.shouldSerialize = shouldSerialize; - Order = order; - BeginTime = beginTime; - EndTime = endTime; - Limit = limit; - Status = status; - BatchToken = batchToken; - } - - /// - /// The order (e.g., chronological or alphabetical) in which results from a request are returned. - /// - [JsonProperty("order", NullValueHandling = NullValueHandling.Ignore)] - public string Order { get; } - - /// - /// The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year. - /// - [JsonProperty("begin_time")] - public string BeginTime { get; } - - /// - /// The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. - /// - [JsonProperty("end_time")] - public string EndTime { get; } - - /// - /// The maximum number of settlements to return in a single response. This value cannot exceed 200. - /// - [JsonProperty("limit")] - public int? Limit { get; } - - /// - /// Gets or sets Status. - /// - [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] - public string Status { get; } - - /// - /// A pagination cursor to retrieve the next set of results for your - /// original query to the endpoint. - /// - [JsonProperty("batch_token")] - public string BatchToken { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1ListSettlementsRequest : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeBeginTime() - { - return this.shouldSerialize["begin_time"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeEndTime() - { - return this.shouldSerialize["end_time"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeLimit() - { - return this.shouldSerialize["limit"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeBatchToken() - { - return this.shouldSerialize["batch_token"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1ListSettlementsRequest other && ((this.Order == null && other.Order == null) || (this.Order?.Equals(other.Order) == true)) && - ((this.BeginTime == null && other.BeginTime == null) || (this.BeginTime?.Equals(other.BeginTime) == true)) && - ((this.EndTime == null && other.EndTime == null) || (this.EndTime?.Equals(other.EndTime) == true)) && - ((this.Limit == null && other.Limit == null) || (this.Limit?.Equals(other.Limit) == true)) && - ((this.Status == null && other.Status == null) || (this.Status?.Equals(other.Status) == true)) && - ((this.BatchToken == null && other.BatchToken == null) || (this.BatchToken?.Equals(other.BatchToken) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 331726736; - hashCode = HashCode.Combine(this.Order, this.BeginTime, this.EndTime, this.Limit, this.Status, this.BatchToken); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Order = {(this.Order == null ? "null" : this.Order.ToString())}"); - toStringOutput.Add($"this.BeginTime = {(this.BeginTime == null ? "null" : this.BeginTime)}"); - toStringOutput.Add($"this.EndTime = {(this.EndTime == null ? "null" : this.EndTime)}"); - toStringOutput.Add($"this.Limit = {(this.Limit == null ? "null" : this.Limit.ToString())}"); - toStringOutput.Add($"this.Status = {(this.Status == null ? "null" : this.Status.ToString())}"); - toStringOutput.Add($"this.BatchToken = {(this.BatchToken == null ? "null" : this.BatchToken)}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Order(this.Order) - .BeginTime(this.BeginTime) - .EndTime(this.EndTime) - .Limit(this.Limit) - .Status(this.Status) - .BatchToken(this.BatchToken); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "begin_time", false }, - { "end_time", false }, - { "limit", false }, - { "batch_token", false }, - }; - - private string order; - private string beginTime; - private string endTime; - private int? limit; - private string status; - private string batchToken; - - /// - /// Order. - /// - /// order. - /// Builder. - public Builder Order(string order) - { - this.order = order; - return this; - } - - /// - /// BeginTime. - /// - /// beginTime. - /// Builder. - public Builder BeginTime(string beginTime) - { - shouldSerialize["begin_time"] = true; - this.beginTime = beginTime; - return this; - } - - /// - /// EndTime. - /// - /// endTime. - /// Builder. - public Builder EndTime(string endTime) - { - shouldSerialize["end_time"] = true; - this.endTime = endTime; - return this; - } - - /// - /// Limit. - /// - /// limit. - /// Builder. - public Builder Limit(int? limit) - { - shouldSerialize["limit"] = true; - this.limit = limit; - return this; - } - - /// - /// Status. - /// - /// status. - /// Builder. - public Builder Status(string status) - { - this.status = status; - return this; - } - - /// - /// BatchToken. - /// - /// batchToken. - /// Builder. - public Builder BatchToken(string batchToken) - { - shouldSerialize["batch_token"] = true; - this.batchToken = batchToken; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetBeginTime() - { - this.shouldSerialize["begin_time"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetEndTime() - { - this.shouldSerialize["end_time"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetLimit() - { - this.shouldSerialize["limit"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetBatchToken() - { - this.shouldSerialize["batch_token"] = false; - } - - - /// - /// Builds class object. - /// - /// V1ListSettlementsRequest. - public V1ListSettlementsRequest Build() - { - return new V1ListSettlementsRequest(shouldSerialize, - this.order, - this.beginTime, - this.endTime, - this.limit, - this.status, - this.batchToken); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1ListSettlementsResponse.cs b/Square/Models/V1ListSettlementsResponse.cs deleted file mode 100644 index ff22116a..00000000 --- a/Square/Models/V1ListSettlementsResponse.cs +++ /dev/null @@ -1,119 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1ListSettlementsResponse. - /// - public class V1ListSettlementsResponse - { - /// - /// Initializes a new instance of the class. - /// - /// items. - public V1ListSettlementsResponse( - IList items = null) - { - this.Items = items; - } - - /// - /// Gets or sets Items. - /// - [JsonProperty("items", NullValueHandling = NullValueHandling.Ignore)] - public IList Items { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1ListSettlementsResponse : ({string.Join(", ", toStringOutput)})"; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1ListSettlementsResponse other && ((this.Items == null && other.Items == null) || (this.Items?.Equals(other.Items) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 1251551169; - hashCode = HashCode.Combine(this.Items); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Items = {(this.Items == null ? "null" : $"[{string.Join(", ", this.Items)} ]")}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Items(this.Items); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private IList items; - - /// - /// Items. - /// - /// items. - /// Builder. - public Builder Items(IList items) - { - this.items = items; - return this; - } - - /// - /// Builds class object. - /// - /// V1ListSettlementsResponse. - public V1ListSettlementsResponse Build() - { - return new V1ListSettlementsResponse( - this.items); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1Payment.cs b/Square/Models/V1Payment.cs deleted file mode 100644 index 3e1477c6..00000000 --- a/Square/Models/V1Payment.cs +++ /dev/null @@ -1,1143 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Http.Client; - using Square.Utilities; - - /// - /// V1Payment. - /// - public class V1Payment - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// id. - /// merchant_id. - /// created_at. - /// creator_id. - /// device. - /// payment_url. - /// receipt_url. - /// inclusive_tax_money. - /// additive_tax_money. - /// tax_money. - /// tip_money. - /// discount_money. - /// total_collected_money. - /// processing_fee_money. - /// net_total_money. - /// refunded_money. - /// swedish_rounding_money. - /// gross_sales_money. - /// net_sales_money. - /// inclusive_tax. - /// additive_tax. - /// tender. - /// refunds. - /// itemizations. - /// surcharge_money. - /// surcharges. - /// is_partial. - public V1Payment( - string id = null, - string merchantId = null, - string createdAt = null, - string creatorId = null, - Models.V1Device device = null, - string paymentUrl = null, - string receiptUrl = null, - Models.V1Money inclusiveTaxMoney = null, - Models.V1Money additiveTaxMoney = null, - Models.V1Money taxMoney = null, - Models.V1Money tipMoney = null, - Models.V1Money discountMoney = null, - Models.V1Money totalCollectedMoney = null, - Models.V1Money processingFeeMoney = null, - Models.V1Money netTotalMoney = null, - Models.V1Money refundedMoney = null, - Models.V1Money swedishRoundingMoney = null, - Models.V1Money grossSalesMoney = null, - Models.V1Money netSalesMoney = null, - IList inclusiveTax = null, - IList additiveTax = null, - IList tender = null, - IList refunds = null, - IList itemizations = null, - Models.V1Money surchargeMoney = null, - IList surcharges = null, - bool? isPartial = null) - { - shouldSerialize = new Dictionary - { - { "merchant_id", false }, - { "creator_id", false }, - { "payment_url", false }, - { "receipt_url", false }, - { "inclusive_tax", false }, - { "additive_tax", false }, - { "tender", false }, - { "refunds", false }, - { "itemizations", false }, - { "surcharges", false }, - { "is_partial", false } - }; - - this.Id = id; - if (merchantId != null) - { - shouldSerialize["merchant_id"] = true; - this.MerchantId = merchantId; - } - - this.CreatedAt = createdAt; - if (creatorId != null) - { - shouldSerialize["creator_id"] = true; - this.CreatorId = creatorId; - } - - this.Device = device; - if (paymentUrl != null) - { - shouldSerialize["payment_url"] = true; - this.PaymentUrl = paymentUrl; - } - - if (receiptUrl != null) - { - shouldSerialize["receipt_url"] = true; - this.ReceiptUrl = receiptUrl; - } - - this.InclusiveTaxMoney = inclusiveTaxMoney; - this.AdditiveTaxMoney = additiveTaxMoney; - this.TaxMoney = taxMoney; - this.TipMoney = tipMoney; - this.DiscountMoney = discountMoney; - this.TotalCollectedMoney = totalCollectedMoney; - this.ProcessingFeeMoney = processingFeeMoney; - this.NetTotalMoney = netTotalMoney; - this.RefundedMoney = refundedMoney; - this.SwedishRoundingMoney = swedishRoundingMoney; - this.GrossSalesMoney = grossSalesMoney; - this.NetSalesMoney = netSalesMoney; - if (inclusiveTax != null) - { - shouldSerialize["inclusive_tax"] = true; - this.InclusiveTax = inclusiveTax; - } - - if (additiveTax != null) - { - shouldSerialize["additive_tax"] = true; - this.AdditiveTax = additiveTax; - } - - if (tender != null) - { - shouldSerialize["tender"] = true; - this.Tender = tender; - } - - if (refunds != null) - { - shouldSerialize["refunds"] = true; - this.Refunds = refunds; - } - - if (itemizations != null) - { - shouldSerialize["itemizations"] = true; - this.Itemizations = itemizations; - } - - this.SurchargeMoney = surchargeMoney; - if (surcharges != null) - { - shouldSerialize["surcharges"] = true; - this.Surcharges = surcharges; - } - - if (isPartial != null) - { - shouldSerialize["is_partial"] = true; - this.IsPartial = isPartial; - } - - } - internal V1Payment(Dictionary shouldSerialize, - string id = null, - string merchantId = null, - string createdAt = null, - string creatorId = null, - Models.V1Device device = null, - string paymentUrl = null, - string receiptUrl = null, - Models.V1Money inclusiveTaxMoney = null, - Models.V1Money additiveTaxMoney = null, - Models.V1Money taxMoney = null, - Models.V1Money tipMoney = null, - Models.V1Money discountMoney = null, - Models.V1Money totalCollectedMoney = null, - Models.V1Money processingFeeMoney = null, - Models.V1Money netTotalMoney = null, - Models.V1Money refundedMoney = null, - Models.V1Money swedishRoundingMoney = null, - Models.V1Money grossSalesMoney = null, - Models.V1Money netSalesMoney = null, - IList inclusiveTax = null, - IList additiveTax = null, - IList tender = null, - IList refunds = null, - IList itemizations = null, - Models.V1Money surchargeMoney = null, - IList surcharges = null, - bool? isPartial = null) - { - this.shouldSerialize = shouldSerialize; - Id = id; - MerchantId = merchantId; - CreatedAt = createdAt; - CreatorId = creatorId; - Device = device; - PaymentUrl = paymentUrl; - ReceiptUrl = receiptUrl; - InclusiveTaxMoney = inclusiveTaxMoney; - AdditiveTaxMoney = additiveTaxMoney; - TaxMoney = taxMoney; - TipMoney = tipMoney; - DiscountMoney = discountMoney; - TotalCollectedMoney = totalCollectedMoney; - ProcessingFeeMoney = processingFeeMoney; - NetTotalMoney = netTotalMoney; - RefundedMoney = refundedMoney; - SwedishRoundingMoney = swedishRoundingMoney; - GrossSalesMoney = grossSalesMoney; - NetSalesMoney = netSalesMoney; - InclusiveTax = inclusiveTax; - AdditiveTax = additiveTax; - Tender = tender; - Refunds = refunds; - Itemizations = itemizations; - SurchargeMoney = surchargeMoney; - Surcharges = surcharges; - IsPartial = isPartial; - } - - /// - /// Gets http context. - /// - [JsonIgnore] - public HttpContext Context { get; internal set; } - - /// - /// The payment's unique identifier. - /// - [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] - public string Id { get; } - - /// - /// The unique identifier of the merchant that took the payment. - /// - [JsonProperty("merchant_id")] - public string MerchantId { get; } - - /// - /// The time when the payment was created, in ISO 8601 format. Reflects the time of the first payment if the object represents an incomplete partial payment, and the time of the last or complete payment otherwise. - /// - [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] - public string CreatedAt { get; } - - /// - /// The unique identifier of the Square account that took the payment. - /// - [JsonProperty("creator_id")] - public string CreatorId { get; } - - /// - /// Gets or sets Device. - /// - [JsonProperty("device", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Device Device { get; } - - /// - /// The URL of the payment's detail page in the merchant dashboard. The merchant must be signed in to the merchant dashboard to view this page. - /// - [JsonProperty("payment_url")] - public string PaymentUrl { get; } - - /// - /// The URL of the receipt for the payment. Note that for split tender - /// payments, this URL corresponds to the receipt for the first tender - /// listed in the payment's tender field. Each Tender object has its own - /// receipt_url field you can use to get the other receipts associated with - /// a split tender payment. - /// - [JsonProperty("receipt_url")] - public string ReceiptUrl { get; } - - /// - /// Gets or sets InclusiveTaxMoney. - /// - [JsonProperty("inclusive_tax_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money InclusiveTaxMoney { get; } - - /// - /// Gets or sets AdditiveTaxMoney. - /// - [JsonProperty("additive_tax_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money AdditiveTaxMoney { get; } - - /// - /// Gets or sets TaxMoney. - /// - [JsonProperty("tax_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money TaxMoney { get; } - - /// - /// Gets or sets TipMoney. - /// - [JsonProperty("tip_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money TipMoney { get; } - - /// - /// Gets or sets DiscountMoney. - /// - [JsonProperty("discount_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money DiscountMoney { get; } - - /// - /// Gets or sets TotalCollectedMoney. - /// - [JsonProperty("total_collected_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money TotalCollectedMoney { get; } - - /// - /// Gets or sets ProcessingFeeMoney. - /// - [JsonProperty("processing_fee_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money ProcessingFeeMoney { get; } - - /// - /// Gets or sets NetTotalMoney. - /// - [JsonProperty("net_total_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money NetTotalMoney { get; } - - /// - /// Gets or sets RefundedMoney. - /// - [JsonProperty("refunded_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money RefundedMoney { get; } - - /// - /// Gets or sets SwedishRoundingMoney. - /// - [JsonProperty("swedish_rounding_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money SwedishRoundingMoney { get; } - - /// - /// Gets or sets GrossSalesMoney. - /// - [JsonProperty("gross_sales_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money GrossSalesMoney { get; } - - /// - /// Gets or sets NetSalesMoney. - /// - [JsonProperty("net_sales_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money NetSalesMoney { get; } - - /// - /// All of the inclusive taxes associated with the payment. - /// - [JsonProperty("inclusive_tax")] - public IList InclusiveTax { get; } - - /// - /// All of the additive taxes associated with the payment. - /// - [JsonProperty("additive_tax")] - public IList AdditiveTax { get; } - - /// - /// All of the tenders associated with the payment. - /// - [JsonProperty("tender")] - public IList Tender { get; } - - /// - /// All of the refunds applied to the payment. Note that the value of all refunds on a payment can exceed the value of all tenders if a merchant chooses to refund money to a tender after previously accepting returned goods as part of an exchange. - /// - [JsonProperty("refunds")] - public IList Refunds { get; } - - /// - /// The items purchased in the payment. - /// - [JsonProperty("itemizations")] - public IList Itemizations { get; } - - /// - /// Gets or sets SurchargeMoney. - /// - [JsonProperty("surcharge_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money SurchargeMoney { get; } - - /// - /// A list of all surcharges associated with the payment. - /// - [JsonProperty("surcharges")] - public IList Surcharges { get; } - - /// - /// Indicates whether or not the payment is only partially paid for. - /// If true, this payment will have the tenders collected so far, but the - /// itemizations will be empty until the payment is completed. - /// - [JsonProperty("is_partial")] - public bool? IsPartial { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1Payment : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeMerchantId() - { - return this.shouldSerialize["merchant_id"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeCreatorId() - { - return this.shouldSerialize["creator_id"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializePaymentUrl() - { - return this.shouldSerialize["payment_url"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeReceiptUrl() - { - return this.shouldSerialize["receipt_url"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeInclusiveTax() - { - return this.shouldSerialize["inclusive_tax"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeAdditiveTax() - { - return this.shouldSerialize["additive_tax"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeTender() - { - return this.shouldSerialize["tender"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeRefunds() - { - return this.shouldSerialize["refunds"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeItemizations() - { - return this.shouldSerialize["itemizations"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeSurcharges() - { - return this.shouldSerialize["surcharges"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeIsPartial() - { - return this.shouldSerialize["is_partial"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1Payment other && ((this.Context == null && other.Context == null) || (this.Context?.Equals(other.Context) == true)) && - ((this.Id == null && other.Id == null) || (this.Id?.Equals(other.Id) == true)) && - ((this.MerchantId == null && other.MerchantId == null) || (this.MerchantId?.Equals(other.MerchantId) == true)) && - ((this.CreatedAt == null && other.CreatedAt == null) || (this.CreatedAt?.Equals(other.CreatedAt) == true)) && - ((this.CreatorId == null && other.CreatorId == null) || (this.CreatorId?.Equals(other.CreatorId) == true)) && - ((this.Device == null && other.Device == null) || (this.Device?.Equals(other.Device) == true)) && - ((this.PaymentUrl == null && other.PaymentUrl == null) || (this.PaymentUrl?.Equals(other.PaymentUrl) == true)) && - ((this.ReceiptUrl == null && other.ReceiptUrl == null) || (this.ReceiptUrl?.Equals(other.ReceiptUrl) == true)) && - ((this.InclusiveTaxMoney == null && other.InclusiveTaxMoney == null) || (this.InclusiveTaxMoney?.Equals(other.InclusiveTaxMoney) == true)) && - ((this.AdditiveTaxMoney == null && other.AdditiveTaxMoney == null) || (this.AdditiveTaxMoney?.Equals(other.AdditiveTaxMoney) == true)) && - ((this.TaxMoney == null && other.TaxMoney == null) || (this.TaxMoney?.Equals(other.TaxMoney) == true)) && - ((this.TipMoney == null && other.TipMoney == null) || (this.TipMoney?.Equals(other.TipMoney) == true)) && - ((this.DiscountMoney == null && other.DiscountMoney == null) || (this.DiscountMoney?.Equals(other.DiscountMoney) == true)) && - ((this.TotalCollectedMoney == null && other.TotalCollectedMoney == null) || (this.TotalCollectedMoney?.Equals(other.TotalCollectedMoney) == true)) && - ((this.ProcessingFeeMoney == null && other.ProcessingFeeMoney == null) || (this.ProcessingFeeMoney?.Equals(other.ProcessingFeeMoney) == true)) && - ((this.NetTotalMoney == null && other.NetTotalMoney == null) || (this.NetTotalMoney?.Equals(other.NetTotalMoney) == true)) && - ((this.RefundedMoney == null && other.RefundedMoney == null) || (this.RefundedMoney?.Equals(other.RefundedMoney) == true)) && - ((this.SwedishRoundingMoney == null && other.SwedishRoundingMoney == null) || (this.SwedishRoundingMoney?.Equals(other.SwedishRoundingMoney) == true)) && - ((this.GrossSalesMoney == null && other.GrossSalesMoney == null) || (this.GrossSalesMoney?.Equals(other.GrossSalesMoney) == true)) && - ((this.NetSalesMoney == null && other.NetSalesMoney == null) || (this.NetSalesMoney?.Equals(other.NetSalesMoney) == true)) && - ((this.InclusiveTax == null && other.InclusiveTax == null) || (this.InclusiveTax?.Equals(other.InclusiveTax) == true)) && - ((this.AdditiveTax == null && other.AdditiveTax == null) || (this.AdditiveTax?.Equals(other.AdditiveTax) == true)) && - ((this.Tender == null && other.Tender == null) || (this.Tender?.Equals(other.Tender) == true)) && - ((this.Refunds == null && other.Refunds == null) || (this.Refunds?.Equals(other.Refunds) == true)) && - ((this.Itemizations == null && other.Itemizations == null) || (this.Itemizations?.Equals(other.Itemizations) == true)) && - ((this.SurchargeMoney == null && other.SurchargeMoney == null) || (this.SurchargeMoney?.Equals(other.SurchargeMoney) == true)) && - ((this.Surcharges == null && other.Surcharges == null) || (this.Surcharges?.Equals(other.Surcharges) == true)) && - ((this.IsPartial == null && other.IsPartial == null) || (this.IsPartial?.Equals(other.IsPartial) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 1409432714; - - if (this.Context != null) - { - hashCode += this.Context.GetHashCode(); - } - hashCode = HashCode.Combine(this.Id, this.MerchantId, this.CreatedAt, this.CreatorId, this.Device, this.PaymentUrl, this.ReceiptUrl); - - hashCode = HashCode.Combine(hashCode, this.InclusiveTaxMoney, this.AdditiveTaxMoney, this.TaxMoney, this.TipMoney, this.DiscountMoney, this.TotalCollectedMoney, this.ProcessingFeeMoney); - - hashCode = HashCode.Combine(hashCode, this.NetTotalMoney, this.RefundedMoney, this.SwedishRoundingMoney, this.GrossSalesMoney, this.NetSalesMoney, this.InclusiveTax, this.AdditiveTax); - - hashCode = HashCode.Combine(hashCode, this.Tender, this.Refunds, this.Itemizations, this.SurchargeMoney, this.Surcharges, this.IsPartial); - - return hashCode; - } - internal V1Payment ContextSetter(HttpContext context) - { - this.Context = context; - return this; - } - - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Id = {(this.Id == null ? "null" : this.Id)}"); - toStringOutput.Add($"this.MerchantId = {(this.MerchantId == null ? "null" : this.MerchantId)}"); - toStringOutput.Add($"this.CreatedAt = {(this.CreatedAt == null ? "null" : this.CreatedAt)}"); - toStringOutput.Add($"this.CreatorId = {(this.CreatorId == null ? "null" : this.CreatorId)}"); - toStringOutput.Add($"this.Device = {(this.Device == null ? "null" : this.Device.ToString())}"); - toStringOutput.Add($"this.PaymentUrl = {(this.PaymentUrl == null ? "null" : this.PaymentUrl)}"); - toStringOutput.Add($"this.ReceiptUrl = {(this.ReceiptUrl == null ? "null" : this.ReceiptUrl)}"); - toStringOutput.Add($"this.InclusiveTaxMoney = {(this.InclusiveTaxMoney == null ? "null" : this.InclusiveTaxMoney.ToString())}"); - toStringOutput.Add($"this.AdditiveTaxMoney = {(this.AdditiveTaxMoney == null ? "null" : this.AdditiveTaxMoney.ToString())}"); - toStringOutput.Add($"this.TaxMoney = {(this.TaxMoney == null ? "null" : this.TaxMoney.ToString())}"); - toStringOutput.Add($"this.TipMoney = {(this.TipMoney == null ? "null" : this.TipMoney.ToString())}"); - toStringOutput.Add($"this.DiscountMoney = {(this.DiscountMoney == null ? "null" : this.DiscountMoney.ToString())}"); - toStringOutput.Add($"this.TotalCollectedMoney = {(this.TotalCollectedMoney == null ? "null" : this.TotalCollectedMoney.ToString())}"); - toStringOutput.Add($"this.ProcessingFeeMoney = {(this.ProcessingFeeMoney == null ? "null" : this.ProcessingFeeMoney.ToString())}"); - toStringOutput.Add($"this.NetTotalMoney = {(this.NetTotalMoney == null ? "null" : this.NetTotalMoney.ToString())}"); - toStringOutput.Add($"this.RefundedMoney = {(this.RefundedMoney == null ? "null" : this.RefundedMoney.ToString())}"); - toStringOutput.Add($"this.SwedishRoundingMoney = {(this.SwedishRoundingMoney == null ? "null" : this.SwedishRoundingMoney.ToString())}"); - toStringOutput.Add($"this.GrossSalesMoney = {(this.GrossSalesMoney == null ? "null" : this.GrossSalesMoney.ToString())}"); - toStringOutput.Add($"this.NetSalesMoney = {(this.NetSalesMoney == null ? "null" : this.NetSalesMoney.ToString())}"); - toStringOutput.Add($"this.InclusiveTax = {(this.InclusiveTax == null ? "null" : $"[{string.Join(", ", this.InclusiveTax)} ]")}"); - toStringOutput.Add($"this.AdditiveTax = {(this.AdditiveTax == null ? "null" : $"[{string.Join(", ", this.AdditiveTax)} ]")}"); - toStringOutput.Add($"this.Tender = {(this.Tender == null ? "null" : $"[{string.Join(", ", this.Tender)} ]")}"); - toStringOutput.Add($"this.Refunds = {(this.Refunds == null ? "null" : $"[{string.Join(", ", this.Refunds)} ]")}"); - toStringOutput.Add($"this.Itemizations = {(this.Itemizations == null ? "null" : $"[{string.Join(", ", this.Itemizations)} ]")}"); - toStringOutput.Add($"this.SurchargeMoney = {(this.SurchargeMoney == null ? "null" : this.SurchargeMoney.ToString())}"); - toStringOutput.Add($"this.Surcharges = {(this.Surcharges == null ? "null" : $"[{string.Join(", ", this.Surcharges)} ]")}"); - toStringOutput.Add($"this.IsPartial = {(this.IsPartial == null ? "null" : this.IsPartial.ToString())}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Id(this.Id) - .MerchantId(this.MerchantId) - .CreatedAt(this.CreatedAt) - .CreatorId(this.CreatorId) - .Device(this.Device) - .PaymentUrl(this.PaymentUrl) - .ReceiptUrl(this.ReceiptUrl) - .InclusiveTaxMoney(this.InclusiveTaxMoney) - .AdditiveTaxMoney(this.AdditiveTaxMoney) - .TaxMoney(this.TaxMoney) - .TipMoney(this.TipMoney) - .DiscountMoney(this.DiscountMoney) - .TotalCollectedMoney(this.TotalCollectedMoney) - .ProcessingFeeMoney(this.ProcessingFeeMoney) - .NetTotalMoney(this.NetTotalMoney) - .RefundedMoney(this.RefundedMoney) - .SwedishRoundingMoney(this.SwedishRoundingMoney) - .GrossSalesMoney(this.GrossSalesMoney) - .NetSalesMoney(this.NetSalesMoney) - .InclusiveTax(this.InclusiveTax) - .AdditiveTax(this.AdditiveTax) - .Tender(this.Tender) - .Refunds(this.Refunds) - .Itemizations(this.Itemizations) - .SurchargeMoney(this.SurchargeMoney) - .Surcharges(this.Surcharges) - .IsPartial(this.IsPartial); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "merchant_id", false }, - { "creator_id", false }, - { "payment_url", false }, - { "receipt_url", false }, - { "inclusive_tax", false }, - { "additive_tax", false }, - { "tender", false }, - { "refunds", false }, - { "itemizations", false }, - { "surcharges", false }, - { "is_partial", false }, - }; - - private string id; - private string merchantId; - private string createdAt; - private string creatorId; - private Models.V1Device device; - private string paymentUrl; - private string receiptUrl; - private Models.V1Money inclusiveTaxMoney; - private Models.V1Money additiveTaxMoney; - private Models.V1Money taxMoney; - private Models.V1Money tipMoney; - private Models.V1Money discountMoney; - private Models.V1Money totalCollectedMoney; - private Models.V1Money processingFeeMoney; - private Models.V1Money netTotalMoney; - private Models.V1Money refundedMoney; - private Models.V1Money swedishRoundingMoney; - private Models.V1Money grossSalesMoney; - private Models.V1Money netSalesMoney; - private IList inclusiveTax; - private IList additiveTax; - private IList tender; - private IList refunds; - private IList itemizations; - private Models.V1Money surchargeMoney; - private IList surcharges; - private bool? isPartial; - - /// - /// Id. - /// - /// id. - /// Builder. - public Builder Id(string id) - { - this.id = id; - return this; - } - - /// - /// MerchantId. - /// - /// merchantId. - /// Builder. - public Builder MerchantId(string merchantId) - { - shouldSerialize["merchant_id"] = true; - this.merchantId = merchantId; - return this; - } - - /// - /// CreatedAt. - /// - /// createdAt. - /// Builder. - public Builder CreatedAt(string createdAt) - { - this.createdAt = createdAt; - return this; - } - - /// - /// CreatorId. - /// - /// creatorId. - /// Builder. - public Builder CreatorId(string creatorId) - { - shouldSerialize["creator_id"] = true; - this.creatorId = creatorId; - return this; - } - - /// - /// Device. - /// - /// device. - /// Builder. - public Builder Device(Models.V1Device device) - { - this.device = device; - return this; - } - - /// - /// PaymentUrl. - /// - /// paymentUrl. - /// Builder. - public Builder PaymentUrl(string paymentUrl) - { - shouldSerialize["payment_url"] = true; - this.paymentUrl = paymentUrl; - return this; - } - - /// - /// ReceiptUrl. - /// - /// receiptUrl. - /// Builder. - public Builder ReceiptUrl(string receiptUrl) - { - shouldSerialize["receipt_url"] = true; - this.receiptUrl = receiptUrl; - return this; - } - - /// - /// InclusiveTaxMoney. - /// - /// inclusiveTaxMoney. - /// Builder. - public Builder InclusiveTaxMoney(Models.V1Money inclusiveTaxMoney) - { - this.inclusiveTaxMoney = inclusiveTaxMoney; - return this; - } - - /// - /// AdditiveTaxMoney. - /// - /// additiveTaxMoney. - /// Builder. - public Builder AdditiveTaxMoney(Models.V1Money additiveTaxMoney) - { - this.additiveTaxMoney = additiveTaxMoney; - return this; - } - - /// - /// TaxMoney. - /// - /// taxMoney. - /// Builder. - public Builder TaxMoney(Models.V1Money taxMoney) - { - this.taxMoney = taxMoney; - return this; - } - - /// - /// TipMoney. - /// - /// tipMoney. - /// Builder. - public Builder TipMoney(Models.V1Money tipMoney) - { - this.tipMoney = tipMoney; - return this; - } - - /// - /// DiscountMoney. - /// - /// discountMoney. - /// Builder. - public Builder DiscountMoney(Models.V1Money discountMoney) - { - this.discountMoney = discountMoney; - return this; - } - - /// - /// TotalCollectedMoney. - /// - /// totalCollectedMoney. - /// Builder. - public Builder TotalCollectedMoney(Models.V1Money totalCollectedMoney) - { - this.totalCollectedMoney = totalCollectedMoney; - return this; - } - - /// - /// ProcessingFeeMoney. - /// - /// processingFeeMoney. - /// Builder. - public Builder ProcessingFeeMoney(Models.V1Money processingFeeMoney) - { - this.processingFeeMoney = processingFeeMoney; - return this; - } - - /// - /// NetTotalMoney. - /// - /// netTotalMoney. - /// Builder. - public Builder NetTotalMoney(Models.V1Money netTotalMoney) - { - this.netTotalMoney = netTotalMoney; - return this; - } - - /// - /// RefundedMoney. - /// - /// refundedMoney. - /// Builder. - public Builder RefundedMoney(Models.V1Money refundedMoney) - { - this.refundedMoney = refundedMoney; - return this; - } - - /// - /// SwedishRoundingMoney. - /// - /// swedishRoundingMoney. - /// Builder. - public Builder SwedishRoundingMoney(Models.V1Money swedishRoundingMoney) - { - this.swedishRoundingMoney = swedishRoundingMoney; - return this; - } - - /// - /// GrossSalesMoney. - /// - /// grossSalesMoney. - /// Builder. - public Builder GrossSalesMoney(Models.V1Money grossSalesMoney) - { - this.grossSalesMoney = grossSalesMoney; - return this; - } - - /// - /// NetSalesMoney. - /// - /// netSalesMoney. - /// Builder. - public Builder NetSalesMoney(Models.V1Money netSalesMoney) - { - this.netSalesMoney = netSalesMoney; - return this; - } - - /// - /// InclusiveTax. - /// - /// inclusiveTax. - /// Builder. - public Builder InclusiveTax(IList inclusiveTax) - { - shouldSerialize["inclusive_tax"] = true; - this.inclusiveTax = inclusiveTax; - return this; - } - - /// - /// AdditiveTax. - /// - /// additiveTax. - /// Builder. - public Builder AdditiveTax(IList additiveTax) - { - shouldSerialize["additive_tax"] = true; - this.additiveTax = additiveTax; - return this; - } - - /// - /// Tender. - /// - /// tender. - /// Builder. - public Builder Tender(IList tender) - { - shouldSerialize["tender"] = true; - this.tender = tender; - return this; - } - - /// - /// Refunds. - /// - /// refunds. - /// Builder. - public Builder Refunds(IList refunds) - { - shouldSerialize["refunds"] = true; - this.refunds = refunds; - return this; - } - - /// - /// Itemizations. - /// - /// itemizations. - /// Builder. - public Builder Itemizations(IList itemizations) - { - shouldSerialize["itemizations"] = true; - this.itemizations = itemizations; - return this; - } - - /// - /// SurchargeMoney. - /// - /// surchargeMoney. - /// Builder. - public Builder SurchargeMoney(Models.V1Money surchargeMoney) - { - this.surchargeMoney = surchargeMoney; - return this; - } - - /// - /// Surcharges. - /// - /// surcharges. - /// Builder. - public Builder Surcharges(IList surcharges) - { - shouldSerialize["surcharges"] = true; - this.surcharges = surcharges; - return this; - } - - /// - /// IsPartial. - /// - /// isPartial. - /// Builder. - public Builder IsPartial(bool? isPartial) - { - shouldSerialize["is_partial"] = true; - this.isPartial = isPartial; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetMerchantId() - { - this.shouldSerialize["merchant_id"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetCreatorId() - { - this.shouldSerialize["creator_id"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetPaymentUrl() - { - this.shouldSerialize["payment_url"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetReceiptUrl() - { - this.shouldSerialize["receipt_url"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetInclusiveTax() - { - this.shouldSerialize["inclusive_tax"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetAdditiveTax() - { - this.shouldSerialize["additive_tax"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetTender() - { - this.shouldSerialize["tender"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetRefunds() - { - this.shouldSerialize["refunds"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetItemizations() - { - this.shouldSerialize["itemizations"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetSurcharges() - { - this.shouldSerialize["surcharges"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetIsPartial() - { - this.shouldSerialize["is_partial"] = false; - } - - - /// - /// Builds class object. - /// - /// V1Payment. - public V1Payment Build() - { - return new V1Payment(shouldSerialize, - this.id, - this.merchantId, - this.createdAt, - this.creatorId, - this.device, - this.paymentUrl, - this.receiptUrl, - this.inclusiveTaxMoney, - this.additiveTaxMoney, - this.taxMoney, - this.tipMoney, - this.discountMoney, - this.totalCollectedMoney, - this.processingFeeMoney, - this.netTotalMoney, - this.refundedMoney, - this.swedishRoundingMoney, - this.grossSalesMoney, - this.netSalesMoney, - this.inclusiveTax, - this.additiveTax, - this.tender, - this.refunds, - this.itemizations, - this.surchargeMoney, - this.surcharges, - this.isPartial); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1PaymentDiscount.cs b/Square/Models/V1PaymentDiscount.cs deleted file mode 100644 index 8637fedd..00000000 --- a/Square/Models/V1PaymentDiscount.cs +++ /dev/null @@ -1,239 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1PaymentDiscount. - /// - public class V1PaymentDiscount - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// name. - /// applied_money. - /// discount_id. - public V1PaymentDiscount( - string name = null, - Models.V1Money appliedMoney = null, - string discountId = null) - { - shouldSerialize = new Dictionary - { - { "name", false }, - { "discount_id", false } - }; - - if (name != null) - { - shouldSerialize["name"] = true; - this.Name = name; - } - - this.AppliedMoney = appliedMoney; - if (discountId != null) - { - shouldSerialize["discount_id"] = true; - this.DiscountId = discountId; - } - - } - internal V1PaymentDiscount(Dictionary shouldSerialize, - string name = null, - Models.V1Money appliedMoney = null, - string discountId = null) - { - this.shouldSerialize = shouldSerialize; - Name = name; - AppliedMoney = appliedMoney; - DiscountId = discountId; - } - - /// - /// The discount's name. - /// - [JsonProperty("name")] - public string Name { get; } - - /// - /// Gets or sets AppliedMoney. - /// - [JsonProperty("applied_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money AppliedMoney { get; } - - /// - /// The ID of the applied discount, if available. Discounts applied in older versions of Square Register might not have an ID. - /// - [JsonProperty("discount_id")] - public string DiscountId { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1PaymentDiscount : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeName() - { - return this.shouldSerialize["name"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeDiscountId() - { - return this.shouldSerialize["discount_id"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1PaymentDiscount other && ((this.Name == null && other.Name == null) || (this.Name?.Equals(other.Name) == true)) && - ((this.AppliedMoney == null && other.AppliedMoney == null) || (this.AppliedMoney?.Equals(other.AppliedMoney) == true)) && - ((this.DiscountId == null && other.DiscountId == null) || (this.DiscountId?.Equals(other.DiscountId) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 1602240589; - hashCode = HashCode.Combine(this.Name, this.AppliedMoney, this.DiscountId); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Name = {(this.Name == null ? "null" : this.Name)}"); - toStringOutput.Add($"this.AppliedMoney = {(this.AppliedMoney == null ? "null" : this.AppliedMoney.ToString())}"); - toStringOutput.Add($"this.DiscountId = {(this.DiscountId == null ? "null" : this.DiscountId)}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Name(this.Name) - .AppliedMoney(this.AppliedMoney) - .DiscountId(this.DiscountId); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "name", false }, - { "discount_id", false }, - }; - - private string name; - private Models.V1Money appliedMoney; - private string discountId; - - /// - /// Name. - /// - /// name. - /// Builder. - public Builder Name(string name) - { - shouldSerialize["name"] = true; - this.name = name; - return this; - } - - /// - /// AppliedMoney. - /// - /// appliedMoney. - /// Builder. - public Builder AppliedMoney(Models.V1Money appliedMoney) - { - this.appliedMoney = appliedMoney; - return this; - } - - /// - /// DiscountId. - /// - /// discountId. - /// Builder. - public Builder DiscountId(string discountId) - { - shouldSerialize["discount_id"] = true; - this.discountId = discountId; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetName() - { - this.shouldSerialize["name"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetDiscountId() - { - this.shouldSerialize["discount_id"] = false; - } - - - /// - /// Builds class object. - /// - /// V1PaymentDiscount. - public V1PaymentDiscount Build() - { - return new V1PaymentDiscount(shouldSerialize, - this.name, - this.appliedMoney, - this.discountId); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1PaymentItemDetail.cs b/Square/Models/V1PaymentItemDetail.cs deleted file mode 100644 index 73a80a36..00000000 --- a/Square/Models/V1PaymentItemDetail.cs +++ /dev/null @@ -1,316 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1PaymentItemDetail. - /// - public class V1PaymentItemDetail - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// category_name. - /// sku. - /// item_id. - /// item_variation_id. - public V1PaymentItemDetail( - string categoryName = null, - string sku = null, - string itemId = null, - string itemVariationId = null) - { - shouldSerialize = new Dictionary - { - { "category_name", false }, - { "sku", false }, - { "item_id", false }, - { "item_variation_id", false } - }; - - if (categoryName != null) - { - shouldSerialize["category_name"] = true; - this.CategoryName = categoryName; - } - - if (sku != null) - { - shouldSerialize["sku"] = true; - this.Sku = sku; - } - - if (itemId != null) - { - shouldSerialize["item_id"] = true; - this.ItemId = itemId; - } - - if (itemVariationId != null) - { - shouldSerialize["item_variation_id"] = true; - this.ItemVariationId = itemVariationId; - } - - } - internal V1PaymentItemDetail(Dictionary shouldSerialize, - string categoryName = null, - string sku = null, - string itemId = null, - string itemVariationId = null) - { - this.shouldSerialize = shouldSerialize; - CategoryName = categoryName; - Sku = sku; - ItemId = itemId; - ItemVariationId = itemVariationId; - } - - /// - /// The name of the item's merchant-defined category, if any. - /// - [JsonProperty("category_name")] - public string CategoryName { get; } - - /// - /// The item's merchant-defined SKU, if any. - /// - [JsonProperty("sku")] - public string Sku { get; } - - /// - /// The unique ID of the item purchased, if any. - /// - [JsonProperty("item_id")] - public string ItemId { get; } - - /// - /// The unique ID of the item variation purchased, if any. - /// - [JsonProperty("item_variation_id")] - public string ItemVariationId { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1PaymentItemDetail : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeCategoryName() - { - return this.shouldSerialize["category_name"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeSku() - { - return this.shouldSerialize["sku"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeItemId() - { - return this.shouldSerialize["item_id"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeItemVariationId() - { - return this.shouldSerialize["item_variation_id"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1PaymentItemDetail other && ((this.CategoryName == null && other.CategoryName == null) || (this.CategoryName?.Equals(other.CategoryName) == true)) && - ((this.Sku == null && other.Sku == null) || (this.Sku?.Equals(other.Sku) == true)) && - ((this.ItemId == null && other.ItemId == null) || (this.ItemId?.Equals(other.ItemId) == true)) && - ((this.ItemVariationId == null && other.ItemVariationId == null) || (this.ItemVariationId?.Equals(other.ItemVariationId) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 1460876522; - hashCode = HashCode.Combine(this.CategoryName, this.Sku, this.ItemId, this.ItemVariationId); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.CategoryName = {(this.CategoryName == null ? "null" : this.CategoryName)}"); - toStringOutput.Add($"this.Sku = {(this.Sku == null ? "null" : this.Sku)}"); - toStringOutput.Add($"this.ItemId = {(this.ItemId == null ? "null" : this.ItemId)}"); - toStringOutput.Add($"this.ItemVariationId = {(this.ItemVariationId == null ? "null" : this.ItemVariationId)}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .CategoryName(this.CategoryName) - .Sku(this.Sku) - .ItemId(this.ItemId) - .ItemVariationId(this.ItemVariationId); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "category_name", false }, - { "sku", false }, - { "item_id", false }, - { "item_variation_id", false }, - }; - - private string categoryName; - private string sku; - private string itemId; - private string itemVariationId; - - /// - /// CategoryName. - /// - /// categoryName. - /// Builder. - public Builder CategoryName(string categoryName) - { - shouldSerialize["category_name"] = true; - this.categoryName = categoryName; - return this; - } - - /// - /// Sku. - /// - /// sku. - /// Builder. - public Builder Sku(string sku) - { - shouldSerialize["sku"] = true; - this.sku = sku; - return this; - } - - /// - /// ItemId. - /// - /// itemId. - /// Builder. - public Builder ItemId(string itemId) - { - shouldSerialize["item_id"] = true; - this.itemId = itemId; - return this; - } - - /// - /// ItemVariationId. - /// - /// itemVariationId. - /// Builder. - public Builder ItemVariationId(string itemVariationId) - { - shouldSerialize["item_variation_id"] = true; - this.itemVariationId = itemVariationId; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetCategoryName() - { - this.shouldSerialize["category_name"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetSku() - { - this.shouldSerialize["sku"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetItemId() - { - this.shouldSerialize["item_id"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetItemVariationId() - { - this.shouldSerialize["item_variation_id"] = false; - } - - - /// - /// Builds class object. - /// - /// V1PaymentItemDetail. - public V1PaymentItemDetail Build() - { - return new V1PaymentItemDetail(shouldSerialize, - this.categoryName, - this.sku, - this.itemId, - this.itemVariationId); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1PaymentItemization.cs b/Square/Models/V1PaymentItemization.cs deleted file mode 100644 index aeac40eb..00000000 --- a/Square/Models/V1PaymentItemization.cs +++ /dev/null @@ -1,663 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1PaymentItemization. - /// - public class V1PaymentItemization - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// name. - /// quantity. - /// itemization_type. - /// item_detail. - /// notes. - /// item_variation_name. - /// total_money. - /// single_quantity_money. - /// gross_sales_money. - /// discount_money. - /// net_sales_money. - /// taxes. - /// discounts. - /// modifiers. - public V1PaymentItemization( - string name = null, - double? quantity = null, - string itemizationType = null, - Models.V1PaymentItemDetail itemDetail = null, - string notes = null, - string itemVariationName = null, - Models.V1Money totalMoney = null, - Models.V1Money singleQuantityMoney = null, - Models.V1Money grossSalesMoney = null, - Models.V1Money discountMoney = null, - Models.V1Money netSalesMoney = null, - IList taxes = null, - IList discounts = null, - IList modifiers = null) - { - shouldSerialize = new Dictionary - { - { "name", false }, - { "quantity", false }, - { "notes", false }, - { "item_variation_name", false }, - { "taxes", false }, - { "discounts", false }, - { "modifiers", false } - }; - - if (name != null) - { - shouldSerialize["name"] = true; - this.Name = name; - } - - if (quantity != null) - { - shouldSerialize["quantity"] = true; - this.Quantity = quantity; - } - - this.ItemizationType = itemizationType; - this.ItemDetail = itemDetail; - if (notes != null) - { - shouldSerialize["notes"] = true; - this.Notes = notes; - } - - if (itemVariationName != null) - { - shouldSerialize["item_variation_name"] = true; - this.ItemVariationName = itemVariationName; - } - - this.TotalMoney = totalMoney; - this.SingleQuantityMoney = singleQuantityMoney; - this.GrossSalesMoney = grossSalesMoney; - this.DiscountMoney = discountMoney; - this.NetSalesMoney = netSalesMoney; - if (taxes != null) - { - shouldSerialize["taxes"] = true; - this.Taxes = taxes; - } - - if (discounts != null) - { - shouldSerialize["discounts"] = true; - this.Discounts = discounts; - } - - if (modifiers != null) - { - shouldSerialize["modifiers"] = true; - this.Modifiers = modifiers; - } - - } - internal V1PaymentItemization(Dictionary shouldSerialize, - string name = null, - double? quantity = null, - string itemizationType = null, - Models.V1PaymentItemDetail itemDetail = null, - string notes = null, - string itemVariationName = null, - Models.V1Money totalMoney = null, - Models.V1Money singleQuantityMoney = null, - Models.V1Money grossSalesMoney = null, - Models.V1Money discountMoney = null, - Models.V1Money netSalesMoney = null, - IList taxes = null, - IList discounts = null, - IList modifiers = null) - { - this.shouldSerialize = shouldSerialize; - Name = name; - Quantity = quantity; - ItemizationType = itemizationType; - ItemDetail = itemDetail; - Notes = notes; - ItemVariationName = itemVariationName; - TotalMoney = totalMoney; - SingleQuantityMoney = singleQuantityMoney; - GrossSalesMoney = grossSalesMoney; - DiscountMoney = discountMoney; - NetSalesMoney = netSalesMoney; - Taxes = taxes; - Discounts = discounts; - Modifiers = modifiers; - } - - /// - /// The item's name. - /// - [JsonProperty("name")] - public string Name { get; } - - /// - /// The quantity of the item purchased. This can be a decimal value. - /// - [JsonProperty("quantity")] - public double? Quantity { get; } - - /// - /// Gets or sets ItemizationType. - /// - [JsonProperty("itemization_type", NullValueHandling = NullValueHandling.Ignore)] - public string ItemizationType { get; } - - /// - /// V1PaymentItemDetail - /// - [JsonProperty("item_detail", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1PaymentItemDetail ItemDetail { get; } - - /// - /// Notes entered by the merchant about the item at the time of payment, if any. - /// - [JsonProperty("notes")] - public string Notes { get; } - - /// - /// The name of the item variation purchased, if any. - /// - [JsonProperty("item_variation_name")] - public string ItemVariationName { get; } - - /// - /// Gets or sets TotalMoney. - /// - [JsonProperty("total_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money TotalMoney { get; } - - /// - /// Gets or sets SingleQuantityMoney. - /// - [JsonProperty("single_quantity_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money SingleQuantityMoney { get; } - - /// - /// Gets or sets GrossSalesMoney. - /// - [JsonProperty("gross_sales_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money GrossSalesMoney { get; } - - /// - /// Gets or sets DiscountMoney. - /// - [JsonProperty("discount_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money DiscountMoney { get; } - - /// - /// Gets or sets NetSalesMoney. - /// - [JsonProperty("net_sales_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money NetSalesMoney { get; } - - /// - /// All taxes applied to this itemization. - /// - [JsonProperty("taxes")] - public IList Taxes { get; } - - /// - /// All discounts applied to this itemization. - /// - [JsonProperty("discounts")] - public IList Discounts { get; } - - /// - /// All modifier options applied to this itemization. - /// - [JsonProperty("modifiers")] - public IList Modifiers { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1PaymentItemization : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeName() - { - return this.shouldSerialize["name"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeQuantity() - { - return this.shouldSerialize["quantity"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeNotes() - { - return this.shouldSerialize["notes"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeItemVariationName() - { - return this.shouldSerialize["item_variation_name"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeTaxes() - { - return this.shouldSerialize["taxes"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeDiscounts() - { - return this.shouldSerialize["discounts"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeModifiers() - { - return this.shouldSerialize["modifiers"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1PaymentItemization other && ((this.Name == null && other.Name == null) || (this.Name?.Equals(other.Name) == true)) && - ((this.Quantity == null && other.Quantity == null) || (this.Quantity?.Equals(other.Quantity) == true)) && - ((this.ItemizationType == null && other.ItemizationType == null) || (this.ItemizationType?.Equals(other.ItemizationType) == true)) && - ((this.ItemDetail == null && other.ItemDetail == null) || (this.ItemDetail?.Equals(other.ItemDetail) == true)) && - ((this.Notes == null && other.Notes == null) || (this.Notes?.Equals(other.Notes) == true)) && - ((this.ItemVariationName == null && other.ItemVariationName == null) || (this.ItemVariationName?.Equals(other.ItemVariationName) == true)) && - ((this.TotalMoney == null && other.TotalMoney == null) || (this.TotalMoney?.Equals(other.TotalMoney) == true)) && - ((this.SingleQuantityMoney == null && other.SingleQuantityMoney == null) || (this.SingleQuantityMoney?.Equals(other.SingleQuantityMoney) == true)) && - ((this.GrossSalesMoney == null && other.GrossSalesMoney == null) || (this.GrossSalesMoney?.Equals(other.GrossSalesMoney) == true)) && - ((this.DiscountMoney == null && other.DiscountMoney == null) || (this.DiscountMoney?.Equals(other.DiscountMoney) == true)) && - ((this.NetSalesMoney == null && other.NetSalesMoney == null) || (this.NetSalesMoney?.Equals(other.NetSalesMoney) == true)) && - ((this.Taxes == null && other.Taxes == null) || (this.Taxes?.Equals(other.Taxes) == true)) && - ((this.Discounts == null && other.Discounts == null) || (this.Discounts?.Equals(other.Discounts) == true)) && - ((this.Modifiers == null && other.Modifiers == null) || (this.Modifiers?.Equals(other.Modifiers) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 1047875174; - hashCode = HashCode.Combine(this.Name, this.Quantity, this.ItemizationType, this.ItemDetail, this.Notes, this.ItemVariationName, this.TotalMoney); - - hashCode = HashCode.Combine(hashCode, this.SingleQuantityMoney, this.GrossSalesMoney, this.DiscountMoney, this.NetSalesMoney, this.Taxes, this.Discounts, this.Modifiers); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Name = {(this.Name == null ? "null" : this.Name)}"); - toStringOutput.Add($"this.Quantity = {(this.Quantity == null ? "null" : this.Quantity.ToString())}"); - toStringOutput.Add($"this.ItemizationType = {(this.ItemizationType == null ? "null" : this.ItemizationType.ToString())}"); - toStringOutput.Add($"this.ItemDetail = {(this.ItemDetail == null ? "null" : this.ItemDetail.ToString())}"); - toStringOutput.Add($"this.Notes = {(this.Notes == null ? "null" : this.Notes)}"); - toStringOutput.Add($"this.ItemVariationName = {(this.ItemVariationName == null ? "null" : this.ItemVariationName)}"); - toStringOutput.Add($"this.TotalMoney = {(this.TotalMoney == null ? "null" : this.TotalMoney.ToString())}"); - toStringOutput.Add($"this.SingleQuantityMoney = {(this.SingleQuantityMoney == null ? "null" : this.SingleQuantityMoney.ToString())}"); - toStringOutput.Add($"this.GrossSalesMoney = {(this.GrossSalesMoney == null ? "null" : this.GrossSalesMoney.ToString())}"); - toStringOutput.Add($"this.DiscountMoney = {(this.DiscountMoney == null ? "null" : this.DiscountMoney.ToString())}"); - toStringOutput.Add($"this.NetSalesMoney = {(this.NetSalesMoney == null ? "null" : this.NetSalesMoney.ToString())}"); - toStringOutput.Add($"this.Taxes = {(this.Taxes == null ? "null" : $"[{string.Join(", ", this.Taxes)} ]")}"); - toStringOutput.Add($"this.Discounts = {(this.Discounts == null ? "null" : $"[{string.Join(", ", this.Discounts)} ]")}"); - toStringOutput.Add($"this.Modifiers = {(this.Modifiers == null ? "null" : $"[{string.Join(", ", this.Modifiers)} ]")}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Name(this.Name) - .Quantity(this.Quantity) - .ItemizationType(this.ItemizationType) - .ItemDetail(this.ItemDetail) - .Notes(this.Notes) - .ItemVariationName(this.ItemVariationName) - .TotalMoney(this.TotalMoney) - .SingleQuantityMoney(this.SingleQuantityMoney) - .GrossSalesMoney(this.GrossSalesMoney) - .DiscountMoney(this.DiscountMoney) - .NetSalesMoney(this.NetSalesMoney) - .Taxes(this.Taxes) - .Discounts(this.Discounts) - .Modifiers(this.Modifiers); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "name", false }, - { "quantity", false }, - { "notes", false }, - { "item_variation_name", false }, - { "taxes", false }, - { "discounts", false }, - { "modifiers", false }, - }; - - private string name; - private double? quantity; - private string itemizationType; - private Models.V1PaymentItemDetail itemDetail; - private string notes; - private string itemVariationName; - private Models.V1Money totalMoney; - private Models.V1Money singleQuantityMoney; - private Models.V1Money grossSalesMoney; - private Models.V1Money discountMoney; - private Models.V1Money netSalesMoney; - private IList taxes; - private IList discounts; - private IList modifiers; - - /// - /// Name. - /// - /// name. - /// Builder. - public Builder Name(string name) - { - shouldSerialize["name"] = true; - this.name = name; - return this; - } - - /// - /// Quantity. - /// - /// quantity. - /// Builder. - public Builder Quantity(double? quantity) - { - shouldSerialize["quantity"] = true; - this.quantity = quantity; - return this; - } - - /// - /// ItemizationType. - /// - /// itemizationType. - /// Builder. - public Builder ItemizationType(string itemizationType) - { - this.itemizationType = itemizationType; - return this; - } - - /// - /// ItemDetail. - /// - /// itemDetail. - /// Builder. - public Builder ItemDetail(Models.V1PaymentItemDetail itemDetail) - { - this.itemDetail = itemDetail; - return this; - } - - /// - /// Notes. - /// - /// notes. - /// Builder. - public Builder Notes(string notes) - { - shouldSerialize["notes"] = true; - this.notes = notes; - return this; - } - - /// - /// ItemVariationName. - /// - /// itemVariationName. - /// Builder. - public Builder ItemVariationName(string itemVariationName) - { - shouldSerialize["item_variation_name"] = true; - this.itemVariationName = itemVariationName; - return this; - } - - /// - /// TotalMoney. - /// - /// totalMoney. - /// Builder. - public Builder TotalMoney(Models.V1Money totalMoney) - { - this.totalMoney = totalMoney; - return this; - } - - /// - /// SingleQuantityMoney. - /// - /// singleQuantityMoney. - /// Builder. - public Builder SingleQuantityMoney(Models.V1Money singleQuantityMoney) - { - this.singleQuantityMoney = singleQuantityMoney; - return this; - } - - /// - /// GrossSalesMoney. - /// - /// grossSalesMoney. - /// Builder. - public Builder GrossSalesMoney(Models.V1Money grossSalesMoney) - { - this.grossSalesMoney = grossSalesMoney; - return this; - } - - /// - /// DiscountMoney. - /// - /// discountMoney. - /// Builder. - public Builder DiscountMoney(Models.V1Money discountMoney) - { - this.discountMoney = discountMoney; - return this; - } - - /// - /// NetSalesMoney. - /// - /// netSalesMoney. - /// Builder. - public Builder NetSalesMoney(Models.V1Money netSalesMoney) - { - this.netSalesMoney = netSalesMoney; - return this; - } - - /// - /// Taxes. - /// - /// taxes. - /// Builder. - public Builder Taxes(IList taxes) - { - shouldSerialize["taxes"] = true; - this.taxes = taxes; - return this; - } - - /// - /// Discounts. - /// - /// discounts. - /// Builder. - public Builder Discounts(IList discounts) - { - shouldSerialize["discounts"] = true; - this.discounts = discounts; - return this; - } - - /// - /// Modifiers. - /// - /// modifiers. - /// Builder. - public Builder Modifiers(IList modifiers) - { - shouldSerialize["modifiers"] = true; - this.modifiers = modifiers; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetName() - { - this.shouldSerialize["name"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetQuantity() - { - this.shouldSerialize["quantity"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetNotes() - { - this.shouldSerialize["notes"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetItemVariationName() - { - this.shouldSerialize["item_variation_name"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetTaxes() - { - this.shouldSerialize["taxes"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetDiscounts() - { - this.shouldSerialize["discounts"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetModifiers() - { - this.shouldSerialize["modifiers"] = false; - } - - - /// - /// Builds class object. - /// - /// V1PaymentItemization. - public V1PaymentItemization Build() - { - return new V1PaymentItemization(shouldSerialize, - this.name, - this.quantity, - this.itemizationType, - this.itemDetail, - this.notes, - this.itemVariationName, - this.totalMoney, - this.singleQuantityMoney, - this.grossSalesMoney, - this.discountMoney, - this.netSalesMoney, - this.taxes, - this.discounts, - this.modifiers); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1PaymentModifier.cs b/Square/Models/V1PaymentModifier.cs deleted file mode 100644 index 73799303..00000000 --- a/Square/Models/V1PaymentModifier.cs +++ /dev/null @@ -1,239 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1PaymentModifier. - /// - public class V1PaymentModifier - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// name. - /// applied_money. - /// modifier_option_id. - public V1PaymentModifier( - string name = null, - Models.V1Money appliedMoney = null, - string modifierOptionId = null) - { - shouldSerialize = new Dictionary - { - { "name", false }, - { "modifier_option_id", false } - }; - - if (name != null) - { - shouldSerialize["name"] = true; - this.Name = name; - } - - this.AppliedMoney = appliedMoney; - if (modifierOptionId != null) - { - shouldSerialize["modifier_option_id"] = true; - this.ModifierOptionId = modifierOptionId; - } - - } - internal V1PaymentModifier(Dictionary shouldSerialize, - string name = null, - Models.V1Money appliedMoney = null, - string modifierOptionId = null) - { - this.shouldSerialize = shouldSerialize; - Name = name; - AppliedMoney = appliedMoney; - ModifierOptionId = modifierOptionId; - } - - /// - /// The modifier option's name. - /// - [JsonProperty("name")] - public string Name { get; } - - /// - /// Gets or sets AppliedMoney. - /// - [JsonProperty("applied_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money AppliedMoney { get; } - - /// - /// The ID of the applied modifier option, if available. Modifier options applied in older versions of Square Register might not have an ID. - /// - [JsonProperty("modifier_option_id")] - public string ModifierOptionId { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1PaymentModifier : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeName() - { - return this.shouldSerialize["name"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeModifierOptionId() - { - return this.shouldSerialize["modifier_option_id"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1PaymentModifier other && ((this.Name == null && other.Name == null) || (this.Name?.Equals(other.Name) == true)) && - ((this.AppliedMoney == null && other.AppliedMoney == null) || (this.AppliedMoney?.Equals(other.AppliedMoney) == true)) && - ((this.ModifierOptionId == null && other.ModifierOptionId == null) || (this.ModifierOptionId?.Equals(other.ModifierOptionId) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 255545397; - hashCode = HashCode.Combine(this.Name, this.AppliedMoney, this.ModifierOptionId); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Name = {(this.Name == null ? "null" : this.Name)}"); - toStringOutput.Add($"this.AppliedMoney = {(this.AppliedMoney == null ? "null" : this.AppliedMoney.ToString())}"); - toStringOutput.Add($"this.ModifierOptionId = {(this.ModifierOptionId == null ? "null" : this.ModifierOptionId)}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Name(this.Name) - .AppliedMoney(this.AppliedMoney) - .ModifierOptionId(this.ModifierOptionId); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "name", false }, - { "modifier_option_id", false }, - }; - - private string name; - private Models.V1Money appliedMoney; - private string modifierOptionId; - - /// - /// Name. - /// - /// name. - /// Builder. - public Builder Name(string name) - { - shouldSerialize["name"] = true; - this.name = name; - return this; - } - - /// - /// AppliedMoney. - /// - /// appliedMoney. - /// Builder. - public Builder AppliedMoney(Models.V1Money appliedMoney) - { - this.appliedMoney = appliedMoney; - return this; - } - - /// - /// ModifierOptionId. - /// - /// modifierOptionId. - /// Builder. - public Builder ModifierOptionId(string modifierOptionId) - { - shouldSerialize["modifier_option_id"] = true; - this.modifierOptionId = modifierOptionId; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetName() - { - this.shouldSerialize["name"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetModifierOptionId() - { - this.shouldSerialize["modifier_option_id"] = false; - } - - - /// - /// Builds class object. - /// - /// V1PaymentModifier. - public V1PaymentModifier Build() - { - return new V1PaymentModifier(shouldSerialize, - this.name, - this.appliedMoney, - this.modifierOptionId); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1PaymentSurcharge.cs b/Square/Models/V1PaymentSurcharge.cs deleted file mode 100644 index 3f773246..00000000 --- a/Square/Models/V1PaymentSurcharge.cs +++ /dev/null @@ -1,451 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1PaymentSurcharge. - /// - public class V1PaymentSurcharge - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// name. - /// applied_money. - /// rate. - /// amount_money. - /// type. - /// taxable. - /// taxes. - /// surcharge_id. - public V1PaymentSurcharge( - string name = null, - Models.V1Money appliedMoney = null, - string rate = null, - Models.V1Money amountMoney = null, - string type = null, - bool? taxable = null, - IList taxes = null, - string surchargeId = null) - { - shouldSerialize = new Dictionary - { - { "name", false }, - { "rate", false }, - { "taxable", false }, - { "taxes", false }, - { "surcharge_id", false } - }; - - if (name != null) - { - shouldSerialize["name"] = true; - this.Name = name; - } - - this.AppliedMoney = appliedMoney; - if (rate != null) - { - shouldSerialize["rate"] = true; - this.Rate = rate; - } - - this.AmountMoney = amountMoney; - this.Type = type; - if (taxable != null) - { - shouldSerialize["taxable"] = true; - this.Taxable = taxable; - } - - if (taxes != null) - { - shouldSerialize["taxes"] = true; - this.Taxes = taxes; - } - - if (surchargeId != null) - { - shouldSerialize["surcharge_id"] = true; - this.SurchargeId = surchargeId; - } - - } - internal V1PaymentSurcharge(Dictionary shouldSerialize, - string name = null, - Models.V1Money appliedMoney = null, - string rate = null, - Models.V1Money amountMoney = null, - string type = null, - bool? taxable = null, - IList taxes = null, - string surchargeId = null) - { - this.shouldSerialize = shouldSerialize; - Name = name; - AppliedMoney = appliedMoney; - Rate = rate; - AmountMoney = amountMoney; - Type = type; - Taxable = taxable; - Taxes = taxes; - SurchargeId = surchargeId; - } - - /// - /// The name of the surcharge. - /// - [JsonProperty("name")] - public string Name { get; } - - /// - /// Gets or sets AppliedMoney. - /// - [JsonProperty("applied_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money AppliedMoney { get; } - - /// - /// The amount of the surcharge as a percentage. The percentage is provided as a string representing the decimal equivalent of the percentage. For example, "0.7" corresponds to a 7% surcharge. Exactly one of rate or amount_money should be set. - /// - [JsonProperty("rate")] - public string Rate { get; } - - /// - /// Gets or sets AmountMoney. - /// - [JsonProperty("amount_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money AmountMoney { get; } - - /// - /// Gets or sets Type. - /// - [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)] - public string Type { get; } - - /// - /// Indicates whether the surcharge is taxable. - /// - [JsonProperty("taxable")] - public bool? Taxable { get; } - - /// - /// The list of taxes that should be applied to the surcharge. - /// - [JsonProperty("taxes")] - public IList Taxes { get; } - - /// - /// A Square-issued unique identifier associated with the surcharge. - /// - [JsonProperty("surcharge_id")] - public string SurchargeId { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1PaymentSurcharge : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeName() - { - return this.shouldSerialize["name"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeRate() - { - return this.shouldSerialize["rate"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeTaxable() - { - return this.shouldSerialize["taxable"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeTaxes() - { - return this.shouldSerialize["taxes"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeSurchargeId() - { - return this.shouldSerialize["surcharge_id"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1PaymentSurcharge other && ((this.Name == null && other.Name == null) || (this.Name?.Equals(other.Name) == true)) && - ((this.AppliedMoney == null && other.AppliedMoney == null) || (this.AppliedMoney?.Equals(other.AppliedMoney) == true)) && - ((this.Rate == null && other.Rate == null) || (this.Rate?.Equals(other.Rate) == true)) && - ((this.AmountMoney == null && other.AmountMoney == null) || (this.AmountMoney?.Equals(other.AmountMoney) == true)) && - ((this.Type == null && other.Type == null) || (this.Type?.Equals(other.Type) == true)) && - ((this.Taxable == null && other.Taxable == null) || (this.Taxable?.Equals(other.Taxable) == true)) && - ((this.Taxes == null && other.Taxes == null) || (this.Taxes?.Equals(other.Taxes) == true)) && - ((this.SurchargeId == null && other.SurchargeId == null) || (this.SurchargeId?.Equals(other.SurchargeId) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = -446593569; - hashCode = HashCode.Combine(this.Name, this.AppliedMoney, this.Rate, this.AmountMoney, this.Type, this.Taxable, this.Taxes); - - hashCode = HashCode.Combine(hashCode, this.SurchargeId); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Name = {(this.Name == null ? "null" : this.Name)}"); - toStringOutput.Add($"this.AppliedMoney = {(this.AppliedMoney == null ? "null" : this.AppliedMoney.ToString())}"); - toStringOutput.Add($"this.Rate = {(this.Rate == null ? "null" : this.Rate)}"); - toStringOutput.Add($"this.AmountMoney = {(this.AmountMoney == null ? "null" : this.AmountMoney.ToString())}"); - toStringOutput.Add($"this.Type = {(this.Type == null ? "null" : this.Type.ToString())}"); - toStringOutput.Add($"this.Taxable = {(this.Taxable == null ? "null" : this.Taxable.ToString())}"); - toStringOutput.Add($"this.Taxes = {(this.Taxes == null ? "null" : $"[{string.Join(", ", this.Taxes)} ]")}"); - toStringOutput.Add($"this.SurchargeId = {(this.SurchargeId == null ? "null" : this.SurchargeId)}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Name(this.Name) - .AppliedMoney(this.AppliedMoney) - .Rate(this.Rate) - .AmountMoney(this.AmountMoney) - .Type(this.Type) - .Taxable(this.Taxable) - .Taxes(this.Taxes) - .SurchargeId(this.SurchargeId); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "name", false }, - { "rate", false }, - { "taxable", false }, - { "taxes", false }, - { "surcharge_id", false }, - }; - - private string name; - private Models.V1Money appliedMoney; - private string rate; - private Models.V1Money amountMoney; - private string type; - private bool? taxable; - private IList taxes; - private string surchargeId; - - /// - /// Name. - /// - /// name. - /// Builder. - public Builder Name(string name) - { - shouldSerialize["name"] = true; - this.name = name; - return this; - } - - /// - /// AppliedMoney. - /// - /// appliedMoney. - /// Builder. - public Builder AppliedMoney(Models.V1Money appliedMoney) - { - this.appliedMoney = appliedMoney; - return this; - } - - /// - /// Rate. - /// - /// rate. - /// Builder. - public Builder Rate(string rate) - { - shouldSerialize["rate"] = true; - this.rate = rate; - return this; - } - - /// - /// AmountMoney. - /// - /// amountMoney. - /// Builder. - public Builder AmountMoney(Models.V1Money amountMoney) - { - this.amountMoney = amountMoney; - return this; - } - - /// - /// Type. - /// - /// type. - /// Builder. - public Builder Type(string type) - { - this.type = type; - return this; - } - - /// - /// Taxable. - /// - /// taxable. - /// Builder. - public Builder Taxable(bool? taxable) - { - shouldSerialize["taxable"] = true; - this.taxable = taxable; - return this; - } - - /// - /// Taxes. - /// - /// taxes. - /// Builder. - public Builder Taxes(IList taxes) - { - shouldSerialize["taxes"] = true; - this.taxes = taxes; - return this; - } - - /// - /// SurchargeId. - /// - /// surchargeId. - /// Builder. - public Builder SurchargeId(string surchargeId) - { - shouldSerialize["surcharge_id"] = true; - this.surchargeId = surchargeId; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetName() - { - this.shouldSerialize["name"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetRate() - { - this.shouldSerialize["rate"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetTaxable() - { - this.shouldSerialize["taxable"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetTaxes() - { - this.shouldSerialize["taxes"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetSurchargeId() - { - this.shouldSerialize["surcharge_id"] = false; - } - - - /// - /// Builds class object. - /// - /// V1PaymentSurcharge. - public V1PaymentSurcharge Build() - { - return new V1PaymentSurcharge(shouldSerialize, - this.name, - this.appliedMoney, - this.rate, - this.amountMoney, - this.type, - this.taxable, - this.taxes, - this.surchargeId); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1PaymentTax.cs b/Square/Models/V1PaymentTax.cs deleted file mode 100644 index ab38d943..00000000 --- a/Square/Models/V1PaymentTax.cs +++ /dev/null @@ -1,370 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1PaymentTax. - /// - public class V1PaymentTax - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// errors. - /// name. - /// applied_money. - /// rate. - /// inclusion_type. - /// fee_id. - public V1PaymentTax( - IList errors = null, - string name = null, - Models.V1Money appliedMoney = null, - string rate = null, - string inclusionType = null, - string feeId = null) - { - shouldSerialize = new Dictionary - { - { "errors", false }, - { "name", false }, - { "rate", false }, - { "fee_id", false } - }; - - if (errors != null) - { - shouldSerialize["errors"] = true; - this.Errors = errors; - } - - if (name != null) - { - shouldSerialize["name"] = true; - this.Name = name; - } - - this.AppliedMoney = appliedMoney; - if (rate != null) - { - shouldSerialize["rate"] = true; - this.Rate = rate; - } - - this.InclusionType = inclusionType; - if (feeId != null) - { - shouldSerialize["fee_id"] = true; - this.FeeId = feeId; - } - - } - internal V1PaymentTax(Dictionary shouldSerialize, - IList errors = null, - string name = null, - Models.V1Money appliedMoney = null, - string rate = null, - string inclusionType = null, - string feeId = null) - { - this.shouldSerialize = shouldSerialize; - Errors = errors; - Name = name; - AppliedMoney = appliedMoney; - Rate = rate; - InclusionType = inclusionType; - FeeId = feeId; - } - - /// - /// Any errors that occurred during the request. - /// - [JsonProperty("errors")] - public IList Errors { get; } - - /// - /// The merchant-defined name of the tax. - /// - [JsonProperty("name")] - public string Name { get; } - - /// - /// Gets or sets AppliedMoney. - /// - [JsonProperty("applied_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money AppliedMoney { get; } - - /// - /// The rate of the tax, as a string representation of a decimal number. A value of 0.07 corresponds to a rate of 7%. - /// - [JsonProperty("rate")] - public string Rate { get; } - - /// - /// Gets or sets InclusionType. - /// - [JsonProperty("inclusion_type", NullValueHandling = NullValueHandling.Ignore)] - public string InclusionType { get; } - - /// - /// The ID of the tax, if available. Taxes applied in older versions of Square Register might not have an ID. - /// - [JsonProperty("fee_id")] - public string FeeId { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1PaymentTax : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeErrors() - { - return this.shouldSerialize["errors"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeName() - { - return this.shouldSerialize["name"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeRate() - { - return this.shouldSerialize["rate"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeFeeId() - { - return this.shouldSerialize["fee_id"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1PaymentTax other && ((this.Errors == null && other.Errors == null) || (this.Errors?.Equals(other.Errors) == true)) && - ((this.Name == null && other.Name == null) || (this.Name?.Equals(other.Name) == true)) && - ((this.AppliedMoney == null && other.AppliedMoney == null) || (this.AppliedMoney?.Equals(other.AppliedMoney) == true)) && - ((this.Rate == null && other.Rate == null) || (this.Rate?.Equals(other.Rate) == true)) && - ((this.InclusionType == null && other.InclusionType == null) || (this.InclusionType?.Equals(other.InclusionType) == true)) && - ((this.FeeId == null && other.FeeId == null) || (this.FeeId?.Equals(other.FeeId) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 2123751229; - hashCode = HashCode.Combine(this.Errors, this.Name, this.AppliedMoney, this.Rate, this.InclusionType, this.FeeId); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Errors = {(this.Errors == null ? "null" : $"[{string.Join(", ", this.Errors)} ]")}"); - toStringOutput.Add($"this.Name = {(this.Name == null ? "null" : this.Name)}"); - toStringOutput.Add($"this.AppliedMoney = {(this.AppliedMoney == null ? "null" : this.AppliedMoney.ToString())}"); - toStringOutput.Add($"this.Rate = {(this.Rate == null ? "null" : this.Rate)}"); - toStringOutput.Add($"this.InclusionType = {(this.InclusionType == null ? "null" : this.InclusionType.ToString())}"); - toStringOutput.Add($"this.FeeId = {(this.FeeId == null ? "null" : this.FeeId)}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Errors(this.Errors) - .Name(this.Name) - .AppliedMoney(this.AppliedMoney) - .Rate(this.Rate) - .InclusionType(this.InclusionType) - .FeeId(this.FeeId); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "errors", false }, - { "name", false }, - { "rate", false }, - { "fee_id", false }, - }; - - private IList errors; - private string name; - private Models.V1Money appliedMoney; - private string rate; - private string inclusionType; - private string feeId; - - /// - /// Errors. - /// - /// errors. - /// Builder. - public Builder Errors(IList errors) - { - shouldSerialize["errors"] = true; - this.errors = errors; - return this; - } - - /// - /// Name. - /// - /// name. - /// Builder. - public Builder Name(string name) - { - shouldSerialize["name"] = true; - this.name = name; - return this; - } - - /// - /// AppliedMoney. - /// - /// appliedMoney. - /// Builder. - public Builder AppliedMoney(Models.V1Money appliedMoney) - { - this.appliedMoney = appliedMoney; - return this; - } - - /// - /// Rate. - /// - /// rate. - /// Builder. - public Builder Rate(string rate) - { - shouldSerialize["rate"] = true; - this.rate = rate; - return this; - } - - /// - /// InclusionType. - /// - /// inclusionType. - /// Builder. - public Builder InclusionType(string inclusionType) - { - this.inclusionType = inclusionType; - return this; - } - - /// - /// FeeId. - /// - /// feeId. - /// Builder. - public Builder FeeId(string feeId) - { - shouldSerialize["fee_id"] = true; - this.feeId = feeId; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetErrors() - { - this.shouldSerialize["errors"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetName() - { - this.shouldSerialize["name"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetRate() - { - this.shouldSerialize["rate"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetFeeId() - { - this.shouldSerialize["fee_id"] = false; - } - - - /// - /// Builds class object. - /// - /// V1PaymentTax. - public V1PaymentTax Build() - { - return new V1PaymentTax(shouldSerialize, - this.errors, - this.name, - this.appliedMoney, - this.rate, - this.inclusionType, - this.feeId); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1PhoneNumber.cs b/Square/Models/V1PhoneNumber.cs index 5c0d81c6..a68e3dd6 100644 --- a/Square/Models/V1PhoneNumber.cs +++ b/Square/Models/V1PhoneNumber.cs @@ -107,6 +107,11 @@ public class Builder private string callingCode; private string number; + /// + /// Initialize Builder for V1PhoneNumber. + /// + /// callingCode. + /// number. public Builder( string callingCode, string number) diff --git a/Square/Models/V1Refund.cs b/Square/Models/V1Refund.cs deleted file mode 100644 index 86f47489..00000000 --- a/Square/Models/V1Refund.cs +++ /dev/null @@ -1,817 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Http.Client; - using Square.Utilities; - - /// - /// V1Refund. - /// - public class V1Refund - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// type. - /// reason. - /// refunded_money. - /// refunded_processing_fee_money. - /// refunded_tax_money. - /// refunded_additive_tax_money. - /// refunded_additive_tax. - /// refunded_inclusive_tax_money. - /// refunded_inclusive_tax. - /// refunded_tip_money. - /// refunded_discount_money. - /// refunded_surcharge_money. - /// refunded_surcharges. - /// created_at. - /// processed_at. - /// payment_id. - /// merchant_id. - /// is_exchange. - public V1Refund( - string type = null, - string reason = null, - Models.V1Money refundedMoney = null, - Models.V1Money refundedProcessingFeeMoney = null, - Models.V1Money refundedTaxMoney = null, - Models.V1Money refundedAdditiveTaxMoney = null, - IList refundedAdditiveTax = null, - Models.V1Money refundedInclusiveTaxMoney = null, - IList refundedInclusiveTax = null, - Models.V1Money refundedTipMoney = null, - Models.V1Money refundedDiscountMoney = null, - Models.V1Money refundedSurchargeMoney = null, - IList refundedSurcharges = null, - string createdAt = null, - string processedAt = null, - string paymentId = null, - string merchantId = null, - bool? isExchange = null) - { - shouldSerialize = new Dictionary - { - { "reason", false }, - { "refunded_additive_tax", false }, - { "refunded_inclusive_tax", false }, - { "refunded_surcharges", false }, - { "processed_at", false }, - { "payment_id", false }, - { "merchant_id", false }, - { "is_exchange", false } - }; - - this.Type = type; - if (reason != null) - { - shouldSerialize["reason"] = true; - this.Reason = reason; - } - - this.RefundedMoney = refundedMoney; - this.RefundedProcessingFeeMoney = refundedProcessingFeeMoney; - this.RefundedTaxMoney = refundedTaxMoney; - this.RefundedAdditiveTaxMoney = refundedAdditiveTaxMoney; - if (refundedAdditiveTax != null) - { - shouldSerialize["refunded_additive_tax"] = true; - this.RefundedAdditiveTax = refundedAdditiveTax; - } - - this.RefundedInclusiveTaxMoney = refundedInclusiveTaxMoney; - if (refundedInclusiveTax != null) - { - shouldSerialize["refunded_inclusive_tax"] = true; - this.RefundedInclusiveTax = refundedInclusiveTax; - } - - this.RefundedTipMoney = refundedTipMoney; - this.RefundedDiscountMoney = refundedDiscountMoney; - this.RefundedSurchargeMoney = refundedSurchargeMoney; - if (refundedSurcharges != null) - { - shouldSerialize["refunded_surcharges"] = true; - this.RefundedSurcharges = refundedSurcharges; - } - - this.CreatedAt = createdAt; - if (processedAt != null) - { - shouldSerialize["processed_at"] = true; - this.ProcessedAt = processedAt; - } - - if (paymentId != null) - { - shouldSerialize["payment_id"] = true; - this.PaymentId = paymentId; - } - - if (merchantId != null) - { - shouldSerialize["merchant_id"] = true; - this.MerchantId = merchantId; - } - - if (isExchange != null) - { - shouldSerialize["is_exchange"] = true; - this.IsExchange = isExchange; - } - - } - internal V1Refund(Dictionary shouldSerialize, - string type = null, - string reason = null, - Models.V1Money refundedMoney = null, - Models.V1Money refundedProcessingFeeMoney = null, - Models.V1Money refundedTaxMoney = null, - Models.V1Money refundedAdditiveTaxMoney = null, - IList refundedAdditiveTax = null, - Models.V1Money refundedInclusiveTaxMoney = null, - IList refundedInclusiveTax = null, - Models.V1Money refundedTipMoney = null, - Models.V1Money refundedDiscountMoney = null, - Models.V1Money refundedSurchargeMoney = null, - IList refundedSurcharges = null, - string createdAt = null, - string processedAt = null, - string paymentId = null, - string merchantId = null, - bool? isExchange = null) - { - this.shouldSerialize = shouldSerialize; - Type = type; - Reason = reason; - RefundedMoney = refundedMoney; - RefundedProcessingFeeMoney = refundedProcessingFeeMoney; - RefundedTaxMoney = refundedTaxMoney; - RefundedAdditiveTaxMoney = refundedAdditiveTaxMoney; - RefundedAdditiveTax = refundedAdditiveTax; - RefundedInclusiveTaxMoney = refundedInclusiveTaxMoney; - RefundedInclusiveTax = refundedInclusiveTax; - RefundedTipMoney = refundedTipMoney; - RefundedDiscountMoney = refundedDiscountMoney; - RefundedSurchargeMoney = refundedSurchargeMoney; - RefundedSurcharges = refundedSurcharges; - CreatedAt = createdAt; - ProcessedAt = processedAt; - PaymentId = paymentId; - MerchantId = merchantId; - IsExchange = isExchange; - } - - /// - /// Gets http context. - /// - [JsonIgnore] - public HttpContext Context { get; internal set; } - - /// - /// Gets or sets Type. - /// - [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)] - public string Type { get; } - - /// - /// The merchant-specified reason for the refund. - /// - [JsonProperty("reason")] - public string Reason { get; } - - /// - /// Gets or sets RefundedMoney. - /// - [JsonProperty("refunded_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money RefundedMoney { get; } - - /// - /// Gets or sets RefundedProcessingFeeMoney. - /// - [JsonProperty("refunded_processing_fee_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money RefundedProcessingFeeMoney { get; } - - /// - /// Gets or sets RefundedTaxMoney. - /// - [JsonProperty("refunded_tax_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money RefundedTaxMoney { get; } - - /// - /// Gets or sets RefundedAdditiveTaxMoney. - /// - [JsonProperty("refunded_additive_tax_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money RefundedAdditiveTaxMoney { get; } - - /// - /// All of the additive taxes associated with the refund. - /// - [JsonProperty("refunded_additive_tax")] - public IList RefundedAdditiveTax { get; } - - /// - /// Gets or sets RefundedInclusiveTaxMoney. - /// - [JsonProperty("refunded_inclusive_tax_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money RefundedInclusiveTaxMoney { get; } - - /// - /// All of the inclusive taxes associated with the refund. - /// - [JsonProperty("refunded_inclusive_tax")] - public IList RefundedInclusiveTax { get; } - - /// - /// Gets or sets RefundedTipMoney. - /// - [JsonProperty("refunded_tip_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money RefundedTipMoney { get; } - - /// - /// Gets or sets RefundedDiscountMoney. - /// - [JsonProperty("refunded_discount_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money RefundedDiscountMoney { get; } - - /// - /// Gets or sets RefundedSurchargeMoney. - /// - [JsonProperty("refunded_surcharge_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money RefundedSurchargeMoney { get; } - - /// - /// A list of all surcharges associated with the refund. - /// - [JsonProperty("refunded_surcharges")] - public IList RefundedSurcharges { get; } - - /// - /// The time when the merchant initiated the refund for Square to process, in ISO 8601 format. - /// - [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] - public string CreatedAt { get; } - - /// - /// The time when Square processed the refund on behalf of the merchant, in ISO 8601 format. - /// - [JsonProperty("processed_at")] - public string ProcessedAt { get; } - - /// - /// A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders. - /// - [JsonProperty("payment_id")] - public string PaymentId { get; } - - /// - /// Gets or sets MerchantId. - /// - [JsonProperty("merchant_id")] - public string MerchantId { get; } - - /// - /// Indicates whether or not the refund is associated with an exchange. If is_exchange is true, the refund reflects the value of goods returned in the exchange not the total money refunded. - /// - [JsonProperty("is_exchange")] - public bool? IsExchange { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1Refund : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeReason() - { - return this.shouldSerialize["reason"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeRefundedAdditiveTax() - { - return this.shouldSerialize["refunded_additive_tax"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeRefundedInclusiveTax() - { - return this.shouldSerialize["refunded_inclusive_tax"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeRefundedSurcharges() - { - return this.shouldSerialize["refunded_surcharges"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeProcessedAt() - { - return this.shouldSerialize["processed_at"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializePaymentId() - { - return this.shouldSerialize["payment_id"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeMerchantId() - { - return this.shouldSerialize["merchant_id"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeIsExchange() - { - return this.shouldSerialize["is_exchange"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1Refund other && ((this.Context == null && other.Context == null) || (this.Context?.Equals(other.Context) == true)) && - ((this.Type == null && other.Type == null) || (this.Type?.Equals(other.Type) == true)) && - ((this.Reason == null && other.Reason == null) || (this.Reason?.Equals(other.Reason) == true)) && - ((this.RefundedMoney == null && other.RefundedMoney == null) || (this.RefundedMoney?.Equals(other.RefundedMoney) == true)) && - ((this.RefundedProcessingFeeMoney == null && other.RefundedProcessingFeeMoney == null) || (this.RefundedProcessingFeeMoney?.Equals(other.RefundedProcessingFeeMoney) == true)) && - ((this.RefundedTaxMoney == null && other.RefundedTaxMoney == null) || (this.RefundedTaxMoney?.Equals(other.RefundedTaxMoney) == true)) && - ((this.RefundedAdditiveTaxMoney == null && other.RefundedAdditiveTaxMoney == null) || (this.RefundedAdditiveTaxMoney?.Equals(other.RefundedAdditiveTaxMoney) == true)) && - ((this.RefundedAdditiveTax == null && other.RefundedAdditiveTax == null) || (this.RefundedAdditiveTax?.Equals(other.RefundedAdditiveTax) == true)) && - ((this.RefundedInclusiveTaxMoney == null && other.RefundedInclusiveTaxMoney == null) || (this.RefundedInclusiveTaxMoney?.Equals(other.RefundedInclusiveTaxMoney) == true)) && - ((this.RefundedInclusiveTax == null && other.RefundedInclusiveTax == null) || (this.RefundedInclusiveTax?.Equals(other.RefundedInclusiveTax) == true)) && - ((this.RefundedTipMoney == null && other.RefundedTipMoney == null) || (this.RefundedTipMoney?.Equals(other.RefundedTipMoney) == true)) && - ((this.RefundedDiscountMoney == null && other.RefundedDiscountMoney == null) || (this.RefundedDiscountMoney?.Equals(other.RefundedDiscountMoney) == true)) && - ((this.RefundedSurchargeMoney == null && other.RefundedSurchargeMoney == null) || (this.RefundedSurchargeMoney?.Equals(other.RefundedSurchargeMoney) == true)) && - ((this.RefundedSurcharges == null && other.RefundedSurcharges == null) || (this.RefundedSurcharges?.Equals(other.RefundedSurcharges) == true)) && - ((this.CreatedAt == null && other.CreatedAt == null) || (this.CreatedAt?.Equals(other.CreatedAt) == true)) && - ((this.ProcessedAt == null && other.ProcessedAt == null) || (this.ProcessedAt?.Equals(other.ProcessedAt) == true)) && - ((this.PaymentId == null && other.PaymentId == null) || (this.PaymentId?.Equals(other.PaymentId) == true)) && - ((this.MerchantId == null && other.MerchantId == null) || (this.MerchantId?.Equals(other.MerchantId) == true)) && - ((this.IsExchange == null && other.IsExchange == null) || (this.IsExchange?.Equals(other.IsExchange) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 699909783; - - if (this.Context != null) - { - hashCode += this.Context.GetHashCode(); - } - hashCode = HashCode.Combine(this.Type, this.Reason, this.RefundedMoney, this.RefundedProcessingFeeMoney, this.RefundedTaxMoney, this.RefundedAdditiveTaxMoney, this.RefundedAdditiveTax); - - hashCode = HashCode.Combine(hashCode, this.RefundedInclusiveTaxMoney, this.RefundedInclusiveTax, this.RefundedTipMoney, this.RefundedDiscountMoney, this.RefundedSurchargeMoney, this.RefundedSurcharges, this.CreatedAt); - - hashCode = HashCode.Combine(hashCode, this.ProcessedAt, this.PaymentId, this.MerchantId, this.IsExchange); - - return hashCode; - } - internal V1Refund ContextSetter(HttpContext context) - { - this.Context = context; - return this; - } - - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Type = {(this.Type == null ? "null" : this.Type.ToString())}"); - toStringOutput.Add($"this.Reason = {(this.Reason == null ? "null" : this.Reason)}"); - toStringOutput.Add($"this.RefundedMoney = {(this.RefundedMoney == null ? "null" : this.RefundedMoney.ToString())}"); - toStringOutput.Add($"this.RefundedProcessingFeeMoney = {(this.RefundedProcessingFeeMoney == null ? "null" : this.RefundedProcessingFeeMoney.ToString())}"); - toStringOutput.Add($"this.RefundedTaxMoney = {(this.RefundedTaxMoney == null ? "null" : this.RefundedTaxMoney.ToString())}"); - toStringOutput.Add($"this.RefundedAdditiveTaxMoney = {(this.RefundedAdditiveTaxMoney == null ? "null" : this.RefundedAdditiveTaxMoney.ToString())}"); - toStringOutput.Add($"this.RefundedAdditiveTax = {(this.RefundedAdditiveTax == null ? "null" : $"[{string.Join(", ", this.RefundedAdditiveTax)} ]")}"); - toStringOutput.Add($"this.RefundedInclusiveTaxMoney = {(this.RefundedInclusiveTaxMoney == null ? "null" : this.RefundedInclusiveTaxMoney.ToString())}"); - toStringOutput.Add($"this.RefundedInclusiveTax = {(this.RefundedInclusiveTax == null ? "null" : $"[{string.Join(", ", this.RefundedInclusiveTax)} ]")}"); - toStringOutput.Add($"this.RefundedTipMoney = {(this.RefundedTipMoney == null ? "null" : this.RefundedTipMoney.ToString())}"); - toStringOutput.Add($"this.RefundedDiscountMoney = {(this.RefundedDiscountMoney == null ? "null" : this.RefundedDiscountMoney.ToString())}"); - toStringOutput.Add($"this.RefundedSurchargeMoney = {(this.RefundedSurchargeMoney == null ? "null" : this.RefundedSurchargeMoney.ToString())}"); - toStringOutput.Add($"this.RefundedSurcharges = {(this.RefundedSurcharges == null ? "null" : $"[{string.Join(", ", this.RefundedSurcharges)} ]")}"); - toStringOutput.Add($"this.CreatedAt = {(this.CreatedAt == null ? "null" : this.CreatedAt)}"); - toStringOutput.Add($"this.ProcessedAt = {(this.ProcessedAt == null ? "null" : this.ProcessedAt)}"); - toStringOutput.Add($"this.PaymentId = {(this.PaymentId == null ? "null" : this.PaymentId)}"); - toStringOutput.Add($"this.MerchantId = {(this.MerchantId == null ? "null" : this.MerchantId)}"); - toStringOutput.Add($"this.IsExchange = {(this.IsExchange == null ? "null" : this.IsExchange.ToString())}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Type(this.Type) - .Reason(this.Reason) - .RefundedMoney(this.RefundedMoney) - .RefundedProcessingFeeMoney(this.RefundedProcessingFeeMoney) - .RefundedTaxMoney(this.RefundedTaxMoney) - .RefundedAdditiveTaxMoney(this.RefundedAdditiveTaxMoney) - .RefundedAdditiveTax(this.RefundedAdditiveTax) - .RefundedInclusiveTaxMoney(this.RefundedInclusiveTaxMoney) - .RefundedInclusiveTax(this.RefundedInclusiveTax) - .RefundedTipMoney(this.RefundedTipMoney) - .RefundedDiscountMoney(this.RefundedDiscountMoney) - .RefundedSurchargeMoney(this.RefundedSurchargeMoney) - .RefundedSurcharges(this.RefundedSurcharges) - .CreatedAt(this.CreatedAt) - .ProcessedAt(this.ProcessedAt) - .PaymentId(this.PaymentId) - .MerchantId(this.MerchantId) - .IsExchange(this.IsExchange); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "reason", false }, - { "refunded_additive_tax", false }, - { "refunded_inclusive_tax", false }, - { "refunded_surcharges", false }, - { "processed_at", false }, - { "payment_id", false }, - { "merchant_id", false }, - { "is_exchange", false }, - }; - - private string type; - private string reason; - private Models.V1Money refundedMoney; - private Models.V1Money refundedProcessingFeeMoney; - private Models.V1Money refundedTaxMoney; - private Models.V1Money refundedAdditiveTaxMoney; - private IList refundedAdditiveTax; - private Models.V1Money refundedInclusiveTaxMoney; - private IList refundedInclusiveTax; - private Models.V1Money refundedTipMoney; - private Models.V1Money refundedDiscountMoney; - private Models.V1Money refundedSurchargeMoney; - private IList refundedSurcharges; - private string createdAt; - private string processedAt; - private string paymentId; - private string merchantId; - private bool? isExchange; - - /// - /// Type. - /// - /// type. - /// Builder. - public Builder Type(string type) - { - this.type = type; - return this; - } - - /// - /// Reason. - /// - /// reason. - /// Builder. - public Builder Reason(string reason) - { - shouldSerialize["reason"] = true; - this.reason = reason; - return this; - } - - /// - /// RefundedMoney. - /// - /// refundedMoney. - /// Builder. - public Builder RefundedMoney(Models.V1Money refundedMoney) - { - this.refundedMoney = refundedMoney; - return this; - } - - /// - /// RefundedProcessingFeeMoney. - /// - /// refundedProcessingFeeMoney. - /// Builder. - public Builder RefundedProcessingFeeMoney(Models.V1Money refundedProcessingFeeMoney) - { - this.refundedProcessingFeeMoney = refundedProcessingFeeMoney; - return this; - } - - /// - /// RefundedTaxMoney. - /// - /// refundedTaxMoney. - /// Builder. - public Builder RefundedTaxMoney(Models.V1Money refundedTaxMoney) - { - this.refundedTaxMoney = refundedTaxMoney; - return this; - } - - /// - /// RefundedAdditiveTaxMoney. - /// - /// refundedAdditiveTaxMoney. - /// Builder. - public Builder RefundedAdditiveTaxMoney(Models.V1Money refundedAdditiveTaxMoney) - { - this.refundedAdditiveTaxMoney = refundedAdditiveTaxMoney; - return this; - } - - /// - /// RefundedAdditiveTax. - /// - /// refundedAdditiveTax. - /// Builder. - public Builder RefundedAdditiveTax(IList refundedAdditiveTax) - { - shouldSerialize["refunded_additive_tax"] = true; - this.refundedAdditiveTax = refundedAdditiveTax; - return this; - } - - /// - /// RefundedInclusiveTaxMoney. - /// - /// refundedInclusiveTaxMoney. - /// Builder. - public Builder RefundedInclusiveTaxMoney(Models.V1Money refundedInclusiveTaxMoney) - { - this.refundedInclusiveTaxMoney = refundedInclusiveTaxMoney; - return this; - } - - /// - /// RefundedInclusiveTax. - /// - /// refundedInclusiveTax. - /// Builder. - public Builder RefundedInclusiveTax(IList refundedInclusiveTax) - { - shouldSerialize["refunded_inclusive_tax"] = true; - this.refundedInclusiveTax = refundedInclusiveTax; - return this; - } - - /// - /// RefundedTipMoney. - /// - /// refundedTipMoney. - /// Builder. - public Builder RefundedTipMoney(Models.V1Money refundedTipMoney) - { - this.refundedTipMoney = refundedTipMoney; - return this; - } - - /// - /// RefundedDiscountMoney. - /// - /// refundedDiscountMoney. - /// Builder. - public Builder RefundedDiscountMoney(Models.V1Money refundedDiscountMoney) - { - this.refundedDiscountMoney = refundedDiscountMoney; - return this; - } - - /// - /// RefundedSurchargeMoney. - /// - /// refundedSurchargeMoney. - /// Builder. - public Builder RefundedSurchargeMoney(Models.V1Money refundedSurchargeMoney) - { - this.refundedSurchargeMoney = refundedSurchargeMoney; - return this; - } - - /// - /// RefundedSurcharges. - /// - /// refundedSurcharges. - /// Builder. - public Builder RefundedSurcharges(IList refundedSurcharges) - { - shouldSerialize["refunded_surcharges"] = true; - this.refundedSurcharges = refundedSurcharges; - return this; - } - - /// - /// CreatedAt. - /// - /// createdAt. - /// Builder. - public Builder CreatedAt(string createdAt) - { - this.createdAt = createdAt; - return this; - } - - /// - /// ProcessedAt. - /// - /// processedAt. - /// Builder. - public Builder ProcessedAt(string processedAt) - { - shouldSerialize["processed_at"] = true; - this.processedAt = processedAt; - return this; - } - - /// - /// PaymentId. - /// - /// paymentId. - /// Builder. - public Builder PaymentId(string paymentId) - { - shouldSerialize["payment_id"] = true; - this.paymentId = paymentId; - return this; - } - - /// - /// MerchantId. - /// - /// merchantId. - /// Builder. - public Builder MerchantId(string merchantId) - { - shouldSerialize["merchant_id"] = true; - this.merchantId = merchantId; - return this; - } - - /// - /// IsExchange. - /// - /// isExchange. - /// Builder. - public Builder IsExchange(bool? isExchange) - { - shouldSerialize["is_exchange"] = true; - this.isExchange = isExchange; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetReason() - { - this.shouldSerialize["reason"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetRefundedAdditiveTax() - { - this.shouldSerialize["refunded_additive_tax"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetRefundedInclusiveTax() - { - this.shouldSerialize["refunded_inclusive_tax"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetRefundedSurcharges() - { - this.shouldSerialize["refunded_surcharges"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetProcessedAt() - { - this.shouldSerialize["processed_at"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetPaymentId() - { - this.shouldSerialize["payment_id"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetMerchantId() - { - this.shouldSerialize["merchant_id"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetIsExchange() - { - this.shouldSerialize["is_exchange"] = false; - } - - - /// - /// Builds class object. - /// - /// V1Refund. - public V1Refund Build() - { - return new V1Refund(shouldSerialize, - this.type, - this.reason, - this.refundedMoney, - this.refundedProcessingFeeMoney, - this.refundedTaxMoney, - this.refundedAdditiveTaxMoney, - this.refundedAdditiveTax, - this.refundedInclusiveTaxMoney, - this.refundedInclusiveTax, - this.refundedTipMoney, - this.refundedDiscountMoney, - this.refundedSurchargeMoney, - this.refundedSurcharges, - this.createdAt, - this.processedAt, - this.paymentId, - this.merchantId, - this.isExchange); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1Settlement.cs b/Square/Models/V1Settlement.cs deleted file mode 100644 index 9f509554..00000000 --- a/Square/Models/V1Settlement.cs +++ /dev/null @@ -1,364 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Http.Client; - using Square.Utilities; - - /// - /// V1Settlement. - /// - public class V1Settlement - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// id. - /// status. - /// total_money. - /// initiated_at. - /// bank_account_id. - /// entries. - public V1Settlement( - string id = null, - string status = null, - Models.V1Money totalMoney = null, - string initiatedAt = null, - string bankAccountId = null, - IList entries = null) - { - shouldSerialize = new Dictionary - { - { "initiated_at", false }, - { "bank_account_id", false }, - { "entries", false } - }; - - this.Id = id; - this.Status = status; - this.TotalMoney = totalMoney; - if (initiatedAt != null) - { - shouldSerialize["initiated_at"] = true; - this.InitiatedAt = initiatedAt; - } - - if (bankAccountId != null) - { - shouldSerialize["bank_account_id"] = true; - this.BankAccountId = bankAccountId; - } - - if (entries != null) - { - shouldSerialize["entries"] = true; - this.Entries = entries; - } - - } - internal V1Settlement(Dictionary shouldSerialize, - string id = null, - string status = null, - Models.V1Money totalMoney = null, - string initiatedAt = null, - string bankAccountId = null, - IList entries = null) - { - this.shouldSerialize = shouldSerialize; - Id = id; - Status = status; - TotalMoney = totalMoney; - InitiatedAt = initiatedAt; - BankAccountId = bankAccountId; - Entries = entries; - } - - /// - /// Gets http context. - /// - [JsonIgnore] - public HttpContext Context { get; internal set; } - - /// - /// The settlement's unique identifier. - /// - [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] - public string Id { get; } - - /// - /// Gets or sets Status. - /// - [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] - public string Status { get; } - - /// - /// Gets or sets TotalMoney. - /// - [JsonProperty("total_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money TotalMoney { get; } - - /// - /// The time when the settlement was submitted for deposit or withdrawal, in ISO 8601 format. - /// - [JsonProperty("initiated_at")] - public string InitiatedAt { get; } - - /// - /// The Square-issued unique identifier for the bank account associated with the settlement. - /// - [JsonProperty("bank_account_id")] - public string BankAccountId { get; } - - /// - /// The entries included in this settlement. - /// - [JsonProperty("entries")] - public IList Entries { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1Settlement : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeInitiatedAt() - { - return this.shouldSerialize["initiated_at"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeBankAccountId() - { - return this.shouldSerialize["bank_account_id"]; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializeEntries() - { - return this.shouldSerialize["entries"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1Settlement other && ((this.Context == null && other.Context == null) || (this.Context?.Equals(other.Context) == true)) && - ((this.Id == null && other.Id == null) || (this.Id?.Equals(other.Id) == true)) && - ((this.Status == null && other.Status == null) || (this.Status?.Equals(other.Status) == true)) && - ((this.TotalMoney == null && other.TotalMoney == null) || (this.TotalMoney?.Equals(other.TotalMoney) == true)) && - ((this.InitiatedAt == null && other.InitiatedAt == null) || (this.InitiatedAt?.Equals(other.InitiatedAt) == true)) && - ((this.BankAccountId == null && other.BankAccountId == null) || (this.BankAccountId?.Equals(other.BankAccountId) == true)) && - ((this.Entries == null && other.Entries == null) || (this.Entries?.Equals(other.Entries) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 388412647; - - if (this.Context != null) - { - hashCode += this.Context.GetHashCode(); - } - hashCode = HashCode.Combine(this.Id, this.Status, this.TotalMoney, this.InitiatedAt, this.BankAccountId, this.Entries); - - return hashCode; - } - internal V1Settlement ContextSetter(HttpContext context) - { - this.Context = context; - return this; - } - - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.Id = {(this.Id == null ? "null" : this.Id)}"); - toStringOutput.Add($"this.Status = {(this.Status == null ? "null" : this.Status.ToString())}"); - toStringOutput.Add($"this.TotalMoney = {(this.TotalMoney == null ? "null" : this.TotalMoney.ToString())}"); - toStringOutput.Add($"this.InitiatedAt = {(this.InitiatedAt == null ? "null" : this.InitiatedAt)}"); - toStringOutput.Add($"this.BankAccountId = {(this.BankAccountId == null ? "null" : this.BankAccountId)}"); - toStringOutput.Add($"this.Entries = {(this.Entries == null ? "null" : $"[{string.Join(", ", this.Entries)} ]")}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .Id(this.Id) - .Status(this.Status) - .TotalMoney(this.TotalMoney) - .InitiatedAt(this.InitiatedAt) - .BankAccountId(this.BankAccountId) - .Entries(this.Entries); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "initiated_at", false }, - { "bank_account_id", false }, - { "entries", false }, - }; - - private string id; - private string status; - private Models.V1Money totalMoney; - private string initiatedAt; - private string bankAccountId; - private IList entries; - - /// - /// Id. - /// - /// id. - /// Builder. - public Builder Id(string id) - { - this.id = id; - return this; - } - - /// - /// Status. - /// - /// status. - /// Builder. - public Builder Status(string status) - { - this.status = status; - return this; - } - - /// - /// TotalMoney. - /// - /// totalMoney. - /// Builder. - public Builder TotalMoney(Models.V1Money totalMoney) - { - this.totalMoney = totalMoney; - return this; - } - - /// - /// InitiatedAt. - /// - /// initiatedAt. - /// Builder. - public Builder InitiatedAt(string initiatedAt) - { - shouldSerialize["initiated_at"] = true; - this.initiatedAt = initiatedAt; - return this; - } - - /// - /// BankAccountId. - /// - /// bankAccountId. - /// Builder. - public Builder BankAccountId(string bankAccountId) - { - shouldSerialize["bank_account_id"] = true; - this.bankAccountId = bankAccountId; - return this; - } - - /// - /// Entries. - /// - /// entries. - /// Builder. - public Builder Entries(IList entries) - { - shouldSerialize["entries"] = true; - this.entries = entries; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetInitiatedAt() - { - this.shouldSerialize["initiated_at"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetBankAccountId() - { - this.shouldSerialize["bank_account_id"] = false; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetEntries() - { - this.shouldSerialize["entries"] = false; - } - - - /// - /// Builds class object. - /// - /// V1Settlement. - public V1Settlement Build() - { - return new V1Settlement(shouldSerialize, - this.id, - this.status, - this.totalMoney, - this.initiatedAt, - this.bankAccountId, - this.entries); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1SettlementEntry.cs b/Square/Models/V1SettlementEntry.cs deleted file mode 100644 index 32c0dd23..00000000 --- a/Square/Models/V1SettlementEntry.cs +++ /dev/null @@ -1,241 +0,0 @@ -namespace Square.Models -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.IO; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using APIMatic.Core.Utilities.Converters; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using Square; - using Square.Utilities; - - /// - /// V1SettlementEntry. - /// - public class V1SettlementEntry - { - private readonly Dictionary shouldSerialize; - /// - /// Initializes a new instance of the class. - /// - /// payment_id. - /// type. - /// amount_money. - /// fee_money. - public V1SettlementEntry( - string paymentId = null, - string type = null, - Models.V1Money amountMoney = null, - Models.V1Money feeMoney = null) - { - shouldSerialize = new Dictionary - { - { "payment_id", false } - }; - - if (paymentId != null) - { - shouldSerialize["payment_id"] = true; - this.PaymentId = paymentId; - } - - this.Type = type; - this.AmountMoney = amountMoney; - this.FeeMoney = feeMoney; - } - internal V1SettlementEntry(Dictionary shouldSerialize, - string paymentId = null, - string type = null, - Models.V1Money amountMoney = null, - Models.V1Money feeMoney = null) - { - this.shouldSerialize = shouldSerialize; - PaymentId = paymentId; - Type = type; - AmountMoney = amountMoney; - FeeMoney = feeMoney; - } - - /// - /// The settlement's unique identifier. - /// - [JsonProperty("payment_id")] - public string PaymentId { get; } - - /// - /// Gets or sets Type. - /// - [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)] - public string Type { get; } - - /// - /// Gets or sets AmountMoney. - /// - [JsonProperty("amount_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money AmountMoney { get; } - - /// - /// Gets or sets FeeMoney. - /// - [JsonProperty("fee_money", NullValueHandling = NullValueHandling.Ignore)] - public Models.V1Money FeeMoney { get; } - - /// - public override string ToString() - { - var toStringOutput = new List(); - - this.ToString(toStringOutput); - - return $"V1SettlementEntry : ({string.Join(", ", toStringOutput)})"; - } - - /// - /// Checks if the field should be serialized or not. - /// - /// A boolean weather the field should be serialized or not. - public bool ShouldSerializePaymentId() - { - return this.shouldSerialize["payment_id"]; - } - - /// - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - - if (obj == this) - { - return true; - } - return obj is V1SettlementEntry other && ((this.PaymentId == null && other.PaymentId == null) || (this.PaymentId?.Equals(other.PaymentId) == true)) && - ((this.Type == null && other.Type == null) || (this.Type?.Equals(other.Type) == true)) && - ((this.AmountMoney == null && other.AmountMoney == null) || (this.AmountMoney?.Equals(other.AmountMoney) == true)) && - ((this.FeeMoney == null && other.FeeMoney == null) || (this.FeeMoney?.Equals(other.FeeMoney) == true)); - } - - /// - public override int GetHashCode() - { - int hashCode = 2064570648; - hashCode = HashCode.Combine(this.PaymentId, this.Type, this.AmountMoney, this.FeeMoney); - - return hashCode; - } - /// - /// ToString overload. - /// - /// List of strings. - protected void ToString(List toStringOutput) - { - toStringOutput.Add($"this.PaymentId = {(this.PaymentId == null ? "null" : this.PaymentId)}"); - toStringOutput.Add($"this.Type = {(this.Type == null ? "null" : this.Type.ToString())}"); - toStringOutput.Add($"this.AmountMoney = {(this.AmountMoney == null ? "null" : this.AmountMoney.ToString())}"); - toStringOutput.Add($"this.FeeMoney = {(this.FeeMoney == null ? "null" : this.FeeMoney.ToString())}"); - } - - /// - /// Converts to builder object. - /// - /// Builder. - public Builder ToBuilder() - { - var builder = new Builder() - .PaymentId(this.PaymentId) - .Type(this.Type) - .AmountMoney(this.AmountMoney) - .FeeMoney(this.FeeMoney); - return builder; - } - - /// - /// Builder class. - /// - public class Builder - { - private Dictionary shouldSerialize = new Dictionary - { - { "payment_id", false }, - }; - - private string paymentId; - private string type; - private Models.V1Money amountMoney; - private Models.V1Money feeMoney; - - /// - /// PaymentId. - /// - /// paymentId. - /// Builder. - public Builder PaymentId(string paymentId) - { - shouldSerialize["payment_id"] = true; - this.paymentId = paymentId; - return this; - } - - /// - /// Type. - /// - /// type. - /// Builder. - public Builder Type(string type) - { - this.type = type; - return this; - } - - /// - /// AmountMoney. - /// - /// amountMoney. - /// Builder. - public Builder AmountMoney(Models.V1Money amountMoney) - { - this.amountMoney = amountMoney; - return this; - } - - /// - /// FeeMoney. - /// - /// feeMoney. - /// Builder. - public Builder FeeMoney(Models.V1Money feeMoney) - { - this.feeMoney = feeMoney; - return this; - } - - /// - /// Marks the field to not be serailized. - /// - public void UnsetPaymentId() - { - this.shouldSerialize["payment_id"] = false; - } - - - /// - /// Builds class object. - /// - /// V1SettlementEntry. - public V1SettlementEntry Build() - { - return new V1SettlementEntry(shouldSerialize, - this.paymentId, - this.type, - this.amountMoney, - this.feeMoney); - } - } - } -} \ No newline at end of file diff --git a/Square/Models/V1UpdateOrderRequest.cs b/Square/Models/V1UpdateOrderRequest.cs index c5e0310a..61153103 100644 --- a/Square/Models/V1UpdateOrderRequest.cs +++ b/Square/Models/V1UpdateOrderRequest.cs @@ -233,6 +233,10 @@ public class Builder private string refundedNote; private string canceledNote; + /// + /// Initialize Builder for V1UpdateOrderRequest. + /// + /// action. public Builder( string action) { diff --git a/Square/Models/VendorContact.cs b/Square/Models/VendorContact.cs index 30910d4c..787de319 100644 --- a/Square/Models/VendorContact.cs +++ b/Square/Models/VendorContact.cs @@ -250,6 +250,10 @@ public class Builder private string phoneNumber; private bool? removed; + /// + /// Initialize Builder for VendorContact. + /// + /// ordinal. public Builder( int ordinal) { diff --git a/Square/Models/WorkweekConfig.cs b/Square/Models/WorkweekConfig.cs index ac80f011..0b5e87a0 100644 --- a/Square/Models/WorkweekConfig.cs +++ b/Square/Models/WorkweekConfig.cs @@ -164,6 +164,11 @@ public class Builder private string createdAt; private string updatedAt; + /// + /// Initialize Builder for WorkweekConfig. + /// + /// startOfWeek. + /// startOfDayLocalTime. public Builder( string startOfWeek, string startOfDayLocalTime) diff --git a/Square/Square.csproj b/Square/Square.csproj index 0b83ec72..0b95e422 100644 --- a/Square/Square.csproj +++ b/Square/Square.csproj @@ -4,19 +4,21 @@ netstandard2.0 Square - 34.0.1.0 + 35.0.0.0 Square Developer Platform Square Developer Platform Square Copyright © 2019 - 34.0.1.0 - 34.0.1.0 + 35.0.0.0 + 35.0.0.0 .NET client library for the Square API 7.3 true Square README.md LICENSE + + true diff --git a/Square/SquareClient.cs b/Square/SquareClient.cs index d50beb33..d18aa95f 100644 --- a/Square/SquareClient.cs +++ b/Square/SquareClient.cs @@ -43,9 +43,8 @@ public sealed class SquareClient : ISquareClient }; private readonly GlobalConfiguration globalConfiguration; - private const string userAgent = "Square-DotNet-SDK/34.0.1 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}"; + private const string userAgent = "Square-DotNet-SDK/35.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}"; private readonly HttpCallBack httpCallBack; - private readonly BearerAuthManager bearerAuthManager; private readonly IDictionary> additionalHeaders; private readonly Lazy mobileAuthorization; private readonly Lazy oAuth; @@ -94,7 +93,7 @@ private SquareClient( string userAgentDetail, Environment environment, string customUrl, - string accessToken, + BearerAuthModel bearerAuthModel, HttpCallBack httpCallBack, IDictionary> additionalHeaders, IHttpClientConfiguration httpClientConfiguration) @@ -106,10 +105,11 @@ private SquareClient( this.httpCallBack = httpCallBack; this.additionalHeaders = additionalHeaders; this.HttpClientConfiguration = httpClientConfiguration; - bearerAuthManager = new BearerAuthManager(accessToken); + BearerAuthModel = bearerAuthModel; + var bearerAuthManager = new BearerAuthManager(bearerAuthModel); globalConfiguration = new GlobalConfiguration.Builder() .AuthManagers(new Dictionary { - {"global", bearerAuthManager} + {"global", bearerAuthManager}, }) .ApiCallback(httpCallBack) .HttpConfiguration(httpClientConfiguration) @@ -121,6 +121,7 @@ private SquareClient( .UserAgent(userAgent, GetUserAgentConfig()) .Build(); + BearerAuthCredentials = bearerAuthManager; this.mobileAuthorization = new Lazy( () => new MobileAuthorizationApi(globalConfiguration)); @@ -419,7 +420,7 @@ private SquareClient( /// /// Gets the current version of the SDK. /// - public string SdkVersion => "34.0.1"; + public string SdkVersion => "35.0.0"; /// /// Gets the configuration of the Http Client associated with this client. @@ -458,7 +459,12 @@ private SquareClient( /// /// Gets the credentials to use with BearerAuth. /// - private IBearerAuthCredentials BearerAuthCredentials => this.bearerAuthManager; + public IBearerAuthCredentials BearerAuthCredentials { get; private set; } + + /// + /// Gets the credentials model to use with BearerAuth. + /// + public BearerAuthModel BearerAuthModel { get; private set; } /// /// Gets the access token to use with OAuth 2 authentication. @@ -487,11 +493,15 @@ public Builder ToBuilder() .UserAgentDetail(this.UserAgentDetail) .Environment(this.Environment) .CustomUrl(this.CustomUrl) - .AccessToken(BearerAuthCredentials.AccessToken) .AdditionalHeaders(additionalHeaders) .HttpCallBack(httpCallBack) .HttpClientConfig(config => config.Build()); + if (BearerAuthModel != null) + { + builder.BearerAuthCredentials(BearerAuthModel.ToBuilder().Build()); + } + return builder; } @@ -537,7 +547,9 @@ internal static SquareClient CreateFromEnvironment() if (accessToken != null) { - builder.AccessToken(accessToken); + builder.BearerAuthCredentials(new BearerAuthModel + .Builder(accessToken) + .Build()); } return builder.Build(); @@ -566,11 +578,11 @@ private void SetupAdditionalHeaders(AdditionalHeaderParams additionalHeaderParam /// public class Builder { - private string squareVersion = "2024-01-18"; + private string squareVersion = "2024-02-22"; private string userAgentDetail = null; private Environment environment = Square.Environment.Production; private string customUrl = "https://connect.squareup.com"; - private string accessToken = ""; + private BearerAuthModel bearerAuthModel = new BearerAuthModel(); private HttpClientConfiguration.Builder httpClientConfig = new HttpClientConfiguration.Builder(); private HttpCallBack httpCallBack; private IDictionary> additionalHeaders = new Dictionary>(); @@ -580,9 +592,28 @@ public class Builder /// /// AccessToken. /// Builder. + [Obsolete("This method is deprecated. Use BearerAuthCredentials(bearerAuthModel) instead.")] public Builder AccessToken(string accessToken) { - this.accessToken = accessToken ?? throw new ArgumentNullException(nameof(accessToken)); + bearerAuthModel = bearerAuthModel.ToBuilder() + .AccessToken(accessToken) + .Build(); + return this; + } + + /// + /// Sets credentials for BearerAuth. + /// + /// BearerAuthModel. + /// Builder. + public Builder BearerAuthCredentials(BearerAuthModel bearerAuthModel) + { + if (bearerAuthModel is null) + { + throw new ArgumentNullException(nameof(bearerAuthModel)); + } + + this.bearerAuthModel = bearerAuthModel; return this; } @@ -711,12 +742,16 @@ internal Builder HttpCallBack(HttpCallBack httpCallBack) public SquareClient Build() { + if (bearerAuthModel.AccessToken == null) + { + bearerAuthModel = null; + } return new SquareClient( squareVersion, userAgentDetail, environment, customUrl, - accessToken, + bearerAuthModel, httpCallBack, additionalHeaders, httpClientConfig.Build()); diff --git a/doc/api/checkout.md b/doc/api/checkout.md index 39b01c32..bdb0bdad 100644 --- a/doc/api/checkout.md +++ b/doc/api/checkout.md @@ -348,7 +348,7 @@ ListPaymentLinksAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `cursor` | `string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
If a cursor is not provided, the endpoint returns the first page of the results.
For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). | +| `cursor` | `string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
If a cursor is not provided, the endpoint returns the first page of the results.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | | `limit` | `int?` | Query, Optional | A limit on the number of results to return per page. The limit is advisory and
the implementation might return more or less results. If the supplied limit is negative, zero, or
greater than the maximum limit of 1000, it is ignored.

Default value: `100` | ## Response Type diff --git a/doc/api/customers.md b/doc/api/customers.md index c79ffad5..b32e595a 100644 --- a/doc/api/customers.md +++ b/doc/api/customers.md @@ -12,6 +12,10 @@ ICustomersApi customersApi = client.CustomersApi; * [List Customers](../../doc/api/customers.md#list-customers) * [Create Customer](../../doc/api/customers.md#create-customer) +* [Bulk Create Customers](../../doc/api/customers.md#bulk-create-customers) +* [Bulk Delete Customers](../../doc/api/customers.md#bulk-delete-customers) +* [Bulk Retrieve Customers](../../doc/api/customers.md#bulk-retrieve-customers) +* [Bulk Update Customers](../../doc/api/customers.md#bulk-update-customers) * [Search Customers](../../doc/api/customers.md#search-customers) * [Delete Customer](../../doc/api/customers.md#delete-customer) * [Retrieve Customer](../../doc/api/customers.md#retrieve-customer) @@ -136,6 +140,239 @@ catch (ApiException e) ``` +# Bulk Create Customers + +Creates multiple [customer profiles](../../doc/models/customer.md) for a business. + +This endpoint takes a map of individual create requests and returns a map of responses. + +You must provide at least one of the following values in each create request: + +- `given_name` +- `family_name` +- `company_name` +- `email_address` +- `phone_number` + +```csharp +BulkCreateCustomersAsync( + Models.BulkCreateCustomersRequest body) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkCreateCustomersRequest`](../../doc/models/bulk-create-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +[`Task`](../../doc/models/bulk-create-customers-response.md) + +## Example Usage + +```csharp +Models.BulkCreateCustomersRequest body = new Models.BulkCreateCustomersRequest.Builder( + new Dictionary + { + ["8bb76c4f-e35d-4c5b-90de-1194cd9179f0"] = new Models.BulkCreateCustomerData.Builder() + .GivenName("Amelia") + .FamilyName("Earhart") + .EmailAddress("Amelia.Earhart@example.com") + .Address( + new Models.Address.Builder() + .AddressLine1("500 Electric Ave") + .AddressLine2("Suite 600") + .Locality("New York") + .AdministrativeDistrictLevel1("NY") + .PostalCode("10003") + .Country("US") + .Build()) + .PhoneNumber("+1-212-555-4240") + .ReferenceId("YOUR_REFERENCE_ID") + .Note("a customer") + .Build(), + ["d1689f23-b25d-4932-b2f0-aed00f5e2029"] = new Models.BulkCreateCustomerData.Builder() + .GivenName("Marie") + .FamilyName("Curie") + .EmailAddress("Marie.Curie@example.com") + .Address( + new Models.Address.Builder() + .AddressLine1("500 Electric Ave") + .AddressLine2("Suite 601") + .Locality("New York") + .AdministrativeDistrictLevel1("NY") + .PostalCode("10003") + .Country("US") + .Build()) + .PhoneNumber("+1-212-444-4240") + .ReferenceId("YOUR_REFERENCE_ID") + .Note("another customer") + .Build(), + } +) +.Build(); + +try +{ + BulkCreateCustomersResponse result = await customersApi.BulkCreateCustomersAsync(body); +} +catch (ApiException e) +{ + // TODO: Handle exception here + Console.WriteLine(e.Message); +} +``` + + +# Bulk Delete Customers + +Deletes multiple customer profiles. + +The endpoint takes a list of customer IDs and returns a map of responses. + +```csharp +BulkDeleteCustomersAsync( + Models.BulkDeleteCustomersRequest body) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkDeleteCustomersRequest`](../../doc/models/bulk-delete-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +[`Task`](../../doc/models/bulk-delete-customers-response.md) + +## Example Usage + +```csharp +Models.BulkDeleteCustomersRequest body = new Models.BulkDeleteCustomersRequest.Builder( + new List + { + "8DDA5NZVBZFGAX0V3HPF81HHE0", + "N18CPRVXR5214XPBBA6BZQWF3C", + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8", + } +) +.Build(); + +try +{ + BulkDeleteCustomersResponse result = await customersApi.BulkDeleteCustomersAsync(body); +} +catch (ApiException e) +{ + // TODO: Handle exception here + Console.WriteLine(e.Message); +} +``` + + +# Bulk Retrieve Customers + +Retrieves multiple customer profiles. + +This endpoint takes a list of customer IDs and returns a map of responses. + +```csharp +BulkRetrieveCustomersAsync( + Models.BulkRetrieveCustomersRequest body) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkRetrieveCustomersRequest`](../../doc/models/bulk-retrieve-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +[`Task`](../../doc/models/bulk-retrieve-customers-response.md) + +## Example Usage + +```csharp +Models.BulkRetrieveCustomersRequest body = new Models.BulkRetrieveCustomersRequest.Builder( + new List + { + "8DDA5NZVBZFGAX0V3HPF81HHE0", + "N18CPRVXR5214XPBBA6BZQWF3C", + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8", + } +) +.Build(); + +try +{ + BulkRetrieveCustomersResponse result = await customersApi.BulkRetrieveCustomersAsync(body); +} +catch (ApiException e) +{ + // TODO: Handle exception here + Console.WriteLine(e.Message); +} +``` + + +# Bulk Update Customers + +Updates multiple customer profiles. + +This endpoint takes a map of individual update requests and returns a map of responses. + +You cannot use this endpoint to change cards on file. To make changes, use the [Cards API](../../doc/api/cards.md) or [Gift Cards API](../../doc/api/gift-cards.md). + +```csharp +BulkUpdateCustomersAsync( + Models.BulkUpdateCustomersRequest body) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkUpdateCustomersRequest`](../../doc/models/bulk-update-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +[`Task`](../../doc/models/bulk-update-customers-response.md) + +## Example Usage + +```csharp +Models.BulkUpdateCustomersRequest body = new Models.BulkUpdateCustomersRequest.Builder( + new Dictionary + { + ["8DDA5NZVBZFGAX0V3HPF81HHE0"] = new Models.BulkUpdateCustomerData.Builder() + .EmailAddress("New.Amelia.Earhart@example.com") + .PhoneNumber("phone_number2") + .Note("updated customer note") + .Version(2L) + .Build(), + ["N18CPRVXR5214XPBBA6BZQWF3C"] = new Models.BulkUpdateCustomerData.Builder() + .GivenName("Marie") + .FamilyName("Curie") + .Version(0L) + .Build(), + } +) +.Build(); + +try +{ + BulkUpdateCustomersResponse result = await customersApi.BulkUpdateCustomersAsync(body); +} +catch (ApiException e) +{ + // TODO: Handle exception here + Console.WriteLine(e.Message); +} +``` + + # Search Customers Searches the customer profiles associated with a Square account using one or more supported query filters. @@ -223,9 +460,6 @@ catch (ApiException e) Deletes a customer profile from a business. This operation also unlinks any associated cards on file. -As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. -If included, the value must be set to the current version of the customer profile. - To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. ```csharp @@ -299,11 +533,7 @@ catch (ApiException e) # Update Customer Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request. -To add or update a field, specify the new value. To remove a field, specify `null` -(recommended) or specify an empty string (string fields only). - -As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. -If included, the value must be set to the current version of the customer profile. +To add or update a field, specify the new value. To remove a field, specify `null`. To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. @@ -332,7 +562,7 @@ UpdateCustomerAsync( string customerId = "customer_id8"; Models.UpdateCustomerRequest body = new Models.UpdateCustomerRequest.Builder() .EmailAddress("New.Amelia.Earhart@example.com") -.PhoneNumber("") +.PhoneNumber("phone_number2") .Note("updated customer note") .Version(2L) .Build(); diff --git a/doc/api/invoices.md b/doc/api/invoices.md index 360cf598..a2607a20 100644 --- a/doc/api/invoices.md +++ b/doc/api/invoices.md @@ -517,9 +517,12 @@ nothing. Square also makes the invoice available on a Square-hosted invoice page The invoice `status` also changes from `DRAFT` to a status based on the invoice configuration. For example, the status changes to `UNPAID` if -Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion of the +Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the invoice amount. +In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ` +and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments. + ```csharp PublishInvoiceAsync( string invoiceId, diff --git a/doc/api/locations.md b/doc/api/locations.md index 82cdaa15..a46ddfba 100644 --- a/doc/api/locations.md +++ b/doc/api/locations.md @@ -19,7 +19,7 @@ ILocationsApi locationsApi = client.LocationsApi; # List Locations Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api), -including those with an inactive status. +including those with an inactive status. Locations are listed alphabetically by `name`. ```csharp ListLocationsAsync() diff --git a/doc/api/v1-transactions.md b/doc/api/v1-transactions.md index d1ed607d..908d8677 100644 --- a/doc/api/v1-transactions.md +++ b/doc/api/v1-transactions.md @@ -13,12 +13,6 @@ IV1TransactionsApi v1TransactionsApi = client.V1TransactionsApi; * [V1 List Orders](../../doc/api/v1-transactions.md#v1-list-orders) * [V1 Retrieve Order](../../doc/api/v1-transactions.md#v1-retrieve-order) * [V1 Update Order](../../doc/api/v1-transactions.md#v1-update-order) -* [V1 List Payments](../../doc/api/v1-transactions.md#v1-list-payments) -* [V1 Retrieve Payment](../../doc/api/v1-transactions.md#v1-retrieve-payment) -* [V1 List Refunds](../../doc/api/v1-transactions.md#v1-list-refunds) -* [V1 Create Refund](../../doc/api/v1-transactions.md#v1-create-refund) -* [V1 List Settlements](../../doc/api/v1-transactions.md#v1-list-settlements) -* [V1 Retrieve Settlement](../../doc/api/v1-transactions.md#v1-retrieve-settlement) # V1 List Orders @@ -157,334 +151,3 @@ catch (ApiException e) } ``` - -# V1 List Payments - -**This endpoint is deprecated.** - -Provides summary information for all payments taken for a given -Square account during a date range. Date ranges cannot exceed 1 year in -length. See Date ranges for details of inclusive and exclusive dates. - -*Note**: Details for payments processed with Square Point of Sale while -in offline mode may not be transmitted to Square for up to 72 hours. -Offline payments have a `created_at` value that reflects the time the -payment was originally processed, not the time it was subsequently -transmitted to Square. Consequently, the ListPayments endpoint might -list an offline payment chronologically between online payments that -were seen in a previous request. - -```csharp -V1ListPaymentsAsync( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null, - bool? includePartial = false) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the location to list payments for. If you specify me, this endpoint returns payments aggregated from all of the business's locations. | -| `order` | [`string`](../../doc/models/sort-order.md) | Query, Optional | The order in which payments are listed in the response. | -| `beginTime` | `string` | Query, Optional | The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year. | -| `endTime` | `string` | Query, Optional | The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. | -| `limit` | `int?` | Query, Optional | The maximum number of payments to return in a single response. This value cannot exceed 200. | -| `batchToken` | `string` | Query, Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | -| `includePartial` | `bool?` | Query, Optional | Indicates whether or not to include partial payments in the response. Partial payments will have the tenders collected so far, but the itemizations will be empty until the payment is completed. | - -## Response Type - -[`Task>`](../../doc/models/v1-payment.md) - -## Example Usage - -```csharp -string locationId = "location_id4"; -bool? includePartial = false; -try -{ - List result = await v1TransactionsApi.V1ListPaymentsAsync( - locationId, - null, - null, - null, - null, - null, - includePartial - ); -} -catch (ApiException e) -{ - // TODO: Handle exception here - Console.WriteLine(e.Message); -} -``` - - -# V1 Retrieve Payment - -**This endpoint is deprecated.** - -Provides comprehensive information for a single payment. - -```csharp -V1RetrievePaymentAsync( - string locationId, - string paymentId) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the payment's associated location. | -| `paymentId` | `string` | Template, Required | The Square-issued payment ID. payment_id comes from Payment objects returned by the List Payments endpoint, Settlement objects returned by the List Settlements endpoint, or Refund objects returned by the List Refunds endpoint. | - -## Response Type - -[`Task`](../../doc/models/v1-payment.md) - -## Example Usage - -```csharp -string locationId = "location_id4"; -string paymentId = "payment_id0"; -try -{ - V1Payment result = await v1TransactionsApi.V1RetrievePaymentAsync( - locationId, - paymentId - ); -} -catch (ApiException e) -{ - // TODO: Handle exception here - Console.WriteLine(e.Message); -} -``` - - -# V1 List Refunds - -**This endpoint is deprecated.** - -Provides the details for all refunds initiated by a merchant or any of the merchant's mobile staff during a date range. Date ranges cannot exceed one year in length. - -```csharp -V1ListRefundsAsync( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string batchToken = null) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the location to list refunds for. | -| `order` | [`string`](../../doc/models/sort-order.md) | Query, Optional | The order in which payments are listed in the response. | -| `beginTime` | `string` | Query, Optional | The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year. | -| `endTime` | `string` | Query, Optional | The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. | -| `limit` | `int?` | Query, Optional | The approximate number of refunds to return in a single response. Default: 100. Max: 200. Response may contain more results than the prescribed limit when refunds are made simultaneously to multiple tenders in a payment or when refunds are generated in an exchange to account for the value of returned goods. | -| `batchToken` | `string` | Query, Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | - -## Response Type - -[`Task>`](../../doc/models/v1-refund.md) - -## Example Usage - -```csharp -string locationId = "location_id4"; -try -{ - List result = await v1TransactionsApi.V1ListRefundsAsync(locationId); -} -catch (ApiException e) -{ - // TODO: Handle exception here - Console.WriteLine(e.Message); -} -``` - - -# V1 Create Refund - -**This endpoint is deprecated.** - -Issues a refund for a previously processed payment. You must issue -a refund within 60 days of the associated payment. - -You cannot issue a partial refund for a split tender payment. You must -instead issue a full or partial refund for a particular tender, by -providing the applicable tender id to the V1CreateRefund endpoint. -Issuing a full refund for a split tender payment refunds all tenders -associated with the payment. - -Issuing a refund for a card payment is not reversible. For development -purposes, you can create fake cash payments in Square Point of Sale and -refund them. - -```csharp -V1CreateRefundAsync( - string locationId, - Models.V1CreateRefundRequest body) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the original payment's associated location. | -| `body` | [`V1CreateRefundRequest`](../../doc/models/v1-create-refund-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -[`Task`](../../doc/models/v1-refund.md) - -## Example Usage - -```csharp -string locationId = "location_id4"; -Models.V1CreateRefundRequest body = new Models.V1CreateRefundRequest.Builder( - "payment_id6", - "FULL", - "reason8" -) -.Build(); - -try -{ - V1Refund result = await v1TransactionsApi.V1CreateRefundAsync( - locationId, - body - ); -} -catch (ApiException e) -{ - // TODO: Handle exception here - Console.WriteLine(e.Message); -} -``` - - -# V1 List Settlements - -**This endpoint is deprecated.** - -Provides summary information for all deposits and withdrawals -initiated by Square to a linked bank account during a date range. Date -ranges cannot exceed one year in length. - -*Note**: the ListSettlements endpoint does not provide entry -information. - -```csharp -V1ListSettlementsAsync( - string locationId, - string order = null, - string beginTime = null, - string endTime = null, - int? limit = null, - string status = null, - string batchToken = null) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the location to list settlements for. If you specify me, this endpoint returns settlements aggregated from all of the business's locations. | -| `order` | [`string`](../../doc/models/sort-order.md) | Query, Optional | The order in which settlements are listed in the response. | -| `beginTime` | `string` | Query, Optional | The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year. | -| `endTime` | `string` | Query, Optional | The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. | -| `limit` | `int?` | Query, Optional | The maximum number of settlements to return in a single response. This value cannot exceed 200. | -| `status` | [`string`](../../doc/models/v1-list-settlements-request-status.md) | Query, Optional | Provide this parameter to retrieve only settlements with a particular status (SENT or FAILED). | -| `batchToken` | `string` | Query, Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | - -## Response Type - -[`Task>`](../../doc/models/v1-settlement.md) - -## Example Usage - -```csharp -string locationId = "location_id4"; -try -{ - List result = await v1TransactionsApi.V1ListSettlementsAsync(locationId); -} -catch (ApiException e) -{ - // TODO: Handle exception here - Console.WriteLine(e.Message); -} -``` - - -# V1 Retrieve Settlement - -**This endpoint is deprecated.** - -Provides comprehensive information for a single settlement. - -The returned `Settlement` objects include an `entries` field that lists -the transactions that contribute to the settlement total. Most -settlement entries correspond to a payment payout, but settlement -entries are also generated for less common events, like refunds, manual -adjustments, or chargeback holds. - -Square initiates its regular deposits as indicated in the -[Deposit Options with Square](https://squareup.com/help/us/en/article/3807) -help article. Details for a regular deposit are usually not available -from Connect API endpoints before 10 p.m. PST the same day. - -Square does not know when an initiated settlement **completes**, only -whether it has failed. A completed settlement is typically reflected in -a bank account within 3 business days, but in exceptional cases it may -take longer. - -```csharp -V1RetrieveSettlementAsync( - string locationId, - string settlementId) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the settlements's associated location. | -| `settlementId` | `string` | Template, Required | The settlement's Square-issued ID. You obtain this value from Settlement objects returned by the List Settlements endpoint. | - -## Response Type - -[`Task`](../../doc/models/v1-settlement.md) - -## Example Usage - -```csharp -string locationId = "location_id4"; -string settlementId = "settlement_id0"; -try -{ - V1Settlement result = await v1TransactionsApi.V1RetrieveSettlementAsync( - locationId, - settlementId - ); -} -catch (ApiException e) -{ - // TODO: Handle exception here - Console.WriteLine(e.Message); -} -``` - diff --git a/doc/auth/oauth-2-bearer-token.md b/doc/auth/oauth-2-bearer-token.md new file mode 100644 index 00000000..8982e447 --- /dev/null +++ b/doc/auth/oauth-2-bearer-token.md @@ -0,0 +1,34 @@ + +# OAuth 2 Bearer token + + + +Documentation for accessing and setting credentials for global. + +## Auth Credentials + +| Name | Type | Description | Setter | Getter | +| --- | --- | --- | --- | --- | +| AccessToken | `string` | The OAuth 2.0 Access Token to use for API requests. | `AccessToken` | `AccessToken` | + + + +**Note:** Auth credentials can be set using `BearerAuthCredentials` in the client builder and accessed through `BearerAuthCredentials` method in the client instance. + +## Usage Example + +### Client Initialization + +You must provide credentials in the client as shown in the following code snippet. + +```csharp +Square.SquareClient client = new Square.SquareClient.Builder() + .BearerAuthCredentials( + new BearerAuthModel.Builder( + "AccessToken" + ) + .Build()) + .Build(); +``` + + diff --git a/doc/client.md b/doc/client.md index 2af8a8a1..3e02450b 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,19 +5,23 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `SquareVersion` | `string` | Square Connect API versions
*Default*: `"2024-01-18"` | +| `SquareVersion` | `string` | Square Connect API versions
*Default*: `"2024-02-22"` | | `CustomUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`
*Default*: `"https://connect.squareup.com"` | | `Environment` | `string` | The API environment.
**Default: `production`** | | `Timeout` | `TimeSpan` | Http client timeout.
*Default*: `TimeSpan.FromSeconds(60)` | | `UserAgentDetail` | `string` | User-Agent detail.
*Default*: `"null"` | -| `AccessToken` | `string` | The OAuth 2.0 Access Token to use for API requests. | +| `BearerAuthCredentials` | [`BearerAuthCredentials`](auth/oauth-2-bearer-token.md) | The Credentials Setter for OAuth 2 Bearer token | The API client can be initialized as follows: ```csharp Square.SquareClient client = new Square.SquareClient.Builder() - .AccessToken("AccessToken") - .SquareVersion("2024-01-18") + .BearerAuthCredentials( + new BearerAuthModel.Builder( + "AccessToken" + ) + .Build()) + .SquareVersion("2024-02-22") .Environment(Square.Environment.Production) .CustomUrl("https://connect.squareup.com") .Build(); @@ -27,6 +31,7 @@ Square.SquareClient client = new Square.SquareClient.Builder() ```csharp using Square.Apis; +using Square.Authentication; using Square.Exceptions; using Square.Models; using System; @@ -39,8 +44,12 @@ namespace Testing public static async Task Main() { SquareClient client = new SquareClient.Builder() - .AccessToken("AccessToken") - .SquareVersion("2024-01-18") + .BearerAuthCredentials( + new BearerAuthModel.Builder( + "AccessToken" + ) + .Build()) + .SquareVersion("2024-02-22") .Build(); ILocationsApi locationsApi = client.LocationsApi; @@ -121,6 +130,7 @@ The gateway for the SDK. This class acts as a factory for the Apis and also hold | UserAgentDetail | User-Agent detail. | `string` | | Environment | Current API environment. | `Environment` | | CustomUrl | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com` | `string` | +| BearerAuthCredentials | Gets the credentials to use with BearerAuth. | [`IBearerAuthCredentials`](auth/oauth-2-bearer-token.md) | ### Methods @@ -145,4 +155,5 @@ Class to build instances of SquareClient. | `UserAgentDetail(string userAgentDetail)` | User-Agent detail. | `Builder` | | `Environment(Environment environment)` | Current API environment. | `Builder` | | `CustomUrl(string customUrl)` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com` | `Builder` | +| `BearerAuthCredentials(Action action)` | Sets credentials for BearerAuth. | `Builder` | diff --git a/doc/models/activity-type.md b/doc/models/activity-type.md index f2157dcf..69a5808e 100644 --- a/doc/models/activity-type.md +++ b/doc/models/activity-type.md @@ -12,40 +12,56 @@ | `ADJUSTMENT` | A manual adjustment applied to the seller's account by Square. | | `APP_FEE_REFUND` | A refund for an application fee on a payment. | | `APP_FEE_REVENUE` | Revenue generated from an application fee on a payment. | -| `AUTOMATIC_SAVINGS` | An automatic transfer from the payment processing balance to the Square Savings account.
These are, generally, proportional to the seller's sales. | -| `AUTOMATIC_SAVINGS_REVERSED` | An automatic transfer from the Square Savings account back to the processing balance.
These are, generally, proportional to the seller's refunds. | +| `AUTOMATIC_SAVINGS` | An automatic transfer from the payment processing balance to the Square Savings account. These are generally proportional to the seller's sales. | +| `AUTOMATIC_SAVINGS_REVERSED` | An automatic transfer from the Square Savings account back to the processing balance. These are generally proportional to the seller's refunds. | | `CHARGE` | A credit card payment capture. | | `DEPOSIT_FEE` | Any fees involved with deposits such as instant deposits. | | `DISPUTE` | The balance change due to a dispute event. | | `ESCHEATMENT` | An escheatment entry for remittance. | -| `FEE` | The Square processing fee. | +| `FEE` | The cost plus adjustment fee. | | `FREE_PROCESSING` | Square offers free payments processing for a variety of business scenarios, including seller
referrals or when Square wants to apologize (for example, for a bug, customer service, or repricing complication).
This entry represents a credit to the seller for the purposes of free processing. | | `HOLD_ADJUSTMENT` | An adjustment made by Square related to holding a payment. | -| `INITIAL_BALANCE_CHANGE` | An external change to a seller's balance. Initial, in the sense that it
causes the creation of the other activity types, such as hold and refund. | +| `INITIAL_BALANCE_CHANGE` | An external change to a seller's balance (initial, in the sense that it causes the creation of the other activity types, such as a hold and refund). | | `MONEY_TRANSFER` | The balance change from a money transfer. | | `MONEY_TRANSFER_REVERSAL` | The reversal of a money transfer. | -| `OPEN_DISPUTE` | The balance change for a chargeback that has been filed. | -| `OTHER` | Any other type that does not belong in the rest of the types. | -| `OTHER_ADJUSTMENT` | Any other type of adjustment that does not fall under existing types. | -| `PAID_SERVICE_FEE` | A fee paid to a third-party merchant. | -| `PAID_SERVICE_FEE_REFUND` | A fee paid to a third-party merchant. | +| `OPEN_DISPUTE` | The balance change for a chargeback that's been filed. | +| `OTHER` | Any other type that doesn't belong in the rest of the types. | +| `OTHER_ADJUSTMENT` | Any other type of adjustment that doesn't fall under existing types. | +| `PAID_SERVICE_FEE` | A fee paid to a third-party seller. | +| `PAID_SERVICE_FEE_REFUND` | A fee refunded to a third-party seller. | | `REDEMPTION_CODE` | Repayment for a redemption code. | | `REFUND` | A refund for an existing card payment. | | `RELEASE_ADJUSTMENT` | An adjustment made by Square related to releasing a payment. | -| `RESERVE_HOLD` | Fees paid for funding risk reserve. | -| `RESERVE_RELEASE` | Fees released from risk reserve. | +| `RESERVE_HOLD` | Fees paid for a funding risk reserve. | +| `RESERVE_RELEASE` | Fees released from a risk reserve. | | `RETURNED_PAYOUT` | An entry created when Square receives a response for the ACH file that Square sent indicating that the
settlement of the original entry failed. | -| `SQUARE_CAPITAL_PAYMENT` | A capital merchant cash advance (MCA) assessment. These are, generally,
proportional to the merchant's sales but can be issued for other reasons related to the MCA. | -| `SQUARE_CAPITAL_REVERSED_PAYMENT` | A capital merchant cash advance (MCA) assessment refund. These are, generally,
proportional to the merchant's refunds but can be issued for other reasons related to the MCA. | +| `SQUARE_CAPITAL_PAYMENT` | A capital merchant cash advance (MCA) assessment. These are generally proportional to the merchant's sales but can be issued for other reasons related to the MCA. | +| `SQUARE_CAPITAL_REVERSED_PAYMENT` | A capital merchant cash advance (MCA) assessment refund. These are generally proportional to the merchant's refunds but can be issued for other reasons related to the MCA. | | `SUBSCRIPTION_FEE` | A fee charged for subscription to a Square product. | -| `SUBSCRIPTION_FEE_PAID_REFUND` | A Square subscription fee that has been refunded. | +| `SUBSCRIPTION_FEE_PAID_REFUND` | A Square subscription fee that's been refunded. | | `SUBSCRIPTION_FEE_REFUND` | The refund of a previously charged Square product subscription fee. | | `TAX_ON_FEE` | The tax paid on fee amounts. | | `THIRD_PARTY_FEE` | Fees collected by a third-party platform. | | `THIRD_PARTY_FEE_REFUND` | Refunded fees from a third-party platform. | -| `PAYOUT` | Balance change due to money transfer. | -| `AUTOMATIC_BITCOIN_CONVERSIONS` | Indicates the withholding of a portion of each payment by Square that has been
automatically converted into bitcoin using Cash App. The seller manages their bitcoin in
their Cash App account. | -| `AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED` | Indicates a return of the payment withholding that had been scheduled to be converted
into bitcoin using Cash App to the Square payments balance. | -| `CREDIT_CARD_REPAYMENT` | The repayment made toward the outstanding balance on the seller's Square credit card. | -| `CREDIT_CARD_REPAYMENT_REVERSED` | The reversal of the repayment made toward the outstanding balance on the seller's
Square credit card. | +| `PAYOUT` | The balance change due to money transfer. | +| `AUTOMATIC_BITCOIN_CONVERSIONS` | Indicates that the portion of each payment withheld by Square was automatically converted into bitcoin using Cash App. The seller manages their bitcoin in their Cash App account. | +| `AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED` | Indicates that a withheld payment, which was scheduled to be converted into bitcoin using Cash App, was deposited back to the Square payments balance. | +| `CREDIT_CARD_REPAYMENT` | Indicates that a repayment toward the outstanding balance on the seller's Square credit card was made. | +| `CREDIT_CARD_REPAYMENT_REVERSED` | Indicates that a repayment toward the outstanding balance on the seller's Square credit card was reversed. | +| `LOCAL_OFFERS_CASHBACK` | Cashback amount given by a Square Local Offers seller to their customer for a purchase. | +| `LOCAL_OFFERS_FEE` | A commission fee paid by a Square Local Offers seller to Square for a purchase discovered through Square Local Offers. | +| `PERCENTAGE_PROCESSING_ENROLLMENT` | When activating Percentage Processing, a credit is applied to the seller’s account to offset any negative balance caused by a dispute. | +| `PERCENTAGE_PROCESSING_DEACTIVATION` | Deducting the outstanding Percentage Processing balance from the seller’s account. It's the final installment in repaying the dispute-induced negative balance through percentage processing. | +| `PERCENTAGE_PROCESSING_REPAYMENT` | Withheld funds from a payment to cover a negative balance. It's an installment to repay the amount from a dispute that had been offset during Percentage Processing enrollment. | +| `PERCENTAGE_PROCESSING_REPAYMENT_REVERSED` | The reversal of a percentage processing repayment that happens for example when a refund is issued for a payment. | +| `PROCESSING_FEE` | The processing fee for a payment. If sellers opt for Gross Settlement, i.e., direct bank withdrawal instead of deducting fees from daily sales, the processing fee is recorded separately as a new payout entry, not part of the CHARGE payout entry. | +| `PROCESSING_FEE_REFUND` | The processing fee for a payment refund issued by sellers enrolled in Gross Settlement. The refunded processing fee is recorded separately as a new payout entry, not part of the REFUND payout entry. | +| `UNDO_PROCESSING_FEE_REFUND` | When undoing a processing fee refund in a Gross Settlement payment, this payout entry type is used. | +| `GIFT_CARD_LOAD_FEE` | Fee collected during the sale or reload of a gift card. This fee, which is a portion of the amount loaded on the gift card, is deducted from the merchant's payment balance. | +| `GIFT_CARD_LOAD_FEE_REFUND` | Refund for fee charged during the sale or reload of a gift card. | +| `UNDO_GIFT_CARD_LOAD_FEE_REFUND` | The undo of a refund for a fee charged during the sale or reload of a gift card. | +| `BALANCE_FOLDERS_TRANSFER` | A transfer of funds to a banking folder. In the United States, the folder name is 'Checking Folder'; in Canada, it's 'Balance Folder.' | +| `BALANCE_FOLDERS_TRANSFER_REVERSED` | A reversal of transfer of funds from a banking folder. In the United States, the folder name is 'Checking Folder'; in Canada, it's 'Balance Folder.' | +| `GIFT_CARD_POOL_TRANSFER` | A transfer of gift card funds to a central gift card pool account. In franchises, when gift cards are loaded or reloaded at any location, the money transfers to the franchisor's account. | +| `GIFT_CARD_POOL_TRANSFER_REVERSED` | A reversal of transfer of gift card funds from a central gift card pool account. In franchises, when gift cards are loaded or reloaded at any location, the money transfers to the franchisor's account. | diff --git a/doc/models/bulk-create-customer-data.md b/doc/models/bulk-create-customer-data.md new file mode 100644 index 00000000..f3b92646 --- /dev/null +++ b/doc/models/bulk-create-customer-data.md @@ -0,0 +1,38 @@ + +# Bulk Create Customer Data + +Defines the customer data provided in individual create requests for a +[BulkCreateCustomers](../../doc/api/customers.md#bulk-create-customers) operation. + +## Structure + +`BulkCreateCustomerData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `GivenName` | `string` | Optional | The given name (that is, the first name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | +| `FamilyName` | `string` | Optional | The family name (that is, the last name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | +| `CompanyName` | `string` | Optional | A business name associated with the customer profile.
**Constraints**: *Maximum Length*: `500` | +| `Nickname` | `string` | Optional | A nickname for the customer profile.
**Constraints**: *Maximum Length*: `100` | +| `EmailAddress` | `string` | Optional | The email address associated with the customer profile.
**Constraints**: *Maximum Length*: `254` | +| `Address` | [`Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `PhoneNumber` | `string` | Optional | The phone number associated with the customer profile. The phone number must be valid
and can contain 9–16 digits, with an optional `+` prefix and country code. For more information,
see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). | +| `ReferenceId` | `string` | Optional | An optional second ID used to associate the customer profile with an
entity in another system.
**Constraints**: *Maximum Length*: `100` | +| `Note` | `string` | Optional | A custom note associated with the customer profile. | +| `Birthday` | `string` | Optional | The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format.
For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21.
Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or
`0000` if a birth year is not specified. | +| `TaxIds` | [`CustomerTaxIds`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom.
For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). | + +## Example (as JSON) + +```json +{ + "given_name": "given_name4", + "family_name": "family_name4", + "company_name": "company_name8", + "nickname": "nickname8", + "email_address": "email_address0" +} +``` + diff --git a/doc/models/bulk-create-customers-request.md b/doc/models/bulk-create-customers-request.md new file mode 100644 index 00000000..41c50229 --- /dev/null +++ b/doc/models/bulk-create-customers-request.md @@ -0,0 +1,61 @@ + +# Bulk Create Customers Request + +Defines the body parameters that can be included in requests to the +[BulkCreateCustomers](../../doc/api/customers.md#bulk-create-customers) endpoint. + +## Structure + +`BulkCreateCustomersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Customers` | [`IDictionary`](../../doc/models/bulk-create-customer-data.md) | Required | A map of 1 to 100 individual create requests, represented by `idempotency key: { customer data }`
key-value pairs.

Each key is an [idempotency key](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)
that uniquely identifies the create request. Each value contains the customer data used to create the
customer profile. | + +## Example (as JSON) + +```json +{ + "customers": { + "8bb76c4f-e35d-4c5b-90de-1194cd9179f0": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "reference_id": "YOUR_REFERENCE_ID", + "company_name": "company_name8", + "nickname": "nickname8" + }, + "d1689f23-b25d-4932-b2f0-aed00f5e2029": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 601", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "email_address": "Marie.Curie@example.com", + "family_name": "Curie", + "given_name": "Marie", + "note": "another customer", + "phone_number": "+1-212-444-4240", + "reference_id": "YOUR_REFERENCE_ID", + "company_name": "company_name8", + "nickname": "nickname8" + } + } +} +``` + diff --git a/doc/models/bulk-create-customers-response.md b/doc/models/bulk-create-customers-response.md new file mode 100644 index 00000000..d92b4048 --- /dev/null +++ b/doc/models/bulk-create-customers-response.md @@ -0,0 +1,150 @@ + +# Bulk Create Customers Response + +Defines the fields included in the response body from the +[BulkCreateCustomers](../../doc/api/customers.md#bulk-create-customers) endpoint. + +## Structure + +`BulkCreateCustomersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Responses` | [`IDictionary`](../../doc/models/create-customer-response.md) | Optional | A map of responses that correspond to individual create requests, represented by
key-value pairs.

Each key is the idempotency key that was provided for a create request and each value
is the corresponding response.
If the request succeeds, the value is the new customer profile.
If the request fails, the value contains any errors that occurred during the request. | +| `Errors` | [`IList`](../../doc/models/error.md) | Optional | Any top-level errors that prevented the bulk operation from running. | + +## Example (as JSON) + +```json +{ + "responses": { + "8bb76c4f-e35d-4c5b-90de-1194cd9179f4": { + "customer": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2024-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "8DDA5NZVBZFGAX0V3HPF81HHE0", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "updated_at": "2024-03-23T20:21:54.859Z", + "version": 0, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] + }, + "d1689f23-b25d-4932-b2f0-aed00f5e2029": { + "customer": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 601", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2024-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "Marie.Curie@example.com", + "family_name": "Curie", + "given_name": "Marie", + "id": "N18CPRVXR5214XPBBA6BZQWF3C", + "note": "another customer", + "phone_number": "+1-212-444-4240", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "updated_at": "2024-03-23T20:21:54.859Z", + "version": 0, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/doc/models/bulk-delete-customers-request.md b/doc/models/bulk-delete-customers-request.md new file mode 100644 index 00000000..57b3521b --- /dev/null +++ b/doc/models/bulk-delete-customers-request.md @@ -0,0 +1,28 @@ + +# Bulk Delete Customers Request + +Defines the body parameters that can be included in requests to the +[BulkDeleteCustomers](../../doc/api/customers.md#bulk-delete-customers) endpoint. + +## Structure + +`BulkDeleteCustomersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CustomerIds` | `IList` | Required | The IDs of the [customer profiles](entity:Customer) to delete. | + +## Example (as JSON) + +```json +{ + "customer_ids": [ + "8DDA5NZVBZFGAX0V3HPF81HHE0", + "N18CPRVXR5214XPBBA6BZQWF3C", + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" + ] +} +``` + diff --git a/doc/models/bulk-delete-customers-response.md b/doc/models/bulk-delete-customers-response.md new file mode 100644 index 00000000..f4bfbd16 --- /dev/null +++ b/doc/models/bulk-delete-customers-response.md @@ -0,0 +1,94 @@ + +# Bulk Delete Customers Response + +Defines the fields included in the response body from the +[BulkDeleteCustomers](../../doc/api/customers.md#bulk-delete-customers) endpoint. + +## Structure + +`BulkDeleteCustomersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Responses` | [`IDictionary`](../../doc/models/delete-customer-response.md) | Optional | A map of responses that correspond to individual delete requests, represented by
key-value pairs.

Each key is the customer ID that was specified for a delete request and each value
is the corresponding response.
If the request succeeds, the value is an empty object (`{ }`).
If the request fails, the value contains any errors that occurred during the request. | +| `Errors` | [`IList`](../../doc/models/error.md) | Optional | Any top-level errors that prevented the bulk operation from running. | + +## Example (as JSON) + +```json +{ + "responses": { + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "NOT_FOUND", + "detail": "Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found.", + "field": "field4" + } + ] + }, + "8DDA5NZVBZFGAX0V3HPF81HHE0": { + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] + }, + "N18CPRVXR5214XPBBA6BZQWF3C": { + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/doc/models/bulk-retrieve-customers-request.md b/doc/models/bulk-retrieve-customers-request.md new file mode 100644 index 00000000..905e646a --- /dev/null +++ b/doc/models/bulk-retrieve-customers-request.md @@ -0,0 +1,28 @@ + +# Bulk Retrieve Customers Request + +Defines the body parameters that can be included in requests to the +[BulkRetrieveCustomers](../../doc/api/customers.md#bulk-retrieve-customers) endpoint. + +## Structure + +`BulkRetrieveCustomersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CustomerIds` | `IList` | Required | The IDs of the [customer profiles](entity:Customer) to retrieve. | + +## Example (as JSON) + +```json +{ + "customer_ids": [ + "8DDA5NZVBZFGAX0V3HPF81HHE0", + "N18CPRVXR5214XPBBA6BZQWF3C", + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" + ] +} +``` + diff --git a/doc/models/bulk-retrieve-customers-response.md b/doc/models/bulk-retrieve-customers-response.md new file mode 100644 index 00000000..c9243f61 --- /dev/null +++ b/doc/models/bulk-retrieve-customers-response.md @@ -0,0 +1,142 @@ + +# Bulk Retrieve Customers Response + +Defines the fields included in the response body from the +[BulkRetrieveCustomers](../../doc/api/customers.md#bulk-retrieve-customers) endpoint. + +## Structure + +`BulkRetrieveCustomersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Responses` | [`IDictionary`](../../doc/models/retrieve-customer-response.md) | Optional | A map of responses that correspond to individual retrieve requests, represented by
key-value pairs.

Each key is the customer ID that was specified for a retrieve request and each value
is the corresponding response.
If the request succeeds, the value is the requested customer profile.
If the request fails, the value contains any errors that occurred during the request. | +| `Errors` | [`IList`](../../doc/models/error.md) | Optional | Any top-level errors that prevented the bulk operation from running. | + +## Example (as JSON) + +```json +{ + "responses": { + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "NOT_FOUND", + "detail": "Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found.", + "field": "field4" + } + ], + "customer": { + "id": "id0", + "created_at": "created_at2", + "updated_at": "updated_at4", + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ], + "given_name": "given_name2" + } + }, + "8DDA5NZVBZFGAX0V3HPF81HHE0": { + "customer": { + "birthday": "1897-07-24", + "created_at": "2024-01-19T00:27:54.59Z", + "creation_source": "THIRD_PARTY", + "email_address": "New.Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "8DDA5NZVBZFGAX0V3HPF81HHE0", + "note": "updated customer note", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2024-01-19T00:38:06Z", + "version": 3 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] + }, + "N18CPRVXR5214XPBBA6BZQWF3C": { + "customer": { + "created_at": "2024-01-19T00:27:54.59Z", + "creation_source": "THIRD_PARTY", + "family_name": "Curie", + "given_name": "Marie", + "id": "N18CPRVXR5214XPBBA6BZQWF3C", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2024-01-19T00:38:06Z", + "version": 1 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/doc/models/bulk-update-customer-data.md b/doc/models/bulk-update-customer-data.md new file mode 100644 index 00000000..72eb36b0 --- /dev/null +++ b/doc/models/bulk-update-customer-data.md @@ -0,0 +1,39 @@ + +# Bulk Update Customer Data + +Defines the customer data provided in individual update requests for a +[BulkUpdateCustomers](../../doc/api/customers.md#bulk-update-customers) operation. + +## Structure + +`BulkUpdateCustomerData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `GivenName` | `string` | Optional | The given name (that is, the first name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | +| `FamilyName` | `string` | Optional | The family name (that is, the last name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | +| `CompanyName` | `string` | Optional | A business name associated with the customer profile.
**Constraints**: *Maximum Length*: `500` | +| `Nickname` | `string` | Optional | A nickname for the customer profile.
**Constraints**: *Maximum Length*: `100` | +| `EmailAddress` | `string` | Optional | The email address associated with the customer profile.
**Constraints**: *Maximum Length*: `254` | +| `Address` | [`Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `PhoneNumber` | `string` | Optional | The phone number associated with the customer profile. The phone number must be valid
and can contain 9–16 digits, with an optional `+` prefix and country code. For more information,
see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). | +| `ReferenceId` | `string` | Optional | An optional second ID used to associate the customer profile with an
entity in another system.
**Constraints**: *Maximum Length*: `100` | +| `Note` | `string` | Optional | An custom note associates with the customer profile. | +| `Birthday` | `string` | Optional | The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format.
For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21.
Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or
`0000` if a birth year is not specified. | +| `TaxIds` | [`CustomerTaxIds`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom.
For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). | +| `Version` | `long?` | Optional | The current version of the customer profile.

As a best practice, you should include this field to enable
[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
control. | + +## Example (as JSON) + +```json +{ + "given_name": "given_name4", + "family_name": "family_name4", + "company_name": "company_name8", + "nickname": "nickname8", + "email_address": "email_address0" +} +``` + diff --git a/doc/models/bulk-update-customers-request.md b/doc/models/bulk-update-customers-request.md new file mode 100644 index 00000000..b3a85e90 --- /dev/null +++ b/doc/models/bulk-update-customers-request.md @@ -0,0 +1,43 @@ + +# Bulk Update Customers Request + +Defines the body parameters that can be included in requests to the +[BulkUpdateCustomers](../../doc/api/customers.md#bulk-update-customers) endpoint. + +## Structure + +`BulkUpdateCustomersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Customers` | [`IDictionary`](../../doc/models/bulk-update-customer-data.md) | Required | A map of 1 to 100 individual update requests, represented by `customer ID: { customer data }`
key-value pairs.

Each key is the ID of the [customer profile](entity:Customer) to update. To update a customer profile
that was created by merging existing profiles, provide the ID of the newly created profile.

Each value contains the updated customer data. Only new or changed fields are required. To add or
update a field, specify the new value. To remove a field, specify `null`. | + +## Example (as JSON) + +```json +{ + "customers": { + "8DDA5NZVBZFGAX0V3HPF81HHE0": { + "email_address": "New.Amelia.Earhart@example.com", + "note": "updated customer note", + "phone_number": null, + "version": 2, + "given_name": "given_name4", + "family_name": "family_name6", + "company_name": "company_name8", + "nickname": "nickname8" + }, + "N18CPRVXR5214XPBBA6BZQWF3C": { + "family_name": "Curie", + "given_name": "Marie", + "version": 0, + "company_name": "company_name8", + "nickname": "nickname8", + "email_address": "email_address0" + } + } +} +``` + diff --git a/doc/models/bulk-update-customers-response.md b/doc/models/bulk-update-customers-response.md new file mode 100644 index 00000000..8da3fd7f --- /dev/null +++ b/doc/models/bulk-update-customers-response.md @@ -0,0 +1,135 @@ + +# Bulk Update Customers Response + +Defines the fields included in the response body from the +[BulkUpdateCustomers](../../doc/api/customers.md#bulk-update-customers) endpoint. + +## Structure + +`BulkUpdateCustomersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Responses` | [`IDictionary`](../../doc/models/update-customer-response.md) | Optional | A map of responses that correspond to individual update requests, represented by
key-value pairs.

Each key is the customer ID that was specified for an update request and each value
is the corresponding response.
If the request succeeds, the value is the updated customer profile.
If the request fails, the value contains any errors that occurred during the request. | +| `Errors` | [`IList`](../../doc/models/error.md) | Optional | Any top-level errors that prevented the bulk operation from running. | + +## Example (as JSON) + +```json +{ + "responses": { + "8DDA5NZVBZFGAX0V3HPF81HHE0": { + "customer": { + "birthday": "1897-07-24", + "created_at": "2024-01-19T00:27:54.59Z", + "creation_source": "THIRD_PARTY", + "email_address": "New.Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "8DDA5NZVBZFGAX0V3HPF81HHE0", + "note": "updated customer note", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2024-01-19T00:38:06Z", + "version": 3, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] + }, + "N18CPRVXR5214XPBBA6BZQWF3C": { + "customer": { + "created_at": "2024-01-19T00:27:54.59Z", + "creation_source": "THIRD_PARTY", + "family_name": "Curie", + "given_name": "Marie", + "id": "N18CPRVXR5214XPBBA6BZQWF3C", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2024-01-19T00:38:06Z", + "version": 1, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/doc/models/catalog-item-modifier-list-info.md b/doc/models/catalog-item-modifier-list-info.md index 60cc6a09..fea629aa 100644 --- a/doc/models/catalog-item-modifier-list-info.md +++ b/doc/models/catalog-item-modifier-list-info.md @@ -1,7 +1,8 @@ # Catalog Item Modifier List Info -Options to control the properties of a `CatalogModifierList` applied to a `CatalogItem` instance. +References a text-based modifier or a list of non text-based modifiers applied to a `CatalogItem` instance +and specifies supported behaviors of the application. ## Structure @@ -16,6 +17,7 @@ Options to control the properties of a `CatalogModifierList` applied to a `Catal | `MinSelectedModifiers` | `int?` | Optional | If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this `CatalogModifierList`. | | `MaxSelectedModifiers` | `int?` | Optional | If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this `CatalogModifierList`. | | `Enabled` | `bool?` | Optional | If `true`, enable this `CatalogModifierList`. The default value is `true`. | +| `Ordinal` | `int?` | Optional | The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` list applied
to a `CatalogItem` instance. | ## Example (as JSON) @@ -34,7 +36,8 @@ Options to control the properties of a `CatalogModifierList` applied to a `Catal ], "min_selected_modifiers": 170, "max_selected_modifiers": 66, - "enabled": false + "enabled": false, + "ordinal": 204 } ``` diff --git a/doc/models/catalog-modifier-list-modifier-type.md b/doc/models/catalog-modifier-list-modifier-type.md new file mode 100644 index 00000000..eede3572 --- /dev/null +++ b/doc/models/catalog-modifier-list-modifier-type.md @@ -0,0 +1,16 @@ + +# Catalog Modifier List Modifier Type + +Defines the type of `CatalogModifierList`. + +## Enumeration + +`CatalogModifierListModifierType` + +## Fields + +| Name | Description | +| --- | --- | +| `LIST` | The `CatalogModifierList` instance is a non-empty list of non text-based modifiers. | +| `TEXT` | The `CatalogModifierList` instance is a single text-based modifier. | + diff --git a/doc/models/catalog-modifier-list.md b/doc/models/catalog-modifier-list.md index 07950d91..7e30a284 100644 --- a/doc/models/catalog-modifier-list.md +++ b/doc/models/catalog-modifier-list.md @@ -1,12 +1,18 @@ # Catalog Modifier List -A list of modifiers applicable to items at the time of sale. +For a text-based modifier, this encapsulates the modifier's text when its `modifier_type` is `TEXT`. +For example, to sell T-shirts with custom prints, a text-based modifier can be used to capture the buyer-supplied +text string to be selected for the T-shirt at the time of sale. +For non text-based modifiers, this encapsulates a non-empty list of modifiers applicable to items +at the time of sale. Each element of the modifier list is a `CatalogObject` instance of the `MODIFIER` type. For example, a "Condiments" modifier list applicable to a "Hot Dog" item may contain "Ketchup", "Mustard", and "Relish" modifiers. -Use the `selection_type` field to specify whether or not multiple selections from -the modifier list are allowed. + +A non text-based modifier can be applied to the modified item once or multiple times, if the `selection_type` field +is set to `SINGLE` or `MULTIPLE`, respectively. On the other hand, a text-based modifier can be applied to the item +only once and the `selection_type` field is always set to `SINGLE`. ## Structure @@ -16,11 +22,15 @@ the modifier list are allowed. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `Name` | `string` | Optional | The name for the `CatalogModifierList` instance. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | -| `Ordinal` | `int?` | Optional | Determines where this modifier list appears in a list of `CatalogModifierList` values. | +| `Name` | `string` | Optional | The name of the `CatalogModifierList` instance. This is a searchable attribute for use in applicable query filters, and its value length is of
Unicode code points.
**Constraints**: *Maximum Length*: `255` | +| `Ordinal` | `int?` | Optional | The position of this `CatalogModifierList` within a list of `CatalogModifierList` instances. | | `SelectionType` | [`string`](../../doc/models/catalog-modifier-list-selection-type.md) | Optional | Indicates whether a CatalogModifierList supports multiple selections. | -| `Modifiers` | [`IList`](../../doc/models/catalog-object.md) | Optional | The options included in the `CatalogModifierList`.
You must include at least one `CatalogModifier`.
Each CatalogObject must have type `MODIFIER` and contain
`CatalogModifier` data. | -| `ImageIds` | `IList` | Optional | The IDs of images associated with this `CatalogModifierList` instance.
Currently these images are not displayed by Square, but are free to be displayed in 3rd party applications. | +| `Modifiers` | [`IList`](../../doc/models/catalog-object.md) | Optional | A non-empty list of `CatalogModifier` objects to be included in the `CatalogModifierList`,
for non text-based modifiers when the `modifier_type` attribute is `LIST`. Each element of this list
is a `CatalogObject` instance of the `MODIFIER` type, containing the following attributes:

```
{
"id": "{{catalog_modifier_id}}",
"type": "MODIFIER",
"modifier_data": {{a CatalogModifier instance>}}
}
``` | +| `ImageIds` | `IList` | Optional | The IDs of images associated with this `CatalogModifierList` instance.
Currently these images are not displayed on Square products, but may be displayed in 3rd-party applications. | +| `ModifierType` | [`string`](../../doc/models/catalog-modifier-list-modifier-type.md) | Optional | Defines the type of `CatalogModifierList`. | +| `MaxLength` | `int?` | Optional | The maximum length, in Unicode points, of the text string of the text-based modifier as represented by
this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. | +| `TextRequired` | `bool?` | Optional | Whether the text string must be a non-empty string (`true`) or not (`false`) for a text-based modifier
as represented by this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. | +| `InternalName` | `string` | Optional | A note for internal use by the business.

For example, for a text-based modifier applied to a T-shirt item, if the buyer-supplied text of "Hello, Kitty!"
is to be printed on the T-shirt, this `internal_name` attribute can be "Use italic face" as
an instruction for the business to follow.

For non text-based modifiers, this `internal_name` attribute can be
used to include SKUs, internal codes, or supplemental descriptions for internal use.
**Constraints**: *Maximum Length*: `512` | ## Example (as JSON) diff --git a/doc/models/catalog-object.md b/doc/models/catalog-object.md index c862de98..cb00667e 100644 --- a/doc/models/catalog-object.md +++ b/doc/models/catalog-object.md @@ -35,7 +35,7 @@ For a more detailed discussion of the Catalog data model, please see the | `ItemVariationData` | [`CatalogItemVariation`](../../doc/models/catalog-item-variation.md) | Optional | An item variation, representing a product for sale, in the Catalog object model. Each [item](../../doc/models/catalog-item.md) must have at least one
item variation and can have at most 250 item variations.

An item variation can be sellable, stockable, or both if it has a unit of measure for its count for the sold number of the variation, the stocked
number of the variation, or both. For example, when a variation representing wine is stocked and sold by the bottle, the variation is both
stockable and sellable. But when a variation of the wine is sold by the glass, the sold units cannot be used as a measure of the stocked units. This by-the-glass
variation is sellable, but not stockable. To accurately keep track of the wine's inventory count at any time, the sellable count must be
converted to stockable count. Typically, the seller defines this unit conversion. For example, 1 bottle equals 5 glasses. The Square API exposes
the `stockable_conversion` property on the variation to specify the conversion. Thus, when two glasses of the wine are sold, the sellable count
decreases by 2, and the stockable count automatically decreases by 0.4 bottle according to the conversion. | | `TaxData` | [`CatalogTax`](../../doc/models/catalog-tax.md) | Optional | A tax applicable to an item. | | `DiscountData` | [`CatalogDiscount`](../../doc/models/catalog-discount.md) | Optional | A discount applicable to items. | -| `ModifierListData` | [`CatalogModifierList`](../../doc/models/catalog-modifier-list.md) | Optional | A list of modifiers applicable to items at the time of sale.

For example, a "Condiments" modifier list applicable to a "Hot Dog" item
may contain "Ketchup", "Mustard", and "Relish" modifiers.
Use the `selection_type` field to specify whether or not multiple selections from
the modifier list are allowed. | +| `ModifierListData` | [`CatalogModifierList`](../../doc/models/catalog-modifier-list.md) | Optional | For a text-based modifier, this encapsulates the modifier's text when its `modifier_type` is `TEXT`.
For example, to sell T-shirts with custom prints, a text-based modifier can be used to capture the buyer-supplied
text string to be selected for the T-shirt at the time of sale.

For non text-based modifiers, this encapsulates a non-empty list of modifiers applicable to items
at the time of sale. Each element of the modifier list is a `CatalogObject` instance of the `MODIFIER` type.
For example, a "Condiments" modifier list applicable to a "Hot Dog" item
may contain "Ketchup", "Mustard", and "Relish" modifiers.

A non text-based modifier can be applied to the modified item once or multiple times, if the `selection_type` field
is set to `SINGLE` or `MULTIPLE`, respectively. On the other hand, a text-based modifier can be applied to the item
only once and the `selection_type` field is always set to `SINGLE`. | | `ModifierData` | [`CatalogModifier`](../../doc/models/catalog-modifier.md) | Optional | A modifier applicable to items at the time of sale. An example of a modifier is a Cheese add-on to a Burger item. | | `TimePeriodData` | [`CatalogTimePeriod`](../../doc/models/catalog-time-period.md) | Optional | Represents a time period - either a single period or a repeating period. | | `ProductSetData` | [`CatalogProductSet`](../../doc/models/catalog-product-set.md) | Optional | Represents a collection of catalog objects for the purpose of applying a
`PricingRule`. Including a catalog object will include all of its subtypes.
For example, including a category in a product set will include all of its
items and associated item variations in the product set. Including an item in
a product set will also include its item variations. | diff --git a/doc/models/create-customer-response.md b/doc/models/create-customer-response.md index 1ef86a38..a2169795 100644 --- a/doc/models/create-customer-response.md +++ b/doc/models/create-customer-response.md @@ -2,7 +2,8 @@ # Create Customer Response Defines the fields that are included in the response body of -a request to the `CreateCustomer` endpoint. +a request to the [CreateCustomer](../../doc/api/customers.md#create-customer) or +[BulkCreateCustomers](../../doc/api/customers.md#bulk-create-customers) endpoint. Either `errors` or `customer` is present in a given response (never both). diff --git a/doc/models/list-payment-links-request.md b/doc/models/list-payment-links-request.md index e6daeea3..c5cf32f3 100644 --- a/doc/models/list-payment-links-request.md +++ b/doc/models/list-payment-links-request.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `Cursor` | `string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
If a cursor is not provided, the endpoint returns the first page of the results.
For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). | +| `Cursor` | `string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
If a cursor is not provided, the endpoint returns the first page of the results.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | | `Limit` | `int?` | Optional | A limit on the number of results to return per page. The limit is advisory and
the implementation might return more or less results. If the supplied limit is negative, zero, or
greater than the maximum limit of 1000, it is ignored.

Default value: `100` | ## Example (as JSON) diff --git a/doc/models/list-payment-links-response.md b/doc/models/list-payment-links-response.md index ee5ff897..1bd8c291 100644 --- a/doc/models/list-payment-links-response.md +++ b/doc/models/list-payment-links-response.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | | `Errors` | [`IList`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | | `PaymentLinks` | [`IList`](../../doc/models/payment-link.md) | Optional | The list of payment links. | -| `Cursor` | `string` | Optional | When a response is truncated, it includes a cursor that you can use in a subsequent request
to retrieve the next set of gift cards. If a cursor is not present, this is the final response.
For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). | +| `Cursor` | `string` | Optional | When a response is truncated, it includes a cursor that you can use in a subsequent request
to retrieve the next set of gift cards. If a cursor is not present, this is the final response.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | ## Example (as JSON) diff --git a/doc/models/order-line-item-tax.md b/doc/models/order-line-item-tax.md index 086aca3d..6a93c2b6 100644 --- a/doc/models/order-line-item-tax.md +++ b/doc/models/order-line-item-tax.md @@ -20,7 +20,7 @@ contributes to the order subtotal. | `CatalogVersion` | `long?` | Optional | The version of the catalog object that this tax references. | | `Name` | `string` | Optional | The tax's name.
**Constraints**: *Maximum Length*: `255` | | `Type` | [`string`](../../doc/models/order-line-item-tax-type.md) | Optional | Indicates how the tax is applied to the associated line item or order. | -| `Percentage` | `string` | Optional | The percentage of the tax, as a string representation of a decimal
number. For example, a value of `"7.25"` corresponds to a percentage of
7.25%.
**Constraints**: *Maximum Length*: `10` | +| `Percentage` | `string` | Optional | The percentage of the tax, as a string representation of a decimal
number. For example, a value of `"7.25"` corresponds to a percentage of
7.25%.

Either `percentage` or `amount_money` should be set, but not both.
**Constraints**: *Maximum Length*: `10` | | `Metadata` | `IDictionary` | Optional | Application-defined data attached to this tax. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (such as personally
identifiable information or card details).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a maximum length of 255 characters.

An application can have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | | `AppliedMoney` | [`Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | | `Scope` | [`string`](../../doc/models/order-line-item-tax-scope.md) | Optional | Indicates whether this is a line-item or order-level tax. | diff --git a/doc/models/payment-balance-activity-fee-detail.md b/doc/models/payment-balance-activity-fee-detail.md index 24a0d336..18ebbb17 100644 --- a/doc/models/payment-balance-activity-fee-detail.md +++ b/doc/models/payment-balance-activity-fee-detail.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `PaymentId` | `string` | Optional | The ID of the payment associated with this activity. | +| `PaymentId` | `string` | Optional | The ID of the payment associated with this activity
This will only be populated when a principal LedgerEntryToken is also populated.
If the fee is independent (there is no principal LedgerEntryToken) then this will likely not
be populated. | ## Example (as JSON) diff --git a/doc/models/payment-refund.md b/doc/models/payment-refund.md index b26d974c..48534354 100644 --- a/doc/models/payment-refund.md +++ b/doc/models/payment-refund.md @@ -16,7 +16,7 @@ the original payment and the amount of money refunded. | `Status` | `string` | Optional | The refund's status:

- `PENDING` - Awaiting approval.
- `COMPLETED` - Successfully completed.
- `REJECTED` - The refund was rejected.
- `FAILED` - An error occurred.
**Constraints**: *Maximum Length*: `50` | | `LocationId` | `string` | Optional | The location ID associated with the payment this refund is attached to.
**Constraints**: *Maximum Length*: `50` | | `Unlinked` | `bool?` | Optional | Flag indicating whether or not the refund is linked to an existing payment in Square. | -| `DestinationType` | `string` | Optional | The destination type for this refund.

Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`, and
`EXTERNAL`.
**Constraints**: *Maximum Length*: `50` | +| `DestinationType` | `string` | Optional | The destination type for this refund.

Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`,
`EXTERNAL`, and `SQUARE_ACCOUNT`.
**Constraints**: *Maximum Length*: `50` | | `DestinationDetails` | [`DestinationDetails`](../../doc/models/destination-details.md) | Optional | Details about a refund's destination. | | `AmountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | | `AppFeeMoney` | [`Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | diff --git a/doc/models/payout-entry.md b/doc/models/payout-entry.md index 0a4b1339..b3c4d406 100644 --- a/doc/models/payout-entry.md +++ b/doc/models/payout-entry.md @@ -49,7 +49,7 @@ The total amount of the payout will equal the sum of the payout entries for a ba "id": "id8", "payout_id": "payout_id4", "effective_at": "effective_at8", - "type": "DEPOSIT_FEE", + "type": "SQUARE_CAPITAL_REVERSED_PAYMENT", "gross_amount_money": { "amount": 186, "currency": "BWP" diff --git a/doc/models/retrieve-merchant-settings-response.md b/doc/models/retrieve-merchant-settings-response.md index fc09be9f..ffd6db6e 100644 --- a/doc/models/retrieve-merchant-settings-response.md +++ b/doc/models/retrieve-merchant-settings-response.md @@ -20,7 +20,6 @@ "merchant_id": "MERCHANT_ID", "payment_methods": { "afterpay_clearpay": { - "available": true, "enabled": true, "item_eligibility_range": { "max": { @@ -44,15 +43,12 @@ } }, "apple_pay": { - "available": true, "enabled": true }, "cash_app_pay": { - "available": true, "enabled": true }, "google_pay": { - "available": true, "enabled": true }, "cash_app": { diff --git a/doc/models/search-orders-response.md b/doc/models/search-orders-response.md index 21264f9e..17eee4dc 100644 --- a/doc/models/search-orders-response.md +++ b/doc/models/search-orders-response.md @@ -14,7 +14,7 @@ Either the `order_entries` or `orders` field is set, depending on whether | --- | --- | --- | --- | | `OrderEntries` | [`IList`](../../doc/models/order-entry.md) | Optional | A list of [OrderEntries](entity:OrderEntry) that fit the query
conditions. The list is populated only if `return_entries` is set to `true` in the request. | | `Orders` | [`IList`](../../doc/models/order.md) | Optional | A list of
[Order](entity:Order) objects that match the query conditions. The list is populated only if
`return_entries` is set to `false` in the request. | -| `Cursor` | `string` | Optional | The pagination cursor to be used in a subsequent request. If unset,
this is the final response.
For more information, see [Pagination](https://developer.squareup.com/docs/basics/build-basics/common-api-patterns/pagination). | +| `Cursor` | `string` | Optional | The pagination cursor to be used in a subsequent request. If unset,
this is the final response.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | | `Errors` | [`IList`](../../doc/models/error.md) | Optional | [Errors](entity:Error) encountered during the search. | ## Example (as JSON) diff --git a/doc/models/update-customer-request.md b/doc/models/update-customer-request.md index ea1eff11..2bb0bcee 100644 --- a/doc/models/update-customer-request.md +++ b/doc/models/update-customer-request.md @@ -31,7 +31,7 @@ Defines the body parameters that can be included in a request to the { "email_address": "New.Amelia.Earhart@example.com", "note": "updated customer note", - "phone_number": "", + "phone_number": null, "version": 2, "given_name": "given_name0", "family_name": "family_name8", diff --git a/doc/models/update-customer-response.md b/doc/models/update-customer-response.md index 64a7f1c3..c2124617 100644 --- a/doc/models/update-customer-response.md +++ b/doc/models/update-customer-response.md @@ -2,7 +2,8 @@ # Update Customer Response Defines the fields that are included in the response body of -a request to the `UpdateCustomer` endpoint. +a request to the [UpdateCustomer](../../doc/api/customers.md#update-customer) or +[BulkUpdateCustomers](../../doc/api/customers.md#bulk-update-customers) endpoint. Either `errors` or `customer` is present in a given response (never both). diff --git a/doc/models/update-merchant-settings-response.md b/doc/models/update-merchant-settings-response.md index 3e3c6f30..bb0ea23a 100644 --- a/doc/models/update-merchant-settings-response.md +++ b/doc/models/update-merchant-settings-response.md @@ -20,7 +20,6 @@ "merchant_id": "MERCHANT_ID", "payment_methods": { "afterpay_clearpay": { - "available": true, "enabled": true, "item_eligibility_range": { "max": { @@ -44,15 +43,12 @@ } }, "apple_pay": { - "available": true, "enabled": false }, "cash_app_pay": { - "available": true, "enabled": true }, "google_pay": { - "available": true, "enabled": true }, "cash_app": { diff --git a/doc/models/v1-create-refund-request-type.md b/doc/models/v1-create-refund-request-type.md deleted file mode 100644 index 439e1bc0..00000000 --- a/doc/models/v1-create-refund-request-type.md +++ /dev/null @@ -1,14 +0,0 @@ - -# V1 Create Refund Request Type - -## Enumeration - -`V1CreateRefundRequestType` - -## Fields - -| Name | -| --- | -| `FULL` | -| `PARTIAL` | - diff --git a/doc/models/v1-create-refund-request.md b/doc/models/v1-create-refund-request.md deleted file mode 100644 index f2570702..00000000 --- a/doc/models/v1-create-refund-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# V1 Create Refund Request - -V1CreateRefundRequest - -## Structure - -`V1CreateRefundRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PaymentId` | `string` | Required | The ID of the payment to refund. If you are creating a `PARTIAL`
refund for a split tender payment, instead provide the id of the
particular tender you want to refund. | -| `Type` | [`string`](../../doc/models/v1-create-refund-request-type.md) | Required | - | -| `Reason` | `string` | Required | The reason for the refund. | -| `RefundedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `RequestIdempotenceKey` | `string` | Optional | An optional key to ensure idempotence if you issue the same PARTIAL refund request more than once. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id2", - "type": "FULL", - "reason": "reason2", - "refunded_money": { - "amount": 214, - "currency_code": "SRD" - }, - "request_idempotence_key": "request_idempotence_key6" -} -``` - diff --git a/doc/models/v1-list-payments-request.md b/doc/models/v1-list-payments-request.md deleted file mode 100644 index 07995fcc..00000000 --- a/doc/models/v1-list-payments-request.md +++ /dev/null @@ -1,30 +0,0 @@ - -# V1 List Payments Request - -## Structure - -`V1ListPaymentsRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Order` | [`string`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | -| `BeginTime` | `string` | Optional | The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year. | -| `EndTime` | `string` | Optional | The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. | -| `Limit` | `int?` | Optional | The maximum number of payments to return in a single response. This value cannot exceed 200. | -| `BatchToken` | `string` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | -| `IncludePartial` | `bool?` | Optional | Indicates whether or not to include partial payments in the response. Partial payments will have the tenders collected so far, but the itemizations will be empty until the payment is completed. | - -## Example (as JSON) - -```json -{ - "order": "DESC", - "begin_time": "begin_time8", - "end_time": "end_time2", - "limit": 104, - "batch_token": "batch_token8" -} -``` - diff --git a/doc/models/v1-list-payments-response.md b/doc/models/v1-list-payments-response.md deleted file mode 100644 index b34ee2bb..00000000 --- a/doc/models/v1-list-payments-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# V1 List Payments Response - -## Structure - -`V1ListPaymentsResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Items` | [`IList`](../../doc/models/v1-payment.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "items": [ - { - "id": "id8", - "merchant_id": "merchant_id8", - "created_at": "created_at6", - "creator_id": "creator_id8", - "device": { - "id": "id6", - "name": "name6" - } - }, - { - "id": "id8", - "merchant_id": "merchant_id8", - "created_at": "created_at6", - "creator_id": "creator_id8", - "device": { - "id": "id6", - "name": "name6" - } - } - ] -} -``` - diff --git a/doc/models/v1-list-refunds-request.md b/doc/models/v1-list-refunds-request.md deleted file mode 100644 index 1d9c1efc..00000000 --- a/doc/models/v1-list-refunds-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# V1 List Refunds Request - -## Structure - -`V1ListRefundsRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Order` | [`string`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | -| `BeginTime` | `string` | Optional | The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year. | -| `EndTime` | `string` | Optional | The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. | -| `Limit` | `int?` | Optional | The approximate number of refunds to return in a single response. Default: 100. Max: 200. Response may contain more results than the prescribed limit when refunds are made simultaneously to multiple tenders in a payment or when refunds are generated in an exchange to account for the value of returned goods. | -| `BatchToken` | `string` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | - -## Example (as JSON) - -```json -{ - "order": "DESC", - "begin_time": "begin_time0", - "end_time": "end_time4", - "limit": 66, - "batch_token": "batch_token0" -} -``` - diff --git a/doc/models/v1-list-refunds-response.md b/doc/models/v1-list-refunds-response.md deleted file mode 100644 index b0cee8a2..00000000 --- a/doc/models/v1-list-refunds-response.md +++ /dev/null @@ -1,70 +0,0 @@ - -# V1 List Refunds Response - -## Structure - -`V1ListRefundsResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Items` | [`IList`](../../doc/models/v1-refund.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "items": [ - { - "type": "FULL", - "reason": "reason6", - "refunded_money": { - "amount": 214, - "currency_code": "SRD" - }, - "refunded_processing_fee_money": { - "amount": 0, - "currency_code": "BGN" - }, - "refunded_tax_money": { - "amount": 148, - "currency_code": "SRD" - } - }, - { - "type": "FULL", - "reason": "reason6", - "refunded_money": { - "amount": 214, - "currency_code": "SRD" - }, - "refunded_processing_fee_money": { - "amount": 0, - "currency_code": "BGN" - }, - "refunded_tax_money": { - "amount": 148, - "currency_code": "SRD" - } - }, - { - "type": "FULL", - "reason": "reason6", - "refunded_money": { - "amount": 214, - "currency_code": "SRD" - }, - "refunded_processing_fee_money": { - "amount": 0, - "currency_code": "BGN" - }, - "refunded_tax_money": { - "amount": 148, - "currency_code": "SRD" - } - } - ] -} -``` - diff --git a/doc/models/v1-list-settlements-request-status.md b/doc/models/v1-list-settlements-request-status.md deleted file mode 100644 index 6f2be903..00000000 --- a/doc/models/v1-list-settlements-request-status.md +++ /dev/null @@ -1,14 +0,0 @@ - -# V1 List Settlements Request Status - -## Enumeration - -`V1ListSettlementsRequestStatus` - -## Fields - -| Name | -| --- | -| `SENT` | -| `FAILED` | - diff --git a/doc/models/v1-list-settlements-request.md b/doc/models/v1-list-settlements-request.md deleted file mode 100644 index 600af8d4..00000000 --- a/doc/models/v1-list-settlements-request.md +++ /dev/null @@ -1,30 +0,0 @@ - -# V1 List Settlements Request - -## Structure - -`V1ListSettlementsRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Order` | [`string`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | -| `BeginTime` | `string` | Optional | The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year. | -| `EndTime` | `string` | Optional | The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. | -| `Limit` | `int?` | Optional | The maximum number of settlements to return in a single response. This value cannot exceed 200. | -| `Status` | [`string`](../../doc/models/v1-list-settlements-request-status.md) | Optional | - | -| `BatchToken` | `string` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | - -## Example (as JSON) - -```json -{ - "order": "DESC", - "begin_time": "begin_time8", - "end_time": "end_time2", - "limit": 226, - "status": "SENT" -} -``` - diff --git a/doc/models/v1-list-settlements-response.md b/doc/models/v1-list-settlements-response.md deleted file mode 100644 index dab6e4ab..00000000 --- a/doc/models/v1-list-settlements-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# V1 List Settlements Response - -## Structure - -`V1ListSettlementsResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Items` | [`IList`](../../doc/models/v1-settlement.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "items": [ - { - "id": "id8", - "status": "FAILED", - "total_money": { - "amount": 250, - "currency_code": "KZT" - }, - "initiated_at": "initiated_at0", - "bank_account_id": "bank_account_id8" - }, - { - "id": "id8", - "status": "FAILED", - "total_money": { - "amount": 250, - "currency_code": "KZT" - }, - "initiated_at": "initiated_at0", - "bank_account_id": "bank_account_id8" - }, - { - "id": "id8", - "status": "FAILED", - "total_money": { - "amount": 250, - "currency_code": "KZT" - }, - "initiated_at": "initiated_at0", - "bank_account_id": "bank_account_id8" - } - ] -} -``` - diff --git a/doc/models/v1-payment-discount.md b/doc/models/v1-payment-discount.md deleted file mode 100644 index a894cb1a..00000000 --- a/doc/models/v1-payment-discount.md +++ /dev/null @@ -1,30 +0,0 @@ - -# V1 Payment Discount - -V1PaymentDiscount - -## Structure - -`V1PaymentDiscount` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `string` | Optional | The discount's name. | -| `AppliedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `DiscountId` | `string` | Optional | The ID of the applied discount, if available. Discounts applied in older versions of Square Register might not have an ID. | - -## Example (as JSON) - -```json -{ - "name": "name4", - "applied_money": { - "amount": 196, - "currency_code": "IQD" - }, - "discount_id": "discount_id2" -} -``` - diff --git a/doc/models/v1-payment-item-detail.md b/doc/models/v1-payment-item-detail.md deleted file mode 100644 index e72bf5e6..00000000 --- a/doc/models/v1-payment-item-detail.md +++ /dev/null @@ -1,29 +0,0 @@ - -# V1 Payment Item Detail - -V1PaymentItemDetail - -## Structure - -`V1PaymentItemDetail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CategoryName` | `string` | Optional | The name of the item's merchant-defined category, if any. | -| `Sku` | `string` | Optional | The item's merchant-defined SKU, if any. | -| `ItemId` | `string` | Optional | The unique ID of the item purchased, if any. | -| `ItemVariationId` | `string` | Optional | The unique ID of the item variation purchased, if any. | - -## Example (as JSON) - -```json -{ - "category_name": "category_name4", - "sku": "sku0", - "item_id": "item_id4", - "item_variation_id": "item_variation_id8" -} -``` - diff --git a/doc/models/v1-payment-itemization-itemization-type.md b/doc/models/v1-payment-itemization-itemization-type.md deleted file mode 100644 index 2838c08e..00000000 --- a/doc/models/v1-payment-itemization-itemization-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# V1 Payment Itemization Itemization Type - -## Enumeration - -`V1PaymentItemizationItemizationType` - -## Fields - -| Name | -| --- | -| `ITEM` | -| `CUSTOM_AMOUNT` | -| `GIFT_CARD_ACTIVATION` | -| `GIFT_CARD_RELOAD` | -| `GIFT_CARD_UNKNOWN` | -| `OTHER` | - diff --git a/doc/models/v1-payment-itemization.md b/doc/models/v1-payment-itemization.md deleted file mode 100644 index c22211cd..00000000 --- a/doc/models/v1-payment-itemization.md +++ /dev/null @@ -1,60 +0,0 @@ - -# V1 Payment Itemization - -Payment include an`itemizations` field that lists the items purchased, -along with associated fees, modifiers, and discounts. Each itemization has an -`itemization_type` field that indicates which of the following the itemization -represents: - -
    -
  • An item variation from the merchant's item library
  • -
  • A custom monetary amount
  • -
  • -An action performed on a Square gift card, such as activating or -reloading it. -
  • -
-*Note**: itemization information included in a `Payment` object reflects -details collected **at the time of the payment**. Details such as the name or -price of items might have changed since the payment was processed. - -## Structure - -`V1PaymentItemization` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `string` | Optional | The item's name. | -| `Quantity` | `double?` | Optional | The quantity of the item purchased. This can be a decimal value. | -| `ItemizationType` | [`string`](../../doc/models/v1-payment-itemization-itemization-type.md) | Optional | - | -| `ItemDetail` | [`V1PaymentItemDetail`](../../doc/models/v1-payment-item-detail.md) | Optional | V1PaymentItemDetail | -| `Notes` | `string` | Optional | Notes entered by the merchant about the item at the time of payment, if any. | -| `ItemVariationName` | `string` | Optional | The name of the item variation purchased, if any. | -| `TotalMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `SingleQuantityMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `GrossSalesMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `DiscountMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `NetSalesMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `Taxes` | [`IList`](../../doc/models/v1-payment-tax.md) | Optional | All taxes applied to this itemization. | -| `Discounts` | [`IList`](../../doc/models/v1-payment-discount.md) | Optional | All discounts applied to this itemization. | -| `Modifiers` | [`IList`](../../doc/models/v1-payment-modifier.md) | Optional | All modifier options applied to this itemization. | - -## Example (as JSON) - -```json -{ - "name": "name4", - "quantity": 253.5, - "itemization_type": "GIFT_CARD_UNKNOWN", - "item_detail": { - "category_name": "category_name0", - "sku": "sku6", - "item_id": "item_id2", - "item_variation_id": "item_variation_id2" - }, - "notes": "notes4" -} -``` - diff --git a/doc/models/v1-payment-modifier.md b/doc/models/v1-payment-modifier.md deleted file mode 100644 index bde7e1fd..00000000 --- a/doc/models/v1-payment-modifier.md +++ /dev/null @@ -1,30 +0,0 @@ - -# V1 Payment Modifier - -V1PaymentModifier - -## Structure - -`V1PaymentModifier` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `string` | Optional | The modifier option's name. | -| `AppliedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `ModifierOptionId` | `string` | Optional | The ID of the applied modifier option, if available. Modifier options applied in older versions of Square Register might not have an ID. | - -## Example (as JSON) - -```json -{ - "name": "name0", - "applied_money": { - "amount": 196, - "currency_code": "IQD" - }, - "modifier_option_id": "modifier_option_id6" -} -``` - diff --git a/doc/models/v1-payment-surcharge-type.md b/doc/models/v1-payment-surcharge-type.md deleted file mode 100644 index 52348c75..00000000 --- a/doc/models/v1-payment-surcharge-type.md +++ /dev/null @@ -1,15 +0,0 @@ - -# V1 Payment Surcharge Type - -## Enumeration - -`V1PaymentSurchargeType` - -## Fields - -| Name | -| --- | -| `UNKNOWN` | -| `AUTO_GRATUITY` | -| `CUSTOM` | - diff --git a/doc/models/v1-payment-surcharge.md b/doc/models/v1-payment-surcharge.md deleted file mode 100644 index 5169d56f..00000000 --- a/doc/models/v1-payment-surcharge.md +++ /dev/null @@ -1,40 +0,0 @@ - -# V1 Payment Surcharge - -V1PaymentSurcharge - -## Structure - -`V1PaymentSurcharge` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `string` | Optional | The name of the surcharge. | -| `AppliedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `Rate` | `string` | Optional | The amount of the surcharge as a percentage. The percentage is provided as a string representing the decimal equivalent of the percentage. For example, "0.7" corresponds to a 7% surcharge. Exactly one of rate or amount_money should be set. | -| `AmountMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `Type` | [`string`](../../doc/models/v1-payment-surcharge-type.md) | Optional | - | -| `Taxable` | `bool?` | Optional | Indicates whether the surcharge is taxable. | -| `Taxes` | [`IList`](../../doc/models/v1-payment-tax.md) | Optional | The list of taxes that should be applied to the surcharge. | -| `SurchargeId` | `string` | Optional | A Square-issued unique identifier associated with the surcharge. | - -## Example (as JSON) - -```json -{ - "name": "name6", - "applied_money": { - "amount": 196, - "currency_code": "IQD" - }, - "rate": "rate4", - "amount_money": { - "amount": 186, - "currency_code": "UZS" - }, - "type": "AUTO_GRATUITY" -} -``` - diff --git a/doc/models/v1-payment-tax-inclusion-type.md b/doc/models/v1-payment-tax-inclusion-type.md deleted file mode 100644 index 6564c7e5..00000000 --- a/doc/models/v1-payment-tax-inclusion-type.md +++ /dev/null @@ -1,14 +0,0 @@ - -# V1 Payment Tax Inclusion Type - -## Enumeration - -`V1PaymentTaxInclusionType` - -## Fields - -| Name | -| --- | -| `ADDITIVE` | -| `INCLUSIVE` | - diff --git a/doc/models/v1-payment-tax.md b/doc/models/v1-payment-tax.md deleted file mode 100644 index 1404ef65..00000000 --- a/doc/models/v1-payment-tax.md +++ /dev/null @@ -1,42 +0,0 @@ - -# V1 Payment Tax - -V1PaymentTax - -## Structure - -`V1PaymentTax` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`IList`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `Name` | `string` | Optional | The merchant-defined name of the tax. | -| `AppliedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `Rate` | `string` | Optional | The rate of the tax, as a string representation of a decimal number. A value of 0.07 corresponds to a rate of 7%. | -| `InclusionType` | [`string`](../../doc/models/v1-payment-tax-inclusion-type.md) | Optional | - | -| `FeeId` | `string` | Optional | The ID of the tax, if available. Taxes applied in older versions of Square Register might not have an ID. | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "MAP_KEY_LENGTH_TOO_LONG", - "detail": "detail6", - "field": "field4" - } - ], - "name": "name6", - "applied_money": { - "amount": 196, - "currency_code": "IQD" - }, - "rate": "rate4", - "inclusion_type": "ADDITIVE" -} -``` - diff --git a/doc/models/v1-payment.md b/doc/models/v1-payment.md deleted file mode 100644 index 48f32dff..00000000 --- a/doc/models/v1-payment.md +++ /dev/null @@ -1,75 +0,0 @@ - -# V1 Payment - -A payment represents a paid transaction between a Square merchant and a -customer. Payment details are usually available from Connect API endpoints -within a few minutes after the transaction completes. - -Each Payment object includes several fields that end in `_money`. These fields -describe the various amounts of money that contribute to the payment total: - -
    -
  • -Monetary values are positive if they represent an -increase in the amount of money the merchant receives (e.g., -tax_money, tip_money). -
  • -
  • -Monetary values are negative if they represent an -decrease in the amount of money the merchant receives (e.g., -discount_money, refunded_money). -
  • -
- - -## Structure - -`V1Payment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `string` | Optional | The payment's unique identifier. | -| `MerchantId` | `string` | Optional | The unique identifier of the merchant that took the payment. | -| `CreatedAt` | `string` | Optional | The time when the payment was created, in ISO 8601 format. Reflects the time of the first payment if the object represents an incomplete partial payment, and the time of the last or complete payment otherwise. | -| `CreatorId` | `string` | Optional | The unique identifier of the Square account that took the payment. | -| `Device` | [`V1Device`](../../doc/models/v1-device.md) | Optional | - | -| `PaymentUrl` | `string` | Optional | The URL of the payment's detail page in the merchant dashboard. The merchant must be signed in to the merchant dashboard to view this page. | -| `ReceiptUrl` | `string` | Optional | The URL of the receipt for the payment. Note that for split tender
payments, this URL corresponds to the receipt for the first tender
listed in the payment's tender field. Each Tender object has its own
receipt_url field you can use to get the other receipts associated with
a split tender payment. | -| `InclusiveTaxMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `AdditiveTaxMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `TaxMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `TipMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `DiscountMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `TotalCollectedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `ProcessingFeeMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `NetTotalMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `RefundedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `SwedishRoundingMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `GrossSalesMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `NetSalesMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `InclusiveTax` | [`IList`](../../doc/models/v1-payment-tax.md) | Optional | All of the inclusive taxes associated with the payment. | -| `AdditiveTax` | [`IList`](../../doc/models/v1-payment-tax.md) | Optional | All of the additive taxes associated with the payment. | -| `Tender` | [`IList`](../../doc/models/v1-tender.md) | Optional | All of the tenders associated with the payment. | -| `Refunds` | [`IList`](../../doc/models/v1-refund.md) | Optional | All of the refunds applied to the payment. Note that the value of all refunds on a payment can exceed the value of all tenders if a merchant chooses to refund money to a tender after previously accepting returned goods as part of an exchange. | -| `Itemizations` | [`IList`](../../doc/models/v1-payment-itemization.md) | Optional | The items purchased in the payment. | -| `SurchargeMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `Surcharges` | [`IList`](../../doc/models/v1-payment-surcharge.md) | Optional | A list of all surcharges associated with the payment. | -| `IsPartial` | `bool?` | Optional | Indicates whether or not the payment is only partially paid for.
If true, this payment will have the tenders collected so far, but the
itemizations will be empty until the payment is completed. | - -## Example (as JSON) - -```json -{ - "id": "id2", - "merchant_id": "merchant_id8", - "created_at": "created_at0", - "creator_id": "creator_id2", - "device": { - "id": "id6", - "name": "name6" - } -} -``` - diff --git a/doc/models/v1-refund-type.md b/doc/models/v1-refund-type.md deleted file mode 100644 index 0cd3137d..00000000 --- a/doc/models/v1-refund-type.md +++ /dev/null @@ -1,14 +0,0 @@ - -# V1 Refund Type - -## Enumeration - -`V1RefundType` - -## Fields - -| Name | -| --- | -| `FULL` | -| `PARTIAL` | - diff --git a/doc/models/v1-refund.md b/doc/models/v1-refund.md deleted file mode 100644 index 5a9c7720..00000000 --- a/doc/models/v1-refund.md +++ /dev/null @@ -1,53 +0,0 @@ - -# V1 Refund - -V1Refund - -## Structure - -`V1Refund` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Type` | [`string`](../../doc/models/v1-refund-type.md) | Optional | - | -| `Reason` | `string` | Optional | The merchant-specified reason for the refund. | -| `RefundedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `RefundedProcessingFeeMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `RefundedTaxMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `RefundedAdditiveTaxMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `RefundedAdditiveTax` | [`IList`](../../doc/models/v1-payment-tax.md) | Optional | All of the additive taxes associated with the refund. | -| `RefundedInclusiveTaxMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `RefundedInclusiveTax` | [`IList`](../../doc/models/v1-payment-tax.md) | Optional | All of the inclusive taxes associated with the refund. | -| `RefundedTipMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `RefundedDiscountMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `RefundedSurchargeMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `RefundedSurcharges` | [`IList`](../../doc/models/v1-payment-surcharge.md) | Optional | A list of all surcharges associated with the refund. | -| `CreatedAt` | `string` | Optional | The time when the merchant initiated the refund for Square to process, in ISO 8601 format. | -| `ProcessedAt` | `string` | Optional | The time when Square processed the refund on behalf of the merchant, in ISO 8601 format. | -| `PaymentId` | `string` | Optional | A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders. | -| `MerchantId` | `string` | Optional | - | -| `IsExchange` | `bool?` | Optional | Indicates whether or not the refund is associated with an exchange. If is_exchange is true, the refund reflects the value of goods returned in the exchange not the total money refunded. | - -## Example (as JSON) - -```json -{ - "type": "FULL", - "reason": "reason4", - "refunded_money": { - "amount": 214, - "currency_code": "SRD" - }, - "refunded_processing_fee_money": { - "amount": 0, - "currency_code": "BGN" - }, - "refunded_tax_money": { - "amount": 148, - "currency_code": "SRD" - } -} -``` - diff --git a/doc/models/v1-settlement-entry-type.md b/doc/models/v1-settlement-entry-type.md deleted file mode 100644 index 9ca3794b..00000000 --- a/doc/models/v1-settlement-entry-type.md +++ /dev/null @@ -1,33 +0,0 @@ - -# V1 Settlement Entry Type - -## Enumeration - -`V1SettlementEntryType` - -## Fields - -| Name | Description | -| --- | --- | -| `ADJUSTMENT` | A manual adjustment applied to the merchant's account by Square | -| `BALANCE_CHARGE` | A payment from an existing Square balance, such as a gift card | -| `CHARGE` | A credit card payment CAPTURE | -| `FREE_PROCESSING` | Square offers Free Payments Processing for a variety of business scenarios including seller referral or when we want to apologize for a bug, customer service, repricing complication, etc. This entry represents a credit to the merchant for the purposes of Free Processing. | -| `HOLD_ADJUSTMENT` | An adjustment made by Square related to holding/releasing a payment | -| `PAID_SERVICE_FEE` | a fee paid to a 3rd party merchant | -| `PAID_SERVICE_FEE_REFUND` | a refund for a 3rd party merchant fee | -| `REDEMPTION_CODE` | Repayment for a redemption code | -| `REFUND` | A refund for an existing card payment | -| `RETURNED_PAYOUT` | An entry created when we receive a response for the ACH file we sent indicating that the settlement of the original entry failed. | -| `SQUARE_CAPITAL_ADVANCE` | Initial deposit to a merchant for a Capital merchant cash advance (MCA). | -| `SQUARE_CAPITAL_PAYMENT` | Capital merchant cash advance (MCA) assessment. These are, generally, proportional to the merchant's sales but may be issued for other reasons related to the MCA. | -| `SQUARE_CAPITAL_REVERSED_PAYMENT` | Capital merchant cash advance (MCA) assessment refund. These are, generally, proportional to the merchant's refunds but may be issued for other reasons related to the MCA. | -| `SUBSCRIPTION_FEE` | Fee charged for subscription to a Square product | -| `SUBSCRIPTION_FEE_REFUND` | Refund of a previously charged Square product subscription fee. | -| `OTHER` | | -| `INCENTED_PAYMENT` | A payment in which Square covers part of the funds for a purchase | -| `RETURNED_ACH_ENTRY` | A settlement failed to be processed and the settlement amount has been returned to the account | -| `RETURNED_SQUARE_275` | Refund for cancelling a Square Plus subscription | -| `SQUARE_275` | Fee charged for a Square Plus subscription ($275) | -| `SQUARE_CARD` | Settlements to or withdrawals from the Square Card (an asset) | - diff --git a/doc/models/v1-settlement-entry.md b/doc/models/v1-settlement-entry.md deleted file mode 100644 index 1e9e0326..00000000 --- a/doc/models/v1-settlement-entry.md +++ /dev/null @@ -1,35 +0,0 @@ - -# V1 Settlement Entry - -V1SettlementEntry - -## Structure - -`V1SettlementEntry` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PaymentId` | `string` | Optional | The settlement's unique identifier. | -| `Type` | [`string`](../../doc/models/v1-settlement-entry-type.md) | Optional | - | -| `AmountMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `FeeMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id0", - "type": "RETURNED_PAYOUT", - "amount_money": { - "amount": 186, - "currency_code": "UZS" - }, - "fee_money": { - "amount": 108, - "currency_code": "ILS" - } -} -``` - diff --git a/doc/models/v1-settlement-status.md b/doc/models/v1-settlement-status.md deleted file mode 100644 index 1c8e14a3..00000000 --- a/doc/models/v1-settlement-status.md +++ /dev/null @@ -1,14 +0,0 @@ - -# V1 Settlement Status - -## Enumeration - -`V1SettlementStatus` - -## Fields - -| Name | -| --- | -| `FAILED` | -| `SENT` | - diff --git a/doc/models/v1-settlement.md b/doc/models/v1-settlement.md deleted file mode 100644 index a8e13b62..00000000 --- a/doc/models/v1-settlement.md +++ /dev/null @@ -1,35 +0,0 @@ - -# V1 Settlement - -V1Settlement - -## Structure - -`V1Settlement` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `string` | Optional | The settlement's unique identifier. | -| `Status` | [`string`](../../doc/models/v1-settlement-status.md) | Optional | - | -| `TotalMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | -| `InitiatedAt` | `string` | Optional | The time when the settlement was submitted for deposit or withdrawal, in ISO 8601 format. | -| `BankAccountId` | `string` | Optional | The Square-issued unique identifier for the bank account associated with the settlement. | -| `Entries` | [`IList`](../../doc/models/v1-settlement-entry.md) | Optional | The entries included in this settlement. | - -## Example (as JSON) - -```json -{ - "id": "id2", - "status": "FAILED", - "total_money": { - "amount": 250, - "currency_code": "KZT" - }, - "initiated_at": "initiated_at4", - "bank_account_id": "bank_account_id2" -} -``` -