From 63f6b5d93831b9e4690f2b48fa29ababc6cd96b3 Mon Sep 17 00:00:00 2001 From: Jenkins Square SDK Update Date: Wed, 22 Jan 2020 22:41:41 +0000 Subject: [PATCH] release --- Square.sln | 20 +- Square/Apis/ApplePayApi.cs | 16 +- Square/Apis/BaseApi.cs | 10 +- Square/Apis/CashDrawersApi.cs | 46 +- Square/Apis/CatalogApi.cs | 152 +++--- Square/Apis/CheckoutApi.cs | 16 +- Square/Apis/CustomersApi.cs | 102 ++-- Square/Apis/EmployeesApi.cs | 30 +- Square/Apis/IApplePayApi.cs | 5 +- Square/Apis/ICashDrawersApi.cs | 9 +- Square/Apis/ICatalogApi.cs | 27 +- Square/Apis/ICheckoutApi.cs | 5 +- Square/Apis/ICustomersApi.cs | 19 +- Square/Apis/IEmployeesApi.cs | 7 +- Square/Apis/IInventoryApi.cs | 17 +- Square/Apis/ILaborApi.cs | 31 +- Square/Apis/ILocationsApi.cs | 11 +- Square/Apis/IMerchantsApi.cs | 7 +- Square/Apis/IMobileAuthorizationApi.cs | 5 +- Square/Apis/IOAuthApi.cs | 9 +- Square/Apis/IOrdersApi.cs | 13 +- Square/Apis/IPaymentsApi.cs | 15 +- Square/Apis/IRefundsApi.cs | 9 +- Square/Apis/IReportingApi.cs | 7 +- Square/Apis/ITransactionsApi.cs | 17 +- Square/Apis/IV1EmployeesApi.cs | 35 +- Square/Apis/IV1ItemsApi.cs | 83 +-- Square/Apis/IV1LocationsApi.cs | 7 +- Square/Apis/IV1TransactionsApi.cs | 37 +- Square/Apis/InventoryApi.cs | 92 ++-- Square/Apis/LaborApi.cs | 178 ++++--- Square/Apis/LocationsApi.cs | 52 +- Square/Apis/MerchantsApi.cs | 30 +- Square/Apis/MobileAuthorizationApi.cs | 16 +- Square/Apis/OAuthApi.cs | 34 +- Square/Apis/OrdersApi.cs | 64 +-- Square/Apis/PaymentsApi.cs | 78 +-- Square/Apis/RefundsApi.cs | 42 +- Square/Apis/ReportingApi.cs | 32 +- Square/Apis/TransactionsApi.cs | 92 ++-- Square/Apis/V1EmployeesApi.cs | 204 +++---- Square/Apis/V1ItemsApi.cs | 490 ++++++++--------- Square/Apis/V1LocationsApi.cs | 28 +- Square/Apis/V1TransactionsApi.cs | 156 +++--- .../AccessTokenManager.cs | 15 +- .../Authentication/IAccessTokenCredentials.cs | 14 + Square/{ => Authentication}/IAuthManager.cs | 5 +- Square/Environment.cs | 2 +- .../{ApiException.cs => APIException.cs} | 11 +- Square/Http/Client/HttpClientConfiguration.cs | 20 + Square/Http/Client/HttpClientWrapper.cs | 34 +- Square/Http/Client/IHttpClient.cs | 10 +- .../Http/Client/IHttpClientConfiguration.cs | 15 + Square/Http/Client/MultipartFileContent.cs | 6 +- Square/IConfiguration.cs | 5 +- Square/Models/AdditionalRecipient.cs | 2 +- .../Models/AdditionalRecipientReceivable.cs | 4 +- .../AdditionalRecipientReceivableRefund.cs | 2 +- Square/Models/Address.cs | 2 +- Square/Models/BalancePaymentDetails.cs | 2 +- Square/Models/BatchChangeInventoryRequest.cs | 4 +- Square/Models/BatchChangeInventoryResponse.cs | 6 +- .../BatchDeleteCatalogObjectsRequest.cs | 4 +- .../BatchDeleteCatalogObjectsResponse.cs | 6 +- .../BatchRetrieveCatalogObjectsRequest.cs | 2 +- .../BatchRetrieveCatalogObjectsResponse.cs | 8 +- .../BatchRetrieveInventoryChangesRequest.cs | 10 +- .../BatchRetrieveInventoryChangesResponse.cs | 6 +- .../BatchRetrieveInventoryCountsRequest.cs | 6 +- .../BatchRetrieveInventoryCountsResponse.cs | 6 +- Square/Models/BatchRetrieveOrdersRequest.cs | 2 +- Square/Models/BatchRetrieveOrdersResponse.cs | 6 +- .../BatchUpsertCatalogObjectsRequest.cs | 4 +- .../BatchUpsertCatalogObjectsResponse.cs | 8 +- Square/Models/Break.cs | 2 +- Square/Models/BreakType.cs | 2 +- Square/Models/BusinessHours.cs | 4 +- Square/Models/BusinessHoursPeriod.cs | 2 +- .../CancelPaymentByIdempotencyKeyRequest.cs | 2 +- .../CancelPaymentByIdempotencyKeyResponse.cs | 4 +- Square/Models/CancelPaymentResponse.cs | 4 +- Square/Models/CaptureTransactionResponse.cs | 4 +- Square/Models/Card.cs | 2 +- Square/Models/CardPaymentDetails.cs | 4 +- Square/Models/CashDrawerDevice.cs | 2 +- Square/Models/CashDrawerShift.cs | 6 +- Square/Models/CashDrawerShiftEvent.cs | 2 +- Square/Models/CashDrawerShiftSummary.cs | 2 +- Square/Models/CashPaymentDetails.cs | 2 +- Square/Models/CatalogCategory.cs | 2 +- Square/Models/CatalogDiscount.cs | 4 +- Square/Models/CatalogIdMapping.cs | 2 +- Square/Models/CatalogImage.cs | 2 +- Square/Models/CatalogInfoResponse.cs | 6 +- Square/Models/CatalogInfoResponseLimits.cs | 2 +- Square/Models/CatalogItem.cs | 10 +- Square/Models/CatalogItemModifierListInfo.cs | 4 +- Square/Models/CatalogItemOption.cs | 4 +- Square/Models/CatalogItemOptionForItem.cs | 2 +- Square/Models/CatalogItemOptionValue.cs | 2 +- .../CatalogItemOptionValueForItemVariation.cs | 2 +- Square/Models/CatalogItemVariation.cs | 6 +- Square/Models/CatalogMeasurementUnit.cs | 2 +- Square/Models/CatalogModifier.cs | 2 +- Square/Models/CatalogModifierList.cs | 4 +- Square/Models/CatalogModifierOverride.cs | 2 +- Square/Models/CatalogObject.cs | 8 +- Square/Models/CatalogObjectBatch.cs | 4 +- Square/Models/CatalogPricingRule.cs | 4 +- Square/Models/CatalogProductSet.cs | 6 +- Square/Models/CatalogQuery.cs | 20 +- .../CatalogQueryCustomAttributeUsage.cs | 8 +- Square/Models/CatalogQueryExact.cs | 2 +- Square/Models/CatalogQueryFilteredItems.cs | 28 +- ...QueryFilteredItemsCustomAttributeFilter.cs | 16 +- ...gQueryItemVariationsForItemOptionValues.cs | 4 +- .../Models/CatalogQueryItemsForItemOptions.cs | 4 +- .../CatalogQueryItemsForModifierList.cs | 2 +- Square/Models/CatalogQueryItemsForTax.cs | 2 +- Square/Models/CatalogQueryPrefix.cs | 2 +- Square/Models/CatalogQueryRange.cs | 2 +- Square/Models/CatalogQuerySortedAttribute.cs | 2 +- Square/Models/CatalogQueryText.cs | 2 +- Square/Models/CatalogTax.cs | 2 +- Square/Models/CatalogTimePeriod.cs | 2 +- Square/Models/CatalogV1Id.cs | 2 +- Square/Models/ChargeRequest.cs | 4 +- .../ChargeRequestAdditionalRecipient.cs | 2 +- Square/Models/ChargeResponse.cs | 4 +- Square/Models/Checkout.cs | 4 +- Square/Models/CompletePaymentResponse.cs | 4 +- Square/Models/Coordinates.cs | 2 +- Square/Models/CreateBreakTypeRequest.cs | 2 +- Square/Models/CreateBreakTypeResponse.cs | 4 +- Square/Models/CreateCatalogImageRequest.cs | 4 +- Square/Models/CreateCatalogImageResponse.cs | 6 +- Square/Models/CreateCheckoutRequest.cs | 6 +- Square/Models/CreateCheckoutResponse.cs | 4 +- Square/Models/CreateCustomerCardRequest.cs | 2 +- Square/Models/CreateCustomerCardResponse.cs | 4 +- Square/Models/CreateCustomerRequest.cs | 2 +- Square/Models/CreateCustomerResponse.cs | 4 +- Square/Models/CreateLocationRequest.cs | 4 +- Square/Models/CreateLocationResponse.cs | 6 +- .../CreateMobileAuthorizationCodeRequest.cs | 2 +- .../CreateMobileAuthorizationCodeResponse.cs | 2 +- Square/Models/CreateOrderRequest.cs | 8 +- Square/Models/CreateOrderRequestDiscount.cs | 2 +- Square/Models/CreateOrderRequestLineItem.cs | 8 +- Square/Models/CreateOrderRequestModifier.cs | 2 +- Square/Models/CreateOrderRequestTax.cs | 2 +- Square/Models/CreateOrderResponse.cs | 4 +- Square/Models/CreatePaymentRequest.cs | 2 +- Square/Models/CreatePaymentResponse.cs | 4 +- Square/Models/CreateRefundRequest.cs | 2 +- Square/Models/CreateRefundResponse.cs | 4 +- Square/Models/CreateShiftRequest.cs | 2 +- Square/Models/CreateShiftResponse.cs | 4 +- Square/Models/Customer.cs | 6 +- Square/Models/CustomerCreationSourceFilter.cs | 4 +- Square/Models/CustomerFilter.cs | 2 +- Square/Models/CustomerGroupInfo.cs | 2 +- Square/Models/CustomerPreferences.cs | 2 +- Square/Models/CustomerQuery.cs | 2 +- Square/Models/CustomerSort.cs | 2 +- Square/Models/DateRange.cs | 2 +- Square/Models/DeleteBreakTypeResponse.cs | 4 +- Square/Models/DeleteCatalogObjectResponse.cs | 6 +- Square/Models/DeleteCustomerCardResponse.cs | 4 +- Square/Models/DeleteCustomerResponse.cs | 4 +- Square/Models/DeleteShiftResponse.cs | 4 +- Square/Models/Device.cs | 2 +- Square/Models/DeviceDetails.cs | 2 +- Square/Models/Employee.cs | 23 +- Square/Models/EmployeeWage.cs | 2 +- Square/Models/Error.cs | 2 +- Square/Models/ExternalPaymentDetails.cs | 2 +- Square/Models/GetBreakTypeResponse.cs | 4 +- Square/Models/GetEmployeeWageResponse.cs | 4 +- Square/Models/GetPaymentRefundResponse.cs | 4 +- Square/Models/GetPaymentResponse.cs | 4 +- Square/Models/GetShiftResponse.cs | 4 +- Square/Models/InventoryAdjustment.cs | 2 +- Square/Models/InventoryChange.cs | 2 +- Square/Models/InventoryCount.cs | 2 +- Square/Models/InventoryPhysicalCount.cs | 2 +- Square/Models/InventoryTransfer.cs | 2 +- .../Models/ItemVariationLocationOverrides.cs | 2 +- ...tionalRecipientReceivableRefundsRequest.cs | 2 +- ...ionalRecipientReceivableRefundsResponse.cs | 6 +- ...stAdditionalRecipientReceivablesRequest.cs | 2 +- ...tAdditionalRecipientReceivablesResponse.cs | 6 +- Square/Models/ListBreakTypesRequest.cs | 2 +- Square/Models/ListBreakTypesResponse.cs | 6 +- .../ListCashDrawerShiftEventsRequest.cs | 2 +- .../ListCashDrawerShiftEventsResponse.cs | 6 +- Square/Models/ListCashDrawerShiftsRequest.cs | 2 +- Square/Models/ListCashDrawerShiftsResponse.cs | 6 +- Square/Models/ListCatalogRequest.cs | 2 +- Square/Models/ListCatalogResponse.cs | 6 +- Square/Models/ListCustomersRequest.cs | 2 +- Square/Models/ListCustomersResponse.cs | 6 +- Square/Models/ListEmployeeWagesRequest.cs | 2 +- Square/Models/ListEmployeeWagesResponse.cs | 6 +- Square/Models/ListEmployeesRequest.cs | 2 +- Square/Models/ListEmployeesResponse.cs | 6 +- Square/Models/ListLocationsResponse.cs | 6 +- Square/Models/ListMerchantsRequest.cs | 2 +- Square/Models/ListMerchantsResponse.cs | 6 +- Square/Models/ListPaymentRefundsRequest.cs | 2 +- Square/Models/ListPaymentRefundsResponse.cs | 6 +- Square/Models/ListPaymentsRequest.cs | 2 +- Square/Models/ListPaymentsResponse.cs | 6 +- Square/Models/ListRefundsRequest.cs | 2 +- Square/Models/ListRefundsResponse.cs | 6 +- Square/Models/ListTransactionsRequest.cs | 2 +- Square/Models/ListTransactionsResponse.cs | 6 +- Square/Models/ListWorkweekConfigsRequest.cs | 2 +- Square/Models/ListWorkweekConfigsResponse.cs | 6 +- Square/Models/Location.cs | 4 +- Square/Models/MeasurementUnit.cs | 4 +- Square/Models/MeasurementUnitCustom.cs | 2 +- Square/Models/Merchant.cs | 4 +- Square/Models/Money.cs | 2 +- Square/Models/ObtainTokenRequest.cs | 2 +- Square/Models/ObtainTokenResponse.cs | 2 +- Square/Models/Order.cs | 20 +- Square/Models/OrderEntry.cs | 2 +- Square/Models/OrderFulfillment.cs | 4 +- .../Models/OrderFulfillmentPickupDetails.cs | 2 +- Square/Models/OrderFulfillmentRecipient.cs | 2 +- .../Models/OrderFulfillmentShipmentDetails.cs | 2 +- Square/Models/OrderLineItem.cs | 14 +- Square/Models/OrderLineItemAppliedDiscount.cs | 2 +- Square/Models/OrderLineItemAppliedTax.cs | 2 +- Square/Models/OrderLineItemDiscount.cs | 4 +- Square/Models/OrderLineItemModifier.cs | 2 +- Square/Models/OrderLineItemTax.cs | 4 +- Square/Models/OrderMoneyAmounts.cs | 2 +- Square/Models/OrderQuantityUnit.cs | 2 +- Square/Models/OrderReturn.cs | 10 +- Square/Models/OrderReturnDiscount.cs | 2 +- Square/Models/OrderReturnLineItem.cs | 12 +- Square/Models/OrderReturnLineItemModifier.cs | 2 +- Square/Models/OrderReturnServiceCharge.cs | 6 +- Square/Models/OrderReturnTax.cs | 2 +- Square/Models/OrderRoundingAdjustment.cs | 2 +- Square/Models/OrderServiceCharge.cs | 8 +- Square/Models/OrderSource.cs | 2 +- Square/Models/PayOrderRequest.cs | 6 +- Square/Models/PayOrderResponse.cs | 4 +- Square/Models/Payment.cs | 6 +- Square/Models/PaymentRefund.cs | 4 +- Square/Models/ProcessingFee.cs | 2 +- Square/Models/Refund.cs | 4 +- Square/Models/RefundPaymentRequest.cs | 24 +- Square/Models/RefundPaymentResponse.cs | 4 +- Square/Models/RegisterDomainRequest.cs | 2 +- Square/Models/RegisterDomainResponse.cs | 4 +- Square/Models/RenewTokenRequest.cs | 2 +- Square/Models/RenewTokenResponse.cs | 2 +- .../Models/RetrieveCashDrawerShiftRequest.cs | 2 +- .../Models/RetrieveCashDrawerShiftResponse.cs | 4 +- Square/Models/RetrieveCatalogObjectRequest.cs | 2 +- .../Models/RetrieveCatalogObjectResponse.cs | 8 +- Square/Models/RetrieveCustomerResponse.cs | 4 +- Square/Models/RetrieveEmployeeResponse.cs | 4 +- .../RetrieveInventoryAdjustmentResponse.cs | 4 +- .../Models/RetrieveInventoryChangesRequest.cs | 2 +- .../RetrieveInventoryChangesResponse.cs | 6 +- .../Models/RetrieveInventoryCountRequest.cs | 2 +- .../Models/RetrieveInventoryCountResponse.cs | 6 +- .../RetrieveInventoryPhysicalCountResponse.cs | 4 +- Square/Models/RetrieveLocationResponse.cs | 6 +- Square/Models/RetrieveMerchantResponse.cs | 4 +- Square/Models/RetrieveTransactionResponse.cs | 4 +- Square/Models/RevokeTokenRequest.cs | 2 +- Square/Models/RevokeTokenResponse.cs | 2 +- Square/Models/SearchCatalogObjectsRequest.cs | 4 +- Square/Models/SearchCatalogObjectsResponse.cs | 8 +- Square/Models/SearchCustomersRequest.cs | 2 +- Square/Models/SearchCustomersResponse.cs | 6 +- Square/Models/SearchOrdersCustomerFilter.cs | 4 +- Square/Models/SearchOrdersDateTimeFilter.cs | 2 +- Square/Models/SearchOrdersFilter.cs | 2 +- .../Models/SearchOrdersFulfillmentFilter.cs | 4 +- Square/Models/SearchOrdersQuery.cs | 2 +- Square/Models/SearchOrdersRequest.cs | 4 +- Square/Models/SearchOrdersResponse.cs | 8 +- Square/Models/SearchOrdersSort.cs | 2 +- Square/Models/SearchOrdersSourceFilter.cs | 4 +- Square/Models/SearchOrdersStateFilter.cs | 2 +- Square/Models/SearchShiftsRequest.cs | 2 +- Square/Models/SearchShiftsResponse.cs | 6 +- Square/Models/Shift.cs | 4 +- Square/Models/ShiftFilter.cs | 6 +- Square/Models/ShiftQuery.cs | 2 +- Square/Models/ShiftSort.cs | 2 +- Square/Models/ShiftWage.cs | 2 +- Square/Models/ShiftWorkday.cs | 2 +- Square/Models/SourceApplication.cs | 2 +- Square/Models/StandardUnitDescription.cs | 2 +- Square/Models/StandardUnitDescriptionGroup.cs | 4 +- Square/Models/Tender.cs | 4 +- Square/Models/TenderCardDetails.cs | 2 +- Square/Models/TenderCashDetails.cs | 2 +- Square/Models/TimeRange.cs | 2 +- Square/Models/Transaction.cs | 6 +- Square/Models/UpdateBreakTypeRequest.cs | 2 +- Square/Models/UpdateBreakTypeResponse.cs | 4 +- Square/Models/UpdateCustomerRequest.cs | 2 +- Square/Models/UpdateCustomerResponse.cs | 4 +- .../Models/UpdateItemModifierListsRequest.cs | 6 +- .../Models/UpdateItemModifierListsResponse.cs | 6 +- Square/Models/UpdateItemTaxesRequest.cs | 6 +- Square/Models/UpdateItemTaxesResponse.cs | 4 +- Square/Models/UpdateLocationRequest.cs | 4 +- Square/Models/UpdateLocationResponse.cs | 6 +- Square/Models/UpdateOrderRequest.cs | 4 +- Square/Models/UpdateOrderResponse.cs | 4 +- Square/Models/UpdateShiftRequest.cs | 2 +- Square/Models/UpdateShiftResponse.cs | 4 +- Square/Models/UpdateWorkweekConfigRequest.cs | 2 +- Square/Models/UpdateWorkweekConfigResponse.cs | 4 +- Square/Models/UpsertCatalogObjectRequest.cs | 4 +- Square/Models/UpsertCatalogObjectResponse.cs | 8 +- Square/Models/V1AdjustInventoryRequest.cs | 4 +- Square/Models/V1BankAccount.cs | 4 +- Square/Models/V1CashDrawerEvent.cs | 6 +- Square/Models/V1CashDrawerShift.cs | 24 +- Square/Models/V1Category.cs | 2 +- Square/Models/V1CreateCategoryRequest.cs | 2 +- Square/Models/V1CreateDiscountRequest.cs | 2 +- Square/Models/V1CreateEmployeeRoleRequest.cs | 2 +- Square/Models/V1CreateFeeRequest.cs | 2 +- Square/Models/V1CreateItemRequest.cs | 2 +- Square/Models/V1CreateModifierListRequest.cs | 2 +- .../Models/V1CreateModifierOptionRequest.cs | 2 +- Square/Models/V1CreatePageRequest.cs | 2 +- Square/Models/V1CreateRefundRequest.cs | 6 +- Square/Models/V1CreateVariationRequest.cs | 2 +- Square/Models/V1DeletePageCellRequest.cs | 2 +- Square/Models/V1Discount.cs | 8 +- Square/Models/V1Employee.cs | 8 +- Square/Models/V1EmployeeRole.cs | 2 +- Square/Models/V1Fee.cs | 10 +- Square/Models/V1InventoryEntry.cs | 2 +- Square/Models/V1Item.cs | 14 +- Square/Models/V1ItemImage.cs | 2 +- Square/Models/V1ListBankAccountsResponse.cs | 6 +- .../Models/V1ListCashDrawerShiftsRequest.cs | 2 +- .../Models/V1ListCashDrawerShiftsResponse.cs | 6 +- Square/Models/V1ListCategoriesResponse.cs | 6 +- Square/Models/V1ListDiscountsResponse.cs | 6 +- Square/Models/V1ListEmployeeRolesRequest.cs | 2 +- Square/Models/V1ListEmployeeRolesResponse.cs | 6 +- Square/Models/V1ListEmployeesRequest.cs | 4 +- Square/Models/V1ListEmployeesResponse.cs | 6 +- Square/Models/V1ListFeesResponse.cs | 6 +- Square/Models/V1ListInventoryRequest.cs | 2 +- Square/Models/V1ListInventoryResponse.cs | 6 +- Square/Models/V1ListItemsRequest.cs | 2 +- Square/Models/V1ListItemsResponse.cs | 6 +- Square/Models/V1ListLocationsResponse.cs | 6 +- Square/Models/V1ListModifierListsResponse.cs | 6 +- Square/Models/V1ListOrdersRequest.cs | 2 +- Square/Models/V1ListOrdersResponse.cs | 6 +- Square/Models/V1ListPagesResponse.cs | 6 +- Square/Models/V1ListPaymentsRequest.cs | 2 +- Square/Models/V1ListPaymentsResponse.cs | 6 +- Square/Models/V1ListRefundsRequest.cs | 2 +- Square/Models/V1ListRefundsResponse.cs | 6 +- Square/Models/V1ListSettlementsRequest.cs | 6 +- Square/Models/V1ListSettlementsResponse.cs | 6 +- Square/Models/V1ListTimecardEventsResponse.cs | 6 +- Square/Models/V1ListTimecardsRequest.cs | 2 +- Square/Models/V1ListTimecardsResponse.cs | 6 +- Square/Models/V1Merchant.cs | 8 +- Square/Models/V1MerchantLocationDetails.cs | 2 +- Square/Models/V1ModifierList.cs | 6 +- Square/Models/V1ModifierOption.cs | 4 +- Square/Models/V1Money.cs | 2 +- Square/Models/V1Order.cs | 18 +- Square/Models/V1OrderHistoryEntry.cs | 4 +- Square/Models/V1Page.cs | 4 +- Square/Models/V1PageCell.cs | 6 +- Square/Models/V1Payment.cs | 42 +- Square/Models/V1PaymentDiscount.cs | 4 +- Square/Models/V1PaymentItemDetail.cs | 2 +- Square/Models/V1PaymentItemization.cs | 20 +- Square/Models/V1PaymentModifier.cs | 4 +- Square/Models/V1PaymentSurcharge.cs | 10 +- Square/Models/V1PaymentTax.cs | 8 +- Square/Models/V1PhoneNumber.cs | 2 +- Square/Models/V1Refund.cs | 28 +- Square/Models/V1Settlement.cs | 8 +- Square/Models/V1SettlementEntry.cs | 8 +- Square/Models/V1Tender.cs | 14 +- Square/Models/V1Timecard.cs | 2 +- Square/Models/V1TimecardEvent.cs | 2 +- Square/Models/V1UpdateCategoryRequest.cs | 2 +- Square/Models/V1UpdateDiscountRequest.cs | 2 +- Square/Models/V1UpdateEmployeeRequest.cs | 2 +- Square/Models/V1UpdateEmployeeRoleRequest.cs | 2 +- Square/Models/V1UpdateFeeRequest.cs | 2 +- Square/Models/V1UpdateItemRequest.cs | 2 +- Square/Models/V1UpdateModifierListRequest.cs | 4 +- .../Models/V1UpdateModifierOptionRequest.cs | 2 +- Square/Models/V1UpdateOrderRequest.cs | 4 +- Square/Models/V1UpdatePageCellRequest.cs | 2 +- Square/Models/V1UpdatePageRequest.cs | 2 +- Square/Models/V1UpdateTimecardRequest.cs | 2 +- Square/Models/V1UpdateVariationRequest.cs | 2 +- Square/Models/V1Variation.cs | 8 +- Square/Models/VoidTransactionResponse.cs | 4 +- Square/Models/WorkweekConfig.cs | 2 +- Square/Square.csproj | 11 +- Square/SquareClient.cs | 79 +-- .../Utilities/{ApiHelper.cs => APIHelper.cs} | 17 +- doc/apple-pay.md | 2 +- doc/cash-drawers.md | 6 +- doc/catalog.md | 24 +- doc/checkout.md | 2 +- doc/customers.md | 16 +- doc/employees.md | 4 +- doc/inventory.md | 14 +- doc/labor.md | 28 +- doc/locations.md | 8 +- doc/merchants.md | 4 +- doc/mobile-authorization.md | 2 +- doc/models/card-brand.md | 23 +- ...ems-custom-attribute-filter-filter-type.md | 12 +- ...query-filtered-items-nullable-attribute.md | 6 +- ...atalog-query-filtered-items-stock-level.md | 8 +- doc/models/country.md | 504 +++++++++--------- doc/models/create-order-response.md | 116 ++-- doc/models/currency.md | 366 ++++++------- doc/models/employee.md | 2 + doc/models/error-code.md | 27 +- doc/models/error.md | 2 +- doc/models/obtain-token-request.md | 11 +- doc/models/obtain-token-response.md | 3 +- doc/models/refund-payment-request.md | 2 +- ...djust-inventory-request-adjustment-type.md | 10 +- doc/models/v1-bank-account-type.md | 16 +- doc/models/v1-cash-drawer-event-event-type.md | 22 +- doc/models/v1-cash-drawer-shift-event-type.md | 10 +- doc/models/v1-create-refund-request-type.md | 8 +- doc/models/v1-discount-color.md | 22 +- doc/models/v1-discount-discount-type.md | 10 +- doc/models/v1-employee-role-permissions.md | 18 +- doc/models/v1-employee-status.md | 8 +- doc/models/v1-fee-adjustment-type.md | 6 +- doc/models/v1-fee-calculation-phase.md | 10 +- doc/models/v1-fee-inclusion-type.md | 8 +- doc/models/v1-fee-type.md | 20 +- doc/models/v1-item-color.md | 22 +- doc/models/v1-item-type.md | 10 +- doc/models/v1-item-visibility.md | 8 +- .../v1-list-employees-request-status.md | 8 +- .../v1-list-settlements-request-status.md | 8 +- doc/models/v1-list-settlements-request.md | 2 +- doc/models/v1-merchant-account-type.md | 8 +- doc/models/v1-merchant-business-type.md | 104 ++-- doc/models/v1-modifier-list-selection-type.md | 8 +- doc/models/v1-order-history-entry-action.md | 18 +- doc/models/v1-order-state.md | 16 +- doc/models/v1-page-cell-object-type.md | 12 +- doc/models/v1-page-cell-placeholder-type.md | 10 +- ...v1-payment-itemization-itemization-type.md | 16 +- doc/models/v1-payment-surcharge-type.md | 10 +- doc/models/v1-payment-tax-inclusion-type.md | 8 +- doc/models/v1-refund-type.md | 8 +- doc/models/v1-settlement-entry-type.md | 2 +- doc/models/v1-settlement-status.md | 8 +- doc/models/v1-tender-card-brand.md | 22 +- doc/models/v1-tender-entry-method.md | 18 +- doc/models/v1-tender-type.md | 20 +- ...te-modifier-list-request-selection-type.md | 8 +- doc/models/v1-update-order-request-action.md | 10 +- .../v1-variation-inventory-alert-type.md | 16 +- doc/models/v1-variation-pricing-type.md | 8 +- doc/o-auth.md | 13 +- doc/orders.md | 10 +- doc/payments.md | 12 +- doc/refunds.md | 10 +- doc/reporting.md | 4 +- doc/transactions.md | 14 +- doc/v1-employees.md | 32 +- doc/v1-items.md | 80 +-- doc/v1-locations.md | 4 +- doc/v1-transactions.md | 28 +- 492 files changed, 3192 insertions(+), 2965 deletions(-) rename Square/{ => Authentication}/AccessTokenManager.cs (57%) create mode 100644 Square/Authentication/IAccessTokenCredentials.cs rename Square/{ => Authentication}/IAuthManager.cs (51%) rename Square/Exceptions/{ApiException.cs => APIException.cs} (92%) create mode 100644 Square/Http/Client/HttpClientConfiguration.cs create mode 100644 Square/Http/Client/IHttpClientConfiguration.cs rename Square/Utilities/{ApiHelper.cs => APIHelper.cs} (97%) diff --git a/Square.sln b/Square.sln index bd785040..0b6e272c 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", "{a71d06ad-1968-47c9-a5ed-5f8cbba2413e}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square", "Square/Square.csproj", "{4ab9eb37-d74c-4ef7-abf1-8cb193a65d25}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Tests", "Square.Tests/Square.Tests.csproj", "{7612e05f-6e0e-4cdc-9fd7-f07a2fcc7197}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Tests", "Square.Tests/Square.Tests.csproj", "{e928dce4-5cdd-4091-b72b-09e6c76ac7cc}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -12,14 +12,14 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {a71d06ad-1968-47c9-a5ed-5f8cbba2413e}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {a71d06ad-1968-47c9-a5ed-5f8cbba2413e}.Debug|Any CPU.Build.0 = Debug|Any CPU - {a71d06ad-1968-47c9-a5ed-5f8cbba2413e}.Release|Any CPU.ActiveCfg = Release|Any CPU - {a71d06ad-1968-47c9-a5ed-5f8cbba2413e}.Release|Any CPU.Build.0 = Release|Any CPU - {7612e05f-6e0e-4cdc-9fd7-f07a2fcc7197}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7612e05f-6e0e-4cdc-9fd7-f07a2fcc7197}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7612e05f-6e0e-4cdc-9fd7-f07a2fcc7197}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7612e05f-6e0e-4cdc-9fd7-f07a2fcc7197}.Release|Any CPU.Build.0 = Release|Any CPU + {4ab9eb37-d74c-4ef7-abf1-8cb193a65d25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4ab9eb37-d74c-4ef7-abf1-8cb193a65d25}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4ab9eb37-d74c-4ef7-abf1-8cb193a65d25}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4ab9eb37-d74c-4ef7-abf1-8cb193a65d25}.Release|Any CPU.Build.0 = Release|Any CPU + {e928dce4-5cdd-4091-b72b-09e6c76ac7cc}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {e928dce4-5cdd-4091-b72b-09e6c76ac7cc}.Debug|Any CPU.Build.0 = Debug|Any CPU + {e928dce4-5cdd-4091-b72b-09e6c76ac7cc}.Release|Any CPU.ActiveCfg = Release|Any CPU + {e928dce4-5cdd-4091-b72b-09e6c76ac7cc}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Square/Apis/ApplePayApi.cs b/Square/Apis/ApplePayApi.cs index e64e7c6e..cfe9200a 100644 --- a/Square/Apis/ApplePayApi.cs +++ b/Square/Apis/ApplePayApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -51,7 +53,7 @@ public Models.RegisterDomainResponse RegisterDomain(Models.RegisterDomainRequest /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.RegisterDomainResponse response from the API call - public async Task RegisterDomainAsync(Models.RegisterDomainRequest body) + public async Task RegisterDomainAsync(Models.RegisterDomainRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -64,12 +66,12 @@ public async Task RegisterDomainAsync(Models.Regi string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -82,10 +84,10 @@ public async Task RegisterDomainAsync(Models.Regi HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -101,4 +103,4 @@ public async Task RegisterDomainAsync(Models.Regi } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/BaseApi.cs b/Square/Apis/BaseApi.cs index e40271ac..a3d64a93 100644 --- a/Square/Apis/BaseApi.cs +++ b/Square/Apis/BaseApi.cs @@ -5,6 +5,7 @@ using Square.Utilities; using Square.Http.Client; using Square.Http.Response; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -19,6 +20,11 @@ internal class BaseApi /// protected IConfiguration config; + /// + /// User-Agent header value + /// + internal string userAgent = "Square-DotNet-SDK/4.1.0"; + /// /// HttpClient instance /// @@ -85,10 +91,10 @@ internal IHttpClient GetClientInstance() /// Context of the request and the recieved response protected void ValidateResponse(HttpResponse _response, HttpContext _context) { - if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200,208] = HTTP OK + if ((_response.StatusCode < 200) || (_response.StatusCode > 208)) //[200, 208] = HTTP OK { throw new ApiException(@"HTTP Response Not OK", _context); } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/CashDrawersApi.cs b/Square/Apis/CashDrawersApi.cs index c97adf74..4d87a37a 100644 --- a/Square/Apis/CashDrawersApi.cs +++ b/Square/Apis/CashDrawersApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -63,7 +65,7 @@ internal class CashDrawersApi: BaseApi, ICashDrawersApi string beginTime = null, string endTime = null, int? limit = null, - string cursor = null) + string cursor = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -81,17 +83,17 @@ internal class CashDrawersApi: BaseApi, ICashDrawersApi { "end_time", endTime }, { "limit", limit }, { "cursor", cursor } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -101,10 +103,10 @@ internal class CashDrawersApi: BaseApi, ICashDrawersApi HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -140,7 +142,7 @@ public Models.RetrieveCashDrawerShiftResponse RetrieveCashDrawerShift(string loc /// Required parameter: The ID of the location to retrieve cash drawer shifts from. /// Required parameter: The shift ID. /// Returns the Models.RetrieveCashDrawerShiftResponse response from the API call - public async Task RetrieveCashDrawerShiftAsync(string locationId, string shiftId) + public async Task RetrieveCashDrawerShiftAsync(string locationId, string shiftId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -159,17 +161,17 @@ public async Task RetrieveCashDrawerShif ApiHelper.AppendUrlWithQueryParameters(_queryBuilder, new Dictionary() { { "location_id", locationId } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -179,10 +181,10 @@ public async Task RetrieveCashDrawerShif HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -228,7 +230,7 @@ public async Task RetrieveCashDrawerShif string locationId, string shiftId, int? limit = null, - string cursor = null) + string cursor = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -249,17 +251,17 @@ public async Task RetrieveCashDrawerShif { "location_id", locationId }, { "limit", limit }, { "cursor", cursor } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -269,10 +271,10 @@ public async Task RetrieveCashDrawerShif HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -288,4 +290,4 @@ public async Task RetrieveCashDrawerShif } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/CatalogApi.cs b/Square/Apis/CatalogApi.cs index 34e4d384..8785de81 100644 --- a/Square/Apis/CatalogApi.cs +++ b/Square/Apis/CatalogApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -55,7 +57,7 @@ public Models.BatchDeleteCatalogObjectsResponse BatchDeleteCatalogObjects(Models /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.BatchDeleteCatalogObjectsResponse response from the API call - public async Task BatchDeleteCatalogObjectsAsync(Models.BatchDeleteCatalogObjectsRequest body) + public async Task BatchDeleteCatalogObjectsAsync(Models.BatchDeleteCatalogObjectsRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -68,12 +70,12 @@ public async Task BatchDeleteCatalogOb string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -86,10 +88,10 @@ public async Task BatchDeleteCatalogOb HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -131,7 +133,7 @@ public Models.BatchRetrieveCatalogObjectsResponse BatchRetrieveCatalogObjects(Mo /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.BatchRetrieveCatalogObjectsResponse response from the API call - public async Task BatchRetrieveCatalogObjectsAsync(Models.BatchRetrieveCatalogObjectsRequest body) + public async Task BatchRetrieveCatalogObjectsAsync(Models.BatchRetrieveCatalogObjectsRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -144,12 +146,12 @@ public async Task BatchRetrieveCatal string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -162,10 +164,10 @@ public async Task BatchRetrieveCatal HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -213,7 +215,7 @@ public Models.BatchUpsertCatalogObjectsResponse BatchUpsertCatalogObjects(Models /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.BatchUpsertCatalogObjectsResponse response from the API call - public async Task BatchUpsertCatalogObjectsAsync(Models.BatchUpsertCatalogObjectsRequest body) + public async Task BatchUpsertCatalogObjectsAsync(Models.BatchUpsertCatalogObjectsRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -226,12 +228,12 @@ public async Task BatchUpsertCatalogOb string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -244,10 +246,10 @@ public async Task BatchUpsertCatalogOb HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -343,7 +345,7 @@ public Models.CreateCatalogImageResponse CreateCatalogImage(Models.CreateCatalog /// Optional parameter: Example: /// Optional parameter: Example: /// Returns the Models.CreateCatalogImageResponse response from the API call - public async Task CreateCatalogImageAsync(Models.CreateCatalogImageRequest request = null, FileStreamInfo imageFile = null) + public async Task CreateCatalogImageAsync(Models.CreateCatalogImageRequest request = null, FileStreamInfo imageFile = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -356,11 +358,11 @@ public async Task CreateCatalogImageAsync(Mod string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; var requestHeaders = new Dictionary>(StringComparer.OrdinalIgnoreCase) @@ -390,10 +392,10 @@ public async Task CreateCatalogImageAsync(Mod HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -425,7 +427,7 @@ public Models.CatalogInfoResponse CatalogInfo() /// limits for `BatchUpsertCatalogObjects`. /// /// Returns the Models.CatalogInfoResponse response from the API call - public async Task CatalogInfoAsync() + public async Task CatalogInfoAsync(CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -438,11 +440,11 @@ public async Task CatalogInfoAsync() string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -452,10 +454,10 @@ public async Task CatalogInfoAsync() HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -503,7 +505,7 @@ public Models.ListCatalogResponse ListCatalog(string cursor = null, string types /// Optional parameter: The pagination cursor returned in the previous response. Leave unset for an initial request. See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. /// Optional parameter: An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY,IMAGE`. The legal values are taken from the CatalogObjectType enum: `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`, or `IMAGE`. /// Returns the Models.ListCatalogResponse response from the API call - public async Task ListCatalogAsync(string cursor = null, string types = null) + public async Task ListCatalogAsync(string cursor = null, string types = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -517,17 +519,17 @@ public async Task ListCatalogAsync(string cursor = n { { "cursor", cursor }, { "types", types } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -537,10 +539,10 @@ public async Task ListCatalogAsync(string cursor = n HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -572,7 +574,7 @@ public Models.UpsertCatalogObjectResponse UpsertCatalogObject(Models.UpsertCatal /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpsertCatalogObjectResponse response from the API call - public async Task UpsertCatalogObjectAsync(Models.UpsertCatalogObjectRequest body) + public async Task UpsertCatalogObjectAsync(Models.UpsertCatalogObjectRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -585,12 +587,12 @@ public async Task UpsertCatalogObjectAsync(M string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -603,10 +605,10 @@ public async Task UpsertCatalogObjectAsync(M HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -648,7 +650,7 @@ public Models.DeleteCatalogObjectResponse DeleteCatalogObject(string objectId) /// /// Required parameter: The ID of the catalog object to be deleted. When an object is deleted, other objects in the graph that depend on that object will be deleted as well (for example, deleting a catalog item will delete its catalog item variations). /// Returns the Models.DeleteCatalogObjectResponse response from the API call - public async Task DeleteCatalogObjectAsync(string objectId) + public async Task DeleteCatalogObjectAsync(string objectId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -667,11 +669,11 @@ public async Task DeleteCatalogObjectAsync(s string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -681,10 +683,10 @@ public async Task DeleteCatalogObjectAsync(s HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -730,7 +732,7 @@ public Models.RetrieveCatalogObjectResponse RetrieveCatalogObject(string objectI /// Required parameter: The object ID of any type of catalog objects to be retrieved. /// Optional parameter: If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a CatalogItem, its associated CatalogCategory, CatalogTax objects, CatalogImages and CatalogModifierLists will be returned in the `related_objects` field of the response. If the `object` field of the response contains a CatalogItemVariation, its parent CatalogItem will be returned in the `related_objects` field of the response. Default value: `false` /// Returns the Models.RetrieveCatalogObjectResponse response from the API call - public async Task RetrieveCatalogObjectAsync(string objectId, bool? includeRelatedObjects = null) + public async Task RetrieveCatalogObjectAsync(string objectId, bool? includeRelatedObjects = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -749,17 +751,17 @@ public async Task RetrieveCatalogObjectAsy ApiHelper.AppendUrlWithQueryParameters(_queryBuilder, new Dictionary() { { "include_related_objects", includeRelatedObjects } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -769,10 +771,10 @@ public async Task RetrieveCatalogObjectAsy HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -830,7 +832,7 @@ public Models.SearchCatalogObjectsResponse SearchCatalogObjects(Models.SearchCat /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.SearchCatalogObjectsResponse response from the API call - public async Task SearchCatalogObjectsAsync(Models.SearchCatalogObjectsRequest body) + public async Task SearchCatalogObjectsAsync(Models.SearchCatalogObjectsRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -843,12 +845,12 @@ public async Task SearchCatalogObjectsAsync string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -861,10 +863,10 @@ public async Task SearchCatalogObjectsAsync HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -900,7 +902,7 @@ public Models.UpdateItemModifierListsResponse UpdateItemModifierLists(Models.Upd /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateItemModifierListsResponse response from the API call - public async Task UpdateItemModifierListsAsync(Models.UpdateItemModifierListsRequest body) + public async Task UpdateItemModifierListsAsync(Models.UpdateItemModifierListsRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -913,12 +915,12 @@ public async Task UpdateItemModifierList string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -931,10 +933,10 @@ public async Task UpdateItemModifierList HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -970,7 +972,7 @@ public Models.UpdateItemTaxesResponse UpdateItemTaxes(Models.UpdateItemTaxesRequ /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateItemTaxesResponse response from the API call - public async Task UpdateItemTaxesAsync(Models.UpdateItemTaxesRequest body) + public async Task UpdateItemTaxesAsync(Models.UpdateItemTaxesRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -983,12 +985,12 @@ public async Task UpdateItemTaxesAsync(Models.Up string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -1001,10 +1003,10 @@ public async Task UpdateItemTaxesAsync(Models.Up HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1020,4 +1022,4 @@ public async Task UpdateItemTaxesAsync(Models.Up } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/CheckoutApi.cs b/Square/Apis/CheckoutApi.cs index 11bbd3b0..5ee4be7b 100644 --- a/Square/Apis/CheckoutApi.cs +++ b/Square/Apis/CheckoutApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -45,7 +47,7 @@ public Models.CreateCheckoutResponse CreateCheckout(string locationId, Models.Cr /// Required parameter: The ID of the business location to associate the checkout with. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateCheckoutResponse response from the API call - public async Task CreateCheckoutAsync(string locationId, Models.CreateCheckoutRequest body) + public async Task CreateCheckoutAsync(string locationId, Models.CreateCheckoutRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -64,12 +66,12 @@ public async Task CreateCheckoutAsync(string loca string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -82,10 +84,10 @@ public async Task CreateCheckoutAsync(string loca HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -101,4 +103,4 @@ public async Task CreateCheckoutAsync(string loca } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/CustomersApi.cs b/Square/Apis/CustomersApi.cs index 72b59016..4b39b2f5 100644 --- a/Square/Apis/CustomersApi.cs +++ b/Square/Apis/CustomersApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -43,7 +45,7 @@ public Models.ListCustomersResponse ListCustomers(string cursor = null, string s /// Optional parameter: Indicates how Customers should be sorted. Default: `DEFAULT`. /// Optional parameter: Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. /// Returns the Models.ListCustomersResponse response from the API call - public async Task ListCustomersAsync(string cursor = null, string sortField = null, string sortOrder = null) + public async Task ListCustomersAsync(string cursor = null, string sortField = null, string sortOrder = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -58,17 +60,17 @@ public async Task ListCustomersAsync(string cursor { "cursor", cursor }, { "sort_field", sortField }, { "sort_order", sortOrder } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -78,10 +80,10 @@ public async Task ListCustomersAsync(string cursor HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -127,7 +129,7 @@ public Models.CreateCustomerResponse CreateCustomer(Models.CreateCustomerRequest /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateCustomerResponse response from the API call - public async Task CreateCustomerAsync(Models.CreateCustomerRequest body) + public async Task CreateCustomerAsync(Models.CreateCustomerRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -140,12 +142,12 @@ public async Task CreateCustomerAsync(Models.Crea string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -158,10 +160,10 @@ public async Task CreateCustomerAsync(Models.Crea HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -199,7 +201,7 @@ public Models.SearchCustomersResponse SearchCustomers(Models.SearchCustomersRequ /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.SearchCustomersResponse response from the API call - public async Task SearchCustomersAsync(Models.SearchCustomersRequest body) + public async Task SearchCustomersAsync(Models.SearchCustomersRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -212,12 +214,12 @@ public async Task SearchCustomersAsync(Models.Se string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -230,10 +232,10 @@ public async Task SearchCustomersAsync(Models.Se HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -269,7 +271,7 @@ public Models.DeleteCustomerResponse DeleteCustomer(string customerId) /// /// Required parameter: The ID of the customer to delete. /// Returns the Models.DeleteCustomerResponse response from the API call - public async Task DeleteCustomerAsync(string customerId) + public async Task DeleteCustomerAsync(string customerId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -288,11 +290,11 @@ public async Task DeleteCustomerAsync(string cust string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -302,10 +304,10 @@ public async Task DeleteCustomerAsync(string cust HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -337,7 +339,7 @@ public Models.RetrieveCustomerResponse RetrieveCustomer(string customerId) /// /// Required parameter: The ID of the customer to retrieve. /// Returns the Models.RetrieveCustomerResponse response from the API call - public async Task RetrieveCustomerAsync(string customerId) + public async Task RetrieveCustomerAsync(string customerId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -356,11 +358,11 @@ public async Task RetrieveCustomerAsync(string string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -370,10 +372,10 @@ public async Task RetrieveCustomerAsync(string HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -419,7 +421,7 @@ public Models.UpdateCustomerResponse UpdateCustomer(string customerId, Models.Up /// Required parameter: The ID of the customer to update. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateCustomerResponse response from the API call - public async Task UpdateCustomerAsync(string customerId, Models.UpdateCustomerRequest body) + public async Task UpdateCustomerAsync(string customerId, Models.UpdateCustomerRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -438,12 +440,12 @@ public async Task UpdateCustomerAsync(string cust string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -456,10 +458,10 @@ public async Task UpdateCustomerAsync(string cust HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -499,7 +501,7 @@ public Models.CreateCustomerCardResponse CreateCustomerCard(string customerId, M /// Required parameter: The Square ID of the customer profile the card is linked to. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateCustomerCardResponse response from the API call - public async Task CreateCustomerCardAsync(string customerId, Models.CreateCustomerCardRequest body) + public async Task CreateCustomerCardAsync(string customerId, Models.CreateCustomerCardRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -518,12 +520,12 @@ public async Task CreateCustomerCardAsync(str string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -536,10 +538,10 @@ public async Task CreateCustomerCardAsync(str HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -573,7 +575,7 @@ public Models.DeleteCustomerCardResponse DeleteCustomerCard(string customerId, s /// Required parameter: The ID of the customer that the card on file belongs to. /// Required parameter: The ID of the card on file to delete. /// Returns the Models.DeleteCustomerCardResponse response from the API call - public async Task DeleteCustomerCardAsync(string customerId, string cardId) + public async Task DeleteCustomerCardAsync(string customerId, string cardId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -593,11 +595,11 @@ public async Task DeleteCustomerCardAsync(str string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -607,10 +609,10 @@ public async Task DeleteCustomerCardAsync(str HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -626,4 +628,4 @@ public async Task DeleteCustomerCardAsync(str } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/EmployeesApi.cs b/Square/Apis/EmployeesApi.cs index 42348fc1..47466f7f 100644 --- a/Square/Apis/EmployeesApi.cs +++ b/Square/Apis/EmployeesApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -53,7 +55,7 @@ internal class EmployeesApi: BaseApi, IEmployeesApi string locationId = null, string status = null, int? limit = null, - string cursor = null) + string cursor = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -69,17 +71,17 @@ internal class EmployeesApi: BaseApi, IEmployeesApi { "status", status }, { "limit", limit }, { "cursor", cursor } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -89,10 +91,10 @@ internal class EmployeesApi: BaseApi, IEmployeesApi HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -124,7 +126,7 @@ public Models.RetrieveEmployeeResponse RetrieveEmployee(string id) /// /// Required parameter: UUID for the employee that was requested. /// Returns the Models.RetrieveEmployeeResponse response from the API call - public async Task RetrieveEmployeeAsync(string id) + public async Task RetrieveEmployeeAsync(string id, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -143,11 +145,11 @@ public async Task RetrieveEmployeeAsync(string string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -157,10 +159,10 @@ public async Task RetrieveEmployeeAsync(string HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -176,4 +178,4 @@ public async Task RetrieveEmployeeAsync(string } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IApplePayApi.cs b/Square/Apis/IApplePayApi.cs index dc8e7d5c..7f86a789 100644 --- a/Square/Apis/IApplePayApi.cs +++ b/Square/Apis/IApplePayApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -39,7 +40,7 @@ public interface IApplePayApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.RegisterDomainResponse response from the API call - Task RegisterDomainAsync(Models.RegisterDomainRequest body); + Task RegisterDomainAsync(Models.RegisterDomainRequest body, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/ICashDrawersApi.cs b/Square/Apis/ICashDrawersApi.cs index 32e2b4a5..d8bb5235 100644 --- a/Square/Apis/ICashDrawersApi.cs +++ b/Square/Apis/ICashDrawersApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -51,7 +52,7 @@ public interface ICashDrawersApi string beginTime = null, string endTime = null, int? limit = null, - string cursor = null); + string cursor = null, CancellationToken cancellationToken = default); /// /// Provides the summary details for a single cash drawer shift. See @@ -69,7 +70,7 @@ public interface ICashDrawersApi /// Required parameter: The ID of the location to retrieve cash drawer shifts from. /// Required parameter: The shift ID. /// Returns the Models.RetrieveCashDrawerShiftResponse response from the API call - Task RetrieveCashDrawerShiftAsync(string locationId, string shiftId); + Task RetrieveCashDrawerShiftAsync(string locationId, string shiftId, CancellationToken cancellationToken = default); /// /// Provides a paginated list of events for a single cash drawer shift. @@ -97,7 +98,7 @@ public interface ICashDrawersApi string locationId, string shiftId, int? limit = null, - string cursor = null); + string cursor = null, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/ICatalogApi.cs b/Square/Apis/ICatalogApi.cs index d25c8e99..3bd1d7ab 100644 --- a/Square/Apis/ICatalogApi.cs +++ b/Square/Apis/ICatalogApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -43,7 +44,7 @@ public interface ICatalogApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.BatchDeleteCatalogObjectsResponse response from the API call - Task BatchDeleteCatalogObjectsAsync(Models.BatchDeleteCatalogObjectsRequest body); + Task BatchDeleteCatalogObjectsAsync(Models.BatchDeleteCatalogObjectsRequest body, CancellationToken cancellationToken = default); /// /// Returns a set of objects based on the provided ID. @@ -67,7 +68,7 @@ public interface ICatalogApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.BatchRetrieveCatalogObjectsResponse response from the API call - Task BatchRetrieveCatalogObjectsAsync(Models.BatchRetrieveCatalogObjectsRequest body); + Task BatchRetrieveCatalogObjectsAsync(Models.BatchRetrieveCatalogObjectsRequest body, CancellationToken cancellationToken = default); /// /// Creates or updates up to 10,000 target objects based on the provided @@ -97,7 +98,7 @@ public interface ICatalogApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.BatchUpsertCatalogObjectsResponse response from the API call - Task BatchUpsertCatalogObjectsAsync(Models.BatchUpsertCatalogObjectsRequest body); + Task BatchUpsertCatalogObjectsAsync(Models.BatchUpsertCatalogObjectsRequest body, CancellationToken cancellationToken = default); /// /// Upload an image file to create a new [CatalogImage](#type-catalogimage) for an existing @@ -175,7 +176,7 @@ public interface ICatalogApi /// Optional parameter: Example: /// Optional parameter: Example: /// Returns the Models.CreateCatalogImageResponse response from the API call - Task CreateCatalogImageAsync(Models.CreateCatalogImageRequest request = null, FileStreamInfo imageFile = null); + Task CreateCatalogImageAsync(Models.CreateCatalogImageRequest request = null, FileStreamInfo imageFile = null, CancellationToken cancellationToken = default); /// /// Returns information about the Square Catalog API, such as batch size @@ -189,7 +190,7 @@ public interface ICatalogApi /// limits for `BatchUpsertCatalogObjects`. /// /// Returns the Models.CatalogInfoResponse response from the API call - Task CatalogInfoAsync(); + Task CatalogInfoAsync(CancellationToken cancellationToken = default); /// /// Returns a list of [CatalogObject](#type-catalogobject)s that includes @@ -219,7 +220,7 @@ public interface ICatalogApi /// Optional parameter: The pagination cursor returned in the previous response. Leave unset for an initial request. See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. /// Optional parameter: An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY,IMAGE`. The legal values are taken from the CatalogObjectType enum: `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`, or `IMAGE`. /// Returns the Models.ListCatalogResponse response from the API call - Task ListCatalogAsync(string cursor = null, string types = null); + Task ListCatalogAsync(string cursor = null, string types = null, CancellationToken cancellationToken = default); /// /// Creates or updates the target [CatalogObject](#type-catalogobject). @@ -233,7 +234,7 @@ public interface ICatalogApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpsertCatalogObjectResponse response from the API call - Task UpsertCatalogObjectAsync(Models.UpsertCatalogObjectRequest body); + Task UpsertCatalogObjectAsync(Models.UpsertCatalogObjectRequest body, CancellationToken cancellationToken = default); /// /// Deletes a single [CatalogObject](#type-catalogobject) based on the @@ -257,7 +258,7 @@ public interface ICatalogApi /// /// Required parameter: The ID of the catalog object to be deleted. When an object is deleted, other objects in the graph that depend on that object will be deleted as well (for example, deleting a catalog item will delete its catalog item variations). /// Returns the Models.DeleteCatalogObjectResponse response from the API call - Task DeleteCatalogObjectAsync(string objectId); + Task DeleteCatalogObjectAsync(string objectId, CancellationToken cancellationToken = default); /// /// Returns a single [CatalogItem](#type-catalogitem) as a @@ -285,7 +286,7 @@ public interface ICatalogApi /// Required parameter: The object ID of any type of catalog objects to be retrieved. /// Optional parameter: If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a CatalogItem, its associated CatalogCategory, CatalogTax objects, CatalogImages and CatalogModifierLists will be returned in the `related_objects` field of the response. If the `object` field of the response contains a CatalogItemVariation, its parent CatalogItem will be returned in the `related_objects` field of the response. Default value: `false` /// Returns the Models.RetrieveCatalogObjectResponse response from the API call - Task RetrieveCatalogObjectAsync(string objectId, bool? includeRelatedObjects = null); + Task RetrieveCatalogObjectAsync(string objectId, bool? includeRelatedObjects = null, CancellationToken cancellationToken = default); /// /// Queries the targeted catalog using a variety of query types: @@ -325,7 +326,7 @@ public interface ICatalogApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.SearchCatalogObjectsResponse response from the API call - Task SearchCatalogObjectsAsync(Models.SearchCatalogObjectsRequest body); + Task SearchCatalogObjectsAsync(Models.SearchCatalogObjectsRequest body, CancellationToken cancellationToken = default); /// /// Updates the [CatalogModifierList](#type-catalogmodifierlist) objects @@ -343,7 +344,7 @@ public interface ICatalogApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateItemModifierListsResponse response from the API call - Task UpdateItemModifierListsAsync(Models.UpdateItemModifierListsRequest body); + Task UpdateItemModifierListsAsync(Models.UpdateItemModifierListsRequest body, CancellationToken cancellationToken = default); /// /// Updates the [CatalogTax](#type-catalogtax) objects that apply to the @@ -361,7 +362,7 @@ public interface ICatalogApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateItemTaxesResponse response from the API call - Task UpdateItemTaxesAsync(Models.UpdateItemTaxesRequest body); + Task UpdateItemTaxesAsync(Models.UpdateItemTaxesRequest body, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/ICheckoutApi.cs b/Square/Apis/ICheckoutApi.cs index b1e24b7e..c46db842 100644 --- a/Square/Apis/ICheckoutApi.cs +++ b/Square/Apis/ICheckoutApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -33,7 +34,7 @@ public interface ICheckoutApi /// Required parameter: The ID of the business location to associate the checkout with. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateCheckoutResponse response from the API call - Task CreateCheckoutAsync(string locationId, Models.CreateCheckoutRequest body); + Task CreateCheckoutAsync(string locationId, Models.CreateCheckoutRequest body, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/ICustomersApi.cs b/Square/Apis/ICustomersApi.cs index 5fb93886..3b6a0080 100644 --- a/Square/Apis/ICustomersApi.cs +++ b/Square/Apis/ICustomersApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -31,7 +32,7 @@ public interface ICustomersApi /// Optional parameter: Indicates how Customers should be sorted. Default: `DEFAULT`. /// Optional parameter: Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. /// Returns the Models.ListCustomersResponse response from the API call - Task ListCustomersAsync(string cursor = null, string sortField = null, string sortOrder = null); + Task ListCustomersAsync(string cursor = null, string sortField = null, string sortOrder = null, CancellationToken cancellationToken = default); /// /// Creates a new customer for a business, which can have associated cards on file. @@ -59,7 +60,7 @@ public interface ICustomersApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateCustomerResponse response from the API call - Task CreateCustomerAsync(Models.CreateCustomerRequest body); + Task CreateCustomerAsync(Models.CreateCustomerRequest body, CancellationToken cancellationToken = default); /// /// Searches the customer profiles associated with a Square account. @@ -79,7 +80,7 @@ public interface ICustomersApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.SearchCustomersResponse response from the API call - Task SearchCustomersAsync(Models.SearchCustomersRequest body); + Task SearchCustomersAsync(Models.SearchCustomersRequest body, CancellationToken cancellationToken = default); /// /// Deletes a customer from a business, along with any linked cards on file. When two profiles @@ -97,7 +98,7 @@ public interface ICustomersApi /// /// Required parameter: The ID of the customer to delete. /// Returns the Models.DeleteCustomerResponse response from the API call - Task DeleteCustomerAsync(string customerId); + Task DeleteCustomerAsync(string customerId, CancellationToken cancellationToken = default); /// /// Returns details for a single customer. @@ -111,7 +112,7 @@ public interface ICustomersApi /// /// Required parameter: The ID of the customer to retrieve. /// Returns the Models.RetrieveCustomerResponse response from the API call - Task RetrieveCustomerAsync(string customerId); + Task RetrieveCustomerAsync(string customerId, CancellationToken cancellationToken = default); /// /// Updates the details of an existing customer. When two profiles are merged @@ -139,7 +140,7 @@ public interface ICustomersApi /// Required parameter: The ID of the customer to update. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateCustomerResponse response from the API call - Task UpdateCustomerAsync(string customerId, Models.UpdateCustomerRequest body); + Task UpdateCustomerAsync(string customerId, Models.UpdateCustomerRequest body, CancellationToken cancellationToken = default); /// /// Adds a card on file to an existing customer. @@ -161,7 +162,7 @@ public interface ICustomersApi /// Required parameter: The Square ID of the customer profile the card is linked to. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateCustomerCardResponse response from the API call - Task CreateCustomerCardAsync(string customerId, Models.CreateCustomerCardRequest body); + Task CreateCustomerCardAsync(string customerId, Models.CreateCustomerCardRequest body, CancellationToken cancellationToken = default); /// /// Removes a card on file from a customer. @@ -177,7 +178,7 @@ public interface ICustomersApi /// Required parameter: The ID of the customer that the card on file belongs to. /// Required parameter: The ID of the card on file to delete. /// Returns the Models.DeleteCustomerCardResponse response from the API call - Task DeleteCustomerCardAsync(string customerId, string cardId); + Task DeleteCustomerCardAsync(string customerId, string cardId, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IEmployeesApi.cs b/Square/Apis/IEmployeesApi.cs index 987e41ad..8ad2ddeb 100644 --- a/Square/Apis/IEmployeesApi.cs +++ b/Square/Apis/IEmployeesApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -41,7 +42,7 @@ public interface IEmployeesApi string locationId = null, string status = null, int? limit = null, - string cursor = null); + string cursor = null, CancellationToken cancellationToken = default); /// /// RetrieveEmployee @@ -55,7 +56,7 @@ public interface IEmployeesApi /// /// Required parameter: UUID for the employee that was requested. /// Returns the Models.RetrieveEmployeeResponse response from the API call - Task RetrieveEmployeeAsync(string id); + Task RetrieveEmployeeAsync(string id, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IInventoryApi.cs b/Square/Apis/IInventoryApi.cs index 0ca84b96..10dbb09a 100644 --- a/Square/Apis/IInventoryApi.cs +++ b/Square/Apis/IInventoryApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -29,7 +30,7 @@ public interface IInventoryApi /// /// Required parameter: ID of the [InventoryAdjustment](#type-inventoryadjustment) to retrieve. /// Returns the Models.RetrieveInventoryAdjustmentResponse response from the API call - Task RetrieveInventoryAdjustmentAsync(string adjustmentId); + Task RetrieveInventoryAdjustmentAsync(string adjustmentId, CancellationToken cancellationToken = default); /// /// Applies adjustments and counts to the provided item quantities. @@ -49,7 +50,7 @@ public interface IInventoryApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.BatchChangeInventoryResponse response from the API call - Task BatchChangeInventoryAsync(Models.BatchChangeInventoryRequest body); + Task BatchChangeInventoryAsync(Models.BatchChangeInventoryRequest body, CancellationToken cancellationToken = default); /// /// Returns historical physical counts and adjustments based on the @@ -73,7 +74,7 @@ public interface IInventoryApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.BatchRetrieveInventoryChangesResponse response from the API call - Task BatchRetrieveInventoryChangesAsync(Models.BatchRetrieveInventoryChangesRequest body); + Task BatchRetrieveInventoryChangesAsync(Models.BatchRetrieveInventoryChangesRequest body, CancellationToken cancellationToken = default); /// /// Returns current counts for the provided @@ -103,7 +104,7 @@ public interface IInventoryApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.BatchRetrieveInventoryCountsResponse response from the API call - Task BatchRetrieveInventoryCountsAsync(Models.BatchRetrieveInventoryCountsRequest body); + Task BatchRetrieveInventoryCountsAsync(Models.BatchRetrieveInventoryCountsRequest body, CancellationToken cancellationToken = default); /// /// Returns the [InventoryPhysicalCount](#type-inventoryphysicalcount) @@ -119,7 +120,7 @@ public interface IInventoryApi /// /// Required parameter: ID of the [InventoryPhysicalCount](#type-inventoryphysicalcount) to retrieve. /// Returns the Models.RetrieveInventoryPhysicalCountResponse response from the API call - Task RetrieveInventoryPhysicalCountAsync(string physicalCountId); + Task RetrieveInventoryPhysicalCountAsync(string physicalCountId, CancellationToken cancellationToken = default); /// /// Retrieves the current calculated stock count for a given @@ -143,7 +144,7 @@ public interface IInventoryApi /// Optional parameter: The [Location](#type-location) IDs to look up as a comma-separated list. An empty list queries all locations. /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information. /// Returns the Models.RetrieveInventoryCountResponse response from the API call - Task RetrieveInventoryCountAsync(string catalogObjectId, string locationIds = null, string cursor = null); + Task RetrieveInventoryCountAsync(string catalogObjectId, string locationIds = null, string cursor = null, CancellationToken cancellationToken = default); /// /// Returns a set of physical counts and inventory adjustments for the @@ -175,7 +176,7 @@ public interface IInventoryApi /// Optional parameter: The [Location](#type-location) IDs to look up as a comma-separated list. An empty list queries all locations. /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information. /// Returns the Models.RetrieveInventoryChangesResponse response from the API call - Task RetrieveInventoryChangesAsync(string catalogObjectId, string locationIds = null, string cursor = null); + Task RetrieveInventoryChangesAsync(string catalogObjectId, string locationIds = null, string cursor = null, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/ILaborApi.cs b/Square/Apis/ILaborApi.cs index 8977cd08..80622533 100644 --- a/Square/Apis/ILaborApi.cs +++ b/Square/Apis/ILaborApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -31,7 +32,7 @@ public interface ILaborApi /// Optional parameter: Maximum number of Break Types to return per page. Can range between 1 and 200. The default is the maximum at 200. /// Optional parameter: Pointer to the next page of Break Type results to fetch. /// Returns the Models.ListBreakTypesResponse response from the API call - Task ListBreakTypesAsync(string locationId = null, int? limit = null, string cursor = null); + Task ListBreakTypesAsync(string locationId = null, int? limit = null, string cursor = null, CancellationToken cancellationToken = default); /// /// Creates a new `BreakType`. @@ -65,7 +66,7 @@ public interface ILaborApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateBreakTypeResponse response from the API call - Task CreateBreakTypeAsync(Models.CreateBreakTypeRequest body); + Task CreateBreakTypeAsync(Models.CreateBreakTypeRequest body, CancellationToken cancellationToken = default); /// /// Deletes an existing `BreakType`. @@ -81,7 +82,7 @@ public interface ILaborApi /// /// Required parameter: UUID for the `BreakType` being deleted. /// Returns the Models.DeleteBreakTypeResponse response from the API call - Task DeleteBreakTypeAsync(string id); + Task DeleteBreakTypeAsync(string id, CancellationToken cancellationToken = default); /// /// Returns a single `BreakType` specified by id. @@ -95,7 +96,7 @@ public interface ILaborApi /// /// Required parameter: UUID for the `BreakType` being retrieved. /// Returns the Models.GetBreakTypeResponse response from the API call - Task GetBreakTypeAsync(string id); + Task GetBreakTypeAsync(string id, CancellationToken cancellationToken = default); /// /// Updates an existing `BreakType`. @@ -111,7 +112,7 @@ public interface ILaborApi /// Required parameter: UUID for the `BreakType` being updated. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateBreakTypeResponse response from the API call - Task UpdateBreakTypeAsync(string id, Models.UpdateBreakTypeRequest body); + Task UpdateBreakTypeAsync(string id, Models.UpdateBreakTypeRequest body, CancellationToken cancellationToken = default); /// /// Returns a paginated list of `EmployeeWage` instances for a business. @@ -129,7 +130,7 @@ public interface ILaborApi /// Optional parameter: Maximum number of Employee Wages to return per page. Can range between 1 and 200. The default is the maximum at 200. /// Optional parameter: Pointer to the next page of Employee Wage results to fetch. /// Returns the Models.ListEmployeeWagesResponse response from the API call - Task ListEmployeeWagesAsync(string employeeId = null, int? limit = null, string cursor = null); + Task ListEmployeeWagesAsync(string employeeId = null, int? limit = null, string cursor = null, CancellationToken cancellationToken = default); /// /// Returns a single `EmployeeWage` specified by id. @@ -143,7 +144,7 @@ public interface ILaborApi /// /// Required parameter: UUID for the `EmployeeWage` being retrieved. /// Returns the Models.GetEmployeeWageResponse response from the API call - Task GetEmployeeWageAsync(string id); + Task GetEmployeeWageAsync(string id, CancellationToken cancellationToken = default); /// /// Creates a new `Shift`. @@ -185,7 +186,7 @@ public interface ILaborApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateShiftResponse response from the API call - Task CreateShiftAsync(Models.CreateShiftRequest body); + Task CreateShiftAsync(Models.CreateShiftRequest body, CancellationToken cancellationToken = default); /// /// Returns a paginated list of `Shift` records for a business. @@ -223,7 +224,7 @@ public interface ILaborApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.SearchShiftsResponse response from the API call - Task SearchShiftsAsync(Models.SearchShiftsRequest body); + Task SearchShiftsAsync(Models.SearchShiftsRequest body, CancellationToken cancellationToken = default); /// /// Deletes a `Shift`. @@ -237,7 +238,7 @@ public interface ILaborApi /// /// Required parameter: UUID for the `Shift` being deleted. /// Returns the Models.DeleteShiftResponse response from the API call - Task DeleteShiftAsync(string id); + Task DeleteShiftAsync(string id, CancellationToken cancellationToken = default); /// /// Returns a single `Shift` specified by id. @@ -251,7 +252,7 @@ public interface ILaborApi /// /// Required parameter: UUID for the `Shift` being retrieved. /// Returns the Models.GetShiftResponse response from the API call - Task GetShiftAsync(string id); + Task GetShiftAsync(string id, CancellationToken cancellationToken = default); /// /// Updates an existing `Shift`. @@ -275,7 +276,7 @@ public interface ILaborApi /// Required parameter: ID of the object being updated. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateShiftResponse response from the API call - Task UpdateShiftAsync(string id, Models.UpdateShiftRequest body); + Task UpdateShiftAsync(string id, Models.UpdateShiftRequest body, CancellationToken cancellationToken = default); /// /// Returns a list of `WorkweekConfig` instances for a business. @@ -291,7 +292,7 @@ public interface ILaborApi /// Optional parameter: Maximum number of Workweek Configs to return per page. /// Optional parameter: Pointer to the next page of Workweek Config results to fetch. /// Returns the Models.ListWorkweekConfigsResponse response from the API call - Task ListWorkweekConfigsAsync(int? limit = null, string cursor = null); + Task ListWorkweekConfigsAsync(int? limit = null, string cursor = null, CancellationToken cancellationToken = default); /// /// Updates a `WorkweekConfig`. @@ -307,7 +308,7 @@ public interface ILaborApi /// Required parameter: UUID for the `WorkweekConfig` object being updated. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateWorkweekConfigResponse response from the API call - Task UpdateWorkweekConfigAsync(string id, Models.UpdateWorkweekConfigRequest body); + Task UpdateWorkweekConfigAsync(string id, Models.UpdateWorkweekConfigRequest body, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/ILocationsApi.cs b/Square/Apis/ILocationsApi.cs index 410bc40d..e9572f32 100644 --- a/Square/Apis/ILocationsApi.cs +++ b/Square/Apis/ILocationsApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -31,7 +32,7 @@ public interface ILocationsApi /// endpoint correspond to that `location_id` parameter. /// /// Returns the Models.ListLocationsResponse response from the API call - Task ListLocationsAsync(); + Task ListLocationsAsync(CancellationToken cancellationToken = default); /// /// Creates a location. @@ -47,7 +48,7 @@ public interface ILocationsApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateLocationResponse response from the API call - Task CreateLocationAsync(Models.CreateLocationRequest body); + Task CreateLocationAsync(Models.CreateLocationRequest body, CancellationToken cancellationToken = default); /// /// Retrieves details of a location. @@ -61,7 +62,7 @@ public interface ILocationsApi /// /// Required parameter: The ID of the location to retrieve. /// Returns the Models.RetrieveLocationResponse response from the API call - Task RetrieveLocationAsync(string locationId); + Task RetrieveLocationAsync(string locationId, CancellationToken cancellationToken = default); /// /// Updates a location. @@ -77,7 +78,7 @@ public interface ILocationsApi /// Required parameter: The ID of the location to update. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateLocationResponse response from the API call - Task UpdateLocationAsync(string locationId, Models.UpdateLocationRequest body); + Task UpdateLocationAsync(string locationId, Models.UpdateLocationRequest body, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IMerchantsApi.cs b/Square/Apis/IMerchantsApi.cs index 721965db..c1007b9d 100644 --- a/Square/Apis/IMerchantsApi.cs +++ b/Square/Apis/IMerchantsApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -37,7 +38,7 @@ public interface IMerchantsApi /// /// Optional parameter: The cursor generated by the previous response. /// Returns the Models.ListMerchantsResponse response from the API call - Task ListMerchantsAsync(int? cursor = null); + Task ListMerchantsAsync(int? cursor = null, CancellationToken cancellationToken = default); /// /// Retrieve a `Merchant` object for the given `merchant_id`. @@ -51,7 +52,7 @@ public interface IMerchantsApi /// /// Required parameter: The ID of the merchant to retrieve. /// Returns the Models.RetrieveMerchantResponse response from the API call - Task RetrieveMerchantAsync(string merchantId); + Task RetrieveMerchantAsync(string merchantId, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IMobileAuthorizationApi.cs b/Square/Apis/IMobileAuthorizationApi.cs index ab34a62e..fc72a9c2 100644 --- a/Square/Apis/IMobileAuthorizationApi.cs +++ b/Square/Apis/IMobileAuthorizationApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -41,7 +42,7 @@ public interface IMobileAuthorizationApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateMobileAuthorizationCodeResponse response from the API call - Task CreateMobileAuthorizationCodeAsync(Models.CreateMobileAuthorizationCodeRequest body); + Task CreateMobileAuthorizationCodeAsync(Models.CreateMobileAuthorizationCodeRequest body, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IOAuthApi.cs b/Square/Apis/IOAuthApi.cs index 0e9c6fac..c65005be 100644 --- a/Square/Apis/IOAuthApi.cs +++ b/Square/Apis/IOAuthApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -59,7 +60,7 @@ public interface IOAuthApi /// Required parameter: Client APPLICATION_SECRET /// Returns the Models.RenewTokenResponse response from the API call [Obsolete] - Task RenewTokenAsync(string clientId, Models.RenewTokenRequest body, string authorization); + Task RenewTokenAsync(string clientId, Models.RenewTokenRequest body, string authorization, CancellationToken cancellationToken = default); /// /// Revokes an access token generated with the OAuth flow. @@ -97,7 +98,7 @@ public interface IOAuthApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Required parameter: Client APPLICATION_SECRET /// Returns the Models.RevokeTokenResponse response from the API call - Task RevokeTokenAsync(Models.RevokeTokenRequest body, string authorization); + Task RevokeTokenAsync(Models.RevokeTokenRequest body, string authorization, CancellationToken cancellationToken = default); /// /// Returns an OAuth access token. @@ -129,7 +130,7 @@ public interface IOAuthApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.ObtainTokenResponse response from the API call - Task ObtainTokenAsync(Models.ObtainTokenRequest body); + Task ObtainTokenAsync(Models.ObtainTokenRequest body, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IOrdersApi.cs b/Square/Apis/IOrdersApi.cs index b1208a01..b4cba6df 100644 --- a/Square/Apis/IOrdersApi.cs +++ b/Square/Apis/IOrdersApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -41,7 +42,7 @@ public interface IOrdersApi /// Required parameter: The ID of the business location to associate the order with. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateOrderResponse response from the API call - Task CreateOrderAsync(string locationId, Models.CreateOrderRequest body); + Task CreateOrderAsync(string locationId, Models.CreateOrderRequest body, CancellationToken cancellationToken = default); /// /// Retrieves a set of [Order](#type-order)s by their IDs. @@ -59,7 +60,7 @@ public interface IOrdersApi /// Required parameter: The ID of the orders' 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.BatchRetrieveOrdersResponse response from the API call - Task BatchRetrieveOrdersAsync(string locationId, Models.BatchRetrieveOrdersRequest body); + Task BatchRetrieveOrdersAsync(string locationId, Models.BatchRetrieveOrdersRequest body, CancellationToken cancellationToken = default); /// /// Updates an open [Order](#type-order) by adding, replacing, or deleting @@ -101,7 +102,7 @@ public interface IOrdersApi /// Required parameter: The ID of the order to update. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateOrderResponse response from the API call - Task UpdateOrderAsync(string locationId, string orderId, Models.UpdateOrderRequest body); + Task UpdateOrderAsync(string locationId, string orderId, Models.UpdateOrderRequest body, CancellationToken cancellationToken = default); /// /// Search all orders for one or more locations. Orders include all sales, @@ -141,7 +142,7 @@ public interface IOrdersApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.SearchOrdersResponse response from the API call - Task SearchOrdersAsync(Models.SearchOrdersRequest body); + Task SearchOrdersAsync(Models.SearchOrdersRequest body, CancellationToken cancellationToken = default); /// /// Pay for an [order](#type-order) using one or more approved [payments](#type-payment), @@ -179,7 +180,7 @@ public interface IOrdersApi /// Required parameter: The ID of the order being paid. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.PayOrderResponse response from the API call - Task PayOrderAsync(string orderId, Models.PayOrderRequest body); + Task PayOrderAsync(string orderId, Models.PayOrderRequest body, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IPaymentsApi.cs b/Square/Apis/IPaymentsApi.cs index be1bd386..53267fb1 100644 --- a/Square/Apis/IPaymentsApi.cs +++ b/Square/Apis/IPaymentsApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -59,7 +60,7 @@ public interface IPaymentsApi string locationId = null, long? total = null, string last4 = null, - string cardBrand = null); + string cardBrand = null, CancellationToken cancellationToken = default); /// /// Charges a payment source, for example, a card @@ -93,7 +94,7 @@ public interface IPaymentsApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreatePaymentResponse response from the API call - Task CreatePaymentAsync(Models.CreatePaymentRequest body); + Task CreatePaymentAsync(Models.CreatePaymentRequest body, CancellationToken cancellationToken = default); /// /// Cancels (voids) a payment identified by the idempotency key that is specified in the request. @@ -123,7 +124,7 @@ public interface IPaymentsApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CancelPaymentByIdempotencyKeyResponse response from the API call - Task CancelPaymentByIdempotencyKeyAsync(Models.CancelPaymentByIdempotencyKeyRequest body); + Task CancelPaymentByIdempotencyKeyAsync(Models.CancelPaymentByIdempotencyKeyRequest body, CancellationToken cancellationToken = default); /// /// Retrieves details for a specific Payment. @@ -137,7 +138,7 @@ public interface IPaymentsApi /// /// Required parameter: Unique ID for the desired `Payment`. /// Returns the Models.GetPaymentResponse response from the API call - Task GetPaymentAsync(string paymentId); + Task GetPaymentAsync(string paymentId, CancellationToken cancellationToken = default); /// /// Cancels (voids) a payment. If you set `autocomplete` to false when creating a payment, @@ -155,7 +156,7 @@ public interface IPaymentsApi /// /// Required parameter: `payment_id` identifying the payment to be canceled. /// Returns the Models.CancelPaymentResponse response from the API call - Task CancelPaymentAsync(string paymentId); + Task CancelPaymentAsync(string paymentId, CancellationToken cancellationToken = default); /// /// Completes (captures) a payment. @@ -177,7 +178,7 @@ public interface IPaymentsApi /// /// Required parameter: Unique ID identifying the payment to be completed. /// Returns the Models.CompletePaymentResponse response from the API call - Task CompletePaymentAsync(string paymentId); + Task CompletePaymentAsync(string paymentId, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IRefundsApi.cs b/Square/Apis/IRefundsApi.cs index 19472f3d..436aeca1 100644 --- a/Square/Apis/IRefundsApi.cs +++ b/Square/Apis/IRefundsApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -55,7 +56,7 @@ public interface IRefundsApi string cursor = null, string locationId = null, string status = null, - string sourceType = null); + string sourceType = null, CancellationToken cancellationToken = default); /// /// Refunds a payment. You can refund the entire payment amount or a @@ -73,7 +74,7 @@ public interface IRefundsApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.RefundPaymentResponse response from the API call - Task RefundPaymentAsync(Models.RefundPaymentRequest body); + Task RefundPaymentAsync(Models.RefundPaymentRequest body, CancellationToken cancellationToken = default); /// /// Retrieves a specific `Refund` using the `refund_id`. @@ -87,7 +88,7 @@ public interface IRefundsApi /// /// Required parameter: Unique ID for the desired `PaymentRefund`. /// Returns the Models.GetPaymentRefundResponse response from the API call - Task GetPaymentRefundAsync(string refundId); + Task GetPaymentRefundAsync(string refundId, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IReportingApi.cs b/Square/Apis/IReportingApi.cs index 74d94c00..e68892d9 100644 --- a/Square/Apis/IReportingApi.cs +++ b/Square/Apis/IReportingApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -51,7 +52,7 @@ public interface IReportingApi string beginTime = null, string endTime = null, string sortOrder = null, - string cursor = null); + string cursor = null, CancellationToken cancellationToken = default); /// /// Returns a list of receivables (across all possible sending locations) representing monies credited @@ -89,7 +90,7 @@ public interface IReportingApi string beginTime = null, string endTime = null, string sortOrder = null, - string cursor = null); + string cursor = null, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/ITransactionsApi.cs b/Square/Apis/ITransactionsApi.cs index 178adf12..767a253b 100644 --- a/Square/Apis/ITransactionsApi.cs +++ b/Square/Apis/ITransactionsApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -61,7 +62,7 @@ public interface ITransactionsApi string beginTime = null, string endTime = null, string sortOrder = null, - string cursor = null); + string cursor = null, CancellationToken cancellationToken = default); /// /// Lists transactions for a particular location. @@ -103,7 +104,7 @@ public interface ITransactionsApi string beginTime = null, string endTime = null, string sortOrder = null, - string cursor = null); + string cursor = null, CancellationToken cancellationToken = default); /// /// Charges a card represented by a card nonce or a customer's card on file. @@ -151,7 +152,7 @@ public interface ITransactionsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.ChargeResponse response from the API call [Obsolete] - Task ChargeAsync(string locationId, Models.ChargeRequest body); + Task ChargeAsync(string locationId, Models.ChargeRequest body, CancellationToken cancellationToken = default); /// /// Retrieves details for a single transaction. @@ -171,7 +172,7 @@ public interface ITransactionsApi /// Required parameter: The ID of the transaction to retrieve. /// Returns the Models.RetrieveTransactionResponse response from the API call [Obsolete] - Task RetrieveTransactionAsync(string locationId, string transactionId); + Task RetrieveTransactionAsync(string locationId, string transactionId, CancellationToken cancellationToken = default); /// /// Captures a transaction that was created with the [Charge](#endpoint-charge) @@ -195,7 +196,7 @@ public interface ITransactionsApi /// Required parameter: Example: /// Returns the Models.CaptureTransactionResponse response from the API call [Obsolete] - Task CaptureTransactionAsync(string locationId, string transactionId); + Task CaptureTransactionAsync(string locationId, string transactionId, CancellationToken cancellationToken = default); /// /// Initiates a refund for a previously charged tender. @@ -229,7 +230,7 @@ public interface ITransactionsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateRefundResponse response from the API call [Obsolete] - Task CreateRefundAsync(string locationId, string transactionId, Models.CreateRefundRequest body); + Task CreateRefundAsync(string locationId, string transactionId, Models.CreateRefundRequest body, CancellationToken cancellationToken = default); /// /// Cancels a transaction that was created with the [Charge](#endpoint-charge) @@ -253,7 +254,7 @@ public interface ITransactionsApi /// Required parameter: Example: /// Returns the Models.VoidTransactionResponse response from the API call [Obsolete] - Task VoidTransactionAsync(string locationId, string transactionId); + Task VoidTransactionAsync(string locationId, string transactionId, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IV1EmployeesApi.cs b/Square/Apis/IV1EmployeesApi.cs index c3894f2b..3bd75016 100644 --- a/Square/Apis/IV1EmployeesApi.cs +++ b/Square/Apis/IV1EmployeesApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -61,7 +62,7 @@ public interface IV1EmployeesApi string status = null, string externalId = null, int? limit = null, - string batchToken = null); + string batchToken = null, CancellationToken cancellationToken = default); /// /// Use the CreateEmployee endpoint to add an employee to a Square @@ -91,7 +92,7 @@ public interface IV1EmployeesApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Employee response from the API call - Task CreateEmployeeAsync(Models.V1Employee body); + Task CreateEmployeeAsync(Models.V1Employee body, CancellationToken cancellationToken = default); /// /// Provides the details for a single employee. @@ -105,7 +106,7 @@ public interface IV1EmployeesApi /// /// Required parameter: The employee's ID. /// Returns the Models.V1Employee response from the API call - Task RetrieveEmployeeAsync(string employeeId); + Task RetrieveEmployeeAsync(string employeeId, CancellationToken cancellationToken = default); /// /// UpdateEmployee @@ -121,7 +122,7 @@ public interface IV1EmployeesApi /// Required parameter: The ID of the role to modify. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Employee response from the API call - Task UpdateEmployeeAsync(string employeeId, Models.V1Employee body); + Task UpdateEmployeeAsync(string employeeId, Models.V1Employee body, CancellationToken cancellationToken = default); /// /// Provides summary information for all of a business's employee roles. @@ -139,7 +140,7 @@ public interface IV1EmployeesApi /// Optional parameter: The maximum integer number of employee entities to return in a single response. Default 100, maximum 200. /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint. /// Returns the List response from the API call - Task> ListEmployeeRolesAsync(string order = null, int? limit = null, string batchToken = null); + Task> ListEmployeeRolesAsync(string order = null, int? limit = null, string batchToken = null, CancellationToken cancellationToken = default); /// /// Creates an employee role you can then assign to employees. @@ -171,7 +172,7 @@ public interface IV1EmployeesApi /// /// Required parameter: An EmployeeRole object with a name and permissions, and an optional owner flag. /// Returns the Models.V1EmployeeRole response from the API call - Task CreateEmployeeRoleAsync(Models.V1EmployeeRole body); + Task CreateEmployeeRoleAsync(Models.V1EmployeeRole body, CancellationToken cancellationToken = default); /// /// Provides the details for a single employee role. @@ -185,7 +186,7 @@ public interface IV1EmployeesApi /// /// Required parameter: The role's ID. /// Returns the Models.V1EmployeeRole response from the API call - Task RetrieveEmployeeRoleAsync(string roleId); + Task RetrieveEmployeeRoleAsync(string roleId, CancellationToken cancellationToken = default); /// /// Modifies the details of an employee role. @@ -201,7 +202,7 @@ public interface IV1EmployeesApi /// Required parameter: The ID of the role to modify. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1EmployeeRole response from the API call - Task UpdateEmployeeRoleAsync(string roleId, Models.V1EmployeeRole body); + Task UpdateEmployeeRoleAsync(string roleId, Models.V1EmployeeRole body, CancellationToken cancellationToken = default); /// /// Provides summary information for all of a business's employee timecards. @@ -257,7 +258,7 @@ public interface IV1EmployeesApi string endUpdatedAt = null, bool? deleted = null, int? limit = null, - string batchToken = null); + string batchToken = null, CancellationToken cancellationToken = default); /// /// Creates a timecard for an employee and clocks them in with an @@ -289,7 +290,7 @@ public interface IV1EmployeesApi /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Timecard response from the API call - Task CreateTimecardAsync(Models.V1Timecard body); + Task CreateTimecardAsync(Models.V1Timecard body, CancellationToken cancellationToken = default); /// /// Deletes a timecard. Timecards can also be deleted through the @@ -327,7 +328,7 @@ public interface IV1EmployeesApi /// /// Required parameter: The ID of the timecard to delete. /// Returns the object response from the API call - Task DeleteTimecardAsync(string timecardId); + Task DeleteTimecardAsync(string timecardId, CancellationToken cancellationToken = default); /// /// Provides the details for a single timecard. @@ -351,7 +352,7 @@ public interface IV1EmployeesApi /// /// Required parameter: The timecard's ID. /// Returns the Models.V1Timecard response from the API call - Task RetrieveTimecardAsync(string timecardId); + Task RetrieveTimecardAsync(string timecardId, CancellationToken cancellationToken = default); /// /// Modifies the details of a timecard with an `API_EDIT` event for @@ -371,7 +372,7 @@ public interface IV1EmployeesApi /// Required parameter: TThe ID of the timecard to modify. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Timecard response from the API call - Task UpdateTimecardAsync(string timecardId, Models.V1Timecard body); + Task UpdateTimecardAsync(string timecardId, Models.V1Timecard body, CancellationToken cancellationToken = default); /// /// Provides summary information for all events associated with a @@ -397,7 +398,7 @@ public interface IV1EmployeesApi /// /// Required parameter: The ID of the timecard to list events for. /// Returns the List response from the API call - Task> ListTimecardEventsAsync(string timecardId); + Task> ListTimecardEventsAsync(string timecardId, CancellationToken cancellationToken = default); /// /// Provides the details for all of a location's cash drawer shifts during a date range. The date range you specify cannot exceed 90 days. @@ -425,7 +426,7 @@ public interface IV1EmployeesApi string locationId, string order = null, string beginTime = null, - string endTime = null); + string endTime = null, CancellationToken cancellationToken = default); /// /// Provides the details for a single cash drawer shift, including all events that occurred during the shift. @@ -441,7 +442,7 @@ public interface IV1EmployeesApi /// Required parameter: The ID of the location to list cash drawer shifts for. /// Required parameter: The shift's ID. /// Returns the Models.V1CashDrawerShift response from the API call - Task RetrieveCashDrawerShiftAsync(string locationId, string shiftId); + Task RetrieveCashDrawerShiftAsync(string locationId, string shiftId, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IV1ItemsApi.cs b/Square/Apis/IV1ItemsApi.cs index 2b399b5a..3443b3f1 100644 --- a/Square/Apis/IV1ItemsApi.cs +++ b/Square/Apis/IV1ItemsApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -39,7 +40,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the location to list categories for. /// Returns the List response from the API call [Obsolete] - Task> ListCategoriesAsync(string locationId); + Task> ListCategoriesAsync(string locationId, CancellationToken cancellationToken = default); /// /// Creates an item category. @@ -67,7 +68,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Category response from the API call [Obsolete] - Task CreateCategoryAsync(string locationId, Models.V1Category body); + Task CreateCategoryAsync(string locationId, Models.V1Category body, CancellationToken cancellationToken = default); /// /// Deletes an existing item category. @@ -101,7 +102,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the category to delete. /// Returns the Models.V1Category response from the API call [Obsolete] - Task DeleteCategoryAsync(string locationId, string categoryId); + Task DeleteCategoryAsync(string locationId, string categoryId, CancellationToken cancellationToken = default); /// /// Modifies the details of an existing item category. @@ -131,7 +132,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Category response from the API call [Obsolete] - Task UpdateCategoryAsync(string locationId, string categoryId, Models.V1Category body); + Task UpdateCategoryAsync(string locationId, string categoryId, Models.V1Category body, CancellationToken cancellationToken = default); /// /// Lists all the discounts for a given location. @@ -157,7 +158,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the location to list categories for. /// Returns the List response from the API call [Obsolete] - Task> ListDiscountsAsync(string locationId); + Task> ListDiscountsAsync(string locationId, CancellationToken cancellationToken = default); /// /// Creates a discount. @@ -185,7 +186,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Discount response from the API call [Obsolete] - Task CreateDiscountAsync(string locationId, Models.V1Discount body); + Task CreateDiscountAsync(string locationId, Models.V1Discount body, CancellationToken cancellationToken = default); /// /// Deletes an existing discount. @@ -219,7 +220,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the discount to delete. /// Returns the Models.V1Discount response from the API call [Obsolete] - Task DeleteDiscountAsync(string locationId, string discountId); + Task DeleteDiscountAsync(string locationId, string discountId, CancellationToken cancellationToken = default); /// /// Modifies the details of an existing discount. @@ -249,7 +250,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Discount response from the API call [Obsolete] - Task UpdateDiscountAsync(string locationId, string discountId, Models.V1Discount body); + Task UpdateDiscountAsync(string locationId, string discountId, Models.V1Discount body, CancellationToken cancellationToken = default); /// /// Lists all the fees (taxes) for a given location. @@ -275,7 +276,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the location to list fees for. /// Returns the List response from the API call [Obsolete] - Task> ListFeesAsync(string locationId); + Task> ListFeesAsync(string locationId, CancellationToken cancellationToken = default); /// /// Creates a fee (tax). @@ -303,7 +304,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Fee response from the API call [Obsolete] - Task CreateFeeAsync(string locationId, Models.V1Fee body); + Task CreateFeeAsync(string locationId, Models.V1Fee body, CancellationToken cancellationToken = default); /// /// Deletes an existing fee (tax). @@ -337,7 +338,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the fee to delete. /// Returns the Models.V1Fee response from the API call [Obsolete] - Task DeleteFeeAsync(string locationId, string feeId); + Task DeleteFeeAsync(string locationId, string feeId, CancellationToken cancellationToken = default); /// /// Modifies the details of an existing fee (tax). @@ -367,7 +368,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Fee response from the API call [Obsolete] - Task UpdateFeeAsync(string locationId, string feeId, Models.V1Fee body); + Task UpdateFeeAsync(string locationId, string feeId, Models.V1Fee body, CancellationToken cancellationToken = default); /// /// Provides inventory information for all inventory-enabled item @@ -399,7 +400,7 @@ public interface IV1ItemsApi /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint. /// Returns the List response from the API call [Obsolete] - Task> ListInventoryAsync(string locationId, int? limit = null, string batchToken = null); + Task> ListInventoryAsync(string locationId, int? limit = null, string batchToken = null, CancellationToken cancellationToken = default); /// /// Adjusts the current available inventory of an item variation. @@ -429,7 +430,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1InventoryEntry response from the API call [Obsolete] - Task AdjustInventoryAsync(string locationId, string variationId, Models.V1AdjustInventoryRequest body); + Task AdjustInventoryAsync(string locationId, string variationId, Models.V1AdjustInventoryRequest body, CancellationToken cancellationToken = default); /// /// Provides summary information of all items for a given location. @@ -457,7 +458,7 @@ public interface IV1ItemsApi /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint. /// Returns the List response from the API call [Obsolete] - Task> ListItemsAsync(string locationId, string batchToken = null); + Task> ListItemsAsync(string locationId, string batchToken = null, CancellationToken cancellationToken = default); /// /// Creates an item and at least one variation for it. @@ -501,7 +502,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Item response from the API call [Obsolete] - Task CreateItemAsync(string locationId, Models.V1Item body); + Task CreateItemAsync(string locationId, Models.V1Item body, CancellationToken cancellationToken = default); /// /// Deletes an existing item and all item variations associated with it. @@ -535,7 +536,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the item to modify. /// Returns the Models.V1Item response from the API call [Obsolete] - Task DeleteItemAsync(string locationId, string itemId); + Task DeleteItemAsync(string locationId, string itemId, CancellationToken cancellationToken = default); /// /// Provides the details for a single item, including associated modifier @@ -565,7 +566,7 @@ public interface IV1ItemsApi /// Required parameter: The item's ID. /// Returns the Models.V1Item response from the API call [Obsolete] - Task RetrieveItemAsync(string locationId, string itemId); + Task RetrieveItemAsync(string locationId, string itemId, CancellationToken cancellationToken = default); /// /// Modifies the core details of an existing item. @@ -595,7 +596,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Item response from the API call [Obsolete] - Task UpdateItemAsync(string locationId, string itemId, Models.V1Item body); + Task UpdateItemAsync(string locationId, string itemId, Models.V1Item body, CancellationToken cancellationToken = default); /// /// Removes a fee assocation from an item so the fee is no longer @@ -627,7 +628,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the fee to apply. /// Returns the Models.V1Item response from the API call [Obsolete] - Task RemoveFeeAsync(string locationId, string itemId, string feeId); + Task RemoveFeeAsync(string locationId, string itemId, string feeId, CancellationToken cancellationToken = default); /// /// Associates a fee with an item so the fee is automatically applied to @@ -659,7 +660,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the fee to apply. /// Returns the Models.V1Item response from the API call [Obsolete] - Task ApplyFeeAsync(string locationId, string itemId, string feeId); + Task ApplyFeeAsync(string locationId, string itemId, string feeId, CancellationToken cancellationToken = default); /// /// Removes a modifier list association from an item so the modifier @@ -691,7 +692,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the item to remove the modifier list from. /// Returns the Models.V1Item response from the API call [Obsolete] - Task RemoveModifierListAsync(string locationId, string modifierListId, string itemId); + Task RemoveModifierListAsync(string locationId, string modifierListId, string itemId, CancellationToken cancellationToken = default); /// /// Associates a modifier list with an item so the associated modifier @@ -723,7 +724,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the item to add the modifier list to. /// Returns the Models.V1Item response from the API call [Obsolete] - Task ApplyModifierListAsync(string locationId, string modifierListId, string itemId); + Task ApplyModifierListAsync(string locationId, string modifierListId, string itemId, CancellationToken cancellationToken = default); /// /// Creates an item variation for an existing item. @@ -753,7 +754,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Variation response from the API call [Obsolete] - Task CreateVariationAsync(string locationId, string itemId, Models.V1Variation body); + Task CreateVariationAsync(string locationId, string itemId, Models.V1Variation body, CancellationToken cancellationToken = default); /// /// Deletes an existing item variation from an item. @@ -789,7 +790,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the variation to delete. /// Returns the Models.V1Variation response from the API call [Obsolete] - Task DeleteVariationAsync(string locationId, string itemId, string variationId); + Task DeleteVariationAsync(string locationId, string itemId, string variationId, CancellationToken cancellationToken = default); /// /// Modifies the details of an existing item variation. @@ -829,7 +830,7 @@ public interface IV1ItemsApi string locationId, string itemId, string variationId, - Models.V1Variation body); + Models.V1Variation body, CancellationToken cancellationToken = default); /// /// Lists all the modifier lists for a given location. @@ -855,7 +856,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the location to list modifier lists for. /// Returns the List response from the API call [Obsolete] - Task> ListModifierListsAsync(string locationId); + Task> ListModifierListsAsync(string locationId, CancellationToken cancellationToken = default); /// /// Creates an item modifier list and at least 1 modifier option for it. @@ -883,7 +884,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1ModifierList response from the API call [Obsolete] - Task CreateModifierListAsync(string locationId, Models.V1ModifierList body); + Task CreateModifierListAsync(string locationId, Models.V1ModifierList body, CancellationToken cancellationToken = default); /// /// Deletes an existing item modifier list and all modifier options @@ -919,7 +920,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the modifier list to delete. /// Returns the Models.V1ModifierList response from the API call [Obsolete] - Task DeleteModifierListAsync(string locationId, string modifierListId); + Task DeleteModifierListAsync(string locationId, string modifierListId, CancellationToken cancellationToken = default); /// /// Provides the details for a single modifier list. @@ -947,7 +948,7 @@ public interface IV1ItemsApi /// Required parameter: The modifier list's ID. /// Returns the Models.V1ModifierList response from the API call [Obsolete] - Task RetrieveModifierListAsync(string locationId, string modifierListId); + Task RetrieveModifierListAsync(string locationId, string modifierListId, CancellationToken cancellationToken = default); /// /// Modifies the details of an existing item modifier list. @@ -977,7 +978,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1ModifierList response from the API call [Obsolete] - Task UpdateModifierListAsync(string locationId, string modifierListId, Models.V1UpdateModifierListRequest body); + Task UpdateModifierListAsync(string locationId, string modifierListId, Models.V1UpdateModifierListRequest body, CancellationToken cancellationToken = default); /// /// Creates an item modifier option and adds it to a modifier list. @@ -1007,7 +1008,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1ModifierOption response from the API call [Obsolete] - Task CreateModifierOptionAsync(string locationId, string modifierListId, Models.V1ModifierOption body); + Task CreateModifierOptionAsync(string locationId, string modifierListId, Models.V1ModifierOption body, CancellationToken cancellationToken = default); /// /// Deletes an existing item modifier option from a modifier list. @@ -1043,7 +1044,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the modifier list to edit. /// Returns the Models.V1ModifierOption response from the API call [Obsolete] - Task DeleteModifierOptionAsync(string locationId, string modifierListId, string modifierOptionId); + Task DeleteModifierOptionAsync(string locationId, string modifierListId, string modifierOptionId, CancellationToken cancellationToken = default); /// /// Modifies the details of an existing item modifier option. @@ -1083,7 +1084,7 @@ public interface IV1ItemsApi string locationId, string modifierListId, string modifierOptionId, - Models.V1ModifierOption body); + Models.V1ModifierOption body, CancellationToken cancellationToken = default); /// /// Lists all Favorites pages (in Square Point of Sale) for a given @@ -1111,7 +1112,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the location to list Favorites pages for. /// Returns the List response from the API call [Obsolete] - Task> ListPagesAsync(string locationId); + Task> ListPagesAsync(string locationId, CancellationToken cancellationToken = default); /// /// Creates a Favorites page in Square Point of Sale. @@ -1139,7 +1140,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Page response from the API call [Obsolete] - Task CreatePageAsync(string locationId, Models.V1Page body); + Task CreatePageAsync(string locationId, Models.V1Page body, CancellationToken cancellationToken = default); /// /// Deletes an existing Favorites page and all of its cells. @@ -1171,7 +1172,7 @@ public interface IV1ItemsApi /// Required parameter: The ID of the page to delete. /// Returns the Models.V1Page response from the API call [Obsolete] - Task DeletePageAsync(string locationId, string pageId); + Task DeletePageAsync(string locationId, string pageId, CancellationToken cancellationToken = default); /// /// Modifies the details of a Favorites page in Square Point of Sale. @@ -1201,7 +1202,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Page response from the API call [Obsolete] - Task UpdatePageAsync(string locationId, string pageId, Models.V1Page body); + Task UpdatePageAsync(string locationId, string pageId, Models.V1Page body, CancellationToken cancellationToken = default); /// /// Deletes a cell from a Favorites page in Square Point of Sale. @@ -1247,7 +1248,7 @@ public interface IV1ItemsApi string locationId, string pageId, string row = null, - string column = null); + string column = null, CancellationToken cancellationToken = default); /// /// Modifies a cell of a Favorites page in Square Point of Sale. @@ -1277,7 +1278,7 @@ public interface IV1ItemsApi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Page response from the API call [Obsolete] - Task UpdatePageCellAsync(string locationId, string pageId, Models.V1PageCell body); + Task UpdatePageCellAsync(string locationId, string pageId, Models.V1PageCell body, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IV1LocationsApi.cs b/Square/Apis/IV1LocationsApi.cs index ea680424..1a6e11aa 100644 --- a/Square/Apis/IV1LocationsApi.cs +++ b/Square/Apis/IV1LocationsApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -37,7 +38,7 @@ public interface IV1LocationsApi /// /// Returns the Models.V1Merchant response from the API call [Obsolete] - Task RetrieveBusinessAsync(); + Task RetrieveBusinessAsync(CancellationToken cancellationToken = default); /// /// Provides details for all business locations associated with a Square @@ -63,7 +64,7 @@ public interface IV1LocationsApi /// /// Returns the List response from the API call [Obsolete] - Task> ListLocationsAsync(); + Task> ListLocationsAsync(CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/IV1TransactionsApi.cs b/Square/Apis/IV1TransactionsApi.cs index 2bb93fda..eb00ea3d 100644 --- a/Square/Apis/IV1TransactionsApi.cs +++ b/Square/Apis/IV1TransactionsApi.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square; using Square.Utilities; @@ -27,7 +28,7 @@ public interface IV1TransactionsApi /// /// Required parameter: The ID of the location to list bank accounts for. /// Returns the List response from the API call - Task> ListBankAccountsAsync(string locationId); + Task> ListBankAccountsAsync(string locationId, CancellationToken cancellationToken = default); /// /// Provides non-confidential details for a merchant's associated bank account. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API. @@ -43,7 +44,7 @@ public interface IV1TransactionsApi /// Required parameter: The ID of the bank account's associated location. /// Required parameter: The bank account's Square-issued ID. You obtain this value from Settlement objects returned. /// Returns the Models.V1BankAccount response from the API call - Task RetrieveBankAccountAsync(string locationId, string bankAccountId); + Task RetrieveBankAccountAsync(string locationId, string bankAccountId, CancellationToken cancellationToken = default); /// /// Provides summary information for a merchant's online store orders. @@ -71,7 +72,7 @@ public interface IV1TransactionsApi string locationId, string order = null, int? limit = null, - string batchToken = null); + string batchToken = null, CancellationToken cancellationToken = default); /// /// Provides comprehensive information for a single online store order, including the order's history. @@ -87,7 +88,7 @@ public interface IV1TransactionsApi /// Required parameter: The ID of the order's associated location. /// Required parameter: The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint /// Returns the Models.V1Order response from the API call - Task RetrieveOrderAsync(string locationId, string orderId); + Task RetrieveOrderAsync(string locationId, string orderId, CancellationToken cancellationToken = default); /// /// Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions: @@ -105,7 +106,7 @@ public interface IV1TransactionsApi /// Required parameter: The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Order response from the API call - Task UpdateOrderAsync(string locationId, string orderId, Models.V1UpdateOrderRequest body); + Task UpdateOrderAsync(string locationId, string orderId, Models.V1UpdateOrderRequest body, CancellationToken cancellationToken = default); /// /// Provides summary information for all payments taken for a given @@ -163,7 +164,7 @@ public interface IV1TransactionsApi string endTime = null, int? limit = null, string batchToken = null, - bool? includePartial = null); + bool? includePartial = null, CancellationToken cancellationToken = default); /// /// Provides comprehensive information for a single payment. @@ -179,7 +180,7 @@ public interface IV1TransactionsApi /// 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 - Task RetrievePaymentAsync(string locationId, string paymentId); + Task RetrievePaymentAsync(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. @@ -215,7 +216,7 @@ public interface IV1TransactionsApi string beginTime = null, string endTime = null, int? limit = null, - string batchToken = null); + string batchToken = null, CancellationToken cancellationToken = default); /// /// Issues a refund for a previously processed payment. You must issue @@ -249,7 +250,7 @@ public interface IV1TransactionsApi /// 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 - Task CreateRefundAsync(string locationId, Models.V1CreateRefundRequest body); + Task CreateRefundAsync(string locationId, Models.V1CreateRefundRequest body, CancellationToken cancellationToken = default); /// /// Provides summary information for all deposits and withdrawals @@ -258,11 +259,11 @@ public interface IV1TransactionsApi /// *Note**: the ListSettlements endpoint does not provide entry /// information. /// - /// Required parameter: The ID of the location to list settlements for. - /// Optional parameter: TThe order in which payments are listed in the response. + /// 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 payments to return in a single response. This value cannot exceed 200. + /// 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 @@ -282,11 +283,11 @@ public interface IV1TransactionsApi /// *Note**: the ListSettlements endpoint does not provide entry /// information. /// - /// Required parameter: The ID of the location to list settlements for. - /// Optional parameter: TThe order in which payments are listed in the response. + /// 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 payments to return in a single response. This value cannot exceed 200. + /// 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 @@ -297,7 +298,7 @@ public interface IV1TransactionsApi string endTime = null, int? limit = null, string status = null, - string batchToken = null); + string batchToken = null, CancellationToken cancellationToken = default); /// /// Provides comprehensive information for a single settlement. @@ -339,7 +340,7 @@ public interface IV1TransactionsApi /// 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 - Task RetrieveSettlementAsync(string locationId, string settlementId); + Task RetrieveSettlementAsync(string locationId, string settlementId, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/InventoryApi.cs b/Square/Apis/InventoryApi.cs index 3a3f417f..e469b2d7 100644 --- a/Square/Apis/InventoryApi.cs +++ b/Square/Apis/InventoryApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -41,7 +43,7 @@ public Models.RetrieveInventoryAdjustmentResponse RetrieveInventoryAdjustment(st /// /// Required parameter: ID of the [InventoryAdjustment](#type-inventoryadjustment) to retrieve. /// Returns the Models.RetrieveInventoryAdjustmentResponse response from the API call - public async Task RetrieveInventoryAdjustmentAsync(string adjustmentId) + public async Task RetrieveInventoryAdjustmentAsync(string adjustmentId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -60,11 +62,11 @@ public async Task RetrieveInventoryA string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -74,10 +76,10 @@ public async Task RetrieveInventoryA HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -115,7 +117,7 @@ public Models.BatchChangeInventoryResponse BatchChangeInventory(Models.BatchChan /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.BatchChangeInventoryResponse response from the API call - public async Task BatchChangeInventoryAsync(Models.BatchChangeInventoryRequest body) + public async Task BatchChangeInventoryAsync(Models.BatchChangeInventoryRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -128,12 +130,12 @@ public async Task BatchChangeInventoryAsync string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -146,10 +148,10 @@ public async Task BatchChangeInventoryAsync HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -191,7 +193,7 @@ public Models.BatchRetrieveInventoryChangesResponse BatchRetrieveInventoryChange /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.BatchRetrieveInventoryChangesResponse response from the API call - public async Task BatchRetrieveInventoryChangesAsync(Models.BatchRetrieveInventoryChangesRequest body) + public async Task BatchRetrieveInventoryChangesAsync(Models.BatchRetrieveInventoryChangesRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -204,12 +206,12 @@ public async Task BatchRetrieveInv string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -222,10 +224,10 @@ public async Task BatchRetrieveInv HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -273,7 +275,7 @@ public Models.BatchRetrieveInventoryCountsResponse BatchRetrieveInventoryCounts( /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.BatchRetrieveInventoryCountsResponse response from the API call - public async Task BatchRetrieveInventoryCountsAsync(Models.BatchRetrieveInventoryCountsRequest body) + public async Task BatchRetrieveInventoryCountsAsync(Models.BatchRetrieveInventoryCountsRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -286,12 +288,12 @@ public async Task BatchRetrieveInve string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -304,10 +306,10 @@ public async Task BatchRetrieveInve HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -341,7 +343,7 @@ public Models.RetrieveInventoryPhysicalCountResponse RetrieveInventoryPhysicalCo /// /// Required parameter: ID of the [InventoryPhysicalCount](#type-inventoryphysicalcount) to retrieve. /// Returns the Models.RetrieveInventoryPhysicalCountResponse response from the API call - public async Task RetrieveInventoryPhysicalCountAsync(string physicalCountId) + public async Task RetrieveInventoryPhysicalCountAsync(string physicalCountId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -360,11 +362,11 @@ public async Task RetrieveInvento string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -374,10 +376,10 @@ public async Task RetrieveInvento HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -419,7 +421,7 @@ public Models.RetrieveInventoryCountResponse RetrieveInventoryCount(string catal /// Optional parameter: The [Location](#type-location) IDs to look up as a comma-separated list. An empty list queries all locations. /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information. /// Returns the Models.RetrieveInventoryCountResponse response from the API call - public async Task RetrieveInventoryCountAsync(string catalogObjectId, string locationIds = null, string cursor = null) + public async Task RetrieveInventoryCountAsync(string catalogObjectId, string locationIds = null, string cursor = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -439,17 +441,17 @@ public async Task RetrieveInventoryCountA { { "location_ids", locationIds }, { "cursor", cursor } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -459,10 +461,10 @@ public async Task RetrieveInventoryCountA HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -512,7 +514,7 @@ public Models.RetrieveInventoryChangesResponse RetrieveInventoryChanges(string c /// Optional parameter: The [Location](#type-location) IDs to look up as a comma-separated list. An empty list queries all locations. /// Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information. /// Returns the Models.RetrieveInventoryChangesResponse response from the API call - public async Task RetrieveInventoryChangesAsync(string catalogObjectId, string locationIds = null, string cursor = null) + public async Task RetrieveInventoryChangesAsync(string catalogObjectId, string locationIds = null, string cursor = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -532,17 +534,17 @@ public async Task RetrieveInventoryChan { { "location_ids", locationIds }, { "cursor", cursor } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -552,10 +554,10 @@ public async Task RetrieveInventoryChan HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -571,4 +573,4 @@ public async Task RetrieveInventoryChan } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/LaborApi.cs b/Square/Apis/LaborApi.cs index d11fae87..3a784b59 100644 --- a/Square/Apis/LaborApi.cs +++ b/Square/Apis/LaborApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -43,7 +45,7 @@ public Models.ListBreakTypesResponse ListBreakTypes(string locationId = null, in /// Optional parameter: Maximum number of Break Types to return per page. Can range between 1 and 200. The default is the maximum at 200. /// Optional parameter: Pointer to the next page of Break Type results to fetch. /// Returns the Models.ListBreakTypesResponse response from the API call - public async Task ListBreakTypesAsync(string locationId = null, int? limit = null, string cursor = null) + public async Task ListBreakTypesAsync(string locationId = null, int? limit = null, string cursor = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -58,17 +60,17 @@ public async Task ListBreakTypesAsync(string loca { "location_id", locationId }, { "limit", limit }, { "cursor", cursor } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -78,10 +80,10 @@ public async Task ListBreakTypesAsync(string loca HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -133,7 +135,7 @@ public Models.CreateBreakTypeResponse CreateBreakType(Models.CreateBreakTypeRequ /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateBreakTypeResponse response from the API call - public async Task CreateBreakTypeAsync(Models.CreateBreakTypeRequest body) + public async Task CreateBreakTypeAsync(Models.CreateBreakTypeRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -146,12 +148,12 @@ public async Task CreateBreakTypeAsync(Models.Cr string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -164,10 +166,10 @@ public async Task CreateBreakTypeAsync(Models.Cr HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -201,7 +203,7 @@ public Models.DeleteBreakTypeResponse DeleteBreakType(string id) /// /// Required parameter: UUID for the `BreakType` being deleted. /// Returns the Models.DeleteBreakTypeResponse response from the API call - public async Task DeleteBreakTypeAsync(string id) + public async Task DeleteBreakTypeAsync(string id, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -220,11 +222,11 @@ public async Task DeleteBreakTypeAsync(string id string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -234,10 +236,10 @@ public async Task DeleteBreakTypeAsync(string id HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -269,7 +271,7 @@ public Models.GetBreakTypeResponse GetBreakType(string id) /// /// Required parameter: UUID for the `BreakType` being retrieved. /// Returns the Models.GetBreakTypeResponse response from the API call - public async Task GetBreakTypeAsync(string id) + public async Task GetBreakTypeAsync(string id, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -288,11 +290,11 @@ public async Task GetBreakTypeAsync(string id) string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -302,10 +304,10 @@ public async Task GetBreakTypeAsync(string id) HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -339,7 +341,7 @@ public Models.UpdateBreakTypeResponse UpdateBreakType(string id, Models.UpdateBr /// Required parameter: UUID for the `BreakType` being updated. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateBreakTypeResponse response from the API call - public async Task UpdateBreakTypeAsync(string id, Models.UpdateBreakTypeRequest body) + public async Task UpdateBreakTypeAsync(string id, Models.UpdateBreakTypeRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -358,12 +360,12 @@ public async Task UpdateBreakTypeAsync(string id string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -376,10 +378,10 @@ public async Task UpdateBreakTypeAsync(string id HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -415,7 +417,7 @@ public Models.ListEmployeeWagesResponse ListEmployeeWages(string employeeId = nu /// Optional parameter: Maximum number of Employee Wages to return per page. Can range between 1 and 200. The default is the maximum at 200. /// Optional parameter: Pointer to the next page of Employee Wage results to fetch. /// Returns the Models.ListEmployeeWagesResponse response from the API call - public async Task ListEmployeeWagesAsync(string employeeId = null, int? limit = null, string cursor = null) + public async Task ListEmployeeWagesAsync(string employeeId = null, int? limit = null, string cursor = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -430,17 +432,17 @@ public async Task ListEmployeeWagesAsync(strin { "employee_id", employeeId }, { "limit", limit }, { "cursor", cursor } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -450,10 +452,10 @@ public async Task ListEmployeeWagesAsync(strin HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -485,7 +487,7 @@ public Models.GetEmployeeWageResponse GetEmployeeWage(string id) /// /// Required parameter: UUID for the `EmployeeWage` being retrieved. /// Returns the Models.GetEmployeeWageResponse response from the API call - public async Task GetEmployeeWageAsync(string id) + public async Task GetEmployeeWageAsync(string id, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -504,11 +506,11 @@ public async Task GetEmployeeWageAsync(string id string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -518,10 +520,10 @@ public async Task GetEmployeeWageAsync(string id HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -581,7 +583,7 @@ public Models.CreateShiftResponse CreateShift(Models.CreateShiftRequest body) /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateShiftResponse response from the API call - public async Task CreateShiftAsync(Models.CreateShiftRequest body) + public async Task CreateShiftAsync(Models.CreateShiftRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -594,12 +596,12 @@ public async Task CreateShiftAsync(Models.CreateShif string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -612,10 +614,10 @@ public async Task CreateShiftAsync(Models.CreateShif HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -671,7 +673,7 @@ public Models.SearchShiftsResponse SearchShifts(Models.SearchShiftsRequest body) /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.SearchShiftsResponse response from the API call - public async Task SearchShiftsAsync(Models.SearchShiftsRequest body) + public async Task SearchShiftsAsync(Models.SearchShiftsRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -684,12 +686,12 @@ public async Task SearchShiftsAsync(Models.SearchSh string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -702,10 +704,10 @@ public async Task SearchShiftsAsync(Models.SearchSh HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -737,7 +739,7 @@ public Models.DeleteShiftResponse DeleteShift(string id) /// /// Required parameter: UUID for the `Shift` being deleted. /// Returns the Models.DeleteShiftResponse response from the API call - public async Task DeleteShiftAsync(string id) + public async Task DeleteShiftAsync(string id, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -756,11 +758,11 @@ public async Task DeleteShiftAsync(string id) string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -770,10 +772,10 @@ public async Task DeleteShiftAsync(string id) HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -805,7 +807,7 @@ public Models.GetShiftResponse GetShift(string id) /// /// Required parameter: UUID for the `Shift` being retrieved. /// Returns the Models.GetShiftResponse response from the API call - public async Task GetShiftAsync(string id) + public async Task GetShiftAsync(string id, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -824,11 +826,11 @@ public async Task GetShiftAsync(string id) string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -838,10 +840,10 @@ public async Task GetShiftAsync(string id) HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -883,7 +885,7 @@ public Models.UpdateShiftResponse UpdateShift(string id, Models.UpdateShiftReque /// Required parameter: ID of the object being updated. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateShiftResponse response from the API call - public async Task UpdateShiftAsync(string id, Models.UpdateShiftRequest body) + public async Task UpdateShiftAsync(string id, Models.UpdateShiftRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -902,12 +904,12 @@ public async Task UpdateShiftAsync(string id, Models string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -920,10 +922,10 @@ public async Task UpdateShiftAsync(string id, Models HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -957,7 +959,7 @@ public Models.ListWorkweekConfigsResponse ListWorkweekConfigs(int? limit = null, /// Optional parameter: Maximum number of Workweek Configs to return per page. /// Optional parameter: Pointer to the next page of Workweek Config results to fetch. /// Returns the Models.ListWorkweekConfigsResponse response from the API call - public async Task ListWorkweekConfigsAsync(int? limit = null, string cursor = null) + public async Task ListWorkweekConfigsAsync(int? limit = null, string cursor = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -971,17 +973,17 @@ public async Task ListWorkweekConfigsAsync(i { { "limit", limit }, { "cursor", cursor } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -991,10 +993,10 @@ public async Task ListWorkweekConfigsAsync(i HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1028,7 +1030,7 @@ public Models.UpdateWorkweekConfigResponse UpdateWorkweekConfig(string id, Model /// Required parameter: UUID for the `WorkweekConfig` object being updated. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateWorkweekConfigResponse response from the API call - public async Task UpdateWorkweekConfigAsync(string id, Models.UpdateWorkweekConfigRequest body) + public async Task UpdateWorkweekConfigAsync(string id, Models.UpdateWorkweekConfigRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1047,12 +1049,12 @@ public async Task UpdateWorkweekConfigAsync string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -1065,10 +1067,10 @@ public async Task UpdateWorkweekConfigAsync HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1084,4 +1086,4 @@ public async Task UpdateWorkweekConfigAsync } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/LocationsApi.cs b/Square/Apis/LocationsApi.cs index 64bde471..d5e574ef 100644 --- a/Square/Apis/LocationsApi.cs +++ b/Square/Apis/LocationsApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -43,7 +45,7 @@ public Models.ListLocationsResponse ListLocations() /// endpoint correspond to that `location_id` parameter. /// /// Returns the Models.ListLocationsResponse response from the API call - public async Task ListLocationsAsync() + public async Task ListLocationsAsync(CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -56,11 +58,11 @@ public async Task ListLocationsAsync() string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -70,10 +72,10 @@ public async Task ListLocationsAsync() HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -107,7 +109,7 @@ public Models.CreateLocationResponse CreateLocation(Models.CreateLocationRequest /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateLocationResponse response from the API call - public async Task CreateLocationAsync(Models.CreateLocationRequest body) + public async Task CreateLocationAsync(Models.CreateLocationRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -120,12 +122,12 @@ public async Task CreateLocationAsync(Models.Crea string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -138,10 +140,10 @@ public async Task CreateLocationAsync(Models.Crea HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -173,7 +175,7 @@ public Models.RetrieveLocationResponse RetrieveLocation(string locationId) /// /// Required parameter: The ID of the location to retrieve. /// Returns the Models.RetrieveLocationResponse response from the API call - public async Task RetrieveLocationAsync(string locationId) + public async Task RetrieveLocationAsync(string locationId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -192,11 +194,11 @@ public async Task RetrieveLocationAsync(string string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -206,10 +208,10 @@ public async Task RetrieveLocationAsync(string HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -243,7 +245,7 @@ public Models.UpdateLocationResponse UpdateLocation(string locationId, Models.Up /// Required parameter: The ID of the location to update. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateLocationResponse response from the API call - public async Task UpdateLocationAsync(string locationId, Models.UpdateLocationRequest body) + public async Task UpdateLocationAsync(string locationId, Models.UpdateLocationRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -262,12 +264,12 @@ public async Task UpdateLocationAsync(string loca string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -280,10 +282,10 @@ public async Task UpdateLocationAsync(string loca HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -299,4 +301,4 @@ public async Task UpdateLocationAsync(string loca } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/MerchantsApi.cs b/Square/Apis/MerchantsApi.cs index 314eab2c..c021c82e 100644 --- a/Square/Apis/MerchantsApi.cs +++ b/Square/Apis/MerchantsApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -49,7 +51,7 @@ public Models.ListMerchantsResponse ListMerchants(int? cursor = null) /// /// Optional parameter: The cursor generated by the previous response. /// Returns the Models.ListMerchantsResponse response from the API call - public async Task ListMerchantsAsync(int? cursor = null) + public async Task ListMerchantsAsync(int? cursor = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -62,17 +64,17 @@ public async Task ListMerchantsAsync(int? cursor = ApiHelper.AppendUrlWithQueryParameters(_queryBuilder, new Dictionary() { { "cursor", cursor } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -82,10 +84,10 @@ public async Task ListMerchantsAsync(int? cursor = HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -117,7 +119,7 @@ public Models.RetrieveMerchantResponse RetrieveMerchant(string merchantId) /// /// Required parameter: The ID of the merchant to retrieve. /// Returns the Models.RetrieveMerchantResponse response from the API call - public async Task RetrieveMerchantAsync(string merchantId) + public async Task RetrieveMerchantAsync(string merchantId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -136,11 +138,11 @@ public async Task RetrieveMerchantAsync(string string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -150,10 +152,10 @@ public async Task RetrieveMerchantAsync(string HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -169,4 +171,4 @@ public async Task RetrieveMerchantAsync(string } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/MobileAuthorizationApi.cs b/Square/Apis/MobileAuthorizationApi.cs index cd57872a..557feae8 100644 --- a/Square/Apis/MobileAuthorizationApi.cs +++ b/Square/Apis/MobileAuthorizationApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -53,7 +55,7 @@ public Models.CreateMobileAuthorizationCodeResponse CreateMobileAuthorizationCod /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateMobileAuthorizationCodeResponse response from the API call - public async Task CreateMobileAuthorizationCodeAsync(Models.CreateMobileAuthorizationCodeRequest body) + public async Task CreateMobileAuthorizationCodeAsync(Models.CreateMobileAuthorizationCodeRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -66,12 +68,12 @@ public async Task CreateMobileAuth string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -84,10 +86,10 @@ public async Task CreateMobileAuth HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -103,4 +105,4 @@ public async Task CreateMobileAuth } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/OAuthApi.cs b/Square/Apis/OAuthApi.cs index d758e7a3..4a418a6f 100644 --- a/Square/Apis/OAuthApi.cs +++ b/Square/Apis/OAuthApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -71,7 +73,7 @@ public Models.RenewTokenResponse RenewToken(string clientId, Models.RenewTokenRe /// Required parameter: Client APPLICATION_SECRET /// Returns the Models.RenewTokenResponse response from the API call [Obsolete] - public async Task RenewTokenAsync(string clientId, Models.RenewTokenRequest body, string authorization) + public async Task RenewTokenAsync(string clientId, Models.RenewTokenRequest body, string authorization, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -90,13 +92,13 @@ public async Task RenewTokenAsync(string clientId, Mo string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, { "Authorization", authorization }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -110,7 +112,7 @@ public async Task RenewTokenAsync(string clientId, Mo } //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -166,7 +168,7 @@ public Models.RevokeTokenResponse RevokeToken(Models.RevokeTokenRequest body, st /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Required parameter: Client APPLICATION_SECRET /// Returns the Models.RevokeTokenResponse response from the API call - public async Task RevokeTokenAsync(Models.RevokeTokenRequest body, string authorization) + public async Task RevokeTokenAsync(Models.RevokeTokenRequest body, string authorization, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -179,13 +181,13 @@ public async Task RevokeTokenAsync(Models.RevokeToke string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, { "Authorization", authorization }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -199,7 +201,7 @@ public async Task RevokeTokenAsync(Models.RevokeToke } //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -249,7 +251,7 @@ public Models.ObtainTokenResponse ObtainToken(Models.ObtainTokenRequest body) /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.ObtainTokenResponse response from the API call - public async Task ObtainTokenAsync(Models.ObtainTokenRequest body) + public async Task ObtainTokenAsync(Models.ObtainTokenRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -262,12 +264,12 @@ public async Task ObtainTokenAsync(Models.ObtainToke string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -281,7 +283,7 @@ public async Task ObtainTokenAsync(Models.ObtainToke } //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -297,4 +299,4 @@ public async Task ObtainTokenAsync(Models.ObtainToke } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/OrdersApi.cs b/Square/Apis/OrdersApi.cs index 42dbdd9c..629dae81 100644 --- a/Square/Apis/OrdersApi.cs +++ b/Square/Apis/OrdersApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -53,7 +55,7 @@ public Models.CreateOrderResponse CreateOrder(string locationId, Models.CreateOr /// Required parameter: The ID of the business location to associate the order with. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateOrderResponse response from the API call - public async Task CreateOrderAsync(string locationId, Models.CreateOrderRequest body) + public async Task CreateOrderAsync(string locationId, Models.CreateOrderRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -72,12 +74,12 @@ public async Task CreateOrderAsync(string locationId string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -90,10 +92,10 @@ public async Task CreateOrderAsync(string locationId HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -129,7 +131,7 @@ public Models.BatchRetrieveOrdersResponse BatchRetrieveOrders(string locationId, /// Required parameter: The ID of the orders' 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.BatchRetrieveOrdersResponse response from the API call - public async Task BatchRetrieveOrdersAsync(string locationId, Models.BatchRetrieveOrdersRequest body) + public async Task BatchRetrieveOrdersAsync(string locationId, Models.BatchRetrieveOrdersRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -148,12 +150,12 @@ public async Task BatchRetrieveOrdersAsync(s string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -166,10 +168,10 @@ public async Task BatchRetrieveOrdersAsync(s HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -229,7 +231,7 @@ public Models.UpdateOrderResponse UpdateOrder(string locationId, string orderId, /// Required parameter: The ID of the order to update. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.UpdateOrderResponse response from the API call - public async Task UpdateOrderAsync(string locationId, string orderId, Models.UpdateOrderRequest body) + public async Task UpdateOrderAsync(string locationId, string orderId, Models.UpdateOrderRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -249,12 +251,12 @@ public async Task UpdateOrderAsync(string locationId string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -267,10 +269,10 @@ public async Task UpdateOrderAsync(string locationId HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -328,7 +330,7 @@ public Models.SearchOrdersResponse SearchOrders(Models.SearchOrdersRequest body) /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.SearchOrdersResponse response from the API call - public async Task SearchOrdersAsync(Models.SearchOrdersRequest body) + public async Task SearchOrdersAsync(Models.SearchOrdersRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -341,12 +343,12 @@ public async Task SearchOrdersAsync(Models.SearchOr string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -359,10 +361,10 @@ public async Task SearchOrdersAsync(Models.SearchOr HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -418,7 +420,7 @@ public Models.PayOrderResponse PayOrder(string orderId, Models.PayOrderRequest b /// Required parameter: The ID of the order being paid. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.PayOrderResponse response from the API call - public async Task PayOrderAsync(string orderId, Models.PayOrderRequest body) + public async Task PayOrderAsync(string orderId, Models.PayOrderRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -437,12 +439,12 @@ public async Task PayOrderAsync(string orderId, Models. string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -455,10 +457,10 @@ public async Task PayOrderAsync(string orderId, Models. HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -474,4 +476,4 @@ public async Task PayOrderAsync(string orderId, Models. } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/PaymentsApi.cs b/Square/Apis/PaymentsApi.cs index 6db9ffd4..63391e02 100644 --- a/Square/Apis/PaymentsApi.cs +++ b/Square/Apis/PaymentsApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -71,7 +73,7 @@ internal class PaymentsApi: BaseApi, IPaymentsApi string locationId = null, long? total = null, string last4 = null, - string cardBrand = null) + string cardBrand = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -91,17 +93,17 @@ internal class PaymentsApi: BaseApi, IPaymentsApi { "total", total }, { "last_4", last4 }, { "card_brand", cardBrand } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -111,10 +113,10 @@ internal class PaymentsApi: BaseApi, IPaymentsApi HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -166,7 +168,7 @@ public Models.CreatePaymentResponse CreatePayment(Models.CreatePaymentRequest bo /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreatePaymentResponse response from the API call - public async Task CreatePaymentAsync(Models.CreatePaymentRequest body) + public async Task CreatePaymentAsync(Models.CreatePaymentRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -179,12 +181,12 @@ public async Task CreatePaymentAsync(Models.Create string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -197,10 +199,10 @@ public async Task CreatePaymentAsync(Models.Create HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -248,7 +250,7 @@ public Models.CancelPaymentByIdempotencyKeyResponse CancelPaymentByIdempotencyKe /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CancelPaymentByIdempotencyKeyResponse response from the API call - public async Task CancelPaymentByIdempotencyKeyAsync(Models.CancelPaymentByIdempotencyKeyRequest body) + public async Task CancelPaymentByIdempotencyKeyAsync(Models.CancelPaymentByIdempotencyKeyRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -261,12 +263,12 @@ public async Task CancelPaymentByI string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -279,10 +281,10 @@ public async Task CancelPaymentByI HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -314,7 +316,7 @@ public Models.GetPaymentResponse GetPayment(string paymentId) /// /// Required parameter: Unique ID for the desired `Payment`. /// Returns the Models.GetPaymentResponse response from the API call - public async Task GetPaymentAsync(string paymentId) + public async Task GetPaymentAsync(string paymentId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -333,11 +335,11 @@ public async Task GetPaymentAsync(string paymentId) string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -347,10 +349,10 @@ public async Task GetPaymentAsync(string paymentId) HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -386,7 +388,7 @@ public Models.CancelPaymentResponse CancelPayment(string paymentId) /// /// Required parameter: `payment_id` identifying the payment to be canceled. /// Returns the Models.CancelPaymentResponse response from the API call - public async Task CancelPaymentAsync(string paymentId) + public async Task CancelPaymentAsync(string paymentId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -405,11 +407,11 @@ public async Task CancelPaymentAsync(string paymen string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -419,10 +421,10 @@ public async Task CancelPaymentAsync(string paymen HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -462,7 +464,7 @@ public Models.CompletePaymentResponse CompletePayment(string paymentId) /// /// Required parameter: Unique ID identifying the payment to be completed. /// Returns the Models.CompletePaymentResponse response from the API call - public async Task CompletePaymentAsync(string paymentId) + public async Task CompletePaymentAsync(string paymentId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -481,11 +483,11 @@ public async Task CompletePaymentAsync(string pa string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -495,10 +497,10 @@ public async Task CompletePaymentAsync(string pa HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -514,4 +516,4 @@ public async Task CompletePaymentAsync(string pa } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/RefundsApi.cs b/Square/Apis/RefundsApi.cs index 82af5a62..dfb206c2 100644 --- a/Square/Apis/RefundsApi.cs +++ b/Square/Apis/RefundsApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -67,7 +69,7 @@ internal class RefundsApi: BaseApi, IRefundsApi string cursor = null, string locationId = null, string status = null, - string sourceType = null) + string sourceType = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -86,17 +88,17 @@ internal class RefundsApi: BaseApi, IRefundsApi { "location_id", locationId }, { "status", status }, { "source_type", sourceType } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -106,10 +108,10 @@ internal class RefundsApi: BaseApi, IRefundsApi HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -145,7 +147,7 @@ public Models.RefundPaymentResponse RefundPayment(Models.RefundPaymentRequest bo /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.RefundPaymentResponse response from the API call - public async Task RefundPaymentAsync(Models.RefundPaymentRequest body) + public async Task RefundPaymentAsync(Models.RefundPaymentRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -158,12 +160,12 @@ public async Task RefundPaymentAsync(Models.Refund string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -176,10 +178,10 @@ public async Task RefundPaymentAsync(Models.Refund HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -211,7 +213,7 @@ public Models.GetPaymentRefundResponse GetPaymentRefund(string refundId) /// /// Required parameter: Unique ID for the desired `PaymentRefund`. /// Returns the Models.GetPaymentRefundResponse response from the API call - public async Task GetPaymentRefundAsync(string refundId) + public async Task GetPaymentRefundAsync(string refundId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -230,11 +232,11 @@ public async Task GetPaymentRefundAsync(string string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -244,10 +246,10 @@ public async Task GetPaymentRefundAsync(string HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -263,4 +265,4 @@ public async Task GetPaymentRefundAsync(string } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/ReportingApi.cs b/Square/Apis/ReportingApi.cs index 0c4f4ef2..bf1de0fd 100644 --- a/Square/Apis/ReportingApi.cs +++ b/Square/Apis/ReportingApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -63,7 +65,7 @@ internal class ReportingApi: BaseApi, IReportingApi string beginTime = null, string endTime = null, string sortOrder = null, - string cursor = null) + string cursor = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -85,17 +87,17 @@ internal class ReportingApi: BaseApi, IReportingApi { "end_time", endTime }, { "sort_order", sortOrder }, { "cursor", cursor } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -105,10 +107,10 @@ internal class ReportingApi: BaseApi, IReportingApi HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -164,7 +166,7 @@ internal class ReportingApi: BaseApi, IReportingApi string beginTime = null, string endTime = null, string sortOrder = null, - string cursor = null) + string cursor = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -186,17 +188,17 @@ internal class ReportingApi: BaseApi, IReportingApi { "end_time", endTime }, { "sort_order", sortOrder }, { "cursor", cursor } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -206,10 +208,10 @@ internal class ReportingApi: BaseApi, IReportingApi HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -225,4 +227,4 @@ internal class ReportingApi: BaseApi, IReportingApi } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/TransactionsApi.cs b/Square/Apis/TransactionsApi.cs index 9ae6c59a..97043a62 100644 --- a/Square/Apis/TransactionsApi.cs +++ b/Square/Apis/TransactionsApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -73,7 +75,7 @@ internal class TransactionsApi: BaseApi, ITransactionsApi string beginTime = null, string endTime = null, string sortOrder = null, - string cursor = null) + string cursor = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -95,17 +97,17 @@ internal class TransactionsApi: BaseApi, ITransactionsApi { "end_time", endTime }, { "sort_order", sortOrder }, { "cursor", cursor } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -115,10 +117,10 @@ internal class TransactionsApi: BaseApi, ITransactionsApi HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -178,7 +180,7 @@ internal class TransactionsApi: BaseApi, ITransactionsApi string beginTime = null, string endTime = null, string sortOrder = null, - string cursor = null) + string cursor = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -200,17 +202,17 @@ internal class TransactionsApi: BaseApi, ITransactionsApi { "end_time", endTime }, { "sort_order", sortOrder }, { "cursor", cursor } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -220,10 +222,10 @@ internal class TransactionsApi: BaseApi, ITransactionsApi HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -289,7 +291,7 @@ public Models.ChargeResponse Charge(string locationId, Models.ChargeRequest body /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.ChargeResponse response from the API call [Obsolete] - public async Task ChargeAsync(string locationId, Models.ChargeRequest body) + public async Task ChargeAsync(string locationId, Models.ChargeRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -308,12 +310,12 @@ public async Task ChargeAsync(string locationId, Models.C string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -326,10 +328,10 @@ public async Task ChargeAsync(string locationId, Models.C HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -367,7 +369,7 @@ public Models.RetrieveTransactionResponse RetrieveTransaction(string locationId, /// Required parameter: The ID of the transaction to retrieve. /// Returns the Models.RetrieveTransactionResponse response from the API call [Obsolete] - public async Task RetrieveTransactionAsync(string locationId, string transactionId) + public async Task RetrieveTransactionAsync(string locationId, string transactionId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -387,11 +389,11 @@ public async Task RetrieveTransactionAsync(s string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -401,10 +403,10 @@ public async Task RetrieveTransactionAsync(s HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -446,7 +448,7 @@ public Models.CaptureTransactionResponse CaptureTransaction(string locationId, s /// Required parameter: Example: /// Returns the Models.CaptureTransactionResponse response from the API call [Obsolete] - public async Task CaptureTransactionAsync(string locationId, string transactionId) + public async Task CaptureTransactionAsync(string locationId, string transactionId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -466,11 +468,11 @@ public async Task CaptureTransactionAsync(str string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -480,10 +482,10 @@ public async Task CaptureTransactionAsync(str HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -535,7 +537,7 @@ public Models.CreateRefundResponse CreateRefund(string locationId, string transa /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.CreateRefundResponse response from the API call [Obsolete] - public async Task CreateRefundAsync(string locationId, string transactionId, Models.CreateRefundRequest body) + public async Task CreateRefundAsync(string locationId, string transactionId, Models.CreateRefundRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -555,12 +557,12 @@ public async Task CreateRefundAsync(string location string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -573,10 +575,10 @@ public async Task CreateRefundAsync(string location HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -618,7 +620,7 @@ public Models.VoidTransactionResponse VoidTransaction(string locationId, string /// Required parameter: Example: /// Returns the Models.VoidTransactionResponse response from the API call [Obsolete] - public async Task VoidTransactionAsync(string locationId, string transactionId) + public async Task VoidTransactionAsync(string locationId, string transactionId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -638,11 +640,11 @@ public async Task VoidTransactionAsync(string lo string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -652,10 +654,10 @@ public async Task VoidTransactionAsync(string lo HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -671,4 +673,4 @@ public async Task VoidTransactionAsync(string lo } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/V1EmployeesApi.cs b/Square/Apis/V1EmployeesApi.cs index 72992b03..91a2d5ce 100644 --- a/Square/Apis/V1EmployeesApi.cs +++ b/Square/Apis/V1EmployeesApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -73,7 +75,7 @@ internal class V1EmployeesApi: BaseApi, IV1EmployeesApi string status = null, string externalId = null, int? limit = null, - string batchToken = null) + string batchToken = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -94,17 +96,17 @@ internal class V1EmployeesApi: BaseApi, IV1EmployeesApi { "external_id", externalId }, { "limit", limit }, { "batch_token", batchToken } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -114,10 +116,10 @@ internal class V1EmployeesApi: BaseApi, IV1EmployeesApi HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -163,7 +165,7 @@ public Models.V1Employee CreateEmployee(Models.V1Employee body) /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Employee response from the API call - public async Task CreateEmployeeAsync(Models.V1Employee body) + public async Task CreateEmployeeAsync(Models.V1Employee body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -176,12 +178,12 @@ public async Task CreateEmployeeAsync(Models.V1Employee body) string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -194,10 +196,10 @@ public async Task CreateEmployeeAsync(Models.V1Employee body) HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -229,7 +231,7 @@ public Models.V1Employee RetrieveEmployee(string employeeId) /// /// Required parameter: The employee's ID. /// Returns the Models.V1Employee response from the API call - public async Task RetrieveEmployeeAsync(string employeeId) + public async Task RetrieveEmployeeAsync(string employeeId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -248,11 +250,11 @@ public async Task RetrieveEmployeeAsync(string employeeId) string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -262,10 +264,10 @@ public async Task RetrieveEmployeeAsync(string employeeId) HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -299,7 +301,7 @@ public Models.V1Employee UpdateEmployee(string employeeId, Models.V1Employee bod /// Required parameter: The ID of the role to modify. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Employee response from the API call - public async Task UpdateEmployeeAsync(string employeeId, Models.V1Employee body) + public async Task UpdateEmployeeAsync(string employeeId, Models.V1Employee body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -318,12 +320,12 @@ public async Task UpdateEmployeeAsync(string employeeId, Mode string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -336,10 +338,10 @@ public async Task UpdateEmployeeAsync(string employeeId, Mode HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -375,7 +377,7 @@ public List ListEmployeeRoles(string order = null, int? l /// Optional parameter: The maximum integer number of employee entities to return in a single response. Default 100, maximum 200. /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint. /// Returns the List response from the API call - public async Task> ListEmployeeRolesAsync(string order = null, int? limit = null, string batchToken = null) + public async Task> ListEmployeeRolesAsync(string order = null, int? limit = null, string batchToken = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -390,17 +392,17 @@ public async Task> ListEmployeeRolesAsync(string ord { "order", order }, { "limit", limit }, { "batch_token", batchToken } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -410,10 +412,10 @@ public async Task> ListEmployeeRolesAsync(string ord HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -461,7 +463,7 @@ public Models.V1EmployeeRole CreateEmployeeRole(Models.V1EmployeeRole body) /// /// Required parameter: An EmployeeRole object with a name and permissions, and an optional owner flag. /// Returns the Models.V1EmployeeRole response from the API call - public async Task CreateEmployeeRoleAsync(Models.V1EmployeeRole body) + public async Task CreateEmployeeRoleAsync(Models.V1EmployeeRole body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -474,12 +476,12 @@ public async Task CreateEmployeeRoleAsync(Models.V1Employ string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -492,10 +494,10 @@ public async Task CreateEmployeeRoleAsync(Models.V1Employ HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -527,7 +529,7 @@ public Models.V1EmployeeRole RetrieveEmployeeRole(string roleId) /// /// Required parameter: The role's ID. /// Returns the Models.V1EmployeeRole response from the API call - public async Task RetrieveEmployeeRoleAsync(string roleId) + public async Task RetrieveEmployeeRoleAsync(string roleId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -546,11 +548,11 @@ public async Task RetrieveEmployeeRoleAsync(string roleId string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -560,10 +562,10 @@ public async Task RetrieveEmployeeRoleAsync(string roleId HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -597,7 +599,7 @@ public Models.V1EmployeeRole UpdateEmployeeRole(string roleId, Models.V1Employee /// Required parameter: The ID of the role to modify. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1EmployeeRole response from the API call - public async Task UpdateEmployeeRoleAsync(string roleId, Models.V1EmployeeRole body) + public async Task UpdateEmployeeRoleAsync(string roleId, Models.V1EmployeeRole body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -616,12 +618,12 @@ public async Task UpdateEmployeeRoleAsync(string roleId, string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -634,10 +636,10 @@ public async Task UpdateEmployeeRoleAsync(string roleId, HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -711,7 +713,7 @@ public async Task UpdateEmployeeRoleAsync(string roleId, string endUpdatedAt = null, bool? deleted = null, int? limit = null, - string batchToken = null) + string batchToken = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -734,17 +736,17 @@ public async Task UpdateEmployeeRoleAsync(string roleId, { "deleted", deleted }, { "limit", limit }, { "batch_token", batchToken } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -754,10 +756,10 @@ public async Task UpdateEmployeeRoleAsync(string roleId, HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -805,7 +807,7 @@ public Models.V1Timecard CreateTimecard(Models.V1Timecard body) /// /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Timecard response from the API call - public async Task CreateTimecardAsync(Models.V1Timecard body) + public async Task CreateTimecardAsync(Models.V1Timecard body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -818,12 +820,12 @@ public async Task CreateTimecardAsync(Models.V1Timecard body) string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -836,10 +838,10 @@ public async Task CreateTimecardAsync(Models.V1Timecard body) HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -895,7 +897,7 @@ public object DeleteTimecard(string timecardId) /// /// Required parameter: The ID of the timecard to delete. /// Returns the object response from the API call - public async Task DeleteTimecardAsync(string timecardId) + public async Task DeleteTimecardAsync(string timecardId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -914,10 +916,10 @@ public async Task DeleteTimecardAsync(string timecardId) string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, - { "Square-Version", "2019-12-17" } + { "user-agent", userAgent }, + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -927,10 +929,10 @@ public async Task DeleteTimecardAsync(string timecardId) HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -970,7 +972,7 @@ public Models.V1Timecard RetrieveTimecard(string timecardId) /// /// Required parameter: The timecard's ID. /// Returns the Models.V1Timecard response from the API call - public async Task RetrieveTimecardAsync(string timecardId) + public async Task RetrieveTimecardAsync(string timecardId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -989,11 +991,11 @@ public async Task RetrieveTimecardAsync(string timecardId) string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -1003,10 +1005,10 @@ public async Task RetrieveTimecardAsync(string timecardId) HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1044,7 +1046,7 @@ public Models.V1Timecard UpdateTimecard(string timecardId, Models.V1Timecard bod /// Required parameter: TThe ID of the timecard to modify. /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Timecard response from the API call - public async Task UpdateTimecardAsync(string timecardId, Models.V1Timecard body) + public async Task UpdateTimecardAsync(string timecardId, Models.V1Timecard body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1063,12 +1065,12 @@ public async Task UpdateTimecardAsync(string timecardId, Mode string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -1081,10 +1083,10 @@ public async Task UpdateTimecardAsync(string timecardId, Mode HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1128,7 +1130,7 @@ public List ListTimecardEvents(string timecardId) /// /// Required parameter: The ID of the timecard to list events for. /// Returns the List response from the API call - public async Task> ListTimecardEventsAsync(string timecardId) + public async Task> ListTimecardEventsAsync(string timecardId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1147,11 +1149,11 @@ public async Task> ListTimecardEventsAsync(string t string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -1161,10 +1163,10 @@ public async Task> ListTimecardEventsAsync(string t HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1208,7 +1210,7 @@ public async Task> ListTimecardEventsAsync(string t string locationId, string order = null, string beginTime = null, - string endTime = null) + string endTime = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1229,17 +1231,17 @@ public async Task> ListTimecardEventsAsync(string t { "order", order }, { "begin_time", beginTime }, { "end_time", endTime } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -1249,10 +1251,10 @@ public async Task> ListTimecardEventsAsync(string t HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1284,7 +1286,7 @@ public Models.V1CashDrawerShift RetrieveCashDrawerShift(string locationId, strin /// Required parameter: The ID of the location to list cash drawer shifts for. /// Required parameter: The shift's ID. /// Returns the Models.V1CashDrawerShift response from the API call - public async Task RetrieveCashDrawerShiftAsync(string locationId, string shiftId) + public async Task RetrieveCashDrawerShiftAsync(string locationId, string shiftId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1304,11 +1306,11 @@ public async Task RetrieveCashDrawerShiftAsync(string string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -1318,10 +1320,10 @@ public async Task RetrieveCashDrawerShiftAsync(string HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1337,4 +1339,4 @@ public async Task RetrieveCashDrawerShiftAsync(string } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/V1ItemsApi.cs b/Square/Apis/V1ItemsApi.cs index 96037b2c..d294f4a9 100644 --- a/Square/Apis/V1ItemsApi.cs +++ b/Square/Apis/V1ItemsApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -51,7 +53,7 @@ public List ListCategories(string locationId) /// Required parameter: The ID of the location to list categories for. /// Returns the List response from the API call [Obsolete] - public async Task> ListCategoriesAsync(string locationId) + public async Task> ListCategoriesAsync(string locationId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -70,11 +72,11 @@ public async Task> ListCategoriesAsync(string locationId string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -84,10 +86,10 @@ public async Task> ListCategoriesAsync(string locationId HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -131,7 +133,7 @@ public Models.V1Category CreateCategory(string locationId, Models.V1Category bod /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Category response from the API call [Obsolete] - public async Task CreateCategoryAsync(string locationId, Models.V1Category body) + public async Task CreateCategoryAsync(string locationId, Models.V1Category body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -150,12 +152,12 @@ public async Task CreateCategoryAsync(string locationId, Mode string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -168,10 +170,10 @@ public async Task CreateCategoryAsync(string locationId, Mode HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -223,7 +225,7 @@ public Models.V1Category DeleteCategory(string locationId, string categoryId) /// Required parameter: The ID of the category to delete. /// Returns the Models.V1Category response from the API call [Obsolete] - public async Task DeleteCategoryAsync(string locationId, string categoryId) + public async Task DeleteCategoryAsync(string locationId, string categoryId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -243,11 +245,11 @@ public async Task DeleteCategoryAsync(string locationId, stri string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -257,10 +259,10 @@ public async Task DeleteCategoryAsync(string locationId, stri HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -308,7 +310,7 @@ public Models.V1Category UpdateCategory(string locationId, string categoryId, Mo /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Category response from the API call [Obsolete] - public async Task UpdateCategoryAsync(string locationId, string categoryId, Models.V1Category body) + public async Task UpdateCategoryAsync(string locationId, string categoryId, Models.V1Category body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -328,12 +330,12 @@ public async Task UpdateCategoryAsync(string locationId, stri string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -346,10 +348,10 @@ public async Task UpdateCategoryAsync(string locationId, stri HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -393,7 +395,7 @@ public List ListDiscounts(string locationId) /// Required parameter: The ID of the location to list categories for. /// Returns the List response from the API call [Obsolete] - public async Task> ListDiscountsAsync(string locationId) + public async Task> ListDiscountsAsync(string locationId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -412,11 +414,11 @@ public async Task> ListDiscountsAsync(string locationId) string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -426,10 +428,10 @@ public async Task> ListDiscountsAsync(string locationId) HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -473,7 +475,7 @@ public Models.V1Discount CreateDiscount(string locationId, Models.V1Discount bod /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Discount response from the API call [Obsolete] - public async Task CreateDiscountAsync(string locationId, Models.V1Discount body) + public async Task CreateDiscountAsync(string locationId, Models.V1Discount body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -492,12 +494,12 @@ public async Task CreateDiscountAsync(string locationId, Mode string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -510,10 +512,10 @@ public async Task CreateDiscountAsync(string locationId, Mode HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -565,7 +567,7 @@ public Models.V1Discount DeleteDiscount(string locationId, string discountId) /// Required parameter: The ID of the discount to delete. /// Returns the Models.V1Discount response from the API call [Obsolete] - public async Task DeleteDiscountAsync(string locationId, string discountId) + public async Task DeleteDiscountAsync(string locationId, string discountId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -585,11 +587,11 @@ public async Task DeleteDiscountAsync(string locationId, stri string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -599,10 +601,10 @@ public async Task DeleteDiscountAsync(string locationId, stri HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -650,7 +652,7 @@ public Models.V1Discount UpdateDiscount(string locationId, string discountId, Mo /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Discount response from the API call [Obsolete] - public async Task UpdateDiscountAsync(string locationId, string discountId, Models.V1Discount body) + public async Task UpdateDiscountAsync(string locationId, string discountId, Models.V1Discount body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -670,12 +672,12 @@ public async Task UpdateDiscountAsync(string locationId, stri string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -688,10 +690,10 @@ public async Task UpdateDiscountAsync(string locationId, stri HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -735,7 +737,7 @@ public List ListFees(string locationId) /// Required parameter: The ID of the location to list fees for. /// Returns the List response from the API call [Obsolete] - public async Task> ListFeesAsync(string locationId) + public async Task> ListFeesAsync(string locationId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -754,11 +756,11 @@ public async Task> ListFeesAsync(string locationId) string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -768,10 +770,10 @@ public async Task> ListFeesAsync(string locationId) HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -815,7 +817,7 @@ public Models.V1Fee CreateFee(string locationId, Models.V1Fee body) /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Fee response from the API call [Obsolete] - public async Task CreateFeeAsync(string locationId, Models.V1Fee body) + public async Task CreateFeeAsync(string locationId, Models.V1Fee body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -834,12 +836,12 @@ public async Task CreateFeeAsync(string locationId, Models.V1Fee b string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -852,10 +854,10 @@ public async Task CreateFeeAsync(string locationId, Models.V1Fee b HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -907,7 +909,7 @@ public Models.V1Fee DeleteFee(string locationId, string feeId) /// Required parameter: The ID of the fee to delete. /// Returns the Models.V1Fee response from the API call [Obsolete] - public async Task DeleteFeeAsync(string locationId, string feeId) + public async Task DeleteFeeAsync(string locationId, string feeId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -927,11 +929,11 @@ public async Task DeleteFeeAsync(string locationId, string feeId) string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -941,10 +943,10 @@ public async Task DeleteFeeAsync(string locationId, string feeId) HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -992,7 +994,7 @@ public Models.V1Fee UpdateFee(string locationId, string feeId, Models.V1Fee body /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Fee response from the API call [Obsolete] - public async Task UpdateFeeAsync(string locationId, string feeId, Models.V1Fee body) + public async Task UpdateFeeAsync(string locationId, string feeId, Models.V1Fee body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1012,12 +1014,12 @@ public async Task UpdateFeeAsync(string locationId, string feeId, string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -1030,10 +1032,10 @@ public async Task UpdateFeeAsync(string locationId, string feeId, HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1083,7 +1085,7 @@ public List ListInventory(string locationId, int? limit /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint. /// Returns the List response from the API call [Obsolete] - public async Task> ListInventoryAsync(string locationId, int? limit = null, string batchToken = null) + public async Task> ListInventoryAsync(string locationId, int? limit = null, string batchToken = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1103,17 +1105,17 @@ public async Task> ListInventoryAsync(string locat { { "limit", limit }, { "batch_token", batchToken } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -1123,10 +1125,10 @@ public async Task> ListInventoryAsync(string locat HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1172,7 +1174,7 @@ public Models.V1InventoryEntry AdjustInventory(string locationId, string variati /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1InventoryEntry response from the API call [Obsolete] - public async Task AdjustInventoryAsync(string locationId, string variationId, Models.V1AdjustInventoryRequest body) + public async Task AdjustInventoryAsync(string locationId, string variationId, Models.V1AdjustInventoryRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1192,12 +1194,12 @@ public async Task AdjustInventoryAsync(string locationI string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -1210,10 +1212,10 @@ public async Task AdjustInventoryAsync(string locationI HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1259,7 +1261,7 @@ public List ListItems(string locationId, string batchToken = null /// Optional parameter: A pagination cursor to retrieve the next set of results for your original query to the endpoint. /// Returns the List response from the API call [Obsolete] - public async Task> ListItemsAsync(string locationId, string batchToken = null) + public async Task> ListItemsAsync(string locationId, string batchToken = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1278,17 +1280,17 @@ public async Task> ListItemsAsync(string locationId, string ApiHelper.AppendUrlWithQueryParameters(_queryBuilder, new Dictionary() { { "batch_token", batchToken } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -1298,10 +1300,10 @@ public async Task> ListItemsAsync(string locationId, string HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1361,7 +1363,7 @@ public Models.V1Item CreateItem(string locationId, Models.V1Item body) /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Item response from the API call [Obsolete] - public async Task CreateItemAsync(string locationId, Models.V1Item body) + public async Task CreateItemAsync(string locationId, Models.V1Item body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1380,12 +1382,12 @@ public async Task CreateItemAsync(string locationId, Models.V1Ite string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -1398,10 +1400,10 @@ public async Task CreateItemAsync(string locationId, Models.V1Ite HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1453,7 +1455,7 @@ public Models.V1Item DeleteItem(string locationId, string itemId) /// Required parameter: The ID of the item to modify. /// Returns the Models.V1Item response from the API call [Obsolete] - public async Task DeleteItemAsync(string locationId, string itemId) + public async Task DeleteItemAsync(string locationId, string itemId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1473,11 +1475,11 @@ public async Task DeleteItemAsync(string locationId, string itemI string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -1487,10 +1489,10 @@ public async Task DeleteItemAsync(string locationId, string itemI HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1538,7 +1540,7 @@ public Models.V1Item RetrieveItem(string locationId, string itemId) /// Required parameter: The item's ID. /// Returns the Models.V1Item response from the API call [Obsolete] - public async Task RetrieveItemAsync(string locationId, string itemId) + public async Task RetrieveItemAsync(string locationId, string itemId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1558,11 +1560,11 @@ public async Task RetrieveItemAsync(string locationId, string ite string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -1572,10 +1574,10 @@ public async Task RetrieveItemAsync(string locationId, string ite HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1623,7 +1625,7 @@ public Models.V1Item UpdateItem(string locationId, string itemId, Models.V1Item /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Item response from the API call [Obsolete] - public async Task UpdateItemAsync(string locationId, string itemId, Models.V1Item body) + public async Task UpdateItemAsync(string locationId, string itemId, Models.V1Item body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1643,12 +1645,12 @@ public async Task UpdateItemAsync(string locationId, string itemI string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -1661,10 +1663,10 @@ public async Task UpdateItemAsync(string locationId, string itemI HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1714,7 +1716,7 @@ public Models.V1Item RemoveFee(string locationId, string itemId, string feeId) /// Required parameter: The ID of the fee to apply. /// Returns the Models.V1Item response from the API call [Obsolete] - public async Task RemoveFeeAsync(string locationId, string itemId, string feeId) + public async Task RemoveFeeAsync(string locationId, string itemId, string feeId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1735,11 +1737,11 @@ public async Task RemoveFeeAsync(string locationId, string itemId string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -1749,10 +1751,10 @@ public async Task RemoveFeeAsync(string locationId, string itemId HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1802,7 +1804,7 @@ public Models.V1Item ApplyFee(string locationId, string itemId, string feeId) /// Required parameter: The ID of the fee to apply. /// Returns the Models.V1Item response from the API call [Obsolete] - public async Task ApplyFeeAsync(string locationId, string itemId, string feeId) + public async Task ApplyFeeAsync(string locationId, string itemId, string feeId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1823,11 +1825,11 @@ public async Task ApplyFeeAsync(string locationId, string itemId, string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -1837,10 +1839,10 @@ public async Task ApplyFeeAsync(string locationId, string itemId, HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1890,7 +1892,7 @@ public Models.V1Item RemoveModifierList(string locationId, string modifierListId /// Required parameter: The ID of the item to remove the modifier list from. /// Returns the Models.V1Item response from the API call [Obsolete] - public async Task RemoveModifierListAsync(string locationId, string modifierListId, string itemId) + public async Task RemoveModifierListAsync(string locationId, string modifierListId, string itemId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1911,11 +1913,11 @@ public async Task RemoveModifierListAsync(string locationId, stri string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -1925,10 +1927,10 @@ public async Task RemoveModifierListAsync(string locationId, stri HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -1978,7 +1980,7 @@ public Models.V1Item ApplyModifierList(string locationId, string modifierListId, /// Required parameter: The ID of the item to add the modifier list to. /// Returns the Models.V1Item response from the API call [Obsolete] - public async Task ApplyModifierListAsync(string locationId, string modifierListId, string itemId) + public async Task ApplyModifierListAsync(string locationId, string modifierListId, string itemId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -1999,11 +2001,11 @@ public async Task ApplyModifierListAsync(string locationId, strin string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -2013,10 +2015,10 @@ public async Task ApplyModifierListAsync(string locationId, strin HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -2064,7 +2066,7 @@ public Models.V1Variation CreateVariation(string locationId, string itemId, Mode /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Variation response from the API call [Obsolete] - public async Task CreateVariationAsync(string locationId, string itemId, Models.V1Variation body) + public async Task CreateVariationAsync(string locationId, string itemId, Models.V1Variation body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -2084,12 +2086,12 @@ public async Task CreateVariationAsync(string locationId, st string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -2102,10 +2104,10 @@ public async Task CreateVariationAsync(string locationId, st HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -2159,7 +2161,7 @@ public Models.V1Variation DeleteVariation(string locationId, string itemId, stri /// Required parameter: The ID of the variation to delete. /// Returns the Models.V1Variation response from the API call [Obsolete] - public async Task DeleteVariationAsync(string locationId, string itemId, string variationId) + public async Task DeleteVariationAsync(string locationId, string itemId, string variationId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -2180,11 +2182,11 @@ public async Task DeleteVariationAsync(string locationId, st string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -2194,10 +2196,10 @@ public async Task DeleteVariationAsync(string locationId, st HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -2255,7 +2257,7 @@ public async Task DeleteVariationAsync(string locationId, st string locationId, string itemId, string variationId, - Models.V1Variation body) + Models.V1Variation body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -2276,12 +2278,12 @@ public async Task DeleteVariationAsync(string locationId, st string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -2294,10 +2296,10 @@ public async Task DeleteVariationAsync(string locationId, st HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -2341,7 +2343,7 @@ public List ListModifierLists(string locationId) /// Required parameter: The ID of the location to list modifier lists for. /// Returns the List response from the API call [Obsolete] - public async Task> ListModifierListsAsync(string locationId) + public async Task> ListModifierListsAsync(string locationId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -2360,11 +2362,11 @@ public async Task> ListModifierListsAsync(string loc string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -2374,10 +2376,10 @@ public async Task> ListModifierListsAsync(string loc HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -2421,7 +2423,7 @@ public Models.V1ModifierList CreateModifierList(string locationId, Models.V1Modi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1ModifierList response from the API call [Obsolete] - public async Task CreateModifierListAsync(string locationId, Models.V1ModifierList body) + public async Task CreateModifierListAsync(string locationId, Models.V1ModifierList body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -2440,12 +2442,12 @@ public async Task CreateModifierListAsync(string location string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -2458,10 +2460,10 @@ public async Task CreateModifierListAsync(string location HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -2515,7 +2517,7 @@ public Models.V1ModifierList DeleteModifierList(string locationId, string modifi /// Required parameter: The ID of the modifier list to delete. /// Returns the Models.V1ModifierList response from the API call [Obsolete] - public async Task DeleteModifierListAsync(string locationId, string modifierListId) + public async Task DeleteModifierListAsync(string locationId, string modifierListId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -2535,11 +2537,11 @@ public async Task DeleteModifierListAsync(string location string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -2549,10 +2551,10 @@ public async Task DeleteModifierListAsync(string location HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -2598,7 +2600,7 @@ public Models.V1ModifierList RetrieveModifierList(string locationId, string modi /// Required parameter: The modifier list's ID. /// Returns the Models.V1ModifierList response from the API call [Obsolete] - public async Task RetrieveModifierListAsync(string locationId, string modifierListId) + public async Task RetrieveModifierListAsync(string locationId, string modifierListId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -2618,11 +2620,11 @@ public async Task RetrieveModifierListAsync(string locati string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -2632,10 +2634,10 @@ public async Task RetrieveModifierListAsync(string locati HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -2683,7 +2685,7 @@ public Models.V1ModifierList UpdateModifierList(string locationId, string modifi /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1ModifierList response from the API call [Obsolete] - public async Task UpdateModifierListAsync(string locationId, string modifierListId, Models.V1UpdateModifierListRequest body) + public async Task UpdateModifierListAsync(string locationId, string modifierListId, Models.V1UpdateModifierListRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -2703,12 +2705,12 @@ public async Task UpdateModifierListAsync(string location string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -2721,10 +2723,10 @@ public async Task UpdateModifierListAsync(string location HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -2772,7 +2774,7 @@ public Models.V1ModifierOption CreateModifierOption(string locationId, string mo /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1ModifierOption response from the API call [Obsolete] - public async Task CreateModifierOptionAsync(string locationId, string modifierListId, Models.V1ModifierOption body) + public async Task CreateModifierOptionAsync(string locationId, string modifierListId, Models.V1ModifierOption body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -2792,12 +2794,12 @@ public async Task CreateModifierOptionAsync(string loca string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -2810,10 +2812,10 @@ public async Task CreateModifierOptionAsync(string loca HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -2867,7 +2869,7 @@ public Models.V1ModifierOption DeleteModifierOption(string locationId, string mo /// Required parameter: The ID of the modifier list to edit. /// Returns the Models.V1ModifierOption response from the API call [Obsolete] - public async Task DeleteModifierOptionAsync(string locationId, string modifierListId, string modifierOptionId) + public async Task DeleteModifierOptionAsync(string locationId, string modifierListId, string modifierOptionId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -2888,11 +2890,11 @@ public async Task DeleteModifierOptionAsync(string loca string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -2902,10 +2904,10 @@ public async Task DeleteModifierOptionAsync(string loca HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -2963,7 +2965,7 @@ public async Task DeleteModifierOptionAsync(string loca string locationId, string modifierListId, string modifierOptionId, - Models.V1ModifierOption body) + Models.V1ModifierOption body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -2984,12 +2986,12 @@ public async Task DeleteModifierOptionAsync(string loca string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -3002,10 +3004,10 @@ public async Task DeleteModifierOptionAsync(string loca HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -3051,7 +3053,7 @@ public List ListPages(string locationId) /// Required parameter: The ID of the location to list Favorites pages for. /// Returns the List response from the API call [Obsolete] - public async Task> ListPagesAsync(string locationId) + public async Task> ListPagesAsync(string locationId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -3070,11 +3072,11 @@ public async Task> ListPagesAsync(string locationId) string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -3084,10 +3086,10 @@ public async Task> ListPagesAsync(string locationId) HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -3131,7 +3133,7 @@ public Models.V1Page CreatePage(string locationId, Models.V1Page body) /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Page response from the API call [Obsolete] - public async Task CreatePageAsync(string locationId, Models.V1Page body) + public async Task CreatePageAsync(string locationId, Models.V1Page body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -3150,12 +3152,12 @@ public async Task CreatePageAsync(string locationId, Models.V1Pag string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -3168,10 +3170,10 @@ public async Task CreatePageAsync(string locationId, Models.V1Pag HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -3221,7 +3223,7 @@ public Models.V1Page DeletePage(string locationId, string pageId) /// Required parameter: The ID of the page to delete. /// Returns the Models.V1Page response from the API call [Obsolete] - public async Task DeletePageAsync(string locationId, string pageId) + public async Task DeletePageAsync(string locationId, string pageId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -3241,11 +3243,11 @@ public async Task DeletePageAsync(string locationId, string pageI string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -3255,10 +3257,10 @@ public async Task DeletePageAsync(string locationId, string pageI HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -3306,7 +3308,7 @@ public Models.V1Page UpdatePage(string locationId, string pageId, Models.V1Page /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Page response from the API call [Obsolete] - public async Task UpdatePageAsync(string locationId, string pageId, Models.V1Page body) + public async Task UpdatePageAsync(string locationId, string pageId, Models.V1Page body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -3326,12 +3328,12 @@ public async Task UpdatePageAsync(string locationId, string pageI string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -3344,10 +3346,10 @@ public async Task UpdatePageAsync(string locationId, string pageI HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -3411,7 +3413,7 @@ public async Task UpdatePageAsync(string locationId, string pageI string locationId, string pageId, string row = null, - string column = null) + string column = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -3432,17 +3434,17 @@ public async Task UpdatePageAsync(string locationId, string pageI { { "row", row }, { "column", column } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -3452,10 +3454,10 @@ public async Task UpdatePageAsync(string locationId, string pageI HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -3503,7 +3505,7 @@ public Models.V1Page UpdatePageCell(string locationId, string pageId, Models.V1P /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Page response from the API call [Obsolete] - public async Task UpdatePageCellAsync(string locationId, string pageId, Models.V1PageCell body) + public async Task UpdatePageCellAsync(string locationId, string pageId, Models.V1PageCell body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -3523,12 +3525,12 @@ public async Task UpdatePageCellAsync(string locationId, string p string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -3541,10 +3543,10 @@ public async Task UpdatePageCellAsync(string locationId, string p HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -3560,4 +3562,4 @@ public async Task UpdatePageCellAsync(string locationId, string p } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/V1LocationsApi.cs b/Square/Apis/V1LocationsApi.cs index bfe6679e..eed1c3a5 100644 --- a/Square/Apis/V1LocationsApi.cs +++ b/Square/Apis/V1LocationsApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -49,7 +51,7 @@ public Models.V1Merchant RetrieveBusiness() /// /// Returns the Models.V1Merchant response from the API call [Obsolete] - public async Task RetrieveBusinessAsync() + public async Task RetrieveBusinessAsync(CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -62,11 +64,11 @@ public async Task RetrieveBusinessAsync() string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -76,10 +78,10 @@ public async Task RetrieveBusinessAsync() HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -123,7 +125,7 @@ public List ListLocations() /// /// Returns the List response from the API call [Obsolete] - public async Task> ListLocationsAsync() + public async Task> ListLocationsAsync(CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -136,11 +138,11 @@ public async Task> ListLocationsAsync() string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -150,10 +152,10 @@ public async Task> ListLocationsAsync() HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -167,4 +169,4 @@ public async Task> ListLocationsAsync() } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Apis/V1TransactionsApi.cs b/Square/Apis/V1TransactionsApi.cs index 67e1aefd..135899df 100644 --- a/Square/Apis/V1TransactionsApi.cs +++ b/Square/Apis/V1TransactionsApi.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Converters; using Square; @@ -12,6 +13,7 @@ using Square.Http.Request; using Square.Http.Response; using Square.Http.Client; +using Square.Authentication; using Square.Exceptions; namespace Square.Apis @@ -39,7 +41,7 @@ public List ListBankAccounts(string locationId) /// /// Required parameter: The ID of the location to list bank accounts for. /// Returns the List response from the API call - public async Task> ListBankAccountsAsync(string locationId) + public async Task> ListBankAccountsAsync(string locationId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -58,11 +60,11 @@ public async Task> ListBankAccountsAsync(string locat string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -72,10 +74,10 @@ public async Task> ListBankAccountsAsync(string locat HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -107,7 +109,7 @@ public Models.V1BankAccount RetrieveBankAccount(string locationId, string bankAc /// Required parameter: The ID of the bank account's associated location. /// Required parameter: The bank account's Square-issued ID. You obtain this value from Settlement objects returned. /// Returns the Models.V1BankAccount response from the API call - public async Task RetrieveBankAccountAsync(string locationId, string bankAccountId) + public async Task RetrieveBankAccountAsync(string locationId, string bankAccountId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -127,11 +129,11 @@ public async Task RetrieveBankAccountAsync(string location string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -141,10 +143,10 @@ public async Task RetrieveBankAccountAsync(string location HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -190,7 +192,7 @@ public async Task RetrieveBankAccountAsync(string location string locationId, string order = null, int? limit = null, - string batchToken = null) + string batchToken = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -211,17 +213,17 @@ public async Task RetrieveBankAccountAsync(string location { "order", order }, { "limit", limit }, { "batch_token", batchToken } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -231,10 +233,10 @@ public async Task RetrieveBankAccountAsync(string location HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -266,7 +268,7 @@ public Models.V1Order RetrieveOrder(string locationId, string orderId) /// Required parameter: The ID of the order's associated location. /// Required parameter: The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint /// Returns the Models.V1Order response from the API call - public async Task RetrieveOrderAsync(string locationId, string orderId) + public async Task RetrieveOrderAsync(string locationId, string orderId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -286,11 +288,11 @@ public async Task RetrieveOrderAsync(string locationId, string o string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -300,10 +302,10 @@ public async Task RetrieveOrderAsync(string locationId, string o HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -339,7 +341,7 @@ public Models.V1Order UpdateOrder(string locationId, string orderId, Models.V1Up /// Required parameter: The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint /// Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. /// Returns the Models.V1Order response from the API call - public async Task UpdateOrderAsync(string locationId, string orderId, Models.V1UpdateOrderRequest body) + public async Task UpdateOrderAsync(string locationId, string orderId, Models.V1UpdateOrderRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -359,12 +361,12 @@ public async Task UpdateOrderAsync(string locationId, string ord string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -377,10 +379,10 @@ public async Task UpdateOrderAsync(string locationId, string ord HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -456,7 +458,7 @@ public async Task UpdateOrderAsync(string locationId, string ord string endTime = null, int? limit = null, string batchToken = null, - bool? includePartial = null) + bool? includePartial = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -480,17 +482,17 @@ public async Task UpdateOrderAsync(string locationId, string ord { "limit", limit }, { "batch_token", batchToken }, { "include_partial", includePartial } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -500,10 +502,10 @@ public async Task UpdateOrderAsync(string locationId, string ord HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -535,7 +537,7 @@ public Models.V1Payment RetrievePayment(string locationId, string paymentId) /// 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 - public async Task RetrievePaymentAsync(string locationId, string paymentId) + public async Task RetrievePaymentAsync(string locationId, string paymentId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -555,11 +557,11 @@ public async Task RetrievePaymentAsync(string locationId, stri string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -569,10 +571,10 @@ public async Task RetrievePaymentAsync(string locationId, stri HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -626,7 +628,7 @@ public async Task RetrievePaymentAsync(string locationId, stri string beginTime = null, string endTime = null, int? limit = null, - string batchToken = null) + string batchToken = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -649,17 +651,17 @@ public async Task RetrievePaymentAsync(string locationId, stri { "end_time", endTime }, { "limit", limit }, { "batch_token", batchToken } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -669,10 +671,10 @@ public async Task RetrievePaymentAsync(string locationId, stri HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -722,7 +724,7 @@ public Models.V1Refund CreateRefund(string locationId, Models.V1CreateRefundRequ /// 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 - public async Task CreateRefundAsync(string locationId, Models.V1CreateRefundRequest body) + public async Task CreateRefundAsync(string locationId, Models.V1CreateRefundRequest body, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -741,12 +743,12 @@ public async Task CreateRefundAsync(string locationId, Models.V string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, { "content-type", "application/json; charset=utf-8" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //append body params @@ -759,10 +761,10 @@ public async Task CreateRefundAsync(string locationId, Models.V HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -784,11 +786,11 @@ public async Task CreateRefundAsync(string locationId, Models.V /// *Note**: the ListSettlements endpoint does not provide entry /// information. /// - /// Required parameter: The ID of the location to list settlements for. - /// Optional parameter: TThe order in which payments are listed in the response. + /// 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 payments to return in a single response. This value cannot exceed 200. + /// 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 @@ -813,11 +815,11 @@ public async Task CreateRefundAsync(string locationId, Models.V /// *Note**: the ListSettlements endpoint does not provide entry /// information. /// - /// Required parameter: The ID of the location to list settlements for. - /// Optional parameter: TThe order in which payments are listed in the response. + /// 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 payments to return in a single response. This value cannot exceed 200. + /// 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 @@ -828,7 +830,7 @@ public async Task CreateRefundAsync(string locationId, Models.V string endTime = null, int? limit = null, string status = null, - string batchToken = null) + string batchToken = null, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -852,17 +854,17 @@ public async Task CreateRefundAsync(string locationId, Models.V { "limit", limit }, { "status", status }, { "batch_token", batchToken } - },ArrayDeserializationFormat,ParameterSeparator); + }, ArrayDeserializationFormat, ParameterSeparator); //validate and preprocess url string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -872,10 +874,10 @@ public async Task CreateRefundAsync(string locationId, Models.V HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -933,7 +935,7 @@ public Models.V1Settlement RetrieveSettlement(string locationId, string settleme /// 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 - public async Task RetrieveSettlementAsync(string locationId, string settlementId) + public async Task RetrieveSettlementAsync(string locationId, string settlementId, CancellationToken cancellationToken = default) { //the base uri for api requests string _baseUri = config.GetBaseUri(); @@ -953,11 +955,11 @@ public async Task RetrieveSettlementAsync(string locationId string _queryUrl = ApiHelper.CleanUrl(_queryBuilder); //append request with appropriate headers and parameters - var _headers = new Dictionary() + var _headers = new Dictionary() { - { "user-agent", "Square-DotNet-SDK/4.0.0" }, + { "user-agent", userAgent }, { "accept", "application/json" }, - { "Square-Version", "2019-12-17" } + { "Square-Version", "2020-01-22" } }; //prepare the API call request to fetch the response @@ -967,10 +969,10 @@ public async Task RetrieveSettlementAsync(string locationId HttpCallBack.OnBeforeHttpRequestEventHandler(GetClientInstance(), _request); } - _request = authManagers["default"].Apply(_request); + _request = await authManagers["default"].ApplyAsync(_request).ConfigureAwait(false); //invoke request and get response - HttpStringResponse _response = (HttpStringResponse) await GetClientInstance().ExecuteAsStringAsync(_request).ConfigureAwait(false); + HttpStringResponse _response = await GetClientInstance().ExecuteAsStringAsync(_request, cancellationToken).ConfigureAwait(false); HttpContext _context = new HttpContext(_request, _response); if (HttpCallBack != null) { @@ -986,4 +988,4 @@ public async Task RetrieveSettlementAsync(string locationId } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/AccessTokenManager.cs b/Square/Authentication/AccessTokenManager.cs similarity index 57% rename from Square/AccessTokenManager.cs rename to Square/Authentication/AccessTokenManager.cs index 29674051..94b949a5 100644 --- a/Square/AccessTokenManager.cs +++ b/Square/Authentication/AccessTokenManager.cs @@ -1,10 +1,11 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; using Square.Http.Request; -namespace Square.Utilities +namespace Square.Authentication { - internal class AccessTokenManager: IAuthManager + internal class AccessTokenManager: IAuthManager, IAccessTokenCredentials { /// Header Param to be used for requests public string AccessToken { get; } @@ -28,5 +29,15 @@ public HttpRequest Apply(HttpRequest httpRequest) return httpRequest; } + /// + /// Adds authentication to the given HttpRequest + /// + /// Http Request + /// Returns the httpRequest after adding authentication + public Task ApplyAsync(HttpRequest httpRequest) + { + httpRequest.Headers["Authorization"] = "Bearer " + AccessToken; + return Task.FromResult(httpRequest); + } } } \ No newline at end of file diff --git a/Square/Authentication/IAccessTokenCredentials.cs b/Square/Authentication/IAccessTokenCredentials.cs new file mode 100644 index 00000000..b7882396 --- /dev/null +++ b/Square/Authentication/IAccessTokenCredentials.cs @@ -0,0 +1,14 @@ +using System; + +namespace Square.Authentication +{ + public interface IAccessTokenCredentials + { + /// + /// This returns the access token currently stored + /// + /// + /// Returns AccessToken + string AccessToken { get; } + } +} \ No newline at end of file diff --git a/Square/IAuthManager.cs b/Square/Authentication/IAuthManager.cs similarity index 51% rename from Square/IAuthManager.cs rename to Square/Authentication/IAuthManager.cs index 8a599610..d27d5dc7 100644 --- a/Square/IAuthManager.cs +++ b/Square/Authentication/IAuthManager.cs @@ -1,9 +1,12 @@ using Square.Http.Request; +using System.Threading.Tasks; -namespace Square.Utilities +namespace Square.Authentication { internal interface IAuthManager { HttpRequest Apply(HttpRequest httpRequest); + + Task ApplyAsync(HttpRequest httpRequest); } } diff --git a/Square/Environment.cs b/Square/Environment.cs index 158ee2e8..5e75e79e 100644 --- a/Square/Environment.cs +++ b/Square/Environment.cs @@ -18,7 +18,7 @@ public enum Environment public static class EnvironmentHelper { //string values corresponding the enum elements - private static List stringValues = new List { "production", "sandbox" }; + private static readonly List stringValues = new List { "production", "sandbox" }; /// /// Converts an Environment value to a corresponding string value diff --git a/Square/Exceptions/ApiException.cs b/Square/Exceptions/APIException.cs similarity index 92% rename from Square/Exceptions/ApiException.cs rename to Square/Exceptions/APIException.cs index 1acd9703..33ab891d 100644 --- a/Square/Exceptions/ApiException.cs +++ b/Square/Exceptions/APIException.cs @@ -10,6 +10,9 @@ namespace Square.Exceptions { + /// + /// This is the base class for all exceptions that represent an error response from the server. + /// [JsonObject] public class ApiException : Exception { @@ -54,13 +57,13 @@ public ApiException(string reason, HttpContext context) string responseBody = reader.ReadToEnd(); if (!string.IsNullOrWhiteSpace(responseBody)) { - try - { + try + { JObject body = JObject.Parse(responseBody); if(!this.GetType().Name.Equals("ApiException", StringComparison.OrdinalIgnoreCase)) { - JsonConvert.PopulateObject(responseBody, this); + JsonConvert.PopulateObject(responseBody, this); } // Map Square v1 error to v2 errors @@ -77,7 +80,7 @@ public ApiException(string reason, HttpContext context) Errors = new List { errorBuilder.Build() }; } - catch + catch (JsonReaderException) { // Ignore deserialization and IO issues to prevent exception being thrown when this exception // instance is being constructed. diff --git a/Square/Http/Client/HttpClientConfiguration.cs b/Square/Http/Client/HttpClientConfiguration.cs new file mode 100644 index 00000000..4866a72c --- /dev/null +++ b/Square/Http/Client/HttpClientConfiguration.cs @@ -0,0 +1,20 @@ +using System; + +namespace Square.Http.Client +{ + /// + /// Represents the current state of the Http Client + /// + internal class HttpClientConfiguration : IHttpClientConfiguration + { + public HttpClientConfiguration() + { + Timeout = TimeSpan.FromSeconds(60); + } + + /// + /// Http client timeout + /// + public TimeSpan Timeout { get; internal set; } + } +} diff --git a/Square/Http/Client/HttpClientWrapper.cs b/Square/Http/Client/HttpClientWrapper.cs index 5b51b8ed..77bce500 100644 --- a/Square/Http/Client/HttpClientWrapper.cs +++ b/Square/Http/Client/HttpClientWrapper.cs @@ -5,6 +5,7 @@ using System.Net.Http; using System.Net.Http.Headers; using System.Text; +using System.Threading; using System.Threading.Tasks; using Square.Http.Request; using Square.Http.Response; @@ -22,13 +23,14 @@ public HttpClientWrapper() this.client = GetDefaultHttpClient(); } - public HttpClientWrapper(TimeSpan timeout) + public HttpClientWrapper(HttpClientConfiguration httpClientConfig) { this.client = new HttpClient() { - Timeout = timeout + Timeout = httpClientConfig.Timeout }; } + private HttpClient GetDefaultHttpClient() { if (defaultHttpClient == null) @@ -46,28 +48,31 @@ private HttpClient GetDefaultHttpClient() } return defaultHttpClient; } + #region Execute methods - public HttpResponse ExecuteAsString(HttpRequest request) + public HttpStringResponse ExecuteAsString(HttpRequest request) { - Task t = ExecuteAsStringAsync(request); + Task t = ExecuteAsStringAsync(request); ApiHelper.RunTaskSynchronously(t); return t.Result; } - public async Task ExecuteAsStringAsync(HttpRequest request) + public async Task ExecuteAsStringAsync(HttpRequest request, + CancellationToken cancellationToken = default) { //raise the on before request event RaiseOnBeforeHttpRequestEvent(request); - HttpResponseMessage responseMessage = await HttpResponseMessage(request).ConfigureAwait(false); + HttpResponseMessage responseMessage = await HttpResponseMessage(request, cancellationToken) + .ConfigureAwait(false); int StatusCode = (int)responseMessage.StatusCode; var Headers = GetCombinedResponseHeaders(responseMessage); Stream RawBody = await responseMessage.Content.ReadAsStreamAsync().ConfigureAwait(false); string Body = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); - HttpResponse response = new HttpStringResponse(StatusCode, Headers, RawBody, Body); + var response = new HttpStringResponse(StatusCode, Headers, RawBody, Body); //raise the on after response event RaiseOnAfterHttpResponseEvent(response); @@ -81,12 +86,14 @@ public HttpResponse ExecuteAsBinary(HttpRequest request) return t.Result; } - public async Task ExecuteAsBinaryAsync(HttpRequest request) + public async Task ExecuteAsBinaryAsync(HttpRequest request, + CancellationToken cancellationToken = default) { //raise the on before request event RaiseOnBeforeHttpRequestEvent(request); - HttpResponseMessage responseMessage = await HttpResponseMessage(request).ConfigureAwait(false); + HttpResponseMessage responseMessage = await HttpResponseMessage(request, cancellationToken) + .ConfigureAwait(false); int StatusCode = (int)responseMessage.StatusCode; var Headers = GetCombinedResponseHeaders(responseMessage); @@ -206,7 +213,7 @@ public HttpRequest DeleteBody(string queryUrl, Dictionary header #region Helper methods - private async Task HttpResponseMessage(HttpRequest request) + private async Task HttpResponseMessage(HttpRequest request, CancellationToken cancellationToken) { HttpRequestMessage requestMessage = new HttpRequestMessage { @@ -235,9 +242,8 @@ private async Task HttpResponseMessage(HttpRequest request) if (request.Body != null) { - if (request.Body is FileStreamInfo) + if (request.Body is FileStreamInfo file) { - var file = ((FileStreamInfo)request.Body); requestMessage.Content = new StreamContent(file.FileStream); if (!string.IsNullOrWhiteSpace(file.ContentType)) { @@ -275,7 +281,7 @@ private async Task HttpResponseMessage(HttpRequest request) bytes = Encoding.UTF8.GetBytes((string)request.Body); } - requestMessage.Content = new ByteArrayContent(bytes ?? (new byte[] { })); + requestMessage.Content = new ByteArrayContent(bytes ?? Array.Empty()); try { @@ -324,7 +330,7 @@ private async Task HttpResponseMessage(HttpRequest request) requestMessage.Content = new FormUrlEncodedContent(parameters); } } - return await client.SendAsync(requestMessage).ConfigureAwait(false); + return await client.SendAsync(requestMessage, cancellationToken).ConfigureAwait(false); } private static Dictionary GetCombinedResponseHeaders(HttpResponseMessage responseMessage) diff --git a/Square/Http/Client/IHttpClient.cs b/Square/Http/Client/IHttpClient.cs index 749fbb92..bf2630a7 100644 --- a/Square/Http/Client/IHttpClient.cs +++ b/Square/Http/Client/IHttpClient.cs @@ -1,12 +1,14 @@ using System; +using System.Net; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; using Square.Http.Request; using Square.Http.Response; namespace Square.Http.Client { - internal interface IHttpClient + internal interface IHttpClient { /// /// Event raised before an Http request is sent over the network @@ -27,7 +29,7 @@ internal interface IHttpClient /// /// The given HttpRequest to execute /// HttpResponse containing raw information - HttpResponse ExecuteAsString(HttpRequest request); + HttpStringResponse ExecuteAsString(HttpRequest request); /// /// Execute a given HttpRequest to get binary response back @@ -41,14 +43,14 @@ internal interface IHttpClient /// /// The given HttpRequest to execute /// HttpResponse containing raw information - Task ExecuteAsStringAsync(HttpRequest request); + Task ExecuteAsStringAsync(HttpRequest request, CancellationToken cancellationToken = default); /// /// Execute a given HttpRequest to get async binary response back /// /// The given HttpRequest to execute /// HttpResponse containing raw information - Task ExecuteAsBinaryAsync(HttpRequest request); + Task ExecuteAsBinaryAsync(HttpRequest request, CancellationToken cancellationToken = default); /// /// Create a simple HTTP GET request given the URL diff --git a/Square/Http/Client/IHttpClientConfiguration.cs b/Square/Http/Client/IHttpClientConfiguration.cs new file mode 100644 index 00000000..9808442f --- /dev/null +++ b/Square/Http/Client/IHttpClientConfiguration.cs @@ -0,0 +1,15 @@ +using System; + +namespace Square.Http.Client +{ + /// + /// Represents the current state of the Http Client + /// + public interface IHttpClientConfiguration + { + /// + /// Http client timeout + /// + TimeSpan Timeout { get; } + } +} diff --git a/Square/Http/Client/MultipartFileContent.cs b/Square/Http/Client/MultipartFileContent.cs index 7facc581..9bfdb681 100644 --- a/Square/Http/Client/MultipartFileContent.cs +++ b/Square/Http/Client/MultipartFileContent.cs @@ -37,7 +37,11 @@ protected override void SetHeaders(string contentDispositionName, HttpContentHea FileName = string.IsNullOrWhiteSpace(File.FileName) ? "file" : File.FileName, }; - if (!Headers.ContainsKey("content-type")) + if (!string.IsNullOrEmpty(File.ContentType)) + { + headers.ContentType = new MediaTypeHeaderValue(File.ContentType); + } + else if (!Headers.ContainsKey("content-type")) { headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); } diff --git a/Square/IConfiguration.cs b/Square/IConfiguration.cs index 42bd88c1..1c2d49dc 100644 --- a/Square/IConfiguration.cs +++ b/Square/IConfiguration.cs @@ -1,4 +1,5 @@ using System; +using System.Net; using Square.Models; namespace Square @@ -10,7 +11,9 @@ public interface IConfiguration /// TimeSpan Timeout { get; } - // OAuth 2.0 Access Token + /// + /// OAuth 2.0 Access Token + /// string AccessToken { get; } /// diff --git a/Square/Models/AdditionalRecipient.cs b/Square/Models/AdditionalRecipient.cs index 0a319f53..b95ba00d 100644 --- a/Square/Models/AdditionalRecipient.cs +++ b/Square/Models/AdditionalRecipient.cs @@ -111,4 +111,4 @@ public AdditionalRecipient Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/AdditionalRecipientReceivable.cs b/Square/Models/AdditionalRecipientReceivable.cs index f3026c2b..4d170d2d 100644 --- a/Square/Models/AdditionalRecipientReceivable.cs +++ b/Square/Models/AdditionalRecipientReceivable.cs @@ -88,7 +88,7 @@ public class Builder private string transactionLocationId; private Models.Money amountMoney; private string createdAt; - private IList refunds; + private IList refunds = new List(); public Builder(string id, string transactionId, @@ -147,4 +147,4 @@ public AdditionalRecipientReceivable Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/AdditionalRecipientReceivableRefund.cs b/Square/Models/AdditionalRecipientReceivableRefund.cs index fdb4e3f2..ffd9c33d 100644 --- a/Square/Models/AdditionalRecipientReceivableRefund.cs +++ b/Square/Models/AdditionalRecipientReceivableRefund.cs @@ -149,4 +149,4 @@ public AdditionalRecipientReceivableRefund Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Address.cs b/Square/Models/Address.cs index 82759f16..d22430c5 100644 --- a/Square/Models/Address.cs +++ b/Square/Models/Address.cs @@ -295,4 +295,4 @@ public Address Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BalancePaymentDetails.cs b/Square/Models/BalancePaymentDetails.cs index 58c8d3f9..b8815714 100644 --- a/Square/Models/BalancePaymentDetails.cs +++ b/Square/Models/BalancePaymentDetails.cs @@ -66,4 +66,4 @@ public BalancePaymentDetails Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchChangeInventoryRequest.cs b/Square/Models/BatchChangeInventoryRequest.cs index 2b973fa6..cc81405b 100644 --- a/Square/Models/BatchChangeInventoryRequest.cs +++ b/Square/Models/BatchChangeInventoryRequest.cs @@ -60,7 +60,7 @@ public Builder ToBuilder() public class Builder { private string idempotencyKey; - private IList changes; + private IList changes = new List(); private bool? ignoreUnchangedCounts; public Builder() { } @@ -90,4 +90,4 @@ public BatchChangeInventoryRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchChangeInventoryResponse.cs b/Square/Models/BatchChangeInventoryResponse.cs index 38fcab4c..7ff9a8e7 100644 --- a/Square/Models/BatchChangeInventoryResponse.cs +++ b/Square/Models/BatchChangeInventoryResponse.cs @@ -47,8 +47,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList counts; + private IList errors = new List(); + private IList counts = new List(); public Builder() { } public Builder Errors(IList value) @@ -70,4 +70,4 @@ public BatchChangeInventoryResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchDeleteCatalogObjectsRequest.cs b/Square/Models/BatchDeleteCatalogObjectsRequest.cs index 2efb4c88..2057fa4f 100644 --- a/Square/Models/BatchDeleteCatalogObjectsRequest.cs +++ b/Square/Models/BatchDeleteCatalogObjectsRequest.cs @@ -36,7 +36,7 @@ public Builder ToBuilder() public class Builder { - private IList objectIds; + private IList objectIds = new List(); public Builder() { } public Builder ObjectIds(IList value) @@ -51,4 +51,4 @@ public BatchDeleteCatalogObjectsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchDeleteCatalogObjectsResponse.cs b/Square/Models/BatchDeleteCatalogObjectsResponse.cs index f950f2b0..6b98c03b 100644 --- a/Square/Models/BatchDeleteCatalogObjectsResponse.cs +++ b/Square/Models/BatchDeleteCatalogObjectsResponse.cs @@ -56,8 +56,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList deletedObjectIds; + private IList errors = new List(); + private IList deletedObjectIds = new List(); private string deletedAt; public Builder() { } @@ -87,4 +87,4 @@ public BatchDeleteCatalogObjectsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchRetrieveCatalogObjectsRequest.cs b/Square/Models/BatchRetrieveCatalogObjectsRequest.cs index f2243a87..b517d079 100644 --- a/Square/Models/BatchRetrieveCatalogObjectsRequest.cs +++ b/Square/Models/BatchRetrieveCatalogObjectsRequest.cs @@ -75,4 +75,4 @@ public BatchRetrieveCatalogObjectsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchRetrieveCatalogObjectsResponse.cs b/Square/Models/BatchRetrieveCatalogObjectsResponse.cs index 407b7059..f018e356 100644 --- a/Square/Models/BatchRetrieveCatalogObjectsResponse.cs +++ b/Square/Models/BatchRetrieveCatalogObjectsResponse.cs @@ -56,9 +56,9 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList objects; - private IList relatedObjects; + private IList errors = new List(); + private IList objects = new List(); + private IList relatedObjects = new List(); public Builder() { } public Builder Errors(IList value) @@ -87,4 +87,4 @@ public BatchRetrieveCatalogObjectsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchRetrieveInventoryChangesRequest.cs b/Square/Models/BatchRetrieveInventoryChangesRequest.cs index 6fdcd73e..a15c0de7 100644 --- a/Square/Models/BatchRetrieveInventoryChangesRequest.cs +++ b/Square/Models/BatchRetrieveInventoryChangesRequest.cs @@ -102,10 +102,10 @@ public Builder ToBuilder() public class Builder { - private IList catalogObjectIds; - private IList locationIds; - private IList types; - private IList states; + private IList catalogObjectIds = new List(); + private IList locationIds = new List(); + private IList types = new List(); + private IList states = new List(); private string updatedAfter; private string updatedBefore; private string cursor; @@ -165,4 +165,4 @@ public BatchRetrieveInventoryChangesRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchRetrieveInventoryChangesResponse.cs b/Square/Models/BatchRetrieveInventoryChangesResponse.cs index cfa9f4e4..0a64c2c2 100644 --- a/Square/Models/BatchRetrieveInventoryChangesResponse.cs +++ b/Square/Models/BatchRetrieveInventoryChangesResponse.cs @@ -59,8 +59,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList changes; + private IList errors = new List(); + private IList changes = new List(); private string cursor; public Builder() { } @@ -90,4 +90,4 @@ public BatchRetrieveInventoryChangesResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchRetrieveInventoryCountsRequest.cs b/Square/Models/BatchRetrieveInventoryCountsRequest.cs index ed13586d..2bcb8565 100644 --- a/Square/Models/BatchRetrieveInventoryCountsRequest.cs +++ b/Square/Models/BatchRetrieveInventoryCountsRequest.cs @@ -67,8 +67,8 @@ public Builder ToBuilder() public class Builder { - private IList catalogObjectIds; - private IList locationIds; + private IList catalogObjectIds = new List(); + private IList locationIds = new List(); private string updatedAfter; private string cursor; @@ -106,4 +106,4 @@ public BatchRetrieveInventoryCountsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchRetrieveInventoryCountsResponse.cs b/Square/Models/BatchRetrieveInventoryCountsResponse.cs index 5ba4d83a..04c6884f 100644 --- a/Square/Models/BatchRetrieveInventoryCountsResponse.cs +++ b/Square/Models/BatchRetrieveInventoryCountsResponse.cs @@ -59,8 +59,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList counts; + private IList errors = new List(); + private IList counts = new List(); private string cursor; public Builder() { } @@ -90,4 +90,4 @@ public BatchRetrieveInventoryCountsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchRetrieveOrdersRequest.cs b/Square/Models/BatchRetrieveOrdersRequest.cs index 3a0d8493..23490856 100644 --- a/Square/Models/BatchRetrieveOrdersRequest.cs +++ b/Square/Models/BatchRetrieveOrdersRequest.cs @@ -51,4 +51,4 @@ public BatchRetrieveOrdersRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchRetrieveOrdersResponse.cs b/Square/Models/BatchRetrieveOrdersResponse.cs index 9a2f6838..5851a5f9 100644 --- a/Square/Models/BatchRetrieveOrdersResponse.cs +++ b/Square/Models/BatchRetrieveOrdersResponse.cs @@ -47,8 +47,8 @@ public Builder ToBuilder() public class Builder { - private IList orders; - private IList errors; + private IList orders = new List(); + private IList errors = new List(); public Builder() { } public Builder Orders(IList value) @@ -70,4 +70,4 @@ public BatchRetrieveOrdersResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchUpsertCatalogObjectsRequest.cs b/Square/Models/BatchUpsertCatalogObjectsRequest.cs index 2c1e49b1..7f6ef6ff 100644 --- a/Square/Models/BatchUpsertCatalogObjectsRequest.cs +++ b/Square/Models/BatchUpsertCatalogObjectsRequest.cs @@ -65,7 +65,7 @@ public Builder ToBuilder() public class Builder { private string idempotencyKey; - private IList batches; + private IList batches = new List(); public Builder(string idempotencyKey) { @@ -90,4 +90,4 @@ public BatchUpsertCatalogObjectsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BatchUpsertCatalogObjectsResponse.cs b/Square/Models/BatchUpsertCatalogObjectsResponse.cs index 74e64f1a..ed8d1d45 100644 --- a/Square/Models/BatchUpsertCatalogObjectsResponse.cs +++ b/Square/Models/BatchUpsertCatalogObjectsResponse.cs @@ -65,10 +65,10 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList objects; + private IList errors = new List(); + private IList objects = new List(); private string updatedAt; - private IList idMappings; + private IList idMappings = new List(); public Builder() { } public Builder Errors(IList value) @@ -104,4 +104,4 @@ public BatchUpsertCatalogObjectsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Break.cs b/Square/Models/Break.cs index 22eb7c23..56ac886e 100644 --- a/Square/Models/Break.cs +++ b/Square/Models/Break.cs @@ -167,4 +167,4 @@ public Break Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BreakType.cs b/Square/Models/BreakType.cs index fb77aef8..350b6f79 100644 --- a/Square/Models/BreakType.cs +++ b/Square/Models/BreakType.cs @@ -182,4 +182,4 @@ public BreakType Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BusinessHours.cs b/Square/Models/BusinessHours.cs index 434c4a63..839125d3 100644 --- a/Square/Models/BusinessHours.cs +++ b/Square/Models/BusinessHours.cs @@ -35,7 +35,7 @@ public Builder ToBuilder() public class Builder { - private IList periods; + private IList periods = new List(); public Builder() { } public Builder Periods(IList value) @@ -50,4 +50,4 @@ public BusinessHours Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/BusinessHoursPeriod.cs b/Square/Models/BusinessHoursPeriod.cs index 0b6fc53d..2ca785a3 100644 --- a/Square/Models/BusinessHoursPeriod.cs +++ b/Square/Models/BusinessHoursPeriod.cs @@ -85,4 +85,4 @@ public BusinessHoursPeriod Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CancelPaymentByIdempotencyKeyRequest.cs b/Square/Models/CancelPaymentByIdempotencyKeyRequest.cs index c118e8b5..9438e572 100644 --- a/Square/Models/CancelPaymentByIdempotencyKeyRequest.cs +++ b/Square/Models/CancelPaymentByIdempotencyKeyRequest.cs @@ -51,4 +51,4 @@ public CancelPaymentByIdempotencyKeyRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CancelPaymentByIdempotencyKeyResponse.cs b/Square/Models/CancelPaymentByIdempotencyKeyResponse.cs index b6a38980..fe03cd63 100644 --- a/Square/Models/CancelPaymentByIdempotencyKeyResponse.cs +++ b/Square/Models/CancelPaymentByIdempotencyKeyResponse.cs @@ -38,7 +38,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Errors(IList value) @@ -53,4 +53,4 @@ public CancelPaymentByIdempotencyKeyResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CancelPaymentResponse.cs b/Square/Models/CancelPaymentResponse.cs index f7b40e35..186e4724 100644 --- a/Square/Models/CancelPaymentResponse.cs +++ b/Square/Models/CancelPaymentResponse.cs @@ -47,7 +47,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Payment payment; public Builder() { } @@ -70,4 +70,4 @@ public CancelPaymentResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CaptureTransactionResponse.cs b/Square/Models/CaptureTransactionResponse.cs index 2eda7204..5f6a81f9 100644 --- a/Square/Models/CaptureTransactionResponse.cs +++ b/Square/Models/CaptureTransactionResponse.cs @@ -38,7 +38,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Errors(IList value) @@ -53,4 +53,4 @@ public CaptureTransactionResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Card.cs b/Square/Models/Card.cs index c4f7b98a..c76a1c92 100644 --- a/Square/Models/Card.cs +++ b/Square/Models/Card.cs @@ -188,4 +188,4 @@ public Card Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CardPaymentDetails.cs b/Square/Models/CardPaymentDetails.cs index 70bb8c54..ab73ce41 100644 --- a/Square/Models/CardPaymentDetails.cs +++ b/Square/Models/CardPaymentDetails.cs @@ -174,7 +174,7 @@ public class Builder private string verificationResults; private string statementDescription; private Models.DeviceDetails deviceDetails; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Status(string value) @@ -280,4 +280,4 @@ public CardPaymentDetails Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CashDrawerDevice.cs b/Square/Models/CashDrawerDevice.cs index 87d4a00a..81d9b82b 100644 --- a/Square/Models/CashDrawerDevice.cs +++ b/Square/Models/CashDrawerDevice.cs @@ -66,4 +66,4 @@ public CashDrawerDevice Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CashDrawerShift.cs b/Square/Models/CashDrawerShift.cs index 4afbd5d4..60bc918e 100644 --- a/Square/Models/CashDrawerShift.cs +++ b/Square/Models/CashDrawerShift.cs @@ -193,7 +193,7 @@ public class CashDrawerShift public Models.Money ClosedCashMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for device /// [JsonProperty("device")] public Models.CashDrawerDevice Device { get; } @@ -229,7 +229,7 @@ public class Builder private string openedAt; private string endedAt; private string closedAt; - private IList employeeIds; + private IList employeeIds = new List(); private string openingEmployeeId; private string endingEmployeeId; private string closingEmployeeId; @@ -375,4 +375,4 @@ public CashDrawerShift Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CashDrawerShiftEvent.cs b/Square/Models/CashDrawerShiftEvent.cs index 6798c74a..225791cf 100644 --- a/Square/Models/CashDrawerShiftEvent.cs +++ b/Square/Models/CashDrawerShiftEvent.cs @@ -142,4 +142,4 @@ public CashDrawerShiftEvent Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CashDrawerShiftSummary.cs b/Square/Models/CashDrawerShiftSummary.cs index 3d2d65c9..7ec4d832 100644 --- a/Square/Models/CashDrawerShiftSummary.cs +++ b/Square/Models/CashDrawerShiftSummary.cs @@ -200,4 +200,4 @@ public CashDrawerShiftSummary Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CashPaymentDetails.cs b/Square/Models/CashPaymentDetails.cs index 9db0c92c..93c606e3 100644 --- a/Square/Models/CashPaymentDetails.cs +++ b/Square/Models/CashPaymentDetails.cs @@ -78,4 +78,4 @@ public CashPaymentDetails Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogCategory.cs b/Square/Models/CatalogCategory.cs index bf919fdb..8416559c 100644 --- a/Square/Models/CatalogCategory.cs +++ b/Square/Models/CatalogCategory.cs @@ -49,4 +49,4 @@ public CatalogCategory Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogDiscount.cs b/Square/Models/CatalogDiscount.cs index 85c032a7..061b32dc 100644 --- a/Square/Models/CatalogDiscount.cs +++ b/Square/Models/CatalogDiscount.cs @@ -77,7 +77,7 @@ public class CatalogDiscount public string LabelColor { get; } /// - /// TODO: Write general description for this method + /// Getter for modify_tax_basis /// [JsonProperty("modify_tax_basis")] public string ModifyTaxBasis { get; } @@ -160,4 +160,4 @@ public CatalogDiscount Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogIdMapping.cs b/Square/Models/CatalogIdMapping.cs index e261bfb2..017c9030 100644 --- a/Square/Models/CatalogIdMapping.cs +++ b/Square/Models/CatalogIdMapping.cs @@ -66,4 +66,4 @@ public CatalogIdMapping Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogImage.cs b/Square/Models/CatalogImage.cs index 8b585847..98aa0dfa 100644 --- a/Square/Models/CatalogImage.cs +++ b/Square/Models/CatalogImage.cs @@ -86,4 +86,4 @@ public CatalogImage Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogInfoResponse.cs b/Square/Models/CatalogInfoResponse.cs index 3aa7e6fd..c2c32f33 100644 --- a/Square/Models/CatalogInfoResponse.cs +++ b/Square/Models/CatalogInfoResponse.cs @@ -34,7 +34,7 @@ public class CatalogInfoResponse public IList Errors { get; } /// - /// TODO: Write general description for this method + /// Getter for limits /// [JsonProperty("limits")] public Models.CatalogInfoResponseLimits Limits { get; } @@ -56,7 +56,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.CatalogInfoResponseLimits limits; private Models.StandardUnitDescriptionGroup standardUnitDescriptionGroup; @@ -87,4 +87,4 @@ public CatalogInfoResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogInfoResponseLimits.cs b/Square/Models/CatalogInfoResponseLimits.cs index 281e6eed..9e9f34c2 100644 --- a/Square/Models/CatalogInfoResponseLimits.cs +++ b/Square/Models/CatalogInfoResponseLimits.cs @@ -230,4 +230,4 @@ public CatalogInfoResponseLimits Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogItem.cs b/Square/Models/CatalogItem.cs index 21797839..67def85e 100644 --- a/Square/Models/CatalogItem.cs +++ b/Square/Models/CatalogItem.cs @@ -172,12 +172,12 @@ public class Builder private bool? availableForPickup; private bool? availableElectronically; private string categoryId; - private IList taxIds; - private IList modifierListInfo; - private IList variations; + private IList taxIds = new List(); + private IList modifierListInfo = new List(); + private IList variations = new List(); private string productType; private bool? skipModifierScreen; - private IList itemOptions; + private IList itemOptions = new List(); public Builder() { } public Builder Name(string value) @@ -283,4 +283,4 @@ public CatalogItem Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogItemModifierListInfo.cs b/Square/Models/CatalogItemModifierListInfo.cs index 50cec0d1..8201d698 100644 --- a/Square/Models/CatalogItemModifierListInfo.cs +++ b/Square/Models/CatalogItemModifierListInfo.cs @@ -70,7 +70,7 @@ public Builder ToBuilder() public class Builder { private string modifierListId; - private IList modifierOverrides; + private IList modifierOverrides = new List(); private int? minSelectedModifiers; private int? maxSelectedModifiers; private bool? enabled; @@ -119,4 +119,4 @@ public CatalogItemModifierListInfo Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogItemOption.cs b/Square/Models/CatalogItemOption.cs index b6988f83..3be682f7 100644 --- a/Square/Models/CatalogItemOption.cs +++ b/Square/Models/CatalogItemOption.cs @@ -89,7 +89,7 @@ public class Builder private string displayName; private string description; private bool? showColors; - private IList values; + private IList values = new List(); private long? itemCount; public Builder() { } @@ -140,4 +140,4 @@ public CatalogItemOption Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogItemOptionForItem.cs b/Square/Models/CatalogItemOptionForItem.cs index b1e6f8be..45b1ba8a 100644 --- a/Square/Models/CatalogItemOptionForItem.cs +++ b/Square/Models/CatalogItemOptionForItem.cs @@ -49,4 +49,4 @@ public CatalogItemOptionForItem Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogItemOptionValue.cs b/Square/Models/CatalogItemOptionValue.cs index 5bf37bdc..48a53b34 100644 --- a/Square/Models/CatalogItemOptionValue.cs +++ b/Square/Models/CatalogItemOptionValue.cs @@ -141,4 +141,4 @@ public CatalogItemOptionValue Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogItemOptionValueForItemVariation.cs b/Square/Models/CatalogItemOptionValueForItemVariation.cs index 6eb92b94..52f58812 100644 --- a/Square/Models/CatalogItemOptionValueForItemVariation.cs +++ b/Square/Models/CatalogItemOptionValueForItemVariation.cs @@ -66,4 +66,4 @@ public CatalogItemOptionValueForItemVariation Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogItemVariation.cs b/Square/Models/CatalogItemVariation.cs index 6394d54d..a1909350 100644 --- a/Square/Models/CatalogItemVariation.cs +++ b/Square/Models/CatalogItemVariation.cs @@ -184,13 +184,13 @@ public class Builder private int? ordinal; private string pricingType; private Models.Money priceMoney; - private IList locationOverrides; + private IList locationOverrides = new List(); private bool? trackInventory; private string inventoryAlertType; private long? inventoryAlertThreshold; private string userData; private long? serviceDuration; - private IList itemOptionValues; + private IList itemOptionValues = new List(); private string measurementUnitId; public Builder() { } @@ -304,4 +304,4 @@ public CatalogItemVariation Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogMeasurementUnit.cs b/Square/Models/CatalogMeasurementUnit.cs index 0767379b..eb75f8b0 100644 --- a/Square/Models/CatalogMeasurementUnit.cs +++ b/Square/Models/CatalogMeasurementUnit.cs @@ -74,4 +74,4 @@ public CatalogMeasurementUnit Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogModifier.cs b/Square/Models/CatalogModifier.cs index e56663f0..fe717905 100644 --- a/Square/Models/CatalogModifier.cs +++ b/Square/Models/CatalogModifier.cs @@ -71,4 +71,4 @@ public CatalogModifier Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogModifierList.cs b/Square/Models/CatalogModifierList.cs index bcfa24bd..24a38436 100644 --- a/Square/Models/CatalogModifierList.cs +++ b/Square/Models/CatalogModifierList.cs @@ -57,7 +57,7 @@ public class Builder { private string name; private string selectionType; - private IList modifiers; + private IList modifiers = new List(); public Builder() { } public Builder Name(string value) @@ -86,4 +86,4 @@ public CatalogModifierList Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogModifierOverride.cs b/Square/Models/CatalogModifierOverride.cs index 1abf8e4e..20897409 100644 --- a/Square/Models/CatalogModifierOverride.cs +++ b/Square/Models/CatalogModifierOverride.cs @@ -68,4 +68,4 @@ public CatalogModifierOverride Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogObject.cs b/Square/Models/CatalogObject.cs index 12921649..153653c0 100644 --- a/Square/Models/CatalogObject.cs +++ b/Square/Models/CatalogObject.cs @@ -274,10 +274,10 @@ public class Builder private string updatedAt; private long? version; private bool? isDeleted; - private IList catalogV1Ids; + private IList catalogV1Ids = new List(); private bool? presentAtAllLocations; - private IList presentAtLocationIds; - private IList absentAtLocationIds; + private IList presentAtLocationIds = new List(); + private IList absentAtLocationIds = new List(); private string imageId; private Models.CatalogItem itemData; private Models.CatalogCategory categoryData; @@ -473,4 +473,4 @@ public CatalogObject Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogObjectBatch.cs b/Square/Models/CatalogObjectBatch.cs index 08890187..d4e9e58a 100644 --- a/Square/Models/CatalogObjectBatch.cs +++ b/Square/Models/CatalogObjectBatch.cs @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList objects; + private IList objects = new List(); public Builder() { } public Builder Objects(IList value) @@ -49,4 +49,4 @@ public CatalogObjectBatch Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogPricingRule.cs b/Square/Models/CatalogPricingRule.cs index 70ea0da6..45b42f23 100644 --- a/Square/Models/CatalogPricingRule.cs +++ b/Square/Models/CatalogPricingRule.cs @@ -146,7 +146,7 @@ public Builder ToBuilder() public class Builder { private string name; - private IList timePeriodIds; + private IList timePeriodIds = new List(); private string discountId; private string matchProductsId; private string applyProductsId; @@ -240,4 +240,4 @@ public CatalogPricingRule Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogProductSet.cs b/Square/Models/CatalogProductSet.cs index c6dc5b68..54bc966a 100644 --- a/Square/Models/CatalogProductSet.cs +++ b/Square/Models/CatalogProductSet.cs @@ -105,8 +105,8 @@ public Builder ToBuilder() public class Builder { private string name; - private IList productIdsAny; - private IList productIdsAll; + private IList productIdsAny = new List(); + private IList productIdsAll = new List(); private long? quantityExact; private long? quantityMin; private long? quantityMax; @@ -167,4 +167,4 @@ public CatalogProductSet Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogQuery.cs b/Square/Models/CatalogQuery.cs index 822f2ae7..5e968335 100644 --- a/Square/Models/CatalogQuery.cs +++ b/Square/Models/CatalogQuery.cs @@ -36,55 +36,55 @@ public class CatalogQuery } /// - /// TODO: Write general description for this method + /// Getter for sorted_attribute_query /// [JsonProperty("sorted_attribute_query")] public Models.CatalogQuerySortedAttribute SortedAttributeQuery { get; } /// - /// TODO: Write general description for this method + /// Getter for exact_query /// [JsonProperty("exact_query")] public Models.CatalogQueryExact ExactQuery { get; } /// - /// TODO: Write general description for this method + /// Getter for prefix_query /// [JsonProperty("prefix_query")] public Models.CatalogQueryPrefix PrefixQuery { get; } /// - /// TODO: Write general description for this method + /// Getter for range_query /// [JsonProperty("range_query")] public Models.CatalogQueryRange RangeQuery { get; } /// - /// TODO: Write general description for this method + /// Getter for text_query /// [JsonProperty("text_query")] public Models.CatalogQueryText TextQuery { get; } /// - /// TODO: Write general description for this method + /// Getter for items_for_tax_query /// [JsonProperty("items_for_tax_query")] public Models.CatalogQueryItemsForTax ItemsForTaxQuery { get; } /// - /// TODO: Write general description for this method + /// Getter for items_for_modifier_list_query /// [JsonProperty("items_for_modifier_list_query")] public Models.CatalogQueryItemsForModifierList ItemsForModifierListQuery { get; } /// - /// TODO: Write general description for this method + /// Getter for items_for_item_options_query /// [JsonProperty("items_for_item_options_query")] public Models.CatalogQueryItemsForItemOptions ItemsForItemOptionsQuery { get; } /// - /// TODO: Write general description for this method + /// Getter for item_variations_for_item_option_values_query /// [JsonProperty("item_variations_for_item_option_values_query")] public Models.CatalogQueryItemVariationsForItemOptionValues ItemVariationsForItemOptionValuesQuery { get; } @@ -185,4 +185,4 @@ public CatalogQuery Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogQueryCustomAttributeUsage.cs b/Square/Models/CatalogQueryCustomAttributeUsage.cs index d2832658..2e0b88ff 100644 --- a/Square/Models/CatalogQueryCustomAttributeUsage.cs +++ b/Square/Models/CatalogQueryCustomAttributeUsage.cs @@ -22,13 +22,13 @@ public class CatalogQueryCustomAttributeUsage } /// - /// TODO: Write general description for this method + /// Getter for custom_attribute_definition_ids /// [JsonProperty("custom_attribute_definition_ids")] public IList CustomAttributeDefinitionIds { get; } /// - /// TODO: Write general description for this method + /// Getter for has_value /// [JsonProperty("has_value")] public bool? HasValue { get; } @@ -43,7 +43,7 @@ public Builder ToBuilder() public class Builder { - private IList customAttributeDefinitionIds; + private IList customAttributeDefinitionIds = new List(); private bool? hasValue; public Builder() { } @@ -66,4 +66,4 @@ public CatalogQueryCustomAttributeUsage Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogQueryExact.cs b/Square/Models/CatalogQueryExact.cs index 90f741e8..ff660503 100644 --- a/Square/Models/CatalogQueryExact.cs +++ b/Square/Models/CatalogQueryExact.cs @@ -70,4 +70,4 @@ public CatalogQueryExact Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogQueryFilteredItems.cs b/Square/Models/CatalogQueryFilteredItems.cs index 0af4be9d..04a82234 100644 --- a/Square/Models/CatalogQueryFilteredItems.cs +++ b/Square/Models/CatalogQueryFilteredItems.cs @@ -38,19 +38,19 @@ public class CatalogQueryFilteredItems } /// - /// TODO: Write general description for this method + /// Getter for text_filter /// [JsonProperty("text_filter")] public string TextFilter { get; } /// - /// TODO: Write general description for this method + /// Getter for search_vendor_code /// [JsonProperty("search_vendor_code")] public bool? SearchVendorCode { get; } /// - /// TODO: Write general description for this method + /// Getter for category_ids /// [JsonProperty("category_ids")] public IList CategoryIds { get; } @@ -62,13 +62,13 @@ public class CatalogQueryFilteredItems public IList StockLevels { get; } /// - /// TODO: Write general description for this method + /// Getter for enabled_location_ids /// [JsonProperty("enabled_location_ids")] public IList EnabledLocationIds { get; } /// - /// TODO: Write general description for this method + /// Getter for vendor_ids /// [JsonProperty("vendor_ids")] public IList VendorIds { get; } @@ -80,7 +80,7 @@ public class CatalogQueryFilteredItems public IList ProductTypes { get; } /// - /// TODO: Write general description for this method + /// Getter for custom_attribute_filters /// [JsonProperty("custom_attribute_filters")] public IList CustomAttributeFilters { get; } @@ -117,13 +117,13 @@ public class Builder { private string textFilter; private bool? searchVendorCode; - private IList categoryIds; - private IList stockLevels; - private IList enabledLocationIds; - private IList vendorIds; - private IList productTypes; - private IList customAttributeFilters; - private IList doesNotExist; + private IList categoryIds = new List(); + private IList stockLevels = new List(); + private IList enabledLocationIds = new List(); + private IList vendorIds = new List(); + private IList productTypes = new List(); + private IList customAttributeFilters = new List(); + private IList doesNotExist = new List(); private string sortOrder; public Builder() { } @@ -202,4 +202,4 @@ public CatalogQueryFilteredItems Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogQueryFilteredItemsCustomAttributeFilter.cs b/Square/Models/CatalogQueryFilteredItemsCustomAttributeFilter.cs index f811d6ee..63e9a065 100644 --- a/Square/Models/CatalogQueryFilteredItemsCustomAttributeFilter.cs +++ b/Square/Models/CatalogQueryFilteredItemsCustomAttributeFilter.cs @@ -30,37 +30,37 @@ public class CatalogQueryFilteredItemsCustomAttributeFilter } /// - /// TODO: Write general description for this method + /// Getter for filter_type /// [JsonProperty("filter_type")] public string FilterType { get; } /// - /// TODO: Write general description for this method + /// Getter for custom_attribute_definition_ids /// [JsonProperty("custom_attribute_definition_ids")] public IList CustomAttributeDefinitionIds { get; } /// - /// TODO: Write general description for this method + /// Getter for custom_attribute_value_exact /// [JsonProperty("custom_attribute_value_exact")] public string CustomAttributeValueExact { get; } /// - /// TODO: Write general description for this method + /// Getter for custom_attribute_value_prefix /// [JsonProperty("custom_attribute_value_prefix")] public string CustomAttributeValuePrefix { get; } /// - /// TODO: Write general description for this method + /// Getter for custom_attribute_min_value /// [JsonProperty("custom_attribute_min_value")] public string CustomAttributeMinValue { get; } /// - /// TODO: Write general description for this method + /// Getter for custom_attribute_max_value /// [JsonProperty("custom_attribute_max_value")] public string CustomAttributeMaxValue { get; } @@ -80,7 +80,7 @@ public Builder ToBuilder() public class Builder { private string filterType; - private IList customAttributeDefinitionIds; + private IList customAttributeDefinitionIds = new List(); private string customAttributeValueExact; private string customAttributeValuePrefix; private string customAttributeMinValue; @@ -134,4 +134,4 @@ public CatalogQueryFilteredItemsCustomAttributeFilter Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogQueryItemVariationsForItemOptionValues.cs b/Square/Models/CatalogQueryItemVariationsForItemOptionValues.cs index e5899b53..9aa30d3d 100644 --- a/Square/Models/CatalogQueryItemVariationsForItemOptionValues.cs +++ b/Square/Models/CatalogQueryItemVariationsForItemOptionValues.cs @@ -36,7 +36,7 @@ public Builder ToBuilder() public class Builder { - private IList itemOptionValueIds; + private IList itemOptionValueIds = new List(); public Builder() { } public Builder ItemOptionValueIds(IList value) @@ -51,4 +51,4 @@ public CatalogQueryItemVariationsForItemOptionValues Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogQueryItemsForItemOptions.cs b/Square/Models/CatalogQueryItemsForItemOptions.cs index 168d5e5e..d0bfbd89 100644 --- a/Square/Models/CatalogQueryItemsForItemOptions.cs +++ b/Square/Models/CatalogQueryItemsForItemOptions.cs @@ -36,7 +36,7 @@ public Builder ToBuilder() public class Builder { - private IList itemOptionIds; + private IList itemOptionIds = new List(); public Builder() { } public Builder ItemOptionIds(IList value) @@ -51,4 +51,4 @@ public CatalogQueryItemsForItemOptions Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogQueryItemsForModifierList.cs b/Square/Models/CatalogQueryItemsForModifierList.cs index c0307f57..3ad53e77 100644 --- a/Square/Models/CatalogQueryItemsForModifierList.cs +++ b/Square/Models/CatalogQueryItemsForModifierList.cs @@ -51,4 +51,4 @@ public CatalogQueryItemsForModifierList Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogQueryItemsForTax.cs b/Square/Models/CatalogQueryItemsForTax.cs index c4984762..eb39c10f 100644 --- a/Square/Models/CatalogQueryItemsForTax.cs +++ b/Square/Models/CatalogQueryItemsForTax.cs @@ -51,4 +51,4 @@ public CatalogQueryItemsForTax Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogQueryPrefix.cs b/Square/Models/CatalogQueryPrefix.cs index 94b2d2e4..59e84ad5 100644 --- a/Square/Models/CatalogQueryPrefix.cs +++ b/Square/Models/CatalogQueryPrefix.cs @@ -70,4 +70,4 @@ public CatalogQueryPrefix Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogQueryRange.cs b/Square/Models/CatalogQueryRange.cs index 4e5276bf..7b685033 100644 --- a/Square/Models/CatalogQueryRange.cs +++ b/Square/Models/CatalogQueryRange.cs @@ -85,4 +85,4 @@ public CatalogQueryRange Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogQuerySortedAttribute.cs b/Square/Models/CatalogQuerySortedAttribute.cs index 59f385c0..e8d6bb76 100644 --- a/Square/Models/CatalogQuerySortedAttribute.cs +++ b/Square/Models/CatalogQuerySortedAttribute.cs @@ -87,4 +87,4 @@ public CatalogQuerySortedAttribute Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogQueryText.cs b/Square/Models/CatalogQueryText.cs index ef951546..46ef5eb7 100644 --- a/Square/Models/CatalogQueryText.cs +++ b/Square/Models/CatalogQueryText.cs @@ -52,4 +52,4 @@ public CatalogQueryText Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogTax.cs b/Square/Models/CatalogTax.cs index 55bfa811..af8e1464 100644 --- a/Square/Models/CatalogTax.cs +++ b/Square/Models/CatalogTax.cs @@ -136,4 +136,4 @@ public CatalogTax Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogTimePeriod.cs b/Square/Models/CatalogTimePeriod.cs index c825ed00..d7d2ab50 100644 --- a/Square/Models/CatalogTimePeriod.cs +++ b/Square/Models/CatalogTimePeriod.cs @@ -60,4 +60,4 @@ public CatalogTimePeriod Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CatalogV1Id.cs b/Square/Models/CatalogV1Id.cs index 5625289a..217ef1f6 100644 --- a/Square/Models/CatalogV1Id.cs +++ b/Square/Models/CatalogV1Id.cs @@ -66,4 +66,4 @@ public CatalogV1Id Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ChargeRequest.cs b/Square/Models/ChargeRequest.cs index 7d8d7b95..8defdf84 100644 --- a/Square/Models/ChargeRequest.cs +++ b/Square/Models/ChargeRequest.cs @@ -202,7 +202,7 @@ public class Builder private Models.Address shippingAddress; private string buyerEmailAddress; private string orderId; - private IList additionalRecipients; + private IList additionalRecipients = new List(); private string verificationToken; public Builder(string idempotencyKey, @@ -314,4 +314,4 @@ public ChargeRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ChargeRequestAdditionalRecipient.cs b/Square/Models/ChargeRequestAdditionalRecipient.cs index 3cd06d17..8f888ab9 100644 --- a/Square/Models/ChargeRequestAdditionalRecipient.cs +++ b/Square/Models/ChargeRequestAdditionalRecipient.cs @@ -94,4 +94,4 @@ public ChargeRequestAdditionalRecipient Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ChargeResponse.cs b/Square/Models/ChargeResponse.cs index 223133b9..55278b4b 100644 --- a/Square/Models/ChargeResponse.cs +++ b/Square/Models/ChargeResponse.cs @@ -50,7 +50,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Transaction transaction; public Builder() { } @@ -73,4 +73,4 @@ public ChargeResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Checkout.cs b/Square/Models/Checkout.cs index 4537d457..60df33d6 100644 --- a/Square/Models/Checkout.cs +++ b/Square/Models/Checkout.cs @@ -148,7 +148,7 @@ public class Builder private string redirectUrl; private Models.Order order; private string createdAt; - private IList additionalRecipients; + private IList additionalRecipients = new List(); public Builder() { } public Builder Id(string value) @@ -226,4 +226,4 @@ public Checkout Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CompletePaymentResponse.cs b/Square/Models/CompletePaymentResponse.cs index b5d2795b..63e6d898 100644 --- a/Square/Models/CompletePaymentResponse.cs +++ b/Square/Models/CompletePaymentResponse.cs @@ -47,7 +47,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Payment payment; public Builder() { } @@ -70,4 +70,4 @@ public CompletePaymentResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Coordinates.cs b/Square/Models/Coordinates.cs index 145ad6ed..b1bfe0e8 100644 --- a/Square/Models/Coordinates.cs +++ b/Square/Models/Coordinates.cs @@ -66,4 +66,4 @@ public Coordinates Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateBreakTypeRequest.cs b/Square/Models/CreateBreakTypeRequest.cs index 678d1981..e98a8e1b 100644 --- a/Square/Models/CreateBreakTypeRequest.cs +++ b/Square/Models/CreateBreakTypeRequest.cs @@ -69,4 +69,4 @@ public CreateBreakTypeRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateBreakTypeResponse.cs b/Square/Models/CreateBreakTypeResponse.cs index c61db537..d5e2ee59 100644 --- a/Square/Models/CreateBreakTypeResponse.cs +++ b/Square/Models/CreateBreakTypeResponse.cs @@ -49,7 +49,7 @@ public Builder ToBuilder() public class Builder { private Models.BreakType breakType; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder BreakType(Models.BreakType value) @@ -71,4 +71,4 @@ public CreateBreakTypeResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateCatalogImageRequest.cs b/Square/Models/CreateCatalogImageRequest.cs index 83b2f315..b5a528d9 100644 --- a/Square/Models/CreateCatalogImageRequest.cs +++ b/Square/Models/CreateCatalogImageRequest.cs @@ -40,7 +40,7 @@ public class CreateCatalogImageRequest public string ObjectId { get; } /// - /// TODO: Write general description for this method + /// Getter for image /// [JsonProperty("image")] public Models.CatalogObject Image { get; } @@ -89,4 +89,4 @@ public CreateCatalogImageRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateCatalogImageResponse.cs b/Square/Models/CreateCatalogImageResponse.cs index 22059380..fefa76c7 100644 --- a/Square/Models/CreateCatalogImageResponse.cs +++ b/Square/Models/CreateCatalogImageResponse.cs @@ -32,7 +32,7 @@ public class CreateCatalogImageResponse public IList Errors { get; } /// - /// TODO: Write general description for this method + /// Getter for image /// [JsonProperty("image")] public Models.CatalogObject Image { get; } @@ -47,7 +47,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.CatalogObject image; public Builder() { } @@ -70,4 +70,4 @@ public CreateCatalogImageResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateCheckoutRequest.cs b/Square/Models/CreateCheckoutRequest.cs index 411cdc13..b935e4d5 100644 --- a/Square/Models/CreateCheckoutRequest.cs +++ b/Square/Models/CreateCheckoutRequest.cs @@ -51,7 +51,7 @@ public class CreateCheckoutRequest public string IdempotencyKey { get; } /// - /// TODO: Write general description for this method + /// Getter for order /// [JsonProperty("order")] public Models.CreateOrderRequest Order { get; } @@ -147,7 +147,7 @@ public class Builder private string prePopulateBuyerEmail; private Models.Address prePopulateShippingAddress; private string redirectUrl; - private IList additionalRecipients; + private IList additionalRecipients = new List(); private string note; public Builder(string idempotencyKey, @@ -224,4 +224,4 @@ public CreateCheckoutRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateCheckoutResponse.cs b/Square/Models/CreateCheckoutResponse.cs index 9c186c07..4f16760c 100644 --- a/Square/Models/CreateCheckoutResponse.cs +++ b/Square/Models/CreateCheckoutResponse.cs @@ -49,7 +49,7 @@ public Builder ToBuilder() public class Builder { private Models.Checkout checkout; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Checkout(Models.Checkout value) @@ -71,4 +71,4 @@ public CreateCheckoutResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateCustomerCardRequest.cs b/Square/Models/CreateCustomerCardRequest.cs index deaf4e5b..ed99e546 100644 --- a/Square/Models/CreateCustomerCardRequest.cs +++ b/Square/Models/CreateCustomerCardRequest.cs @@ -110,4 +110,4 @@ public CreateCustomerCardRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateCustomerCardResponse.cs b/Square/Models/CreateCustomerCardResponse.cs index 7798f58f..23e48f59 100644 --- a/Square/Models/CreateCustomerCardResponse.cs +++ b/Square/Models/CreateCustomerCardResponse.cs @@ -48,7 +48,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Card card; public Builder() { } @@ -71,4 +71,4 @@ public CreateCustomerCardResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateCustomerRequest.cs b/Square/Models/CreateCustomerRequest.cs index adcc01ff..0568540d 100644 --- a/Square/Models/CreateCustomerRequest.cs +++ b/Square/Models/CreateCustomerRequest.cs @@ -224,4 +224,4 @@ public CreateCustomerRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateCustomerResponse.cs b/Square/Models/CreateCustomerResponse.cs index ffd79784..730fe286 100644 --- a/Square/Models/CreateCustomerResponse.cs +++ b/Square/Models/CreateCustomerResponse.cs @@ -48,7 +48,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Customer customer; public Builder() { } @@ -71,4 +71,4 @@ public CreateCustomerResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateLocationRequest.cs b/Square/Models/CreateLocationRequest.cs index a73b27d4..7a0e9663 100644 --- a/Square/Models/CreateLocationRequest.cs +++ b/Square/Models/CreateLocationRequest.cs @@ -20,7 +20,7 @@ public CreateLocationRequest(Models.Location location = null) } /// - /// TODO: Write general description for this method + /// Getter for location /// [JsonProperty("location")] public Models.Location Location { get; } @@ -49,4 +49,4 @@ public CreateLocationRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateLocationResponse.cs b/Square/Models/CreateLocationResponse.cs index d10c24cf..50f7aab5 100644 --- a/Square/Models/CreateLocationResponse.cs +++ b/Square/Models/CreateLocationResponse.cs @@ -32,7 +32,7 @@ public class CreateLocationResponse public IList Errors { get; } /// - /// TODO: Write general description for this method + /// Getter for location /// [JsonProperty("location")] public Models.Location Location { get; } @@ -47,7 +47,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Location location; public Builder() { } @@ -70,4 +70,4 @@ public CreateLocationResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateMobileAuthorizationCodeRequest.cs b/Square/Models/CreateMobileAuthorizationCodeRequest.cs index 674073a6..02a6d420 100644 --- a/Square/Models/CreateMobileAuthorizationCodeRequest.cs +++ b/Square/Models/CreateMobileAuthorizationCodeRequest.cs @@ -49,4 +49,4 @@ public CreateMobileAuthorizationCodeRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateMobileAuthorizationCodeResponse.cs b/Square/Models/CreateMobileAuthorizationCodeResponse.cs index 96c8eecf..8fc8d769 100644 --- a/Square/Models/CreateMobileAuthorizationCodeResponse.cs +++ b/Square/Models/CreateMobileAuthorizationCodeResponse.cs @@ -90,4 +90,4 @@ public CreateMobileAuthorizationCodeResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateOrderRequest.cs b/Square/Models/CreateOrderRequest.cs index 88f42e5d..5286fa34 100644 --- a/Square/Models/CreateOrderRequest.cs +++ b/Square/Models/CreateOrderRequest.cs @@ -101,9 +101,9 @@ public class Builder private Models.Order order; private string idempotencyKey; private string referenceId; - private IList lineItems; - private IList taxes; - private IList discounts; + private IList lineItems = new List(); + private IList taxes = new List(); + private IList discounts = new List(); public Builder() { } public Builder Order(Models.Order value) @@ -153,4 +153,4 @@ public CreateOrderRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateOrderRequestDiscount.cs b/Square/Models/CreateOrderRequestDiscount.cs index d4462ef9..8ff5c846 100644 --- a/Square/Models/CreateOrderRequestDiscount.cs +++ b/Square/Models/CreateOrderRequestDiscount.cs @@ -108,4 +108,4 @@ public CreateOrderRequestDiscount Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateOrderRequestLineItem.cs b/Square/Models/CreateOrderRequestLineItem.cs index be27c476..66c3a60f 100644 --- a/Square/Models/CreateOrderRequestLineItem.cs +++ b/Square/Models/CreateOrderRequestLineItem.cs @@ -122,9 +122,9 @@ public class Builder private string variationName; private string note; private string catalogObjectId; - private IList modifiers; - private IList taxes; - private IList discounts; + private IList modifiers = new List(); + private IList taxes = new List(); + private IList discounts = new List(); public Builder(string quantity) { @@ -198,4 +198,4 @@ public CreateOrderRequestLineItem Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateOrderRequestModifier.cs b/Square/Models/CreateOrderRequestModifier.cs index 9d1487ff..2c171b55 100644 --- a/Square/Models/CreateOrderRequestModifier.cs +++ b/Square/Models/CreateOrderRequestModifier.cs @@ -89,4 +89,4 @@ public CreateOrderRequestModifier Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateOrderRequestTax.cs b/Square/Models/CreateOrderRequestTax.cs index e9e37034..b4cbad6a 100644 --- a/Square/Models/CreateOrderRequestTax.cs +++ b/Square/Models/CreateOrderRequestTax.cs @@ -103,4 +103,4 @@ public CreateOrderRequestTax Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateOrderResponse.cs b/Square/Models/CreateOrderResponse.cs index cf1954d1..9796aa09 100644 --- a/Square/Models/CreateOrderResponse.cs +++ b/Square/Models/CreateOrderResponse.cs @@ -52,7 +52,7 @@ public Builder ToBuilder() public class Builder { private Models.Order order; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Order(Models.Order value) @@ -74,4 +74,4 @@ public CreateOrderResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreatePaymentRequest.cs b/Square/Models/CreatePaymentRequest.cs index 64f6da00..d1017e8e 100644 --- a/Square/Models/CreatePaymentRequest.cs +++ b/Square/Models/CreatePaymentRequest.cs @@ -372,4 +372,4 @@ public CreatePaymentRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreatePaymentResponse.cs b/Square/Models/CreatePaymentResponse.cs index 1c9bcd92..4f293a0e 100644 --- a/Square/Models/CreatePaymentResponse.cs +++ b/Square/Models/CreatePaymentResponse.cs @@ -47,7 +47,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Payment payment; public Builder() { } @@ -70,4 +70,4 @@ public CreatePaymentResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateRefundRequest.cs b/Square/Models/CreateRefundRequest.cs index 4d3c03ac..c4351119 100644 --- a/Square/Models/CreateRefundRequest.cs +++ b/Square/Models/CreateRefundRequest.cs @@ -120,4 +120,4 @@ public CreateRefundRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateRefundResponse.cs b/Square/Models/CreateRefundResponse.cs index 8980ec27..a2708d61 100644 --- a/Square/Models/CreateRefundResponse.cs +++ b/Square/Models/CreateRefundResponse.cs @@ -47,7 +47,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Refund refund; public Builder() { } @@ -70,4 +70,4 @@ public CreateRefundResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateShiftRequest.cs b/Square/Models/CreateShiftRequest.cs index c2d53a09..a21b88c0 100644 --- a/Square/Models/CreateShiftRequest.cs +++ b/Square/Models/CreateShiftRequest.cs @@ -70,4 +70,4 @@ public CreateShiftRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CreateShiftResponse.cs b/Square/Models/CreateShiftResponse.cs index c50acba7..9c8a546e 100644 --- a/Square/Models/CreateShiftResponse.cs +++ b/Square/Models/CreateShiftResponse.cs @@ -50,7 +50,7 @@ public Builder ToBuilder() public class Builder { private Models.Shift shift; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Shift(Models.Shift value) @@ -72,4 +72,4 @@ public CreateShiftResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Customer.cs b/Square/Models/Customer.cs index b2150e9b..23915b49 100644 --- a/Square/Models/Customer.cs +++ b/Square/Models/Customer.cs @@ -184,7 +184,7 @@ public class Builder private string id; private string createdAt; private string updatedAt; - private IList cards; + private IList cards = new List(); private string givenName; private string familyName; private string nickname; @@ -196,7 +196,7 @@ public class Builder private string referenceId; private string note; private Models.CustomerPreferences preferences; - private IList groups; + private IList groups = new List(); private string creationSource; public Builder(string id, @@ -331,4 +331,4 @@ public Customer Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CustomerCreationSourceFilter.cs b/Square/Models/CustomerCreationSourceFilter.cs index c923ba03..88950769 100644 --- a/Square/Models/CustomerCreationSourceFilter.cs +++ b/Square/Models/CustomerCreationSourceFilter.cs @@ -45,7 +45,7 @@ public Builder ToBuilder() public class Builder { - private IList values; + private IList values = new List(); private string rule; public Builder() { } @@ -68,4 +68,4 @@ public CustomerCreationSourceFilter Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CustomerFilter.cs b/Square/Models/CustomerFilter.cs index d045215a..8bd298d4 100644 --- a/Square/Models/CustomerFilter.cs +++ b/Square/Models/CustomerFilter.cs @@ -94,4 +94,4 @@ public CustomerFilter Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CustomerGroupInfo.cs b/Square/Models/CustomerGroupInfo.cs index 415674bb..075b54be 100644 --- a/Square/Models/CustomerGroupInfo.cs +++ b/Square/Models/CustomerGroupInfo.cs @@ -70,4 +70,4 @@ public CustomerGroupInfo Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CustomerPreferences.cs b/Square/Models/CustomerPreferences.cs index 27b88c45..a7c2ca62 100644 --- a/Square/Models/CustomerPreferences.cs +++ b/Square/Models/CustomerPreferences.cs @@ -49,4 +49,4 @@ public CustomerPreferences Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CustomerQuery.cs b/Square/Models/CustomerQuery.cs index 083f745c..44c7feff 100644 --- a/Square/Models/CustomerQuery.cs +++ b/Square/Models/CustomerQuery.cs @@ -67,4 +67,4 @@ public CustomerQuery Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/CustomerSort.cs b/Square/Models/CustomerSort.cs index 04bb9dbe..8fa90dfc 100644 --- a/Square/Models/CustomerSort.cs +++ b/Square/Models/CustomerSort.cs @@ -66,4 +66,4 @@ public CustomerSort Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/DateRange.cs b/Square/Models/DateRange.cs index 2009f414..6395d8e4 100644 --- a/Square/Models/DateRange.cs +++ b/Square/Models/DateRange.cs @@ -70,4 +70,4 @@ public DateRange Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/DeleteBreakTypeResponse.cs b/Square/Models/DeleteBreakTypeResponse.cs index 553787ef..4845df7f 100644 --- a/Square/Models/DeleteBreakTypeResponse.cs +++ b/Square/Models/DeleteBreakTypeResponse.cs @@ -38,7 +38,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Errors(IList value) @@ -53,4 +53,4 @@ public DeleteBreakTypeResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/DeleteCatalogObjectResponse.cs b/Square/Models/DeleteCatalogObjectResponse.cs index 363fd6fe..dea0d067 100644 --- a/Square/Models/DeleteCatalogObjectResponse.cs +++ b/Square/Models/DeleteCatalogObjectResponse.cs @@ -60,8 +60,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList deletedObjectIds; + private IList errors = new List(); + private IList deletedObjectIds = new List(); private string deletedAt; public Builder() { } @@ -91,4 +91,4 @@ public DeleteCatalogObjectResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/DeleteCustomerCardResponse.cs b/Square/Models/DeleteCustomerCardResponse.cs index 6d75d1f7..4ac974aa 100644 --- a/Square/Models/DeleteCustomerCardResponse.cs +++ b/Square/Models/DeleteCustomerCardResponse.cs @@ -38,7 +38,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Errors(IList value) @@ -53,4 +53,4 @@ public DeleteCustomerCardResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/DeleteCustomerResponse.cs b/Square/Models/DeleteCustomerResponse.cs index 5a11895a..aedd7b17 100644 --- a/Square/Models/DeleteCustomerResponse.cs +++ b/Square/Models/DeleteCustomerResponse.cs @@ -38,7 +38,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Errors(IList value) @@ -53,4 +53,4 @@ public DeleteCustomerResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/DeleteShiftResponse.cs b/Square/Models/DeleteShiftResponse.cs index fb3d2e90..f2acc3ac 100644 --- a/Square/Models/DeleteShiftResponse.cs +++ b/Square/Models/DeleteShiftResponse.cs @@ -38,7 +38,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Errors(IList value) @@ -53,4 +53,4 @@ public DeleteShiftResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Device.cs b/Square/Models/Device.cs index 8eb48727..b9f84e66 100644 --- a/Square/Models/Device.cs +++ b/Square/Models/Device.cs @@ -66,4 +66,4 @@ public Device Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/DeviceDetails.cs b/Square/Models/DeviceDetails.cs index 0633ff62..cf0106be 100644 --- a/Square/Models/DeviceDetails.cs +++ b/Square/Models/DeviceDetails.cs @@ -66,4 +66,4 @@ public DeviceDetails Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Employee.cs b/Square/Models/Employee.cs index d37590a9..f9c27a48 100644 --- a/Square/Models/Employee.cs +++ b/Square/Models/Employee.cs @@ -21,6 +21,7 @@ public class Employee string phoneNumber = null, IList locationIds = null, string status = null, + bool? isOwner = null, string createdAt = null, string updatedAt = null) { @@ -31,6 +32,7 @@ public class Employee PhoneNumber = phoneNumber; LocationIds = locationIds; Status = status; + IsOwner = isOwner; CreatedAt = createdAt; UpdatedAt = updatedAt; } @@ -77,6 +79,14 @@ public class Employee [JsonProperty("status")] public string Status { get; } + /// + /// Whether this employee is the owner of the merchant. Each merchant + /// has one owner employee, and that employee has full authority over + /// the account. + /// + [JsonProperty("is_owner")] + public bool? IsOwner { get; } + /// /// A read-only timestamp in RFC 3339 format. /// @@ -99,6 +109,7 @@ public Builder ToBuilder() .PhoneNumber(PhoneNumber) .LocationIds(LocationIds) .Status(Status) + .IsOwner(IsOwner) .CreatedAt(CreatedAt) .UpdatedAt(UpdatedAt); return builder; @@ -111,8 +122,9 @@ public class Builder private string lastName; private string email; private string phoneNumber; - private IList locationIds; + private IList locationIds = new List(); private string status; + private bool? isOwner; private string createdAt; private string updatedAt; @@ -159,6 +171,12 @@ public Builder Status(string value) return this; } + public Builder IsOwner(bool? value) + { + isOwner = value; + return this; + } + public Builder CreatedAt(string value) { createdAt = value; @@ -180,9 +198,10 @@ public Employee Build() phoneNumber, locationIds, status, + isOwner, createdAt, updatedAt); } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/EmployeeWage.cs b/Square/Models/EmployeeWage.cs index 544b2c05..6229405d 100644 --- a/Square/Models/EmployeeWage.cs +++ b/Square/Models/EmployeeWage.cs @@ -107,4 +107,4 @@ public EmployeeWage Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Error.cs b/Square/Models/Error.cs index 8d3deec7..d8b365ad 100644 --- a/Square/Models/Error.cs +++ b/Square/Models/Error.cs @@ -107,4 +107,4 @@ public Error Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ExternalPaymentDetails.cs b/Square/Models/ExternalPaymentDetails.cs index 5e4cbd3f..5333d757 100644 --- a/Square/Models/ExternalPaymentDetails.cs +++ b/Square/Models/ExternalPaymentDetails.cs @@ -121,4 +121,4 @@ public ExternalPaymentDetails Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/GetBreakTypeResponse.cs b/Square/Models/GetBreakTypeResponse.cs index 1ac8995f..ca11cb24 100644 --- a/Square/Models/GetBreakTypeResponse.cs +++ b/Square/Models/GetBreakTypeResponse.cs @@ -49,7 +49,7 @@ public Builder ToBuilder() public class Builder { private Models.BreakType breakType; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder BreakType(Models.BreakType value) @@ -71,4 +71,4 @@ public GetBreakTypeResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/GetEmployeeWageResponse.cs b/Square/Models/GetEmployeeWageResponse.cs index e8e9831d..8998779a 100644 --- a/Square/Models/GetEmployeeWageResponse.cs +++ b/Square/Models/GetEmployeeWageResponse.cs @@ -49,7 +49,7 @@ public Builder ToBuilder() public class Builder { private Models.EmployeeWage employeeWage; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder EmployeeWage(Models.EmployeeWage value) @@ -71,4 +71,4 @@ public GetEmployeeWageResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/GetPaymentRefundResponse.cs b/Square/Models/GetPaymentRefundResponse.cs index ec700b78..bb381f61 100644 --- a/Square/Models/GetPaymentRefundResponse.cs +++ b/Square/Models/GetPaymentRefundResponse.cs @@ -48,7 +48,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.PaymentRefund refund; public Builder() { } @@ -71,4 +71,4 @@ public GetPaymentRefundResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/GetPaymentResponse.cs b/Square/Models/GetPaymentResponse.cs index 5998d6ca..6070dd14 100644 --- a/Square/Models/GetPaymentResponse.cs +++ b/Square/Models/GetPaymentResponse.cs @@ -47,7 +47,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Payment payment; public Builder() { } @@ -70,4 +70,4 @@ public GetPaymentResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/GetShiftResponse.cs b/Square/Models/GetShiftResponse.cs index 27deeb49..2fda051c 100644 --- a/Square/Models/GetShiftResponse.cs +++ b/Square/Models/GetShiftResponse.cs @@ -50,7 +50,7 @@ public Builder ToBuilder() public class Builder { private Models.Shift shift; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Shift(Models.Shift value) @@ -72,4 +72,4 @@ public GetShiftResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/InventoryAdjustment.cs b/Square/Models/InventoryAdjustment.cs index 2e0f8213..326c117e 100644 --- a/Square/Models/InventoryAdjustment.cs +++ b/Square/Models/InventoryAdjustment.cs @@ -354,4 +354,4 @@ public InventoryAdjustment Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/InventoryChange.cs b/Square/Models/InventoryChange.cs index 5a5885b6..7f2d882e 100644 --- a/Square/Models/InventoryChange.cs +++ b/Square/Models/InventoryChange.cs @@ -105,4 +105,4 @@ public InventoryChange Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/InventoryCount.cs b/Square/Models/InventoryCount.cs index 62e482c9..0fbd39c9 100644 --- a/Square/Models/InventoryCount.cs +++ b/Square/Models/InventoryCount.cs @@ -147,4 +147,4 @@ public InventoryCount Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/InventoryPhysicalCount.cs b/Square/Models/InventoryPhysicalCount.cs index 812eb217..b1371d1c 100644 --- a/Square/Models/InventoryPhysicalCount.cs +++ b/Square/Models/InventoryPhysicalCount.cs @@ -239,4 +239,4 @@ public InventoryPhysicalCount Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/InventoryTransfer.cs b/Square/Models/InventoryTransfer.cs index f233d92d..112affdd 100644 --- a/Square/Models/InventoryTransfer.cs +++ b/Square/Models/InventoryTransfer.cs @@ -256,4 +256,4 @@ public InventoryTransfer Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ItemVariationLocationOverrides.cs b/Square/Models/ItemVariationLocationOverrides.cs index 4653959a..0b1bb40b 100644 --- a/Square/Models/ItemVariationLocationOverrides.cs +++ b/Square/Models/ItemVariationLocationOverrides.cs @@ -141,4 +141,4 @@ public ItemVariationLocationOverrides Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListAdditionalRecipientReceivableRefundsRequest.cs b/Square/Models/ListAdditionalRecipientReceivableRefundsRequest.cs index f626bb74..7af7d12b 100644 --- a/Square/Models/ListAdditionalRecipientReceivableRefundsRequest.cs +++ b/Square/Models/ListAdditionalRecipientReceivableRefundsRequest.cs @@ -106,4 +106,4 @@ public ListAdditionalRecipientReceivableRefundsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListAdditionalRecipientReceivableRefundsResponse.cs b/Square/Models/ListAdditionalRecipientReceivableRefundsResponse.cs index e615228a..da47817f 100644 --- a/Square/Models/ListAdditionalRecipientReceivableRefundsResponse.cs +++ b/Square/Models/ListAdditionalRecipientReceivableRefundsResponse.cs @@ -59,8 +59,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList receivableRefunds; + private IList errors = new List(); + private IList receivableRefunds = new List(); private string cursor; public Builder() { } @@ -90,4 +90,4 @@ public ListAdditionalRecipientReceivableRefundsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListAdditionalRecipientReceivablesRequest.cs b/Square/Models/ListAdditionalRecipientReceivablesRequest.cs index 6f8ef043..e84bb110 100644 --- a/Square/Models/ListAdditionalRecipientReceivablesRequest.cs +++ b/Square/Models/ListAdditionalRecipientReceivablesRequest.cs @@ -106,4 +106,4 @@ public ListAdditionalRecipientReceivablesRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListAdditionalRecipientReceivablesResponse.cs b/Square/Models/ListAdditionalRecipientReceivablesResponse.cs index d4bdcc59..21dd395d 100644 --- a/Square/Models/ListAdditionalRecipientReceivablesResponse.cs +++ b/Square/Models/ListAdditionalRecipientReceivablesResponse.cs @@ -59,8 +59,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList receivables; + private IList errors = new List(); + private IList receivables = new List(); private string cursor; public Builder() { } @@ -90,4 +90,4 @@ public ListAdditionalRecipientReceivablesResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListBreakTypesRequest.cs b/Square/Models/ListBreakTypesRequest.cs index 8379be6a..af02acb8 100644 --- a/Square/Models/ListBreakTypesRequest.cs +++ b/Square/Models/ListBreakTypesRequest.cs @@ -85,4 +85,4 @@ public ListBreakTypesRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListBreakTypesResponse.cs b/Square/Models/ListBreakTypesResponse.cs index 601507b8..095c8d32 100644 --- a/Square/Models/ListBreakTypesResponse.cs +++ b/Square/Models/ListBreakTypesResponse.cs @@ -57,9 +57,9 @@ public Builder ToBuilder() public class Builder { - private IList breakTypes; + private IList breakTypes = new List(); private string cursor; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder BreakTypes(IList value) @@ -88,4 +88,4 @@ public ListBreakTypesResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListCashDrawerShiftEventsRequest.cs b/Square/Models/ListCashDrawerShiftEventsRequest.cs index d7297430..cadf801b 100644 --- a/Square/Models/ListCashDrawerShiftEventsRequest.cs +++ b/Square/Models/ListCashDrawerShiftEventsRequest.cs @@ -86,4 +86,4 @@ public ListCashDrawerShiftEventsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListCashDrawerShiftEventsResponse.cs b/Square/Models/ListCashDrawerShiftEventsResponse.cs index 71be9110..a4351a52 100644 --- a/Square/Models/ListCashDrawerShiftEventsResponse.cs +++ b/Square/Models/ListCashDrawerShiftEventsResponse.cs @@ -58,9 +58,9 @@ public Builder ToBuilder() public class Builder { - private IList events; + private IList events = new List(); private string cursor; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Events(IList value) @@ -89,4 +89,4 @@ public ListCashDrawerShiftEventsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListCashDrawerShiftsRequest.cs b/Square/Models/ListCashDrawerShiftsRequest.cs index 6f82b987..802ffb90 100644 --- a/Square/Models/ListCashDrawerShiftsRequest.cs +++ b/Square/Models/ListCashDrawerShiftsRequest.cs @@ -137,4 +137,4 @@ public ListCashDrawerShiftsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListCashDrawerShiftsResponse.cs b/Square/Models/ListCashDrawerShiftsResponse.cs index 43aac018..e7249982 100644 --- a/Square/Models/ListCashDrawerShiftsResponse.cs +++ b/Square/Models/ListCashDrawerShiftsResponse.cs @@ -58,9 +58,9 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); private string cursor; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Items(IList value) @@ -89,4 +89,4 @@ public ListCashDrawerShiftsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListCatalogRequest.cs b/Square/Models/ListCatalogRequest.cs index 82daea3f..0476dc71 100644 --- a/Square/Models/ListCatalogRequest.cs +++ b/Square/Models/ListCatalogRequest.cs @@ -71,4 +71,4 @@ public ListCatalogRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListCatalogResponse.cs b/Square/Models/ListCatalogResponse.cs index 04e8e451..c1bb22e7 100644 --- a/Square/Models/ListCatalogResponse.cs +++ b/Square/Models/ListCatalogResponse.cs @@ -57,9 +57,9 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private string cursor; - private IList objects; + private IList objects = new List(); public Builder() { } public Builder Errors(IList value) @@ -88,4 +88,4 @@ public ListCatalogResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListCustomersRequest.cs b/Square/Models/ListCustomersRequest.cs index 9aaadbb2..bea54464 100644 --- a/Square/Models/ListCustomersRequest.cs +++ b/Square/Models/ListCustomersRequest.cs @@ -85,4 +85,4 @@ public ListCustomersRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListCustomersResponse.cs b/Square/Models/ListCustomersResponse.cs index ce51b93d..eaa32c15 100644 --- a/Square/Models/ListCustomersResponse.cs +++ b/Square/Models/ListCustomersResponse.cs @@ -59,8 +59,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList customers; + private IList errors = new List(); + private IList customers = new List(); private string cursor; public Builder() { } @@ -90,4 +90,4 @@ public ListCustomersResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListEmployeeWagesRequest.cs b/Square/Models/ListEmployeeWagesRequest.cs index 57c8f2c6..500d7fe3 100644 --- a/Square/Models/ListEmployeeWagesRequest.cs +++ b/Square/Models/ListEmployeeWagesRequest.cs @@ -85,4 +85,4 @@ public ListEmployeeWagesRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListEmployeeWagesResponse.cs b/Square/Models/ListEmployeeWagesResponse.cs index 4ddaca7d..6abc01ea 100644 --- a/Square/Models/ListEmployeeWagesResponse.cs +++ b/Square/Models/ListEmployeeWagesResponse.cs @@ -57,9 +57,9 @@ public Builder ToBuilder() public class Builder { - private IList employeeWages; + private IList employeeWages = new List(); private string cursor; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder EmployeeWages(IList value) @@ -88,4 +88,4 @@ public ListEmployeeWagesResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListEmployeesRequest.cs b/Square/Models/ListEmployeesRequest.cs index c6b30d5b..ecf3eee9 100644 --- a/Square/Models/ListEmployeesRequest.cs +++ b/Square/Models/ListEmployeesRequest.cs @@ -100,4 +100,4 @@ public ListEmployeesRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListEmployeesResponse.cs b/Square/Models/ListEmployeesResponse.cs index 49808aac..dea6195f 100644 --- a/Square/Models/ListEmployeesResponse.cs +++ b/Square/Models/ListEmployeesResponse.cs @@ -56,9 +56,9 @@ public Builder ToBuilder() public class Builder { - private IList employees; + private IList employees = new List(); private string cursor; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Employees(IList value) @@ -87,4 +87,4 @@ public ListEmployeesResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListLocationsResponse.cs b/Square/Models/ListLocationsResponse.cs index 68c09947..4b67ed49 100644 --- a/Square/Models/ListLocationsResponse.cs +++ b/Square/Models/ListLocationsResponse.cs @@ -47,8 +47,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList locations; + private IList errors = new List(); + private IList locations = new List(); public Builder() { } public Builder Errors(IList value) @@ -70,4 +70,4 @@ public ListLocationsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListMerchantsRequest.cs b/Square/Models/ListMerchantsRequest.cs index b39e4428..fdf73847 100644 --- a/Square/Models/ListMerchantsRequest.cs +++ b/Square/Models/ListMerchantsRequest.cs @@ -49,4 +49,4 @@ public ListMerchantsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListMerchantsResponse.cs b/Square/Models/ListMerchantsResponse.cs index 978abdaf..67051345 100644 --- a/Square/Models/ListMerchantsResponse.cs +++ b/Square/Models/ListMerchantsResponse.cs @@ -56,8 +56,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList merchant; + private IList errors = new List(); + private IList merchant = new List(); private int? cursor; public Builder() { } @@ -87,4 +87,4 @@ public ListMerchantsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListPaymentRefundsRequest.cs b/Square/Models/ListPaymentRefundsRequest.cs index 4c1045e0..6414d62b 100644 --- a/Square/Models/ListPaymentRefundsRequest.cs +++ b/Square/Models/ListPaymentRefundsRequest.cs @@ -162,4 +162,4 @@ public ListPaymentRefundsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListPaymentRefundsResponse.cs b/Square/Models/ListPaymentRefundsResponse.cs index 0b23b825..e1c2c08e 100644 --- a/Square/Models/ListPaymentRefundsResponse.cs +++ b/Square/Models/ListPaymentRefundsResponse.cs @@ -58,8 +58,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList refunds; + private IList errors = new List(); + private IList refunds = new List(); private string cursor; public Builder() { } @@ -89,4 +89,4 @@ public ListPaymentRefundsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListPaymentsRequest.cs b/Square/Models/ListPaymentsRequest.cs index d09221ce..bc9fb69c 100644 --- a/Square/Models/ListPaymentsRequest.cs +++ b/Square/Models/ListPaymentsRequest.cs @@ -174,4 +174,4 @@ public ListPaymentsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListPaymentsResponse.cs b/Square/Models/ListPaymentsResponse.cs index bf3b1c1e..23fce67c 100644 --- a/Square/Models/ListPaymentsResponse.cs +++ b/Square/Models/ListPaymentsResponse.cs @@ -58,8 +58,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList payments; + private IList errors = new List(); + private IList payments = new List(); private string cursor; public Builder() { } @@ -89,4 +89,4 @@ public ListPaymentsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListRefundsRequest.cs b/Square/Models/ListRefundsRequest.cs index 7c41a320..dc78816c 100644 --- a/Square/Models/ListRefundsRequest.cs +++ b/Square/Models/ListRefundsRequest.cs @@ -106,4 +106,4 @@ public ListRefundsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListRefundsResponse.cs b/Square/Models/ListRefundsResponse.cs index 1090cd39..9ecb581e 100644 --- a/Square/Models/ListRefundsResponse.cs +++ b/Square/Models/ListRefundsResponse.cs @@ -59,8 +59,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList refunds; + private IList errors = new List(); + private IList refunds = new List(); private string cursor; public Builder() { } @@ -90,4 +90,4 @@ public ListRefundsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListTransactionsRequest.cs b/Square/Models/ListTransactionsRequest.cs index ead8bb4c..4cc22329 100644 --- a/Square/Models/ListTransactionsRequest.cs +++ b/Square/Models/ListTransactionsRequest.cs @@ -106,4 +106,4 @@ public ListTransactionsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListTransactionsResponse.cs b/Square/Models/ListTransactionsResponse.cs index 2792e429..404f4d1b 100644 --- a/Square/Models/ListTransactionsResponse.cs +++ b/Square/Models/ListTransactionsResponse.cs @@ -59,8 +59,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList transactions; + private IList errors = new List(); + private IList transactions = new List(); private string cursor; public Builder() { } @@ -90,4 +90,4 @@ public ListTransactionsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListWorkweekConfigsRequest.cs b/Square/Models/ListWorkweekConfigsRequest.cs index 8c98d553..1c990b37 100644 --- a/Square/Models/ListWorkweekConfigsRequest.cs +++ b/Square/Models/ListWorkweekConfigsRequest.cs @@ -66,4 +66,4 @@ public ListWorkweekConfigsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ListWorkweekConfigsResponse.cs b/Square/Models/ListWorkweekConfigsResponse.cs index 5a1607aa..0f5b56c5 100644 --- a/Square/Models/ListWorkweekConfigsResponse.cs +++ b/Square/Models/ListWorkweekConfigsResponse.cs @@ -57,9 +57,9 @@ public Builder ToBuilder() public class Builder { - private IList workweekConfigs; + private IList workweekConfigs = new List(); private string cursor; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder WorkweekConfigs(IList value) @@ -88,4 +88,4 @@ public ListWorkweekConfigsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Location.cs b/Square/Models/Location.cs index 285ddfdd..0a7dc104 100644 --- a/Square/Models/Location.cs +++ b/Square/Models/Location.cs @@ -266,7 +266,7 @@ public class Builder private string name; private Models.Address address; private string timezone; - private IList capabilities; + private IList capabilities = new List(); private string status; private string createdAt; private string merchantId; @@ -469,4 +469,4 @@ public Location Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/MeasurementUnit.cs b/Square/Models/MeasurementUnit.cs index a9e503ff..53f6316f 100644 --- a/Square/Models/MeasurementUnit.cs +++ b/Square/Models/MeasurementUnit.cs @@ -64,7 +64,7 @@ public class MeasurementUnit public string WeightUnit { get; } /// - /// TODO: Write general description for this method + /// Getter for generic_unit /// [JsonProperty("generic_unit")] public string GenericUnit { get; } @@ -168,4 +168,4 @@ public MeasurementUnit Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/MeasurementUnitCustom.cs b/Square/Models/MeasurementUnitCustom.cs index 2ff5c17a..a46662d2 100644 --- a/Square/Models/MeasurementUnitCustom.cs +++ b/Square/Models/MeasurementUnitCustom.cs @@ -71,4 +71,4 @@ public MeasurementUnitCustom Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Merchant.cs b/Square/Models/Merchant.cs index fb38de15..0d02a369 100644 --- a/Square/Models/Merchant.cs +++ b/Square/Models/Merchant.cs @@ -62,7 +62,7 @@ public class Merchant public string Currency { get; } /// - /// TODO: Write general description for this method + /// Getter for status /// [JsonProperty("status")] public string Status { get; } @@ -138,4 +138,4 @@ public Merchant Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Money.cs b/Square/Models/Money.cs index 1b9038e5..edc93f4d 100644 --- a/Square/Models/Money.cs +++ b/Square/Models/Money.cs @@ -70,4 +70,4 @@ public Money Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ObtainTokenRequest.cs b/Square/Models/ObtainTokenRequest.cs index 788a9307..ec83aa31 100644 --- a/Square/Models/ObtainTokenRequest.cs +++ b/Square/Models/ObtainTokenRequest.cs @@ -168,4 +168,4 @@ public ObtainTokenRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ObtainTokenResponse.cs b/Square/Models/ObtainTokenResponse.cs index 7d918cea..5ee763ce 100644 --- a/Square/Models/ObtainTokenResponse.cs +++ b/Square/Models/ObtainTokenResponse.cs @@ -180,4 +180,4 @@ public ObtainTokenResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Order.cs b/Square/Models/Order.cs index b2d0b368..ccef6929 100644 --- a/Square/Models/Order.cs +++ b/Square/Models/Order.cs @@ -318,18 +318,18 @@ public class Builder private string referenceId; private Models.OrderSource source; private string customerId; - private IList lineItems; - private IList taxes; - private IList discounts; - private IList serviceCharges; - private IList fulfillments; - private IList returns; + private IList lineItems = new List(); + private IList taxes = new List(); + private IList discounts = new List(); + private IList serviceCharges = new List(); + private IList fulfillments = new List(); + private IList returns = new List(); private Models.OrderMoneyAmounts returnAmounts; private Models.OrderMoneyAmounts netAmounts; private Models.OrderRoundingAdjustment roundingAdjustment; - private IList tenders; - private IList refunds; - private IDictionary metadata; + private IList tenders = new List(); + private IList refunds = new List(); + private IDictionary metadata = new Dictionary(); private string createdAt; private string updatedAt; private string closedAt; @@ -531,4 +531,4 @@ public Order Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderEntry.cs b/Square/Models/OrderEntry.cs index 1a19e257..cbd1fb2b 100644 --- a/Square/Models/OrderEntry.cs +++ b/Square/Models/OrderEntry.cs @@ -86,4 +86,4 @@ public OrderEntry Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderFulfillment.cs b/Square/Models/OrderFulfillment.cs index 9fa103ea..bc63498d 100644 --- a/Square/Models/OrderFulfillment.cs +++ b/Square/Models/OrderFulfillment.cs @@ -94,7 +94,7 @@ public class Builder private string uid; private string type; private string state; - private IDictionary metadata; + private IDictionary metadata = new Dictionary(); private Models.OrderFulfillmentPickupDetails pickupDetails; private Models.OrderFulfillmentShipmentDetails shipmentDetails; @@ -146,4 +146,4 @@ public OrderFulfillment Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderFulfillmentPickupDetails.cs b/Square/Models/OrderFulfillmentPickupDetails.cs index 822845c5..959a48fa 100644 --- a/Square/Models/OrderFulfillmentPickupDetails.cs +++ b/Square/Models/OrderFulfillmentPickupDetails.cs @@ -327,4 +327,4 @@ public OrderFulfillmentPickupDetails Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderFulfillmentRecipient.cs b/Square/Models/OrderFulfillmentRecipient.cs index f17198e6..7118b20f 100644 --- a/Square/Models/OrderFulfillmentRecipient.cs +++ b/Square/Models/OrderFulfillmentRecipient.cs @@ -126,4 +126,4 @@ public OrderFulfillmentRecipient Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderFulfillmentShipmentDetails.cs b/Square/Models/OrderFulfillmentShipmentDetails.cs index 6b4a6191..ea9f5fcf 100644 --- a/Square/Models/OrderFulfillmentShipmentDetails.cs +++ b/Square/Models/OrderFulfillmentShipmentDetails.cs @@ -301,4 +301,4 @@ public OrderFulfillmentShipmentDetails Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderLineItem.cs b/Square/Models/OrderLineItem.cs index f2bc4828..a6c0b026 100644 --- a/Square/Models/OrderLineItem.cs +++ b/Square/Models/OrderLineItem.cs @@ -274,12 +274,12 @@ public class Builder private string note; private string catalogObjectId; private string variationName; - private IDictionary metadata; - private IList modifiers; - private IList taxes; - private IList discounts; - private IList appliedTaxes; - private IList appliedDiscounts; + private IDictionary metadata = new Dictionary(); + private IList modifiers = new List(); + private IList taxes = new List(); + private IList discounts = new List(); + private IList appliedTaxes = new List(); + private IList appliedDiscounts = new List(); private Models.Money basePriceMoney; private Models.Money variationTotalPriceMoney; private Models.Money grossSalesMoney; @@ -429,4 +429,4 @@ public OrderLineItem Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderLineItemAppliedDiscount.cs b/Square/Models/OrderLineItemAppliedDiscount.cs index a47d4521..ddf360c8 100644 --- a/Square/Models/OrderLineItemAppliedDiscount.cs +++ b/Square/Models/OrderLineItemAppliedDiscount.cs @@ -93,4 +93,4 @@ public OrderLineItemAppliedDiscount Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderLineItemAppliedTax.cs b/Square/Models/OrderLineItemAppliedTax.cs index ed7267fc..aa1e3b07 100644 --- a/Square/Models/OrderLineItemAppliedTax.cs +++ b/Square/Models/OrderLineItemAppliedTax.cs @@ -93,4 +93,4 @@ public OrderLineItemAppliedTax Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderLineItemDiscount.cs b/Square/Models/OrderLineItemDiscount.cs index 4e6be496..42258899 100644 --- a/Square/Models/OrderLineItemDiscount.cs +++ b/Square/Models/OrderLineItemDiscount.cs @@ -137,7 +137,7 @@ public class Builder private string percentage; private Models.Money amountMoney; private Models.Money appliedMoney; - private IDictionary metadata; + private IDictionary metadata = new Dictionary(); private string scope; public Builder() { } @@ -209,4 +209,4 @@ public OrderLineItemDiscount Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderLineItemModifier.cs b/Square/Models/OrderLineItemModifier.cs index 69881835..4c9535d1 100644 --- a/Square/Models/OrderLineItemModifier.cs +++ b/Square/Models/OrderLineItemModifier.cs @@ -127,4 +127,4 @@ public OrderLineItemModifier Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderLineItemTax.cs b/Square/Models/OrderLineItemTax.cs index bb4e622a..f6a47e7b 100644 --- a/Square/Models/OrderLineItemTax.cs +++ b/Square/Models/OrderLineItemTax.cs @@ -121,7 +121,7 @@ public class Builder private string name; private string type; private string percentage; - private IDictionary metadata; + private IDictionary metadata = new Dictionary(); private Models.Money appliedMoney; private string scope; @@ -187,4 +187,4 @@ public OrderLineItemTax Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderMoneyAmounts.cs b/Square/Models/OrderMoneyAmounts.cs index 77a7879c..457369e0 100644 --- a/Square/Models/OrderMoneyAmounts.cs +++ b/Square/Models/OrderMoneyAmounts.cs @@ -142,4 +142,4 @@ public OrderMoneyAmounts Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderQuantityUnit.cs b/Square/Models/OrderQuantityUnit.cs index dd9e4380..192c485f 100644 --- a/Square/Models/OrderQuantityUnit.cs +++ b/Square/Models/OrderQuantityUnit.cs @@ -71,4 +71,4 @@ public OrderQuantityUnit Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderReturn.cs b/Square/Models/OrderReturn.cs index 90084679..6d541fc6 100644 --- a/Square/Models/OrderReturn.cs +++ b/Square/Models/OrderReturn.cs @@ -105,10 +105,10 @@ public class Builder { private string uid; private string sourceOrderId; - private IList returnLineItems; - private IList returnServiceCharges; - private IList returnTaxes; - private IList returnDiscounts; + private IList returnLineItems = new List(); + private IList returnServiceCharges = new List(); + private IList returnTaxes = new List(); + private IList returnDiscounts = new List(); private Models.OrderRoundingAdjustment roundingAdjustment; private Models.OrderMoneyAmounts returnAmounts; @@ -174,4 +174,4 @@ public OrderReturn Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderReturnDiscount.cs b/Square/Models/OrderReturnDiscount.cs index cf254a03..d84f65ca 100644 --- a/Square/Models/OrderReturnDiscount.cs +++ b/Square/Models/OrderReturnDiscount.cs @@ -197,4 +197,4 @@ public OrderReturnDiscount Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderReturnLineItem.cs b/Square/Models/OrderReturnLineItem.cs index 48ecbed4..01616ac7 100644 --- a/Square/Models/OrderReturnLineItem.cs +++ b/Square/Models/OrderReturnLineItem.cs @@ -247,11 +247,11 @@ public class Builder private string note; private string catalogObjectId; private string variationName; - private IList returnModifiers; - private IList returnTaxes; - private IList returnDiscounts; - private IList appliedTaxes; - private IList appliedDiscounts; + private IList returnModifiers = new List(); + private IList returnTaxes = new List(); + private IList returnDiscounts = new List(); + private IList appliedTaxes = new List(); + private IList appliedDiscounts = new List(); private Models.Money basePriceMoney; private Models.Money variationTotalPriceMoney; private Models.Money grossReturnMoney; @@ -401,4 +401,4 @@ public OrderReturnLineItem Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderReturnLineItemModifier.cs b/Square/Models/OrderReturnLineItemModifier.cs index 15007eba..2abe85f4 100644 --- a/Square/Models/OrderReturnLineItemModifier.cs +++ b/Square/Models/OrderReturnLineItemModifier.cs @@ -145,4 +145,4 @@ public OrderReturnLineItemModifier Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderReturnServiceCharge.cs b/Square/Models/OrderReturnServiceCharge.cs index 409ee777..aefed674 100644 --- a/Square/Models/OrderReturnServiceCharge.cs +++ b/Square/Models/OrderReturnServiceCharge.cs @@ -189,8 +189,8 @@ public class Builder private Models.Money totalTaxMoney; private string calculationPhase; private bool? taxable; - private IList returnTaxes; - private IList appliedTaxes; + private IList returnTaxes = new List(); + private IList appliedTaxes = new List(); public Builder() { } public Builder Uid(string value) @@ -289,4 +289,4 @@ public OrderReturnServiceCharge Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderReturnTax.cs b/Square/Models/OrderReturnTax.cs index 0498cb0c..928fefed 100644 --- a/Square/Models/OrderReturnTax.cs +++ b/Square/Models/OrderReturnTax.cs @@ -174,4 +174,4 @@ public OrderReturnTax Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderRoundingAdjustment.cs b/Square/Models/OrderRoundingAdjustment.cs index 8dce3ac9..af58d950 100644 --- a/Square/Models/OrderRoundingAdjustment.cs +++ b/Square/Models/OrderRoundingAdjustment.cs @@ -88,4 +88,4 @@ public OrderRoundingAdjustment Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderServiceCharge.cs b/Square/Models/OrderServiceCharge.cs index bafcadc2..0719e863 100644 --- a/Square/Models/OrderServiceCharge.cs +++ b/Square/Models/OrderServiceCharge.cs @@ -206,9 +206,9 @@ public class Builder private Models.Money totalTaxMoney; private string calculationPhase; private bool? taxable; - private IList taxes; - private IList appliedTaxes; - private IDictionary metadata; + private IList taxes = new List(); + private IList appliedTaxes = new List(); + private IDictionary metadata = new Dictionary(); public Builder() { } public Builder Uid(string value) @@ -307,4 +307,4 @@ public OrderServiceCharge Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/OrderSource.cs b/Square/Models/OrderSource.cs index bcbe21e1..090c96bc 100644 --- a/Square/Models/OrderSource.cs +++ b/Square/Models/OrderSource.cs @@ -50,4 +50,4 @@ public OrderSource Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/PayOrderRequest.cs b/Square/Models/PayOrderRequest.cs index 9bfecbc6..a2ec1f64 100644 --- a/Square/Models/PayOrderRequest.cs +++ b/Square/Models/PayOrderRequest.cs @@ -39,7 +39,7 @@ public class PayOrderRequest public int? OrderVersion { get; } /// - /// TODO: Write general description for this method + /// Getter for payment_ids /// [JsonProperty("payment_ids")] public IList PaymentIds { get; } @@ -56,7 +56,7 @@ public class Builder { private string idempotencyKey; private int? orderVersion; - private IList paymentIds; + private IList paymentIds = new List(); public Builder(string idempotencyKey) { @@ -88,4 +88,4 @@ public PayOrderRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/PayOrderResponse.cs b/Square/Models/PayOrderResponse.cs index 76f46711..8a8d4f3d 100644 --- a/Square/Models/PayOrderResponse.cs +++ b/Square/Models/PayOrderResponse.cs @@ -51,7 +51,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Order order; public Builder() { } @@ -74,4 +74,4 @@ public PayOrderResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Payment.cs b/Square/Models/Payment.cs index 1c9cf97e..8b7be581 100644 --- a/Square/Models/Payment.cs +++ b/Square/Models/Payment.cs @@ -291,7 +291,7 @@ public class Builder private Models.Money tipMoney; private Models.Money totalMoney; private Models.Money appFeeMoney; - private IList processingFee; + private IList processingFee = new List(); private Models.Money refundedMoney; private string status; private string sourceType; @@ -301,7 +301,7 @@ public class Builder private string referenceId; private string customerId; private string employeeId; - private IList refundIds; + private IList refundIds = new List(); private string buyerEmailAddress; private Models.Address billingAddress; private Models.Address shippingAddress; @@ -491,4 +491,4 @@ public Payment Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/PaymentRefund.cs b/Square/Models/PaymentRefund.cs index e05d261f..cb3b6b87 100644 --- a/Square/Models/PaymentRefund.cs +++ b/Square/Models/PaymentRefund.cs @@ -142,7 +142,7 @@ public class Builder private string status; private string locationId; private Models.Money appFeeMoney; - private IList processingFee; + private IList processingFee = new List(); private string paymentId; private string orderId; private string reason; @@ -237,4 +237,4 @@ public PaymentRefund Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ProcessingFee.cs b/Square/Models/ProcessingFee.cs index 96a31dd0..5a34d29d 100644 --- a/Square/Models/ProcessingFee.cs +++ b/Square/Models/ProcessingFee.cs @@ -88,4 +88,4 @@ public ProcessingFee Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Refund.cs b/Square/Models/Refund.cs index d5907c5e..e411b925 100644 --- a/Square/Models/Refund.cs +++ b/Square/Models/Refund.cs @@ -134,7 +134,7 @@ public class Builder private string status; private string createdAt; private Models.Money processingFeeMoney; - private IList additionalRecipients; + private IList additionalRecipients = new List(); public Builder(string id, string locationId, @@ -227,4 +227,4 @@ public Refund Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RefundPaymentRequest.cs b/Square/Models/RefundPaymentRequest.cs index 90c17e03..d1f7bfad 100644 --- a/Square/Models/RefundPaymentRequest.cs +++ b/Square/Models/RefundPaymentRequest.cs @@ -16,8 +16,8 @@ public class RefundPaymentRequest { public RefundPaymentRequest(string idempotencyKey, Models.Money amountMoney, + string paymentId, Models.Money appFeeMoney = null, - string paymentId = null, string reason = null) { IdempotencyKey = idempotencyKey; @@ -72,9 +72,9 @@ public class RefundPaymentRequest public Builder ToBuilder() { var builder = new Builder(IdempotencyKey, - AmountMoney) + AmountMoney, + PaymentId) .AppFeeMoney(AppFeeMoney) - .PaymentId(PaymentId) .Reason(Reason); return builder; } @@ -83,15 +83,17 @@ public class Builder { private string idempotencyKey; private Models.Money amountMoney; - private Models.Money appFeeMoney; private string paymentId; + private Models.Money appFeeMoney; private string reason; public Builder(string idempotencyKey, - Models.Money amountMoney) + Models.Money amountMoney, + string paymentId) { this.idempotencyKey = idempotencyKey; this.amountMoney = amountMoney; + this.paymentId = paymentId; } public Builder IdempotencyKey(string value) { @@ -105,15 +107,15 @@ public Builder AmountMoney(Models.Money value) return this; } - public Builder AppFeeMoney(Models.Money value) + public Builder PaymentId(string value) { - appFeeMoney = value; + paymentId = value; return this; } - public Builder PaymentId(string value) + public Builder AppFeeMoney(Models.Money value) { - paymentId = value; + appFeeMoney = value; return this; } @@ -127,10 +129,10 @@ public RefundPaymentRequest Build() { return new RefundPaymentRequest(idempotencyKey, amountMoney, - appFeeMoney, paymentId, + appFeeMoney, reason); } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RefundPaymentResponse.cs b/Square/Models/RefundPaymentResponse.cs index eea2d52d..76e1c4df 100644 --- a/Square/Models/RefundPaymentResponse.cs +++ b/Square/Models/RefundPaymentResponse.cs @@ -48,7 +48,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.PaymentRefund refund; public Builder() { } @@ -71,4 +71,4 @@ public RefundPaymentResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RegisterDomainRequest.cs b/Square/Models/RegisterDomainRequest.cs index 44058919..757246a6 100644 --- a/Square/Models/RegisterDomainRequest.cs +++ b/Square/Models/RegisterDomainRequest.cs @@ -51,4 +51,4 @@ public RegisterDomainRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RegisterDomainResponse.cs b/Square/Models/RegisterDomainResponse.cs index 7bd8bdc6..519ff752 100644 --- a/Square/Models/RegisterDomainResponse.cs +++ b/Square/Models/RegisterDomainResponse.cs @@ -47,7 +47,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private string status; public Builder() { } @@ -70,4 +70,4 @@ public RegisterDomainResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RenewTokenRequest.cs b/Square/Models/RenewTokenRequest.cs index 8835f326..74c6dadf 100644 --- a/Square/Models/RenewTokenRequest.cs +++ b/Square/Models/RenewTokenRequest.cs @@ -49,4 +49,4 @@ public RenewTokenRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RenewTokenResponse.cs b/Square/Models/RenewTokenResponse.cs index 171fab36..b4d01e7d 100644 --- a/Square/Models/RenewTokenResponse.cs +++ b/Square/Models/RenewTokenResponse.cs @@ -145,4 +145,4 @@ public RenewTokenResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveCashDrawerShiftRequest.cs b/Square/Models/RetrieveCashDrawerShiftRequest.cs index f2d78513..76949796 100644 --- a/Square/Models/RetrieveCashDrawerShiftRequest.cs +++ b/Square/Models/RetrieveCashDrawerShiftRequest.cs @@ -51,4 +51,4 @@ public RetrieveCashDrawerShiftRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveCashDrawerShiftResponse.cs b/Square/Models/RetrieveCashDrawerShiftResponse.cs index 1ff84ffe..9d40b9c8 100644 --- a/Square/Models/RetrieveCashDrawerShiftResponse.cs +++ b/Square/Models/RetrieveCashDrawerShiftResponse.cs @@ -51,7 +51,7 @@ public Builder ToBuilder() public class Builder { private Models.CashDrawerShift cashDrawerShift; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder CashDrawerShift(Models.CashDrawerShift value) @@ -73,4 +73,4 @@ public RetrieveCashDrawerShiftResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveCatalogObjectRequest.cs b/Square/Models/RetrieveCatalogObjectRequest.cs index da45ebb8..84be2bd7 100644 --- a/Square/Models/RetrieveCatalogObjectRequest.cs +++ b/Square/Models/RetrieveCatalogObjectRequest.cs @@ -58,4 +58,4 @@ public RetrieveCatalogObjectRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveCatalogObjectResponse.cs b/Square/Models/RetrieveCatalogObjectResponse.cs index 15d12eab..bfa449a0 100644 --- a/Square/Models/RetrieveCatalogObjectResponse.cs +++ b/Square/Models/RetrieveCatalogObjectResponse.cs @@ -34,7 +34,7 @@ public class RetrieveCatalogObjectResponse public IList Errors { get; } /// - /// TODO: Write general description for this method + /// Getter for object /// [JsonProperty("object")] public Models.CatalogObject MObject { get; } @@ -56,9 +56,9 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.CatalogObject mObject; - private IList relatedObjects; + private IList relatedObjects = new List(); public Builder() { } public Builder Errors(IList value) @@ -87,4 +87,4 @@ public RetrieveCatalogObjectResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveCustomerResponse.cs b/Square/Models/RetrieveCustomerResponse.cs index bfcbaa96..790a82c5 100644 --- a/Square/Models/RetrieveCustomerResponse.cs +++ b/Square/Models/RetrieveCustomerResponse.cs @@ -48,7 +48,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Customer customer; public Builder() { } @@ -71,4 +71,4 @@ public RetrieveCustomerResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveEmployeeResponse.cs b/Square/Models/RetrieveEmployeeResponse.cs index 7c19c33e..f06bf6af 100644 --- a/Square/Models/RetrieveEmployeeResponse.cs +++ b/Square/Models/RetrieveEmployeeResponse.cs @@ -48,7 +48,7 @@ public Builder ToBuilder() public class Builder { private Models.Employee employee; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Employee(Models.Employee value) @@ -70,4 +70,4 @@ public RetrieveEmployeeResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveInventoryAdjustmentResponse.cs b/Square/Models/RetrieveInventoryAdjustmentResponse.cs index 190f1b68..a39da76c 100644 --- a/Square/Models/RetrieveInventoryAdjustmentResponse.cs +++ b/Square/Models/RetrieveInventoryAdjustmentResponse.cs @@ -48,7 +48,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.InventoryAdjustment adjustment; public Builder() { } @@ -71,4 +71,4 @@ public RetrieveInventoryAdjustmentResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveInventoryChangesRequest.cs b/Square/Models/RetrieveInventoryChangesRequest.cs index a5391ebb..54dd2511 100644 --- a/Square/Models/RetrieveInventoryChangesRequest.cs +++ b/Square/Models/RetrieveInventoryChangesRequest.cs @@ -69,4 +69,4 @@ public RetrieveInventoryChangesRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveInventoryChangesResponse.cs b/Square/Models/RetrieveInventoryChangesResponse.cs index 6999c8a3..8c23a1b4 100644 --- a/Square/Models/RetrieveInventoryChangesResponse.cs +++ b/Square/Models/RetrieveInventoryChangesResponse.cs @@ -58,8 +58,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList changes; + private IList errors = new List(); + private IList changes = new List(); private string cursor; public Builder() { } @@ -89,4 +89,4 @@ public RetrieveInventoryChangesResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveInventoryCountRequest.cs b/Square/Models/RetrieveInventoryCountRequest.cs index 81ef5330..da5e22d1 100644 --- a/Square/Models/RetrieveInventoryCountRequest.cs +++ b/Square/Models/RetrieveInventoryCountRequest.cs @@ -69,4 +69,4 @@ public RetrieveInventoryCountRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveInventoryCountResponse.cs b/Square/Models/RetrieveInventoryCountResponse.cs index 7612dd53..3bd994ad 100644 --- a/Square/Models/RetrieveInventoryCountResponse.cs +++ b/Square/Models/RetrieveInventoryCountResponse.cs @@ -59,8 +59,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList counts; + private IList errors = new List(); + private IList counts = new List(); private string cursor; public Builder() { } @@ -90,4 +90,4 @@ public RetrieveInventoryCountResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveInventoryPhysicalCountResponse.cs b/Square/Models/RetrieveInventoryPhysicalCountResponse.cs index 0bae242e..6fa1cec9 100644 --- a/Square/Models/RetrieveInventoryPhysicalCountResponse.cs +++ b/Square/Models/RetrieveInventoryPhysicalCountResponse.cs @@ -50,7 +50,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.InventoryPhysicalCount count; public Builder() { } @@ -73,4 +73,4 @@ public RetrieveInventoryPhysicalCountResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveLocationResponse.cs b/Square/Models/RetrieveLocationResponse.cs index 4df799e1..a482b29a 100644 --- a/Square/Models/RetrieveLocationResponse.cs +++ b/Square/Models/RetrieveLocationResponse.cs @@ -32,7 +32,7 @@ public class RetrieveLocationResponse public IList Errors { get; } /// - /// TODO: Write general description for this method + /// Getter for location /// [JsonProperty("location")] public Models.Location Location { get; } @@ -47,7 +47,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Location location; public Builder() { } @@ -70,4 +70,4 @@ public RetrieveLocationResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveMerchantResponse.cs b/Square/Models/RetrieveMerchantResponse.cs index c4bed393..84320303 100644 --- a/Square/Models/RetrieveMerchantResponse.cs +++ b/Square/Models/RetrieveMerchantResponse.cs @@ -47,7 +47,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Merchant merchant; public Builder() { } @@ -70,4 +70,4 @@ public RetrieveMerchantResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RetrieveTransactionResponse.cs b/Square/Models/RetrieveTransactionResponse.cs index 44205f77..9688e31a 100644 --- a/Square/Models/RetrieveTransactionResponse.cs +++ b/Square/Models/RetrieveTransactionResponse.cs @@ -50,7 +50,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Transaction transaction; public Builder() { } @@ -73,4 +73,4 @@ public RetrieveTransactionResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RevokeTokenRequest.cs b/Square/Models/RevokeTokenRequest.cs index 7e4a45f4..4ae4a13b 100644 --- a/Square/Models/RevokeTokenRequest.cs +++ b/Square/Models/RevokeTokenRequest.cs @@ -86,4 +86,4 @@ public RevokeTokenRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/RevokeTokenResponse.cs b/Square/Models/RevokeTokenResponse.cs index ed26f3d4..64f464dd 100644 --- a/Square/Models/RevokeTokenResponse.cs +++ b/Square/Models/RevokeTokenResponse.cs @@ -53,4 +53,4 @@ public RevokeTokenResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchCatalogObjectsRequest.cs b/Square/Models/SearchCatalogObjectsRequest.cs index b2d5f180..94a3ac8d 100644 --- a/Square/Models/SearchCatalogObjectsRequest.cs +++ b/Square/Models/SearchCatalogObjectsRequest.cs @@ -114,7 +114,7 @@ public Builder ToBuilder() public class Builder { private string cursor; - private IList objectTypes; + private IList objectTypes = new List(); private bool? includeDeletedObjects; private bool? includeRelatedObjects; private string beginTime; @@ -176,4 +176,4 @@ public SearchCatalogObjectsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchCatalogObjectsResponse.cs b/Square/Models/SearchCatalogObjectsResponse.cs index 903b5bb3..b98639e7 100644 --- a/Square/Models/SearchCatalogObjectsResponse.cs +++ b/Square/Models/SearchCatalogObjectsResponse.cs @@ -76,10 +76,10 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private string cursor; - private IList objects; - private IList relatedObjects; + private IList objects = new List(); + private IList relatedObjects = new List(); private string latestTime; public Builder() { } @@ -123,4 +123,4 @@ public SearchCatalogObjectsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchCustomersRequest.cs b/Square/Models/SearchCustomersRequest.cs index dd5ac7f5..d11ab4d3 100644 --- a/Square/Models/SearchCustomersRequest.cs +++ b/Square/Models/SearchCustomersRequest.cs @@ -89,4 +89,4 @@ public SearchCustomersRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchCustomersResponse.cs b/Square/Models/SearchCustomersResponse.cs index dd86892c..0c982823 100644 --- a/Square/Models/SearchCustomersResponse.cs +++ b/Square/Models/SearchCustomersResponse.cs @@ -60,8 +60,8 @@ public Builder ToBuilder() public class Builder { - private IList errors; - private IList customers; + private IList errors = new List(); + private IList customers = new List(); private string cursor; public Builder() { } @@ -91,4 +91,4 @@ public SearchCustomersResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchOrdersCustomerFilter.cs b/Square/Models/SearchOrdersCustomerFilter.cs index c989043d..b265cb36 100644 --- a/Square/Models/SearchOrdersCustomerFilter.cs +++ b/Square/Models/SearchOrdersCustomerFilter.cs @@ -35,7 +35,7 @@ public Builder ToBuilder() public class Builder { - private IList customerIds; + private IList customerIds = new List(); public Builder() { } public Builder CustomerIds(IList value) @@ -50,4 +50,4 @@ public SearchOrdersCustomerFilter Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchOrdersDateTimeFilter.cs b/Square/Models/SearchOrdersDateTimeFilter.cs index 803ed0b6..5b7b9856 100644 --- a/Square/Models/SearchOrdersDateTimeFilter.cs +++ b/Square/Models/SearchOrdersDateTimeFilter.cs @@ -95,4 +95,4 @@ public SearchOrdersDateTimeFilter Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchOrdersFilter.cs b/Square/Models/SearchOrdersFilter.cs index c7070966..2820a705 100644 --- a/Square/Models/SearchOrdersFilter.cs +++ b/Square/Models/SearchOrdersFilter.cs @@ -130,4 +130,4 @@ public SearchOrdersFilter Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchOrdersFulfillmentFilter.cs b/Square/Models/SearchOrdersFulfillmentFilter.cs index 8d5514c3..228d97a7 100644 --- a/Square/Models/SearchOrdersFulfillmentFilter.cs +++ b/Square/Models/SearchOrdersFulfillmentFilter.cs @@ -49,7 +49,7 @@ public Builder ToBuilder() public class Builder { private IList fulfillmentTypes; - private IList fulfillmentStates; + private IList fulfillmentStates = new List(); public Builder(IList fulfillmentTypes) { @@ -74,4 +74,4 @@ public SearchOrdersFulfillmentFilter Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchOrdersQuery.cs b/Square/Models/SearchOrdersQuery.cs index 978cf2e6..02299138 100644 --- a/Square/Models/SearchOrdersQuery.cs +++ b/Square/Models/SearchOrdersQuery.cs @@ -68,4 +68,4 @@ public SearchOrdersQuery Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchOrdersRequest.cs b/Square/Models/SearchOrdersRequest.cs index 469231a9..10725e6c 100644 --- a/Square/Models/SearchOrdersRequest.cs +++ b/Square/Models/SearchOrdersRequest.cs @@ -80,7 +80,7 @@ public Builder ToBuilder() public class Builder { - private IList locationIds; + private IList locationIds = new List(); private string cursor; private Models.SearchOrdersQuery query; private int? limit; @@ -127,4 +127,4 @@ public SearchOrdersRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchOrdersResponse.cs b/Square/Models/SearchOrdersResponse.cs index 5a97f5ee..f1b144ff 100644 --- a/Square/Models/SearchOrdersResponse.cs +++ b/Square/Models/SearchOrdersResponse.cs @@ -70,10 +70,10 @@ public Builder ToBuilder() public class Builder { - private IList orderEntries; - private IList orders; + private IList orderEntries = new List(); + private IList orders = new List(); private string cursor; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder OrderEntries(IList value) @@ -109,4 +109,4 @@ public SearchOrdersResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchOrdersSort.cs b/Square/Models/SearchOrdersSort.cs index 41e5a3ce..f227a498 100644 --- a/Square/Models/SearchOrdersSort.cs +++ b/Square/Models/SearchOrdersSort.cs @@ -68,4 +68,4 @@ public SearchOrdersSort Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchOrdersSourceFilter.cs b/Square/Models/SearchOrdersSourceFilter.cs index 60225e89..be44564a 100644 --- a/Square/Models/SearchOrdersSourceFilter.cs +++ b/Square/Models/SearchOrdersSourceFilter.cs @@ -36,7 +36,7 @@ public Builder ToBuilder() public class Builder { - private IList sourceNames; + private IList sourceNames = new List(); public Builder() { } public Builder SourceNames(IList value) @@ -51,4 +51,4 @@ public SearchOrdersSourceFilter Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchOrdersStateFilter.cs b/Square/Models/SearchOrdersStateFilter.cs index c1f82a72..a51d794a 100644 --- a/Square/Models/SearchOrdersStateFilter.cs +++ b/Square/Models/SearchOrdersStateFilter.cs @@ -52,4 +52,4 @@ public SearchOrdersStateFilter Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchShiftsRequest.cs b/Square/Models/SearchShiftsRequest.cs index df67e947..81264f10 100644 --- a/Square/Models/SearchShiftsRequest.cs +++ b/Square/Models/SearchShiftsRequest.cs @@ -83,4 +83,4 @@ public SearchShiftsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SearchShiftsResponse.cs b/Square/Models/SearchShiftsResponse.cs index d8c8d2c7..546d4c67 100644 --- a/Square/Models/SearchShiftsResponse.cs +++ b/Square/Models/SearchShiftsResponse.cs @@ -56,9 +56,9 @@ public Builder ToBuilder() public class Builder { - private IList shifts; + private IList shifts = new List(); private string cursor; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Shifts(IList value) @@ -87,4 +87,4 @@ public SearchShiftsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Shift.cs b/Square/Models/Shift.cs index 259a9a52..80469403 100644 --- a/Square/Models/Shift.cs +++ b/Square/Models/Shift.cs @@ -149,7 +149,7 @@ public class Builder private string timezone; private string endAt; private Models.ShiftWage wage; - private IList breaks; + private IList breaks = new List(); private string status; private int? version; private string createdAt; @@ -250,4 +250,4 @@ public Shift Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ShiftFilter.cs b/Square/Models/ShiftFilter.cs index 555182cf..3aaa5bfe 100644 --- a/Square/Models/ShiftFilter.cs +++ b/Square/Models/ShiftFilter.cs @@ -88,8 +88,8 @@ public Builder ToBuilder() public class Builder { - private IList locationIds; - private IList employeeIds; + private IList locationIds = new List(); + private IList employeeIds = new List(); private string status; private Models.TimeRange start; private Models.TimeRange end; @@ -143,4 +143,4 @@ public ShiftFilter Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ShiftQuery.cs b/Square/Models/ShiftQuery.cs index e4f7e32c..af769033 100644 --- a/Square/Models/ShiftQuery.cs +++ b/Square/Models/ShiftQuery.cs @@ -67,4 +67,4 @@ public ShiftQuery Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ShiftSort.cs b/Square/Models/ShiftSort.cs index 49fadf84..06554403 100644 --- a/Square/Models/ShiftSort.cs +++ b/Square/Models/ShiftSort.cs @@ -66,4 +66,4 @@ public ShiftSort Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ShiftWage.cs b/Square/Models/ShiftWage.cs index 1a81275a..2e6fcd7a 100644 --- a/Square/Models/ShiftWage.cs +++ b/Square/Models/ShiftWage.cs @@ -72,4 +72,4 @@ public ShiftWage Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/ShiftWorkday.cs b/Square/Models/ShiftWorkday.cs index d9967712..f0adce2f 100644 --- a/Square/Models/ShiftWorkday.cs +++ b/Square/Models/ShiftWorkday.cs @@ -87,4 +87,4 @@ public ShiftWorkday Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/SourceApplication.cs b/Square/Models/SourceApplication.cs index bdb45ae2..bfe107b1 100644 --- a/Square/Models/SourceApplication.cs +++ b/Square/Models/SourceApplication.cs @@ -85,4 +85,4 @@ public SourceApplication Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/StandardUnitDescription.cs b/Square/Models/StandardUnitDescription.cs index 17c767b7..db22a5b3 100644 --- a/Square/Models/StandardUnitDescription.cs +++ b/Square/Models/StandardUnitDescription.cs @@ -85,4 +85,4 @@ public StandardUnitDescription Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/StandardUnitDescriptionGroup.cs b/Square/Models/StandardUnitDescriptionGroup.cs index b47e5867..babcfe56 100644 --- a/Square/Models/StandardUnitDescriptionGroup.cs +++ b/Square/Models/StandardUnitDescriptionGroup.cs @@ -43,7 +43,7 @@ public Builder ToBuilder() public class Builder { - private IList standardUnitDescriptions; + private IList standardUnitDescriptions = new List(); private string languageCode; public Builder() { } @@ -66,4 +66,4 @@ public StandardUnitDescriptionGroup Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Tender.cs b/Square/Models/Tender.cs index 562e4b16..f3b86bf5 100644 --- a/Square/Models/Tender.cs +++ b/Square/Models/Tender.cs @@ -180,7 +180,7 @@ public class Builder private string customerId; private Models.TenderCardDetails cardDetails; private Models.TenderCashDetails cashDetails; - private IList additionalRecipients; + private IList additionalRecipients = new List(); private string paymentId; public Builder(string type) @@ -290,4 +290,4 @@ public Tender Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/TenderCardDetails.cs b/Square/Models/TenderCardDetails.cs index 96d1d365..377a7320 100644 --- a/Square/Models/TenderCardDetails.cs +++ b/Square/Models/TenderCardDetails.cs @@ -84,4 +84,4 @@ public TenderCardDetails Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/TenderCashDetails.cs b/Square/Models/TenderCashDetails.cs index ee11dd90..a4244c25 100644 --- a/Square/Models/TenderCashDetails.cs +++ b/Square/Models/TenderCashDetails.cs @@ -76,4 +76,4 @@ public TenderCashDetails Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/TimeRange.cs b/Square/Models/TimeRange.cs index b33320f7..68090f32 100644 --- a/Square/Models/TimeRange.cs +++ b/Square/Models/TimeRange.cs @@ -68,4 +68,4 @@ public TimeRange Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/Transaction.cs b/Square/Models/Transaction.cs index c8cea867..8382b1ca 100644 --- a/Square/Models/Transaction.cs +++ b/Square/Models/Transaction.cs @@ -127,8 +127,8 @@ public class Builder private string id; private string locationId; private string createdAt; - private IList tenders; - private IList refunds; + private IList tenders = new List(); + private IList refunds = new List(); private string referenceId; private string product; private string clientId; @@ -211,4 +211,4 @@ public Transaction Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateBreakTypeRequest.cs b/Square/Models/UpdateBreakTypeRequest.cs index 0d881325..3ef9440d 100644 --- a/Square/Models/UpdateBreakTypeRequest.cs +++ b/Square/Models/UpdateBreakTypeRequest.cs @@ -52,4 +52,4 @@ public UpdateBreakTypeRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateBreakTypeResponse.cs b/Square/Models/UpdateBreakTypeResponse.cs index 76fd6676..faef660f 100644 --- a/Square/Models/UpdateBreakTypeResponse.cs +++ b/Square/Models/UpdateBreakTypeResponse.cs @@ -49,7 +49,7 @@ public Builder ToBuilder() public class Builder { private Models.BreakType breakType; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder BreakType(Models.BreakType value) @@ -71,4 +71,4 @@ public UpdateBreakTypeResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateCustomerRequest.cs b/Square/Models/UpdateCustomerRequest.cs index e3778b8a..94946141 100644 --- a/Square/Models/UpdateCustomerRequest.cs +++ b/Square/Models/UpdateCustomerRequest.cs @@ -206,4 +206,4 @@ public UpdateCustomerRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateCustomerResponse.cs b/Square/Models/UpdateCustomerResponse.cs index 65737e8a..7180c88e 100644 --- a/Square/Models/UpdateCustomerResponse.cs +++ b/Square/Models/UpdateCustomerResponse.cs @@ -48,7 +48,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Customer customer; public Builder() { } @@ -71,4 +71,4 @@ public UpdateCustomerResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateItemModifierListsRequest.cs b/Square/Models/UpdateItemModifierListsRequest.cs index 23fd22a7..adbab654 100644 --- a/Square/Models/UpdateItemModifierListsRequest.cs +++ b/Square/Models/UpdateItemModifierListsRequest.cs @@ -52,8 +52,8 @@ public Builder ToBuilder() public class Builder { private IList itemIds; - private IList modifierListsToEnable; - private IList modifierListsToDisable; + private IList modifierListsToEnable = new List(); + private IList modifierListsToDisable = new List(); public Builder(IList itemIds) { @@ -85,4 +85,4 @@ public UpdateItemModifierListsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateItemModifierListsResponse.cs b/Square/Models/UpdateItemModifierListsResponse.cs index f8afe476..e93b296c 100644 --- a/Square/Models/UpdateItemModifierListsResponse.cs +++ b/Square/Models/UpdateItemModifierListsResponse.cs @@ -32,7 +32,7 @@ public class UpdateItemModifierListsResponse public IList Errors { get; } /// - /// TODO: Write general description for this method + /// Getter for updated_at /// [JsonProperty("updated_at")] public string UpdatedAt { get; } @@ -47,7 +47,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private string updatedAt; public Builder() { } @@ -70,4 +70,4 @@ public UpdateItemModifierListsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateItemTaxesRequest.cs b/Square/Models/UpdateItemTaxesRequest.cs index 71b51c98..49cff83c 100644 --- a/Square/Models/UpdateItemTaxesRequest.cs +++ b/Square/Models/UpdateItemTaxesRequest.cs @@ -52,8 +52,8 @@ public Builder ToBuilder() public class Builder { private IList itemIds; - private IList taxesToEnable; - private IList taxesToDisable; + private IList taxesToEnable = new List(); + private IList taxesToDisable = new List(); public Builder(IList itemIds) { @@ -85,4 +85,4 @@ public UpdateItemTaxesRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateItemTaxesResponse.cs b/Square/Models/UpdateItemTaxesResponse.cs index f5804ace..9332f7f8 100644 --- a/Square/Models/UpdateItemTaxesResponse.cs +++ b/Square/Models/UpdateItemTaxesResponse.cs @@ -47,7 +47,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private string updatedAt; public Builder() { } @@ -70,4 +70,4 @@ public UpdateItemTaxesResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateLocationRequest.cs b/Square/Models/UpdateLocationRequest.cs index afa039ca..52b980d1 100644 --- a/Square/Models/UpdateLocationRequest.cs +++ b/Square/Models/UpdateLocationRequest.cs @@ -20,7 +20,7 @@ public UpdateLocationRequest(Models.Location location = null) } /// - /// TODO: Write general description for this method + /// Getter for location /// [JsonProperty("location")] public Models.Location Location { get; } @@ -49,4 +49,4 @@ public UpdateLocationRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateLocationResponse.cs b/Square/Models/UpdateLocationResponse.cs index e763211c..987834f5 100644 --- a/Square/Models/UpdateLocationResponse.cs +++ b/Square/Models/UpdateLocationResponse.cs @@ -32,7 +32,7 @@ public class UpdateLocationResponse public IList Errors { get; } /// - /// TODO: Write general description for this method + /// Getter for location /// [JsonProperty("location")] public Models.Location Location { get; } @@ -47,7 +47,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.Location location; public Builder() { } @@ -70,4 +70,4 @@ public UpdateLocationResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateOrderRequest.cs b/Square/Models/UpdateOrderRequest.cs index d24682a3..4dfff0e1 100644 --- a/Square/Models/UpdateOrderRequest.cs +++ b/Square/Models/UpdateOrderRequest.cs @@ -64,7 +64,7 @@ public Builder ToBuilder() public class Builder { private Models.Order order; - private IList fieldsToClear; + private IList fieldsToClear = new List(); private string idempotencyKey; public Builder() { } @@ -94,4 +94,4 @@ public UpdateOrderRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateOrderResponse.cs b/Square/Models/UpdateOrderResponse.cs index 88e9730a..74c52334 100644 --- a/Square/Models/UpdateOrderResponse.cs +++ b/Square/Models/UpdateOrderResponse.cs @@ -52,7 +52,7 @@ public Builder ToBuilder() public class Builder { private Models.Order order; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Order(Models.Order value) @@ -74,4 +74,4 @@ public UpdateOrderResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateShiftRequest.cs b/Square/Models/UpdateShiftRequest.cs index 2058dcbe..022b7d28 100644 --- a/Square/Models/UpdateShiftRequest.cs +++ b/Square/Models/UpdateShiftRequest.cs @@ -53,4 +53,4 @@ public UpdateShiftRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateShiftResponse.cs b/Square/Models/UpdateShiftResponse.cs index 3a4dfcc7..35da0d73 100644 --- a/Square/Models/UpdateShiftResponse.cs +++ b/Square/Models/UpdateShiftResponse.cs @@ -50,7 +50,7 @@ public Builder ToBuilder() public class Builder { private Models.Shift shift; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Shift(Models.Shift value) @@ -72,4 +72,4 @@ public UpdateShiftResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateWorkweekConfigRequest.cs b/Square/Models/UpdateWorkweekConfigRequest.cs index 877e397a..137a74f3 100644 --- a/Square/Models/UpdateWorkweekConfigRequest.cs +++ b/Square/Models/UpdateWorkweekConfigRequest.cs @@ -52,4 +52,4 @@ public UpdateWorkweekConfigRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpdateWorkweekConfigResponse.cs b/Square/Models/UpdateWorkweekConfigResponse.cs index ebe53856..e2ef39e8 100644 --- a/Square/Models/UpdateWorkweekConfigResponse.cs +++ b/Square/Models/UpdateWorkweekConfigResponse.cs @@ -49,7 +49,7 @@ public Builder ToBuilder() public class Builder { private Models.WorkweekConfig workweekConfig; - private IList errors; + private IList errors = new List(); public Builder() { } public Builder WorkweekConfig(Models.WorkweekConfig value) @@ -71,4 +71,4 @@ public UpdateWorkweekConfigResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpsertCatalogObjectRequest.cs b/Square/Models/UpsertCatalogObjectRequest.cs index cabe8774..a314c6a5 100644 --- a/Square/Models/UpsertCatalogObjectRequest.cs +++ b/Square/Models/UpsertCatalogObjectRequest.cs @@ -35,7 +35,7 @@ public class UpsertCatalogObjectRequest public string IdempotencyKey { get; } /// - /// TODO: Write general description for this method + /// Getter for object /// [JsonProperty("object")] public Models.CatalogObject MObject { get; } @@ -77,4 +77,4 @@ public UpsertCatalogObjectRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/UpsertCatalogObjectResponse.cs b/Square/Models/UpsertCatalogObjectResponse.cs index df1b44b8..beec57e0 100644 --- a/Square/Models/UpsertCatalogObjectResponse.cs +++ b/Square/Models/UpsertCatalogObjectResponse.cs @@ -34,7 +34,7 @@ public class UpsertCatalogObjectResponse public IList Errors { get; } /// - /// TODO: Write general description for this method + /// Getter for catalog_object /// [JsonProperty("catalog_object")] public Models.CatalogObject CatalogObject { get; } @@ -56,9 +56,9 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private Models.CatalogObject catalogObject; - private IList idMappings; + private IList idMappings = new List(); public Builder() { } public Builder Errors(IList value) @@ -87,4 +87,4 @@ public UpsertCatalogObjectResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1AdjustInventoryRequest.cs b/Square/Models/V1AdjustInventoryRequest.cs index 7e60d587..23041dc1 100644 --- a/Square/Models/V1AdjustInventoryRequest.cs +++ b/Square/Models/V1AdjustInventoryRequest.cs @@ -30,7 +30,7 @@ public class V1AdjustInventoryRequest public double? QuantityDelta { get; } /// - /// TODO: Write general description for this method + /// Getter for adjustment_type /// [JsonProperty("adjustment_type")] public string AdjustmentType { get; } @@ -83,4 +83,4 @@ public V1AdjustInventoryRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1BankAccount.cs b/Square/Models/V1BankAccount.cs index 420c1c62..c49b39c9 100644 --- a/Square/Models/V1BankAccount.cs +++ b/Square/Models/V1BankAccount.cs @@ -80,7 +80,7 @@ public class V1BankAccount public string CurrencyCode { get; } /// - /// TODO: Write general description for this method + /// Getter for type /// [JsonProperty("type")] public string Type { get; } @@ -172,4 +172,4 @@ public V1BankAccount Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1CashDrawerEvent.cs b/Square/Models/V1CashDrawerEvent.cs index 22c22190..e7e8240d 100644 --- a/Square/Models/V1CashDrawerEvent.cs +++ b/Square/Models/V1CashDrawerEvent.cs @@ -42,13 +42,13 @@ public class V1CashDrawerEvent public string EmployeeId { get; } /// - /// TODO: Write general description for this method + /// Getter for event_type /// [JsonProperty("event_type")] public string EventType { get; } /// - /// TODO: Write general description for this method + /// Getter for event_money /// [JsonProperty("event_money")] public Models.V1Money EventMoney { get; } @@ -134,4 +134,4 @@ public V1CashDrawerEvent Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1CashDrawerShift.cs b/Square/Models/V1CashDrawerShift.cs index 507ec29a..09bd8b84 100644 --- a/Square/Models/V1CashDrawerShift.cs +++ b/Square/Models/V1CashDrawerShift.cs @@ -66,7 +66,7 @@ public class V1CashDrawerShift public string Id { get; } /// - /// TODO: Write general description for this method + /// Getter for event_type /// [JsonProperty("event_type")] public string EventType { get; } @@ -120,49 +120,49 @@ public class V1CashDrawerShift public string Description { get; } /// - /// TODO: Write general description for this method + /// Getter for starting_cash_money /// [JsonProperty("starting_cash_money")] public Models.V1Money StartingCashMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for cash_payment_money /// [JsonProperty("cash_payment_money")] public Models.V1Money CashPaymentMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for cash_refunds_money /// [JsonProperty("cash_refunds_money")] public Models.V1Money CashRefundsMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for cash_paid_in_money /// [JsonProperty("cash_paid_in_money")] public Models.V1Money CashPaidInMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for cash_paid_out_money /// [JsonProperty("cash_paid_out_money")] public Models.V1Money CashPaidOutMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for expected_cash_money /// [JsonProperty("expected_cash_money")] public Models.V1Money ExpectedCashMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for closed_cash_money /// [JsonProperty("closed_cash_money")] public Models.V1Money ClosedCashMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for device /// [JsonProperty("device")] public Models.Device Device { get; } @@ -205,7 +205,7 @@ public class Builder private string openedAt; private string endedAt; private string closedAt; - private IList employeeIds; + private IList employeeIds = new List(); private string openingEmployeeId; private string endingEmployeeId; private string closingEmployeeId; @@ -218,7 +218,7 @@ public class Builder private Models.V1Money expectedCashMoney; private Models.V1Money closedCashMoney; private Models.Device device; - private IList events; + private IList events = new List(); public Builder() { } public Builder Id(string value) @@ -359,4 +359,4 @@ public V1CashDrawerShift Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Category.cs b/Square/Models/V1Category.cs index d77e8106..a0f9bb64 100644 --- a/Square/Models/V1Category.cs +++ b/Square/Models/V1Category.cs @@ -87,4 +87,4 @@ public V1Category Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1CreateCategoryRequest.cs b/Square/Models/V1CreateCategoryRequest.cs index 0779024d..e4b73254 100644 --- a/Square/Models/V1CreateCategoryRequest.cs +++ b/Square/Models/V1CreateCategoryRequest.cs @@ -49,4 +49,4 @@ public V1CreateCategoryRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1CreateDiscountRequest.cs b/Square/Models/V1CreateDiscountRequest.cs index a362a53c..3d61f6f1 100644 --- a/Square/Models/V1CreateDiscountRequest.cs +++ b/Square/Models/V1CreateDiscountRequest.cs @@ -49,4 +49,4 @@ public V1CreateDiscountRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1CreateEmployeeRoleRequest.cs b/Square/Models/V1CreateEmployeeRoleRequest.cs index 0b694d90..f8954da2 100644 --- a/Square/Models/V1CreateEmployeeRoleRequest.cs +++ b/Square/Models/V1CreateEmployeeRoleRequest.cs @@ -49,4 +49,4 @@ public V1CreateEmployeeRoleRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1CreateFeeRequest.cs b/Square/Models/V1CreateFeeRequest.cs index 17ebd7d7..2da3ad3f 100644 --- a/Square/Models/V1CreateFeeRequest.cs +++ b/Square/Models/V1CreateFeeRequest.cs @@ -49,4 +49,4 @@ public V1CreateFeeRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1CreateItemRequest.cs b/Square/Models/V1CreateItemRequest.cs index 162d221d..231db316 100644 --- a/Square/Models/V1CreateItemRequest.cs +++ b/Square/Models/V1CreateItemRequest.cs @@ -49,4 +49,4 @@ public V1CreateItemRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1CreateModifierListRequest.cs b/Square/Models/V1CreateModifierListRequest.cs index a78ef497..25e6db4b 100644 --- a/Square/Models/V1CreateModifierListRequest.cs +++ b/Square/Models/V1CreateModifierListRequest.cs @@ -49,4 +49,4 @@ public V1CreateModifierListRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1CreateModifierOptionRequest.cs b/Square/Models/V1CreateModifierOptionRequest.cs index c91572f9..52ecd749 100644 --- a/Square/Models/V1CreateModifierOptionRequest.cs +++ b/Square/Models/V1CreateModifierOptionRequest.cs @@ -49,4 +49,4 @@ public V1CreateModifierOptionRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1CreatePageRequest.cs b/Square/Models/V1CreatePageRequest.cs index 224af8e4..d3049a71 100644 --- a/Square/Models/V1CreatePageRequest.cs +++ b/Square/Models/V1CreatePageRequest.cs @@ -49,4 +49,4 @@ public V1CreatePageRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1CreateRefundRequest.cs b/Square/Models/V1CreateRefundRequest.cs index be385158..70cd6e44 100644 --- a/Square/Models/V1CreateRefundRequest.cs +++ b/Square/Models/V1CreateRefundRequest.cs @@ -36,7 +36,7 @@ public class V1CreateRefundRequest public string PaymentId { get; } /// - /// TODO: Write general description for this method + /// Getter for type /// [JsonProperty("type")] public string Type { get; } @@ -48,7 +48,7 @@ public class V1CreateRefundRequest public string Reason { get; } /// - /// TODO: Write general description for this method + /// Getter for refunded_money /// [JsonProperty("refunded_money")] public Models.V1Money RefundedMoney { get; } @@ -125,4 +125,4 @@ public V1CreateRefundRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1CreateVariationRequest.cs b/Square/Models/V1CreateVariationRequest.cs index e38024da..ea44b229 100644 --- a/Square/Models/V1CreateVariationRequest.cs +++ b/Square/Models/V1CreateVariationRequest.cs @@ -49,4 +49,4 @@ public V1CreateVariationRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1DeletePageCellRequest.cs b/Square/Models/V1DeletePageCellRequest.cs index 69d8541f..3e4ac9ff 100644 --- a/Square/Models/V1DeletePageCellRequest.cs +++ b/Square/Models/V1DeletePageCellRequest.cs @@ -66,4 +66,4 @@ public V1DeletePageCellRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Discount.cs b/Square/Models/V1Discount.cs index 0cdd2423..93e6afd2 100644 --- a/Square/Models/V1Discount.cs +++ b/Square/Models/V1Discount.cs @@ -56,13 +56,13 @@ public class V1Discount public string Rate { get; } /// - /// TODO: Write general description for this method + /// Getter for amount_money /// [JsonProperty("amount_money")] public Models.V1Money AmountMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for discount_type /// [JsonProperty("discount_type")] public string DiscountType { get; } @@ -74,7 +74,7 @@ public class V1Discount public bool? PinRequired { get; } /// - /// TODO: Write general description for this method + /// Getter for color /// [JsonProperty("color")] public string Color { get; } @@ -172,4 +172,4 @@ public V1Discount Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Employee.cs b/Square/Models/V1Employee.cs index d9752449..c0b88050 100644 --- a/Square/Models/V1Employee.cs +++ b/Square/Models/V1Employee.cs @@ -78,7 +78,7 @@ public class V1Employee public string Email { get; } /// - /// TODO: Write general description for this method + /// Getter for status /// [JsonProperty("status")] public string Status { get; } @@ -121,8 +121,8 @@ public class Builder private string firstName; private string lastName; private string id; - private IList roleIds; - private IList authorizedLocationIds; + private IList roleIds = new List(); + private IList authorizedLocationIds = new List(); private string email; private string status; private string externalId; @@ -210,4 +210,4 @@ public V1Employee Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1EmployeeRole.cs b/Square/Models/V1EmployeeRole.cs index 537c5535..39c37004 100644 --- a/Square/Models/V1EmployeeRole.cs +++ b/Square/Models/V1EmployeeRole.cs @@ -143,4 +143,4 @@ public V1EmployeeRole Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Fee.cs b/Square/Models/V1Fee.cs index 5151d1d1..44ea677e 100644 --- a/Square/Models/V1Fee.cs +++ b/Square/Models/V1Fee.cs @@ -60,13 +60,13 @@ public class V1Fee public string Rate { get; } /// - /// TODO: Write general description for this method + /// Getter for calculation_phase /// [JsonProperty("calculation_phase")] public string CalculationPhase { get; } /// - /// TODO: Write general description for this method + /// Getter for adjustment_type /// [JsonProperty("adjustment_type")] public string AdjustmentType { get; } @@ -84,13 +84,13 @@ public class V1Fee public bool? Enabled { get; } /// - /// TODO: Write general description for this method + /// Getter for inclusion_type /// [JsonProperty("inclusion_type")] public string InclusionType { get; } /// - /// TODO: Write general description for this method + /// Getter for type /// [JsonProperty("type")] public string Type { get; } @@ -206,4 +206,4 @@ public V1Fee Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1InventoryEntry.cs b/Square/Models/V1InventoryEntry.cs index 750ded5d..a29a9622 100644 --- a/Square/Models/V1InventoryEntry.cs +++ b/Square/Models/V1InventoryEntry.cs @@ -70,4 +70,4 @@ public V1InventoryEntry Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Item.cs b/Square/Models/V1Item.cs index 6c06e392..cfc8184f 100644 --- a/Square/Models/V1Item.cs +++ b/Square/Models/V1Item.cs @@ -74,13 +74,13 @@ public class V1Item public string Description { get; } /// - /// TODO: Write general description for this method + /// Getter for type /// [JsonProperty("type")] public string Type { get; } /// - /// TODO: Write general description for this method + /// Getter for color /// [JsonProperty("color")] public string Color { get; } @@ -92,7 +92,7 @@ public class V1Item public string Abbreviation { get; } /// - /// TODO: Write general description for this method + /// Getter for visibility /// [JsonProperty("visibility")] public string Visibility { get; } @@ -192,9 +192,9 @@ public class Builder private bool? availableOnline; private Models.V1ItemImage masterImage; private Models.V1Category category; - private IList variations; - private IList modifierLists; - private IList fees; + private IList variations = new List(); + private IList modifierLists = new List(); + private IList fees = new List(); private bool? taxable; private string categoryId; private bool? availableForPickup; @@ -325,4 +325,4 @@ public V1Item Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ItemImage.cs b/Square/Models/V1ItemImage.cs index 73f62d6e..14ac66f4 100644 --- a/Square/Models/V1ItemImage.cs +++ b/Square/Models/V1ItemImage.cs @@ -66,4 +66,4 @@ public V1ItemImage Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListBankAccountsResponse.cs b/Square/Models/V1ListBankAccountsResponse.cs index 7dc25a3f..7952fce7 100644 --- a/Square/Models/V1ListBankAccountsResponse.cs +++ b/Square/Models/V1ListBankAccountsResponse.cs @@ -20,7 +20,7 @@ public V1ListBankAccountsResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListBankAccountsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListCashDrawerShiftsRequest.cs b/Square/Models/V1ListCashDrawerShiftsRequest.cs index d7799c36..35ea30b8 100644 --- a/Square/Models/V1ListCashDrawerShiftsRequest.cs +++ b/Square/Models/V1ListCashDrawerShiftsRequest.cs @@ -83,4 +83,4 @@ public V1ListCashDrawerShiftsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListCashDrawerShiftsResponse.cs b/Square/Models/V1ListCashDrawerShiftsResponse.cs index c82fb0b6..8bcf4bd2 100644 --- a/Square/Models/V1ListCashDrawerShiftsResponse.cs +++ b/Square/Models/V1ListCashDrawerShiftsResponse.cs @@ -20,7 +20,7 @@ public V1ListCashDrawerShiftsResponse(IList items = nu } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListCashDrawerShiftsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListCategoriesResponse.cs b/Square/Models/V1ListCategoriesResponse.cs index b7a9beb0..17af4e82 100644 --- a/Square/Models/V1ListCategoriesResponse.cs +++ b/Square/Models/V1ListCategoriesResponse.cs @@ -20,7 +20,7 @@ public V1ListCategoriesResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListCategoriesResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListDiscountsResponse.cs b/Square/Models/V1ListDiscountsResponse.cs index 31295edd..872b19a8 100644 --- a/Square/Models/V1ListDiscountsResponse.cs +++ b/Square/Models/V1ListDiscountsResponse.cs @@ -20,7 +20,7 @@ public V1ListDiscountsResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListDiscountsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListEmployeeRolesRequest.cs b/Square/Models/V1ListEmployeeRolesRequest.cs index 55be0e8d..3fc02618 100644 --- a/Square/Models/V1ListEmployeeRolesRequest.cs +++ b/Square/Models/V1ListEmployeeRolesRequest.cs @@ -84,4 +84,4 @@ public V1ListEmployeeRolesRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListEmployeeRolesResponse.cs b/Square/Models/V1ListEmployeeRolesResponse.cs index e2de8a0c..91c6e7c3 100644 --- a/Square/Models/V1ListEmployeeRolesResponse.cs +++ b/Square/Models/V1ListEmployeeRolesResponse.cs @@ -20,7 +20,7 @@ public V1ListEmployeeRolesResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListEmployeeRolesResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListEmployeesRequest.cs b/Square/Models/V1ListEmployeesRequest.cs index 008c461d..4ba7cc8f 100644 --- a/Square/Models/V1ListEmployeesRequest.cs +++ b/Square/Models/V1ListEmployeesRequest.cs @@ -66,7 +66,7 @@ public class V1ListEmployeesRequest public string EndCreatedAt { get; } /// - /// TODO: Write general description for this method + /// Getter for status /// [JsonProperty("status")] public string Status { get; } @@ -186,4 +186,4 @@ public V1ListEmployeesRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListEmployeesResponse.cs b/Square/Models/V1ListEmployeesResponse.cs index 6376675c..049c3487 100644 --- a/Square/Models/V1ListEmployeesResponse.cs +++ b/Square/Models/V1ListEmployeesResponse.cs @@ -20,7 +20,7 @@ public V1ListEmployeesResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListEmployeesResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListFeesResponse.cs b/Square/Models/V1ListFeesResponse.cs index 2117aa5e..26ded3de 100644 --- a/Square/Models/V1ListFeesResponse.cs +++ b/Square/Models/V1ListFeesResponse.cs @@ -20,7 +20,7 @@ public V1ListFeesResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListFeesResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListInventoryRequest.cs b/Square/Models/V1ListInventoryRequest.cs index f434c139..241f205c 100644 --- a/Square/Models/V1ListInventoryRequest.cs +++ b/Square/Models/V1ListInventoryRequest.cs @@ -67,4 +67,4 @@ public V1ListInventoryRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListInventoryResponse.cs b/Square/Models/V1ListInventoryResponse.cs index b3a402f3..8b106182 100644 --- a/Square/Models/V1ListInventoryResponse.cs +++ b/Square/Models/V1ListInventoryResponse.cs @@ -20,7 +20,7 @@ public V1ListInventoryResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListInventoryResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListItemsRequest.cs b/Square/Models/V1ListItemsRequest.cs index b3a5d65b..19855ff7 100644 --- a/Square/Models/V1ListItemsRequest.cs +++ b/Square/Models/V1ListItemsRequest.cs @@ -50,4 +50,4 @@ public V1ListItemsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListItemsResponse.cs b/Square/Models/V1ListItemsResponse.cs index c5080f70..f1585f0a 100644 --- a/Square/Models/V1ListItemsResponse.cs +++ b/Square/Models/V1ListItemsResponse.cs @@ -20,7 +20,7 @@ public V1ListItemsResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListItemsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListLocationsResponse.cs b/Square/Models/V1ListLocationsResponse.cs index 63562d18..4e27df89 100644 --- a/Square/Models/V1ListLocationsResponse.cs +++ b/Square/Models/V1ListLocationsResponse.cs @@ -20,7 +20,7 @@ public V1ListLocationsResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListLocationsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListModifierListsResponse.cs b/Square/Models/V1ListModifierListsResponse.cs index f037506d..48990b04 100644 --- a/Square/Models/V1ListModifierListsResponse.cs +++ b/Square/Models/V1ListModifierListsResponse.cs @@ -20,7 +20,7 @@ public V1ListModifierListsResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListModifierListsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListOrdersRequest.cs b/Square/Models/V1ListOrdersRequest.cs index 57a0130a..19375868 100644 --- a/Square/Models/V1ListOrdersRequest.cs +++ b/Square/Models/V1ListOrdersRequest.cs @@ -84,4 +84,4 @@ public V1ListOrdersRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListOrdersResponse.cs b/Square/Models/V1ListOrdersResponse.cs index b213400b..93d62569 100644 --- a/Square/Models/V1ListOrdersResponse.cs +++ b/Square/Models/V1ListOrdersResponse.cs @@ -20,7 +20,7 @@ public V1ListOrdersResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListOrdersResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListPagesResponse.cs b/Square/Models/V1ListPagesResponse.cs index 6826cd9b..df99543d 100644 --- a/Square/Models/V1ListPagesResponse.cs +++ b/Square/Models/V1ListPagesResponse.cs @@ -20,7 +20,7 @@ public V1ListPagesResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListPagesResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListPaymentsRequest.cs b/Square/Models/V1ListPaymentsRequest.cs index c41eb685..bef88797 100644 --- a/Square/Models/V1ListPaymentsRequest.cs +++ b/Square/Models/V1ListPaymentsRequest.cs @@ -135,4 +135,4 @@ public V1ListPaymentsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListPaymentsResponse.cs b/Square/Models/V1ListPaymentsResponse.cs index a600556e..8d86e107 100644 --- a/Square/Models/V1ListPaymentsResponse.cs +++ b/Square/Models/V1ListPaymentsResponse.cs @@ -20,7 +20,7 @@ public V1ListPaymentsResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListPaymentsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListRefundsRequest.cs b/Square/Models/V1ListRefundsRequest.cs index 086a7c8f..0e5b088f 100644 --- a/Square/Models/V1ListRefundsRequest.cs +++ b/Square/Models/V1ListRefundsRequest.cs @@ -118,4 +118,4 @@ public V1ListRefundsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListRefundsResponse.cs b/Square/Models/V1ListRefundsResponse.cs index 2aa77def..eb3c87cc 100644 --- a/Square/Models/V1ListRefundsResponse.cs +++ b/Square/Models/V1ListRefundsResponse.cs @@ -20,7 +20,7 @@ public V1ListRefundsResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListRefundsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListSettlementsRequest.cs b/Square/Models/V1ListSettlementsRequest.cs index dac4003c..750e7a9d 100644 --- a/Square/Models/V1ListSettlementsRequest.cs +++ b/Square/Models/V1ListSettlementsRequest.cs @@ -48,13 +48,13 @@ public class V1ListSettlementsRequest public string EndTime { get; } /// - /// The maximum number of payments to return in a single response. This value cannot exceed 200. + /// The maximum number of settlements to return in a single response. This value cannot exceed 200. /// [JsonProperty("limit")] public int? Limit { get; } /// - /// TODO: Write general description for this method + /// Getter for status /// [JsonProperty("status")] public string Status { get; } @@ -135,4 +135,4 @@ public V1ListSettlementsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListSettlementsResponse.cs b/Square/Models/V1ListSettlementsResponse.cs index 4ba98adc..32e6b5d2 100644 --- a/Square/Models/V1ListSettlementsResponse.cs +++ b/Square/Models/V1ListSettlementsResponse.cs @@ -20,7 +20,7 @@ public V1ListSettlementsResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListSettlementsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListTimecardEventsResponse.cs b/Square/Models/V1ListTimecardEventsResponse.cs index e7638e0e..e22b3457 100644 --- a/Square/Models/V1ListTimecardEventsResponse.cs +++ b/Square/Models/V1ListTimecardEventsResponse.cs @@ -20,7 +20,7 @@ public V1ListTimecardEventsResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListTimecardEventsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListTimecardsRequest.cs b/Square/Models/V1ListTimecardsRequest.cs index 8d9ef2ba..a16bca49 100644 --- a/Square/Models/V1ListTimecardsRequest.cs +++ b/Square/Models/V1ListTimecardsRequest.cs @@ -220,4 +220,4 @@ public V1ListTimecardsRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ListTimecardsResponse.cs b/Square/Models/V1ListTimecardsResponse.cs index 36665ac7..dfb3b04a 100644 --- a/Square/Models/V1ListTimecardsResponse.cs +++ b/Square/Models/V1ListTimecardsResponse.cs @@ -20,7 +20,7 @@ public V1ListTimecardsResponse(IList items = null) } /// - /// TODO: Write general description for this method + /// Getter for items /// [JsonProperty("items")] public IList Items { get; } @@ -34,7 +34,7 @@ public Builder ToBuilder() public class Builder { - private IList items; + private IList items = new List(); public Builder() { } public Builder Items(IList value) @@ -49,4 +49,4 @@ public V1ListTimecardsResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Merchant.cs b/Square/Models/V1Merchant.cs index 5162bb12..5fe7c70d 100644 --- a/Square/Models/V1Merchant.cs +++ b/Square/Models/V1Merchant.cs @@ -70,7 +70,7 @@ public class V1Merchant public string Email { get; } /// - /// TODO: Write general description for this method + /// Getter for account_type /// [JsonProperty("account_type")] public string AccountType { get; } @@ -118,7 +118,7 @@ public class V1Merchant public Models.V1PhoneNumber BusinessPhone { get; } /// - /// TODO: Write general description for this method + /// Getter for business_type /// [JsonProperty("business_type")] public string BusinessType { get; } @@ -168,7 +168,7 @@ public class Builder private string name; private string email; private string accountType; - private IList accountCapabilities; + private IList accountCapabilities = new List(); private string countryCode; private string languageCode; private string currencyCode; @@ -291,4 +291,4 @@ public V1Merchant Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1MerchantLocationDetails.cs b/Square/Models/V1MerchantLocationDetails.cs index d94efb5b..b6f66c20 100644 --- a/Square/Models/V1MerchantLocationDetails.cs +++ b/Square/Models/V1MerchantLocationDetails.cs @@ -49,4 +49,4 @@ public V1MerchantLocationDetails Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ModifierList.cs b/Square/Models/V1ModifierList.cs index 82de15b1..24a96672 100644 --- a/Square/Models/V1ModifierList.cs +++ b/Square/Models/V1ModifierList.cs @@ -44,7 +44,7 @@ public class V1ModifierList public string Name { get; } /// - /// TODO: Write general description for this method + /// Getter for selection_type /// [JsonProperty("selection_type")] public string SelectionType { get; } @@ -77,7 +77,7 @@ public class Builder private string id; private string name; private string selectionType; - private IList modifierOptions; + private IList modifierOptions = new List(); private string v2Id; public Builder() { } @@ -121,4 +121,4 @@ public V1ModifierList Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1ModifierOption.cs b/Square/Models/V1ModifierOption.cs index b47a9a51..44910891 100644 --- a/Square/Models/V1ModifierOption.cs +++ b/Square/Models/V1ModifierOption.cs @@ -48,7 +48,7 @@ public class V1ModifierOption public string Name { get; } /// - /// TODO: Write general description for this method + /// Getter for price_money /// [JsonProperty("price_money")] public Models.V1Money PriceMoney { get; } @@ -155,4 +155,4 @@ public V1ModifierOption Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Money.cs b/Square/Models/V1Money.cs index bedb02de..3f6bde70 100644 --- a/Square/Models/V1Money.cs +++ b/Square/Models/V1Money.cs @@ -68,4 +68,4 @@ public V1Money Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Order.cs b/Square/Models/V1Order.cs index ca6d735d..0fe0012b 100644 --- a/Square/Models/V1Order.cs +++ b/Square/Models/V1Order.cs @@ -102,7 +102,7 @@ public class V1Order public string RecipientPhoneNumber { get; } /// - /// TODO: Write general description for this method + /// Getter for state /// [JsonProperty("state")] public string State { get; } @@ -114,31 +114,31 @@ public class V1Order public Models.Address ShippingAddress { get; } /// - /// TODO: Write general description for this method + /// Getter for subtotal_money /// [JsonProperty("subtotal_money")] public Models.V1Money SubtotalMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for total_shipping_money /// [JsonProperty("total_shipping_money")] public Models.V1Money TotalShippingMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for total_tax_money /// [JsonProperty("total_tax_money")] public Models.V1Money TotalTaxMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for total_price_money /// [JsonProperty("total_price_money")] public Models.V1Money TotalPriceMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for total_discount_money /// [JsonProperty("total_discount_money")] public Models.V1Money TotalDiscountMoney { get; } @@ -270,7 +270,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private string id; private string buyerEmail; private string recipientName; @@ -291,7 +291,7 @@ public class Builder private string refundedNote; private string canceledNote; private Models.V1Tender tender; - private IList orderHistory; + private IList orderHistory = new List(); private string promoCode; private string btcReceiveAddress; private double? btcPriceSatoshi; @@ -477,4 +477,4 @@ public V1Order Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1OrderHistoryEntry.cs b/Square/Models/V1OrderHistoryEntry.cs index 290b2373..de3c797c 100644 --- a/Square/Models/V1OrderHistoryEntry.cs +++ b/Square/Models/V1OrderHistoryEntry.cs @@ -22,7 +22,7 @@ public class V1OrderHistoryEntry } /// - /// TODO: Write general description for this method + /// Getter for action /// [JsonProperty("action")] public string Action { get; } @@ -66,4 +66,4 @@ public V1OrderHistoryEntry Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Page.cs b/Square/Models/V1Page.cs index 15903bdc..253b5fb7 100644 --- a/Square/Models/V1Page.cs +++ b/Square/Models/V1Page.cs @@ -68,7 +68,7 @@ public class Builder private string id; private string name; private int? pageIndex; - private IList cells; + private IList cells = new List(); public Builder() { } public Builder Id(string value) @@ -104,4 +104,4 @@ public V1Page Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1PageCell.cs b/Square/Models/V1PageCell.cs index ea3e0470..82844006 100644 --- a/Square/Models/V1PageCell.cs +++ b/Square/Models/V1PageCell.cs @@ -48,7 +48,7 @@ public class V1PageCell public int? Column { get; } /// - /// TODO: Write general description for this method + /// Getter for object_type /// [JsonProperty("object_type")] public string ObjectType { get; } @@ -60,7 +60,7 @@ public class V1PageCell public string ObjectId { get; } /// - /// TODO: Write general description for this method + /// Getter for placeholder_type /// [JsonProperty("placeholder_type")] public string PlaceholderType { get; } @@ -134,4 +134,4 @@ public V1PageCell Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Payment.cs b/Square/Models/V1Payment.cs index 1ef119c7..a5f3ad7b 100644 --- a/Square/Models/V1Payment.cs +++ b/Square/Models/V1Payment.cs @@ -100,7 +100,7 @@ public class V1Payment public string CreatorId { get; } /// - /// TODO: Write general description for this method + /// Getter for device /// [JsonProperty("device")] public Models.Device Device { get; } @@ -122,73 +122,73 @@ public class V1Payment public string ReceiptUrl { get; } /// - /// TODO: Write general description for this method + /// Getter for inclusive_tax_money /// [JsonProperty("inclusive_tax_money")] public Models.V1Money InclusiveTaxMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for additive_tax_money /// [JsonProperty("additive_tax_money")] public Models.V1Money AdditiveTaxMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for tax_money /// [JsonProperty("tax_money")] public Models.V1Money TaxMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for tip_money /// [JsonProperty("tip_money")] public Models.V1Money TipMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for discount_money /// [JsonProperty("discount_money")] public Models.V1Money DiscountMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for total_collected_money /// [JsonProperty("total_collected_money")] public Models.V1Money TotalCollectedMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for processing_fee_money /// [JsonProperty("processing_fee_money")] public Models.V1Money ProcessingFeeMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for net_total_money /// [JsonProperty("net_total_money")] public Models.V1Money NetTotalMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for refunded_money /// [JsonProperty("refunded_money")] public Models.V1Money RefundedMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for swedish_rounding_money /// [JsonProperty("swedish_rounding_money")] public Models.V1Money SwedishRoundingMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for gross_sales_money /// [JsonProperty("gross_sales_money")] public Models.V1Money GrossSalesMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for net_sales_money /// [JsonProperty("net_sales_money")] public Models.V1Money NetSalesMoney { get; } @@ -224,7 +224,7 @@ public class V1Payment public IList Itemizations { get; } /// - /// TODO: Write general description for this method + /// Getter for surcharge_money /// [JsonProperty("surcharge_money")] public Models.V1Money SurchargeMoney { get; } @@ -297,13 +297,13 @@ public class Builder 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 IList inclusiveTax = new List(); + private IList additiveTax = new List(); + private IList tender = new List(); + private IList refunds = new List(); + private IList itemizations = new List(); private Models.V1Money surchargeMoney; - private IList surcharges; + private IList surcharges = new List(); private bool? isPartial; public Builder() { } @@ -501,4 +501,4 @@ public V1Payment Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1PaymentDiscount.cs b/Square/Models/V1PaymentDiscount.cs index ccd0f4b3..6b080d1b 100644 --- a/Square/Models/V1PaymentDiscount.cs +++ b/Square/Models/V1PaymentDiscount.cs @@ -30,7 +30,7 @@ public class V1PaymentDiscount public string Name { get; } /// - /// TODO: Write general description for this method + /// Getter for applied_money /// [JsonProperty("applied_money")] public Models.V1Money AppliedMoney { get; } @@ -83,4 +83,4 @@ public V1PaymentDiscount Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1PaymentItemDetail.cs b/Square/Models/V1PaymentItemDetail.cs index 54cf9d63..a7cd3729 100644 --- a/Square/Models/V1PaymentItemDetail.cs +++ b/Square/Models/V1PaymentItemDetail.cs @@ -100,4 +100,4 @@ public V1PaymentItemDetail Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1PaymentItemization.cs b/Square/Models/V1PaymentItemization.cs index a48c0b0f..2e88c39b 100644 --- a/Square/Models/V1PaymentItemization.cs +++ b/Square/Models/V1PaymentItemization.cs @@ -58,7 +58,7 @@ public class V1PaymentItemization public double? Quantity { get; } /// - /// TODO: Write general description for this method + /// Getter for itemization_type /// [JsonProperty("itemization_type")] public string ItemizationType { get; } @@ -82,31 +82,31 @@ public class V1PaymentItemization public string ItemVariationName { get; } /// - /// TODO: Write general description for this method + /// Getter for total_money /// [JsonProperty("total_money")] public Models.V1Money TotalMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for single_quantity_money /// [JsonProperty("single_quantity_money")] public Models.V1Money SingleQuantityMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for gross_sales_money /// [JsonProperty("gross_sales_money")] public Models.V1Money GrossSalesMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for discount_money /// [JsonProperty("discount_money")] public Models.V1Money DiscountMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for net_sales_money /// [JsonProperty("net_sales_money")] public Models.V1Money NetSalesMoney { get; } @@ -162,9 +162,9 @@ public class Builder private Models.V1Money grossSalesMoney; private Models.V1Money discountMoney; private Models.V1Money netSalesMoney; - private IList taxes; - private IList discounts; - private IList modifiers; + private IList taxes = new List(); + private IList discounts = new List(); + private IList modifiers = new List(); public Builder() { } public Builder Name(string value) @@ -270,4 +270,4 @@ public V1PaymentItemization Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1PaymentModifier.cs b/Square/Models/V1PaymentModifier.cs index 10bf41fc..dff3f0ab 100644 --- a/Square/Models/V1PaymentModifier.cs +++ b/Square/Models/V1PaymentModifier.cs @@ -30,7 +30,7 @@ public class V1PaymentModifier public string Name { get; } /// - /// TODO: Write general description for this method + /// Getter for applied_money /// [JsonProperty("applied_money")] public Models.V1Money AppliedMoney { get; } @@ -83,4 +83,4 @@ public V1PaymentModifier Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1PaymentSurcharge.cs b/Square/Models/V1PaymentSurcharge.cs index 472fb112..54b1a4ed 100644 --- a/Square/Models/V1PaymentSurcharge.cs +++ b/Square/Models/V1PaymentSurcharge.cs @@ -40,7 +40,7 @@ public class V1PaymentSurcharge public string Name { get; } /// - /// TODO: Write general description for this method + /// Getter for applied_money /// [JsonProperty("applied_money")] public Models.V1Money AppliedMoney { get; } @@ -52,13 +52,13 @@ public class V1PaymentSurcharge public string Rate { get; } /// - /// TODO: Write general description for this method + /// Getter for amount_money /// [JsonProperty("amount_money")] public Models.V1Money AmountMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for type /// [JsonProperty("type")] public string Type { get; } @@ -103,7 +103,7 @@ public class Builder private Models.V1Money amountMoney; private string type; private bool? taxable; - private IList taxes; + private IList taxes = new List(); private string surchargeId; public Builder() { } @@ -168,4 +168,4 @@ public V1PaymentSurcharge Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1PaymentTax.cs b/Square/Models/V1PaymentTax.cs index 4f7dc841..e1941128 100644 --- a/Square/Models/V1PaymentTax.cs +++ b/Square/Models/V1PaymentTax.cs @@ -42,7 +42,7 @@ public class V1PaymentTax public string Name { get; } /// - /// TODO: Write general description for this method + /// Getter for applied_money /// [JsonProperty("applied_money")] public Models.V1Money AppliedMoney { get; } @@ -54,7 +54,7 @@ public class V1PaymentTax public string Rate { get; } /// - /// TODO: Write general description for this method + /// Getter for inclusion_type /// [JsonProperty("inclusion_type")] public string InclusionType { get; } @@ -79,7 +79,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); private string name; private Models.V1Money appliedMoney; private string rate; @@ -134,4 +134,4 @@ public V1PaymentTax Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1PhoneNumber.cs b/Square/Models/V1PhoneNumber.cs index ab170e77..d7f3e906 100644 --- a/Square/Models/V1PhoneNumber.cs +++ b/Square/Models/V1PhoneNumber.cs @@ -70,4 +70,4 @@ public V1PhoneNumber Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Refund.cs b/Square/Models/V1Refund.cs index 6d691076..0b50efa0 100644 --- a/Square/Models/V1Refund.cs +++ b/Square/Models/V1Refund.cs @@ -58,7 +58,7 @@ public class V1Refund public HttpContext Context { get; internal set; } /// - /// TODO: Write general description for this method + /// Getter for type /// [JsonProperty("type")] public string Type { get; } @@ -70,25 +70,25 @@ public class V1Refund public string Reason { get; } /// - /// TODO: Write general description for this method + /// Getter for refunded_money /// [JsonProperty("refunded_money")] public Models.V1Money RefundedMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for refunded_processing_fee_money /// [JsonProperty("refunded_processing_fee_money")] public Models.V1Money RefundedProcessingFeeMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for refunded_tax_money /// [JsonProperty("refunded_tax_money")] public Models.V1Money RefundedTaxMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for refunded_additive_tax_money /// [JsonProperty("refunded_additive_tax_money")] public Models.V1Money RefundedAdditiveTaxMoney { get; } @@ -100,7 +100,7 @@ public class V1Refund public IList RefundedAdditiveTax { get; } /// - /// TODO: Write general description for this method + /// Getter for refunded_inclusive_tax_money /// [JsonProperty("refunded_inclusive_tax_money")] public Models.V1Money RefundedInclusiveTaxMoney { get; } @@ -112,19 +112,19 @@ public class V1Refund public IList RefundedInclusiveTax { get; } /// - /// TODO: Write general description for this method + /// Getter for refunded_tip_money /// [JsonProperty("refunded_tip_money")] public Models.V1Money RefundedTipMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for refunded_discount_money /// [JsonProperty("refunded_discount_money")] public Models.V1Money RefundedDiscountMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for refunded_surcharge_money /// [JsonProperty("refunded_surcharge_money")] public Models.V1Money RefundedSurchargeMoney { get; } @@ -154,7 +154,7 @@ public class V1Refund public string PaymentId { get; } /// - /// TODO: Write general description for this method + /// Getter for merchant_id /// [JsonProperty("merchant_id")] public string MerchantId { get; } @@ -197,13 +197,13 @@ public class Builder private Models.V1Money refundedProcessingFeeMoney; private Models.V1Money refundedTaxMoney; private Models.V1Money refundedAdditiveTaxMoney; - private IList refundedAdditiveTax; + private IList refundedAdditiveTax = new List(); private Models.V1Money refundedInclusiveTaxMoney; - private IList refundedInclusiveTax; + private IList refundedInclusiveTax = new List(); private Models.V1Money refundedTipMoney; private Models.V1Money refundedDiscountMoney; private Models.V1Money refundedSurchargeMoney; - private IList refundedSurcharges; + private IList refundedSurcharges = new List(); private string createdAt; private string processedAt; private string paymentId; @@ -342,4 +342,4 @@ public V1Refund Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Settlement.cs b/Square/Models/V1Settlement.cs index 1d3f3694..0bcc9d29 100644 --- a/Square/Models/V1Settlement.cs +++ b/Square/Models/V1Settlement.cs @@ -40,13 +40,13 @@ public class V1Settlement public string Id { get; } /// - /// TODO: Write general description for this method + /// Getter for status /// [JsonProperty("status")] public string Status { get; } /// - /// TODO: Write general description for this method + /// Getter for total_money /// [JsonProperty("total_money")] public Models.V1Money TotalMoney { get; } @@ -88,7 +88,7 @@ public class Builder private Models.V1Money totalMoney; private string initiatedAt; private string bankAccountId; - private IList entries; + private IList entries = new List(); public Builder() { } public Builder Id(string value) @@ -138,4 +138,4 @@ public V1Settlement Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1SettlementEntry.cs b/Square/Models/V1SettlementEntry.cs index 268ecc70..1c023862 100644 --- a/Square/Models/V1SettlementEntry.cs +++ b/Square/Models/V1SettlementEntry.cs @@ -32,19 +32,19 @@ public class V1SettlementEntry public string PaymentId { get; } /// - /// TODO: Write general description for this method + /// Getter for type /// [JsonProperty("type")] public string Type { get; } /// - /// TODO: Write general description for this method + /// Getter for amount_money /// [JsonProperty("amount_money")] public Models.V1Money AmountMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for fee_money /// [JsonProperty("fee_money")] public Models.V1Money FeeMoney { get; } @@ -100,4 +100,4 @@ public V1SettlementEntry Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Tender.cs b/Square/Models/V1Tender.cs index 11707d2b..9152f65c 100644 --- a/Square/Models/V1Tender.cs +++ b/Square/Models/V1Tender.cs @@ -56,7 +56,7 @@ public class V1Tender public string Id { get; } /// - /// TODO: Write general description for this method + /// Getter for type /// [JsonProperty("type")] public string Type { get; } @@ -92,7 +92,7 @@ public class V1Tender public string PanSuffix { get; } /// - /// TODO: Write general description for this method + /// Getter for entry_method /// [JsonProperty("entry_method")] public string EntryMethod { get; } @@ -104,13 +104,13 @@ public class V1Tender public string PaymentNote { get; } /// - /// TODO: Write general description for this method + /// Getter for total_money /// [JsonProperty("total_money")] public Models.V1Money TotalMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for tendered_money /// [JsonProperty("tendered_money")] public Models.V1Money TenderedMoney { get; } @@ -128,13 +128,13 @@ public class V1Tender public string SettledAt { get; } /// - /// TODO: Write general description for this method + /// Getter for change_back_money /// [JsonProperty("change_back_money")] public Models.V1Money ChangeBackMoney { get; } /// - /// TODO: Write general description for this method + /// Getter for refunded_money /// [JsonProperty("refunded_money")] public Models.V1Money RefundedMoney { get; } @@ -304,4 +304,4 @@ public V1Tender Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Timecard.cs b/Square/Models/V1Timecard.cs index bade9605..d7840e47 100644 --- a/Square/Models/V1Timecard.cs +++ b/Square/Models/V1Timecard.cs @@ -242,4 +242,4 @@ public V1Timecard Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1TimecardEvent.cs b/Square/Models/V1TimecardEvent.cs index 1faaf4bb..c0d2fd74 100644 --- a/Square/Models/V1TimecardEvent.cs +++ b/Square/Models/V1TimecardEvent.cs @@ -123,4 +123,4 @@ public V1TimecardEvent Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1UpdateCategoryRequest.cs b/Square/Models/V1UpdateCategoryRequest.cs index f8adfe14..b6d37322 100644 --- a/Square/Models/V1UpdateCategoryRequest.cs +++ b/Square/Models/V1UpdateCategoryRequest.cs @@ -51,4 +51,4 @@ public V1UpdateCategoryRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1UpdateDiscountRequest.cs b/Square/Models/V1UpdateDiscountRequest.cs index 982d452e..ccd7e0ba 100644 --- a/Square/Models/V1UpdateDiscountRequest.cs +++ b/Square/Models/V1UpdateDiscountRequest.cs @@ -51,4 +51,4 @@ public V1UpdateDiscountRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1UpdateEmployeeRequest.cs b/Square/Models/V1UpdateEmployeeRequest.cs index 05a5c97e..4e783896 100644 --- a/Square/Models/V1UpdateEmployeeRequest.cs +++ b/Square/Models/V1UpdateEmployeeRequest.cs @@ -51,4 +51,4 @@ public V1UpdateEmployeeRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1UpdateEmployeeRoleRequest.cs b/Square/Models/V1UpdateEmployeeRoleRequest.cs index e00516f9..cfa1d5a9 100644 --- a/Square/Models/V1UpdateEmployeeRoleRequest.cs +++ b/Square/Models/V1UpdateEmployeeRoleRequest.cs @@ -51,4 +51,4 @@ public V1UpdateEmployeeRoleRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1UpdateFeeRequest.cs b/Square/Models/V1UpdateFeeRequest.cs index d06e9114..c3119db0 100644 --- a/Square/Models/V1UpdateFeeRequest.cs +++ b/Square/Models/V1UpdateFeeRequest.cs @@ -51,4 +51,4 @@ public V1UpdateFeeRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1UpdateItemRequest.cs b/Square/Models/V1UpdateItemRequest.cs index 613c61de..d1803c24 100644 --- a/Square/Models/V1UpdateItemRequest.cs +++ b/Square/Models/V1UpdateItemRequest.cs @@ -51,4 +51,4 @@ public V1UpdateItemRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1UpdateModifierListRequest.cs b/Square/Models/V1UpdateModifierListRequest.cs index d397ea1a..a771a4a3 100644 --- a/Square/Models/V1UpdateModifierListRequest.cs +++ b/Square/Models/V1UpdateModifierListRequest.cs @@ -28,7 +28,7 @@ public class V1UpdateModifierListRequest public string Name { get; } /// - /// TODO: Write general description for this method + /// Getter for selection_type /// [JsonProperty("selection_type")] public string SelectionType { get; } @@ -66,4 +66,4 @@ public V1UpdateModifierListRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1UpdateModifierOptionRequest.cs b/Square/Models/V1UpdateModifierOptionRequest.cs index 678faf98..9801c4d7 100644 --- a/Square/Models/V1UpdateModifierOptionRequest.cs +++ b/Square/Models/V1UpdateModifierOptionRequest.cs @@ -51,4 +51,4 @@ public V1UpdateModifierOptionRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1UpdateOrderRequest.cs b/Square/Models/V1UpdateOrderRequest.cs index c553fe3d..1e311a8e 100644 --- a/Square/Models/V1UpdateOrderRequest.cs +++ b/Square/Models/V1UpdateOrderRequest.cs @@ -28,7 +28,7 @@ public class V1UpdateOrderRequest } /// - /// TODO: Write general description for this method + /// Getter for action /// [JsonProperty("action")] public string Action { get; } @@ -119,4 +119,4 @@ public V1UpdateOrderRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1UpdatePageCellRequest.cs b/Square/Models/V1UpdatePageCellRequest.cs index 97ce2f71..ecce59b1 100644 --- a/Square/Models/V1UpdatePageCellRequest.cs +++ b/Square/Models/V1UpdatePageCellRequest.cs @@ -51,4 +51,4 @@ public V1UpdatePageCellRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1UpdatePageRequest.cs b/Square/Models/V1UpdatePageRequest.cs index 3e0840f0..e4265d27 100644 --- a/Square/Models/V1UpdatePageRequest.cs +++ b/Square/Models/V1UpdatePageRequest.cs @@ -51,4 +51,4 @@ public V1UpdatePageRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1UpdateTimecardRequest.cs b/Square/Models/V1UpdateTimecardRequest.cs index 27ca1e4b..c9e3cccb 100644 --- a/Square/Models/V1UpdateTimecardRequest.cs +++ b/Square/Models/V1UpdateTimecardRequest.cs @@ -51,4 +51,4 @@ public V1UpdateTimecardRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1UpdateVariationRequest.cs b/Square/Models/V1UpdateVariationRequest.cs index 9eee4d95..93829a61 100644 --- a/Square/Models/V1UpdateVariationRequest.cs +++ b/Square/Models/V1UpdateVariationRequest.cs @@ -51,4 +51,4 @@ public V1UpdateVariationRequest Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/V1Variation.cs b/Square/Models/V1Variation.cs index 5494802a..4e9478ce 100644 --- a/Square/Models/V1Variation.cs +++ b/Square/Models/V1Variation.cs @@ -70,13 +70,13 @@ public class V1Variation public int? Ordinal { get; } /// - /// TODO: Write general description for this method + /// Getter for pricing_type /// [JsonProperty("pricing_type")] public string PricingType { get; } /// - /// TODO: Write general description for this method + /// Getter for price_money /// [JsonProperty("price_money")] public Models.V1Money PriceMoney { get; } @@ -94,7 +94,7 @@ public class V1Variation public bool? TrackInventory { get; } /// - /// TODO: Write general description for this method + /// Getter for inventory_alert_type /// [JsonProperty("inventory_alert_type")] public string InventoryAlertType { get; } @@ -240,4 +240,4 @@ public V1Variation Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/VoidTransactionResponse.cs b/Square/Models/VoidTransactionResponse.cs index 349ecf45..5870d3f8 100644 --- a/Square/Models/VoidTransactionResponse.cs +++ b/Square/Models/VoidTransactionResponse.cs @@ -38,7 +38,7 @@ public Builder ToBuilder() public class Builder { - private IList errors; + private IList errors = new List(); public Builder() { } public Builder Errors(IList value) @@ -53,4 +53,4 @@ public VoidTransactionResponse Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Models/WorkweekConfig.cs b/Square/Models/WorkweekConfig.cs index 00ad6cb7..0ac902ba 100644 --- a/Square/Models/WorkweekConfig.cs +++ b/Square/Models/WorkweekConfig.cs @@ -143,4 +143,4 @@ public WorkweekConfig Build() } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Square/Square.csproj b/Square/Square.csproj index 1530458d..a4f99e4b 100644 --- a/Square/Square.csproj +++ b/Square/Square.csproj @@ -4,15 +4,15 @@ netstandard1.3 Square - 4.0.0 - Square - Square + 4.1.0 + Square Developer Platform + Square Developer Platform Square https://github.com/square/square-dotnet-sdk/blob/master/LICENSE https://github.com/square/square-dotnet-sdk Copyright © 2019 - 4.0.0 - 4.0.0 + 4.1.0 + 4.1.0 .NET client library for the Square API @@ -22,5 +22,4 @@ <_Parameter1>Square.Tests - \ No newline at end of file diff --git a/Square/SquareClient.cs b/Square/SquareClient.cs index af0b4f96..ce6b2ea5 100644 --- a/Square/SquareClient.cs +++ b/Square/SquareClient.cs @@ -1,17 +1,20 @@ using System; using System.Text; using System.Linq; +using System.Net; using System.Collections.Generic; +using Square.Authentication; using Square.Apis; using Square.Http.Client; using Square.Utilities; namespace Square { - public sealed class SquareClient : ISquareClient + public sealed class SquareClient : ISquareClient { - private readonly IDictionary> additionalHeaders; private readonly IDictionary authManagers; + private readonly IDictionary> additionalHeaders; + private readonly AccessTokenManager accessTokenManager; private readonly IHttpClient httpClient; private readonly HttpCallBack httpCallBack; private readonly Lazy mobileAuthorization; @@ -149,12 +152,12 @@ public sealed class SquareClient : ISquareClient /// /// Current version of the SDK /// - public string SdkVersion => "4.0.0"; + public string SdkVersion => "4.1.0"; /// /// Version of Square API supported by this SDK /// - public string SquareVersion => "2019-12-17"; + public string SquareVersion => "2020-01-22"; internal static SquareClient CreateFromEnvironment() { @@ -184,15 +187,18 @@ internal static SquareClient CreateFromEnvironment() private SquareClient(TimeSpan timeout, string accessToken, Environment environment, IDictionary authManagers, IHttpClient httpClient, - HttpCallBack httpCallBack, IDictionary> additionalHeaders) - { + HttpCallBack httpCallBack, IDictionary> additionalHeaders, + IHttpClientConfiguration httpClientConfiguration) + { Timeout = timeout; AccessToken = accessToken; Environment = environment; this.httpCallBack = httpCallBack; this.httpClient = httpClient; this.authManagers = new Dictionary(authManagers); - this.additionalHeaders = additionalHeaders; + accessTokenManager = new AccessTokenManager(accessToken); + this.additionalHeaders = additionalHeaders; HttpClientConfiguration = httpClientConfiguration; + mobileAuthorization = new Lazy( () => new MobileAuthorizationApi(this, this.httpClient, authManagers, this.httpCallBack)); oAuth = new Lazy( @@ -239,10 +245,15 @@ internal static SquareClient CreateFromEnvironment() if (!authManagers.ContainsKey("default") || ((AccessTokenManager)authManagers["default"]).AccessToken != accessToken) { - authManagers["default"] = new AccessTokenManager(AccessToken); + authManagers["default"] = accessTokenManager; } } + /// + /// The configuration of the Http Client associated with this SquareClient. + /// + public IHttpClientConfiguration HttpClientConfiguration { get; } + /// /// Http client timeout /// @@ -285,7 +296,7 @@ internal static SquareClient CreateFromEnvironment() List> kvpList = new List>() { }; - return kvpList; + return kvpList; } /// @@ -300,16 +311,16 @@ public string GetBaseUri(Server alias = Server.Default) return Url.ToString(); } - public Builder ToBuilder() + public Builder ToBuilder() { - Builder builder = new Builder() - .Timeout(Timeout) - .AccessToken(AccessToken) - .Environment(Environment) - .AuthManagers(authManagers) - .HttpClient(httpClient) - .AdditionalHeaders(additionalHeaders) - .HttpCallBack(httpCallBack); + Builder builder = new Builder(); + builder.Timeout(Timeout); + builder.AccessToken(AccessToken); + builder.Environment(Environment); + builder.AdditionalHeaders(additionalHeaders); + builder.HttpCallBack(httpCallBack); + builder.HttpClient(httpClient); + builder.AuthManagers(authManagers); return builder; } @@ -317,24 +328,14 @@ public Builder ToBuilder() public class Builder { private TimeSpan timeout = TimeSpan.FromSeconds(60); - private string accessToken = "TODO: Replace"; + private string accessToken = String.Empty; private Environment environment = Square.Environment.Production; private IHttpClient httpClient; private IDictionary> additionalHeaders = new Dictionary>(); private IDictionary authManagers = new Dictionary(); - private bool createCustomHttpClient = false; + private HttpClientConfiguration httpClientConfig = new HttpClientConfiguration(); private HttpCallBack httpCallBack; - - // Setter for timeout. Determines whether a new this.httpClient is needed - public Builder Timeout(TimeSpan timeout) - { - if (this.timeout != timeout && timeout.TotalSeconds > 0) - { - this.timeout = timeout; - this.createCustomHttpClient = true; - } - return this; - } + private bool createCustomHttpClient = false; // Setter for AccessToken public Builder AccessToken(string accessToken) @@ -350,9 +351,11 @@ public Builder Environment(Environment environment) return this; } - internal Builder HttpClient(IHttpClient httpClient) + // Setter for Timeout + public Builder Timeout(TimeSpan timeout) { - this.httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); + httpClientConfig.Timeout = timeout.TotalSeconds <= 0 ? TimeSpan.FromSeconds(60) : timeout; + this.createCustomHttpClient = true; return this; } @@ -391,6 +394,12 @@ public Builder AddAdditionalHeader(string headerName, string headerValue) return this; } + internal Builder HttpClient(IHttpClient httpClient) + { + this.httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); + return this; + } + internal Builder AuthManagers(IDictionary authManagers) { this.authManagers = authManagers ?? throw new ArgumentNullException(nameof(authManagers)); @@ -407,7 +416,7 @@ public SquareClient Build() { if (createCustomHttpClient) { - httpClient = new HttpClientWrapper(timeout); + httpClient = new HttpClientWrapper(httpClientConfig); } else { @@ -415,7 +424,7 @@ public SquareClient Build() } return new SquareClient(timeout, accessToken, environment, authManagers, httpClient, httpCallBack, - additionalHeaders); + additionalHeaders, httpClientConfig); } } diff --git a/Square/Utilities/ApiHelper.cs b/Square/Utilities/APIHelper.cs similarity index 97% rename from Square/Utilities/ApiHelper.cs rename to Square/Utilities/APIHelper.cs index 7f0ffa75..de00589f 100644 --- a/Square/Utilities/ApiHelper.cs +++ b/Square/Utilities/APIHelper.cs @@ -19,6 +19,18 @@ public static class ApiHelper //DateTime format to use for parsing and converting dates public static string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"; + /// + /// Creates a deep clone of an object by serializing it into a json string and then + /// deserializing back into an object. + /// + /// The type of the obj parameter as well as the return object + /// The object to clone + /// + internal static T DeepCloneObject(T obj) + { + return JsonDeserialize(JsonSerialize(obj)); + } + /// /// JSON Serialization of a given object. /// @@ -30,7 +42,8 @@ public static string JsonSerialize(object obj, JsonConverter converter = null) if (null == obj) return null; - var settings = new JsonSerializerSettings() { }; + var settings = new JsonSerializerSettings(); + if (converter == null) settings.Converters.Add(new IsoDateTimeConverter()); else @@ -402,7 +415,7 @@ private static string getElementValue(object element, bool urlEncode) converterAttr.ConverterParameters)).Replace("\"", ""); } } - keys.Add(new KeyValuePair(name, (convertedValue) ?? ((DateTime)value).ToString(DateTimeFormat))); + keys.Add(new KeyValuePair(name, (convertedValue) ?? ((DateTime)value).ToString(DateTimeFormat))); } else { diff --git a/doc/apple-pay.md b/doc/apple-pay.md index ae016bcd..0978f802 100644 --- a/doc/apple-pay.md +++ b/doc/apple-pay.md @@ -43,7 +43,7 @@ var body = new RegisterDomainRequest.Builder( try { - RegisterDomainResponse result = applePayApi.RegisterDomainAsync(body).Result; + RegisterDomainResponse result = await applePayApi.RegisterDomainAsync(body); } catch (ApiException e){}; ``` diff --git a/doc/cash-drawers.md b/doc/cash-drawers.md index 4377f00f..6988e673 100644 --- a/doc/cash-drawers.md +++ b/doc/cash-drawers.md @@ -51,7 +51,7 @@ string locationId = "location_id4"; try { - ListCashDrawerShiftsResponse result = cashDrawersApi.ListCashDrawerShiftsAsync(locationId, null, null, null, null, null).Result; + ListCashDrawerShiftsResponse result = await cashDrawersApi.ListCashDrawerShiftsAsync(locationId, null, null, null, null, null); } catch (ApiException e){}; ``` @@ -84,7 +84,7 @@ string shiftId = "shift_id0"; try { - RetrieveCashDrawerShiftResponse result = cashDrawersApi.RetrieveCashDrawerShiftAsync(locationId, shiftId).Result; + RetrieveCashDrawerShiftResponse result = await cashDrawersApi.RetrieveCashDrawerShiftAsync(locationId, shiftId); } catch (ApiException e){}; ``` @@ -122,7 +122,7 @@ string shiftId = "shift_id0"; try { - ListCashDrawerShiftEventsResponse result = cashDrawersApi.ListCashDrawerShiftEventsAsync(locationId, shiftId, null, null).Result; + ListCashDrawerShiftEventsResponse result = await cashDrawersApi.ListCashDrawerShiftEventsAsync(locationId, shiftId, null, null); } catch (ApiException e){}; ``` diff --git a/doc/catalog.md b/doc/catalog.md index fa4ecf88..fa5a05aa 100644 --- a/doc/catalog.md +++ b/doc/catalog.md @@ -62,7 +62,7 @@ var body = new BatchDeleteCatalogObjectsRequest.Builder() try { - BatchDeleteCatalogObjectsResponse result = catalogApi.BatchDeleteCatalogObjectsAsync(body).Result; + BatchDeleteCatalogObjectsResponse result = await catalogApi.BatchDeleteCatalogObjectsAsync(body); } catch (ApiException e){}; ``` @@ -103,7 +103,7 @@ var body = new BatchRetrieveCatalogObjectsRequest.Builder( try { - BatchRetrieveCatalogObjectsResponse result = catalogApi.BatchRetrieveCatalogObjectsAsync(body).Result; + BatchRetrieveCatalogObjectsResponse result = await catalogApi.BatchRetrieveCatalogObjectsAsync(body); } catch (ApiException e){}; ``` @@ -257,7 +257,7 @@ var body = new BatchUpsertCatalogObjectsRequest.Builder( try { - BatchUpsertCatalogObjectsResponse result = catalogApi.BatchUpsertCatalogObjectsAsync(body).Result; + BatchUpsertCatalogObjectsResponse result = await catalogApi.BatchUpsertCatalogObjectsAsync(body); } catch (ApiException e){}; ``` @@ -337,7 +337,7 @@ var request = new CreateCatalogImageRequest.Builder( try { - CreateCatalogImageResponse result = catalogApi.CreateCatalogImageAsync(request, null).Result; + CreateCatalogImageResponse result = await catalogApi.CreateCatalogImageAsync(request, null); } catch (ApiException e){}; ``` @@ -360,7 +360,7 @@ CatalogInfoAsync() ```csharp try { - CatalogInfoResponse result = catalogApi.CatalogInfoAsync().Result; + CatalogInfoResponse result = await catalogApi.CatalogInfoAsync(); } catch (ApiException e){}; ``` @@ -397,7 +397,7 @@ ListCatalogAsync(string cursor = null, string types = null) ```csharp try { - ListCatalogResponse result = catalogApi.ListCatalogAsync(null, null).Result; + ListCatalogResponse result = await catalogApi.ListCatalogAsync(null, null); } catch (ApiException e){}; ``` @@ -440,7 +440,7 @@ var body = new UpsertCatalogObjectRequest.Builder( try { - UpsertCatalogObjectResponse result = catalogApi.UpsertCatalogObjectAsync(body).Result; + UpsertCatalogObjectResponse result = await catalogApi.UpsertCatalogObjectAsync(body); } catch (ApiException e){}; ``` @@ -475,7 +475,7 @@ string objectId = "object_id8"; try { - DeleteCatalogObjectResponse result = catalogApi.DeleteCatalogObjectAsync(objectId).Result; + DeleteCatalogObjectResponse result = await catalogApi.DeleteCatalogObjectAsync(objectId); } catch (ApiException e){}; ``` @@ -512,7 +512,7 @@ string objectId = "object_id8"; try { - RetrieveCatalogObjectResponse result = catalogApi.RetrieveCatalogObjectAsync(objectId, null).Result; + RetrieveCatalogObjectResponse result = await catalogApi.RetrieveCatalogObjectAsync(objectId, null); } catch (ApiException e){}; ``` @@ -568,7 +568,7 @@ var body = new SearchCatalogObjectsRequest.Builder() try { - SearchCatalogObjectsResponse result = catalogApi.SearchCatalogObjectsAsync(body).Result; + SearchCatalogObjectsResponse result = await catalogApi.SearchCatalogObjectsAsync(body); } catch (ApiException e){}; ``` @@ -612,7 +612,7 @@ var body = new UpdateItemModifierListsRequest.Builder( try { - UpdateItemModifierListsResponse result = catalogApi.UpdateItemModifierListsAsync(body).Result; + UpdateItemModifierListsResponse result = await catalogApi.UpdateItemModifierListsAsync(body); } catch (ApiException e){}; ``` @@ -655,7 +655,7 @@ var body = new UpdateItemTaxesRequest.Builder( try { - UpdateItemTaxesResponse result = catalogApi.UpdateItemTaxesAsync(body).Result; + UpdateItemTaxesResponse result = await catalogApi.UpdateItemTaxesAsync(body); } catch (ApiException e){}; ``` diff --git a/doc/checkout.md b/doc/checkout.md index 554f773c..82f0711d 100644 --- a/doc/checkout.md +++ b/doc/checkout.md @@ -177,7 +177,7 @@ var body = new CreateCheckoutRequest.Builder( try { - CreateCheckoutResponse result = checkoutApi.CreateCheckoutAsync(locationId, body).Result; + CreateCheckoutResponse result = await checkoutApi.CreateCheckoutAsync(locationId, body); } catch (ApiException e){}; ``` diff --git a/doc/customers.md b/doc/customers.md index a8ee8247..bb2f5baf 100644 --- a/doc/customers.md +++ b/doc/customers.md @@ -44,7 +44,7 @@ ListCustomersAsync(string cursor = null, string sortField = null, string sortOrd ```csharp try { - ListCustomersResponse result = customersApi.ListCustomersAsync(null, null, null).Result; + ListCustomersResponse result = await customersApi.ListCustomersAsync(null, null, null); } catch (ApiException e){}; ``` @@ -99,7 +99,7 @@ var body = new CreateCustomerRequest.Builder() try { - CreateCustomerResponse result = customersApi.CreateCustomerAsync(body).Result; + CreateCustomerResponse result = await customersApi.CreateCustomerAsync(body); } catch (ApiException e){}; ``` @@ -157,7 +157,7 @@ var body = new SearchCustomersRequest.Builder() try { - SearchCustomersResponse result = customersApi.SearchCustomersAsync(body).Result; + SearchCustomersResponse result = await customersApi.SearchCustomersAsync(body); } catch (ApiException e){}; ``` @@ -189,7 +189,7 @@ string customerId = "customer_id8"; try { - DeleteCustomerResponse result = customersApi.DeleteCustomerAsync(customerId).Result; + DeleteCustomerResponse result = await customersApi.DeleteCustomerAsync(customerId); } catch (ApiException e){}; ``` @@ -219,7 +219,7 @@ string customerId = "customer_id8"; try { - RetrieveCustomerResponse result = customersApi.RetrieveCustomerAsync(customerId).Result; + RetrieveCustomerResponse result = await customersApi.RetrieveCustomerAsync(customerId); } catch (ApiException e){}; ``` @@ -262,7 +262,7 @@ var body = new UpdateCustomerRequest.Builder() try { - UpdateCustomerResponse result = customersApi.UpdateCustomerAsync(customerId, body).Result; + UpdateCustomerResponse result = await customersApi.UpdateCustomerAsync(customerId, body); } catch (ApiException e){}; ``` @@ -310,7 +310,7 @@ var body = new CreateCustomerCardRequest.Builder( try { - CreateCustomerCardResponse result = customersApi.CreateCustomerCardAsync(customerId, body).Result; + CreateCustomerCardResponse result = await customersApi.CreateCustomerCardAsync(customerId, body); } catch (ApiException e){}; ``` @@ -342,7 +342,7 @@ string cardId = "card_id4"; try { - DeleteCustomerCardResponse result = customersApi.DeleteCustomerCardAsync(customerId, cardId).Result; + DeleteCustomerCardResponse result = await customersApi.DeleteCustomerCardAsync(customerId, cardId); } catch (ApiException e){}; ``` diff --git a/doc/employees.md b/doc/employees.md index 16e4bc44..a02395a3 100644 --- a/doc/employees.md +++ b/doc/employees.md @@ -43,7 +43,7 @@ ListEmployeesAsync( ```csharp try { - ListEmployeesResponse result = employeesApi.ListEmployeesAsync(null, null, null, null).Result; + ListEmployeesResponse result = await employeesApi.ListEmployeesAsync(null, null, null, null); } catch (ApiException e){}; ``` @@ -73,7 +73,7 @@ string id = "id0"; try { - RetrieveEmployeeResponse result = employeesApi.RetrieveEmployeeAsync(id).Result; + RetrieveEmployeeResponse result = await employeesApi.RetrieveEmployeeAsync(id); } catch (ApiException e){}; ``` diff --git a/doc/inventory.md b/doc/inventory.md index c155b59f..20776a0f 100644 --- a/doc/inventory.md +++ b/doc/inventory.md @@ -44,7 +44,7 @@ string adjustmentId = "adjustment_id0"; try { - RetrieveInventoryAdjustmentResponse result = inventoryApi.RetrieveInventoryAdjustmentAsync(adjustmentId).Result; + RetrieveInventoryAdjustmentResponse result = await inventoryApi.RetrieveInventoryAdjustmentAsync(adjustmentId); } catch (ApiException e){}; ``` @@ -99,7 +99,7 @@ var body = new BatchChangeInventoryRequest.Builder() try { - BatchChangeInventoryResponse result = inventoryApi.BatchChangeInventoryAsync(body).Result; + BatchChangeInventoryResponse result = await inventoryApi.BatchChangeInventoryAsync(body); } catch (ApiException e){}; ``` @@ -151,7 +151,7 @@ var body = new BatchRetrieveInventoryChangesRequest.Builder() try { - BatchRetrieveInventoryChangesResponse result = inventoryApi.BatchRetrieveInventoryChangesAsync(body).Result; + BatchRetrieveInventoryChangesResponse result = await inventoryApi.BatchRetrieveInventoryChangesAsync(body); } catch (ApiException e){}; ``` @@ -199,7 +199,7 @@ var body = new BatchRetrieveInventoryCountsRequest.Builder() try { - BatchRetrieveInventoryCountsResponse result = inventoryApi.BatchRetrieveInventoryCountsAsync(body).Result; + BatchRetrieveInventoryCountsResponse result = await inventoryApi.BatchRetrieveInventoryCountsAsync(body); } catch (ApiException e){}; ``` @@ -230,7 +230,7 @@ string physicalCountId = "physical_count_id2"; try { - RetrieveInventoryPhysicalCountResponse result = inventoryApi.RetrieveInventoryPhysicalCountAsync(physicalCountId).Result; + RetrieveInventoryPhysicalCountResponse result = await inventoryApi.RetrieveInventoryPhysicalCountAsync(physicalCountId); } catch (ApiException e){}; ``` @@ -265,7 +265,7 @@ string catalogObjectId = "catalog_object_id6"; try { - RetrieveInventoryCountResponse result = inventoryApi.RetrieveInventoryCountAsync(catalogObjectId, null, null).Result; + RetrieveInventoryCountResponse result = await inventoryApi.RetrieveInventoryCountAsync(catalogObjectId, null, null); } catch (ApiException e){}; ``` @@ -306,7 +306,7 @@ string catalogObjectId = "catalog_object_id6"; try { - RetrieveInventoryChangesResponse result = inventoryApi.RetrieveInventoryChangesAsync(catalogObjectId, null, null).Result; + RetrieveInventoryChangesResponse result = await inventoryApi.RetrieveInventoryChangesAsync(catalogObjectId, null, null); } catch (ApiException e){}; ``` diff --git a/doc/labor.md b/doc/labor.md index 91851566..48ee4c5e 100644 --- a/doc/labor.md +++ b/doc/labor.md @@ -50,7 +50,7 @@ ListBreakTypesAsync(string locationId = null, int? limit = null, string cursor = ```csharp try { - ListBreakTypesResponse result = laborApi.ListBreakTypesAsync(null, null, null).Result; + ListBreakTypesResponse result = await laborApi.ListBreakTypesAsync(null, null, null); } catch (ApiException e){}; ``` @@ -102,7 +102,7 @@ var body = new CreateBreakTypeRequest.Builder( try { - CreateBreakTypeResponse result = laborApi.CreateBreakTypeAsync(body).Result; + CreateBreakTypeResponse result = await laborApi.CreateBreakTypeAsync(body); } catch (ApiException e){}; ``` @@ -134,7 +134,7 @@ string id = "id0"; try { - DeleteBreakTypeResponse result = laborApi.DeleteBreakTypeAsync(id).Result; + DeleteBreakTypeResponse result = await laborApi.DeleteBreakTypeAsync(id); } catch (ApiException e){}; ``` @@ -164,7 +164,7 @@ string id = "id0"; try { - GetBreakTypeResponse result = laborApi.GetBreakTypeAsync(id).Result; + GetBreakTypeResponse result = await laborApi.GetBreakTypeAsync(id); } catch (ApiException e){}; ``` @@ -205,7 +205,7 @@ var body = new UpdateBreakTypeRequest.Builder( try { - UpdateBreakTypeResponse result = laborApi.UpdateBreakTypeAsync(id, body).Result; + UpdateBreakTypeResponse result = await laborApi.UpdateBreakTypeAsync(id, body); } catch (ApiException e){}; ``` @@ -235,7 +235,7 @@ ListEmployeeWagesAsync(string employeeId = null, int? limit = null, string curso ```csharp try { - ListEmployeeWagesResponse result = laborApi.ListEmployeeWagesAsync(null, null, null).Result; + ListEmployeeWagesResponse result = await laborApi.ListEmployeeWagesAsync(null, null, null); } catch (ApiException e){}; ``` @@ -265,7 +265,7 @@ string id = "id0"; try { - GetEmployeeWageResponse result = laborApi.GetEmployeeWageAsync(id).Result; + GetEmployeeWageResponse result = await laborApi.GetEmployeeWageAsync(id); } catch (ApiException e){}; ``` @@ -343,7 +343,7 @@ var body = new CreateShiftRequest.Builder( try { - CreateShiftResponse result = laborApi.CreateShiftAsync(body).Result; + CreateShiftResponse result = await laborApi.CreateShiftAsync(body); } catch (ApiException e){}; ``` @@ -404,7 +404,7 @@ var body = new SearchShiftsRequest.Builder() try { - SearchShiftsResponse result = laborApi.SearchShiftsAsync(body).Result; + SearchShiftsResponse result = await laborApi.SearchShiftsAsync(body); } catch (ApiException e){}; ``` @@ -434,7 +434,7 @@ string id = "id0"; try { - DeleteShiftResponse result = laborApi.DeleteShiftAsync(id).Result; + DeleteShiftResponse result = await laborApi.DeleteShiftAsync(id); } catch (ApiException e){}; ``` @@ -464,7 +464,7 @@ string id = "id0"; try { - GetShiftResponse result = laborApi.GetShiftAsync(id).Result; + GetShiftResponse result = await laborApi.GetShiftAsync(id); } catch (ApiException e){}; ``` @@ -534,7 +534,7 @@ var body = new UpdateShiftRequest.Builder( try { - UpdateShiftResponse result = laborApi.UpdateShiftAsync(id, body).Result; + UpdateShiftResponse result = await laborApi.UpdateShiftAsync(id, body); } catch (ApiException e){}; ``` @@ -563,7 +563,7 @@ ListWorkweekConfigsAsync(int? limit = null, string cursor = null) ```csharp try { - ListWorkweekConfigsResponse result = laborApi.ListWorkweekConfigsAsync(null, null).Result; + ListWorkweekConfigsResponse result = await laborApi.ListWorkweekConfigsAsync(null, null); } catch (ApiException e){}; ``` @@ -602,7 +602,7 @@ var body = new UpdateWorkweekConfigRequest.Builder( try { - UpdateWorkweekConfigResponse result = laborApi.UpdateWorkweekConfigAsync(id, body).Result; + UpdateWorkweekConfigResponse result = await laborApi.UpdateWorkweekConfigAsync(id, body); } catch (ApiException e){}; ``` diff --git a/doc/locations.md b/doc/locations.md index 673f458e..13395677 100644 --- a/doc/locations.md +++ b/doc/locations.md @@ -36,7 +36,7 @@ ListLocationsAsync() ```csharp try { - ListLocationsResponse result = locationsApi.ListLocationsAsync().Result; + ListLocationsResponse result = await locationsApi.ListLocationsAsync(); } catch (ApiException e){}; ``` @@ -80,7 +80,7 @@ var body = new CreateLocationRequest.Builder() try { - CreateLocationResponse result = locationsApi.CreateLocationAsync(body).Result; + CreateLocationResponse result = await locationsApi.CreateLocationAsync(body); } catch (ApiException e){}; ``` @@ -110,7 +110,7 @@ string locationId = "location_id4"; try { - RetrieveLocationResponse result = locationsApi.RetrieveLocationAsync(locationId).Result; + RetrieveLocationResponse result = await locationsApi.RetrieveLocationAsync(locationId); } catch (ApiException e){}; ``` @@ -170,7 +170,7 @@ var body = new UpdateLocationRequest.Builder() try { - UpdateLocationResponse result = locationsApi.UpdateLocationAsync(locationId, body).Result; + UpdateLocationResponse result = await locationsApi.UpdateLocationAsync(locationId, body); } catch (ApiException e){}; ``` diff --git a/doc/merchants.md b/doc/merchants.md index 21f60edd..aacd2563 100644 --- a/doc/merchants.md +++ b/doc/merchants.md @@ -43,7 +43,7 @@ ListMerchantsAsync(int? cursor = null) ```csharp try { - ListMerchantsResponse result = merchantsApi.ListMerchantsAsync(null).Result; + ListMerchantsResponse result = await merchantsApi.ListMerchantsAsync(null); } catch (ApiException e){}; ``` @@ -73,7 +73,7 @@ string merchantId = "merchant_id0"; try { - RetrieveMerchantResponse result = merchantsApi.RetrieveMerchantAsync(merchantId).Result; + RetrieveMerchantResponse result = await merchantsApi.RetrieveMerchantAsync(merchantId); } catch (ApiException e){}; ``` diff --git a/doc/mobile-authorization.md b/doc/mobile-authorization.md index 9df2e31a..2fd9a0bf 100644 --- a/doc/mobile-authorization.md +++ b/doc/mobile-authorization.md @@ -46,7 +46,7 @@ var body = new CreateMobileAuthorizationCodeRequest.Builder() try { - CreateMobileAuthorizationCodeResponse result = mobileAuthorizationApi.CreateMobileAuthorizationCodeAsync(body).Result; + CreateMobileAuthorizationCodeResponse result = await mobileAuthorizationApi.CreateMobileAuthorizationCodeAsync(body); } catch (ApiException e){}; ``` diff --git a/doc/models/card-brand.md b/doc/models/card-brand.md index 2cbe0961..38abcf4d 100644 --- a/doc/models/card-brand.md +++ b/doc/models/card-brand.md @@ -8,15 +8,16 @@ Indicates a card's brand, such as `VISA` or `MASTERCARD`. ### Fields -| Name | Description | -| --- | --- | -| `OTHERBRAND` | - | -| `VISA` | - | -| `MASTERCARD` | - | -| `AMERICANEXPRESS` | - | -| `DISCOVER` | - | -| `DISCOVERDINERS` | - | -| `JCB` | - | -| `CHINAUNIONPAY` | - | -| `SQUAREGIFTCARD` | - | +| Name | +| --- | +| `OTHERBRAND` | +| `VISA` | +| `MASTERCARD` | +| `AMERICANEXPRESS` | +| `DISCOVER` | +| `DISCOVERDINERS` | +| `JCB` | +| `CHINAUNIONPAY` | +| `SQUAREGIFTCARD` | +| `SQUARECAPITALCARD` | diff --git a/doc/models/catalog-query-filtered-items-custom-attribute-filter-filter-type.md b/doc/models/catalog-query-filtered-items-custom-attribute-filter-filter-type.md index a7d045f1..cf11561f 100644 --- a/doc/models/catalog-query-filtered-items-custom-attribute-filter-filter-type.md +++ b/doc/models/catalog-query-filtered-items-custom-attribute-filter-filter-type.md @@ -6,10 +6,10 @@ ### Fields -| Name | Description | -| --- | --- | -| `CUSTOMATTRIBUTEFILTERTYPEDONOTUSE` | - | -| `EXACT` | - | -| `PREFIX` | - | -| `RANGE` | - | +| Name | +| --- | +| `CUSTOMATTRIBUTEFILTERTYPEDONOTUSE` | +| `EXACT` | +| `PREFIX` | +| `RANGE` | diff --git a/doc/models/catalog-query-filtered-items-nullable-attribute.md b/doc/models/catalog-query-filtered-items-nullable-attribute.md index 56824831..958bc343 100644 --- a/doc/models/catalog-query-filtered-items-nullable-attribute.md +++ b/doc/models/catalog-query-filtered-items-nullable-attribute.md @@ -6,7 +6,7 @@ ### Fields -| Name | Description | -| --- | --- | -| `VENDORTOKEN` | - | +| Name | +| --- | +| `VENDORTOKEN` | diff --git a/doc/models/catalog-query-filtered-items-stock-level.md b/doc/models/catalog-query-filtered-items-stock-level.md index a73953f9..393f42c2 100644 --- a/doc/models/catalog-query-filtered-items-stock-level.md +++ b/doc/models/catalog-query-filtered-items-stock-level.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `OUT` | - | -| `LOW` | - | +| Name | +| --- | +| `OUT` | +| `LOW` | diff --git a/doc/models/country.md b/doc/models/country.md index 9c7d64a1..14ab47f1 100644 --- a/doc/models/country.md +++ b/doc/models/country.md @@ -9,256 +9,256 @@ Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/ ### Fields -| Name | Description | -| --- | --- | -| `ZZ` | - | -| `AD` | - | -| `AE` | - | -| `AF` | - | -| `AG` | - | -| `AI` | - | -| `AL` | - | -| `AM` | - | -| `AO` | - | -| `AQ` | - | -| `AR` | - | -| `AS` | - | -| `AT` | - | -| `AU` | - | -| `AW` | - | -| `AX` | - | -| `AZ` | - | -| `BA` | - | -| `BB` | - | -| `BD` | - | -| `BE` | - | -| `BF` | - | -| `BG` | - | -| `BH` | - | -| `BI` | - | -| `BJ` | - | -| `BL` | - | -| `BM` | - | -| `BN` | - | -| `BO` | - | -| `BQ` | - | -| `BR` | - | -| `BS` | - | -| `BT` | - | -| `BV` | - | -| `BW` | - | -| `BY` | - | -| `BZ` | - | -| `CA` | - | -| `CC` | - | -| `CD` | - | -| `CF` | - | -| `CG` | - | -| `CH` | - | -| `CI` | - | -| `CK` | - | -| `CL` | - | -| `CM` | - | -| `CN` | - | -| `CO` | - | -| `CR` | - | -| `CU` | - | -| `CV` | - | -| `CW` | - | -| `CX` | - | -| `CY` | - | -| `CZ` | - | -| `DE` | - | -| `DJ` | - | -| `DK` | - | -| `DM` | - | -| `DO` | - | -| `DZ` | - | -| `EC` | - | -| `EE` | - | -| `EG` | - | -| `EH` | - | -| `ER` | - | -| `ES` | - | -| `ET` | - | -| `FI` | - | -| `FJ` | - | -| `FK` | - | -| `FM` | - | -| `FO` | - | -| `FR` | - | -| `GA` | - | -| `GB` | - | -| `GD` | - | -| `GE` | - | -| `GF` | - | -| `GG` | - | -| `GH` | - | -| `GI` | - | -| `GL` | - | -| `GM` | - | -| `GN` | - | -| `GP` | - | -| `GQ` | - | -| `GR` | - | -| `GS` | - | -| `GT` | - | -| `GU` | - | -| `GW` | - | -| `GY` | - | -| `HK` | - | -| `HM` | - | -| `HN` | - | -| `HR` | - | -| `HT` | - | -| `HU` | - | -| `ID` | - | -| `IE` | - | -| `IL` | - | -| `IM` | - | -| `IN` | - | -| `IO` | - | -| `IQ` | - | -| `IR` | - | -| `IS` | - | -| `IT` | - | -| `JE` | - | -| `JM` | - | -| `JO` | - | -| `JP` | - | -| `KE` | - | -| `KG` | - | -| `KH` | - | -| `KI` | - | -| `KM` | - | -| `KN` | - | -| `KP` | - | -| `KR` | - | -| `KW` | - | -| `KY` | - | -| `KZ` | - | -| `LA` | - | -| `LB` | - | -| `LC` | - | -| `LI` | - | -| `LK` | - | -| `LR` | - | -| `LS` | - | -| `LT` | - | -| `LU` | - | -| `LV` | - | -| `LY` | - | -| `MA` | - | -| `MC` | - | -| `MD` | - | -| `ME` | - | -| `MF` | - | -| `MG` | - | -| `MH` | - | -| `MK` | - | -| `ML` | - | -| `MM` | - | -| `MN` | - | -| `MO` | - | -| `MP` | - | -| `MQ` | - | -| `MR` | - | -| `MS` | - | -| `MT` | - | -| `MU` | - | -| `MV` | - | -| `MW` | - | -| `MX` | - | -| `MY` | - | -| `MZ` | - | -| `NA` | - | -| `NC` | - | -| `NE` | - | -| `NF` | - | -| `NG` | - | -| `NI` | - | -| `NL` | - | -| `NO` | - | -| `NP` | - | -| `NR` | - | -| `NU` | - | -| `NZ` | - | -| `OM` | - | -| `PA` | - | -| `PE` | - | -| `PF` | - | -| `PG` | - | -| `PH` | - | -| `PK` | - | -| `PL` | - | -| `PM` | - | -| `PN` | - | -| `PR` | - | -| `PS` | - | -| `PT` | - | -| `PW` | - | -| `PY` | - | -| `QA` | - | -| `RE` | - | -| `RO` | - | -| `RS` | - | -| `RU` | - | -| `RW` | - | -| `SA` | - | -| `SB` | - | -| `SC` | - | -| `SD` | - | -| `SE` | - | -| `SG` | - | -| `SH` | - | -| `SI` | - | -| `SJ` | - | -| `SK` | - | -| `SL` | - | -| `SM` | - | -| `SN` | - | -| `SO` | - | -| `SR` | - | -| `SS` | - | -| `ST` | - | -| `SV` | - | -| `SX` | - | -| `SY` | - | -| `SZ` | - | -| `TC` | - | -| `TD` | - | -| `TF` | - | -| `TG` | - | -| `TH` | - | -| `TJ` | - | -| `TK` | - | -| `TL` | - | -| `TM` | - | -| `TN` | - | -| `TO` | - | -| `TR` | - | -| `TT` | - | -| `TV` | - | -| `TW` | - | -| `TZ` | - | -| `UA` | - | -| `UG` | - | -| `UM` | - | -| `US` | - | -| `UY` | - | -| `UZ` | - | -| `VA` | - | -| `VC` | - | -| `VE` | - | -| `VG` | - | -| `VI` | - | -| `VN` | - | -| `VU` | - | -| `WF` | - | -| `WS` | - | -| `YE` | - | -| `YT` | - | -| `ZA` | - | -| `ZM` | - | -| `ZW` | - | +| Name | +| --- | +| `ZZ` | +| `AD` | +| `AE` | +| `AF` | +| `AG` | +| `AI` | +| `AL` | +| `AM` | +| `AO` | +| `AQ` | +| `AR` | +| `AS` | +| `AT` | +| `AU` | +| `AW` | +| `AX` | +| `AZ` | +| `BA` | +| `BB` | +| `BD` | +| `BE` | +| `BF` | +| `BG` | +| `BH` | +| `BI` | +| `BJ` | +| `BL` | +| `BM` | +| `BN` | +| `BO` | +| `BQ` | +| `BR` | +| `BS` | +| `BT` | +| `BV` | +| `BW` | +| `BY` | +| `BZ` | +| `CA` | +| `CC` | +| `CD` | +| `CF` | +| `CG` | +| `CH` | +| `CI` | +| `CK` | +| `CL` | +| `CM` | +| `CN` | +| `CO` | +| `CR` | +| `CU` | +| `CV` | +| `CW` | +| `CX` | +| `CY` | +| `CZ` | +| `DE` | +| `DJ` | +| `DK` | +| `DM` | +| `DO` | +| `DZ` | +| `EC` | +| `EE` | +| `EG` | +| `EH` | +| `ER` | +| `ES` | +| `ET` | +| `FI` | +| `FJ` | +| `FK` | +| `FM` | +| `FO` | +| `FR` | +| `GA` | +| `GB` | +| `GD` | +| `GE` | +| `GF` | +| `GG` | +| `GH` | +| `GI` | +| `GL` | +| `GM` | +| `GN` | +| `GP` | +| `GQ` | +| `GR` | +| `GS` | +| `GT` | +| `GU` | +| `GW` | +| `GY` | +| `HK` | +| `HM` | +| `HN` | +| `HR` | +| `HT` | +| `HU` | +| `ID` | +| `IE` | +| `IL` | +| `IM` | +| `IN` | +| `IO` | +| `IQ` | +| `IR` | +| `IS` | +| `IT` | +| `JE` | +| `JM` | +| `JO` | +| `JP` | +| `KE` | +| `KG` | +| `KH` | +| `KI` | +| `KM` | +| `KN` | +| `KP` | +| `KR` | +| `KW` | +| `KY` | +| `KZ` | +| `LA` | +| `LB` | +| `LC` | +| `LI` | +| `LK` | +| `LR` | +| `LS` | +| `LT` | +| `LU` | +| `LV` | +| `LY` | +| `MA` | +| `MC` | +| `MD` | +| `ME` | +| `MF` | +| `MG` | +| `MH` | +| `MK` | +| `ML` | +| `MM` | +| `MN` | +| `MO` | +| `MP` | +| `MQ` | +| `MR` | +| `MS` | +| `MT` | +| `MU` | +| `MV` | +| `MW` | +| `MX` | +| `MY` | +| `MZ` | +| `NA` | +| `NC` | +| `NE` | +| `NF` | +| `NG` | +| `NI` | +| `NL` | +| `NO` | +| `NP` | +| `NR` | +| `NU` | +| `NZ` | +| `OM` | +| `PA` | +| `PE` | +| `PF` | +| `PG` | +| `PH` | +| `PK` | +| `PL` | +| `PM` | +| `PN` | +| `PR` | +| `PS` | +| `PT` | +| `PW` | +| `PY` | +| `QA` | +| `RE` | +| `RO` | +| `RS` | +| `RU` | +| `RW` | +| `SA` | +| `SB` | +| `SC` | +| `SD` | +| `SE` | +| `SG` | +| `SH` | +| `SI` | +| `SJ` | +| `SK` | +| `SL` | +| `SM` | +| `SN` | +| `SO` | +| `SR` | +| `SS` | +| `ST` | +| `SV` | +| `SX` | +| `SY` | +| `SZ` | +| `TC` | +| `TD` | +| `TF` | +| `TG` | +| `TH` | +| `TJ` | +| `TK` | +| `TL` | +| `TM` | +| `TN` | +| `TO` | +| `TR` | +| `TT` | +| `TV` | +| `TW` | +| `TZ` | +| `UA` | +| `UG` | +| `UM` | +| `US` | +| `UY` | +| `UZ` | +| `VA` | +| `VC` | +| `VE` | +| `VG` | +| `VI` | +| `VN` | +| `VU` | +| `WF` | +| `WS` | +| `YE` | +| `YT` | +| `ZA` | +| `ZM` | +| `ZW` | diff --git a/doc/models/create-order-response.md b/doc/models/create-order-response.md index 184f6c31..bb6c1362 100644 --- a/doc/models/create-order-response.md +++ b/doc/models/create-order-response.md @@ -25,40 +25,35 @@ One of `errors` or `order` is present in a given response (never both). "location_id": "LOCATION_ID", "line_items": [ { + "uid": "8uSwfzvUImn3IRrvciqlXC", "name": "New York Strip Steak", "quantity": "1", - "taxes": [ + "applied_taxes": [ { - "name": "State Sales Tax", - "type": "ADDITIVE", - "percentage": "9", + "uid": "aKG87ArnDpvMLSZJHxWUl", + "tax_uid": "state-sales-tax", "applied_money": { "amount": 136, "currency": "USD" } } ], - "discounts": [ + "applied_discounts": [ { - "catalog_object_id": "DB7L55ZH2BGWI4H23ULIWOQ7", - "name": "Membership Discount", - "type": "FIXED_PERCENTAGE", - "percentage": "0.5", + "uid": "jWdgP1TpHPFBuVrz81mXVC", + "discount_uid": "membership-discount", "applied_money": { "amount": 8, "currency": "USD" - }, - "scope": "ORDER" + } }, { - "name": "Labor Day Sale", - "type": "FIXED_PERCENTAGE", - "percentage": "5", + "uid": "jnZOjjVY57eRcQAVgEwFuC", + "discount_uid": "labor-day-sale", "applied_money": { "amount": 79, "currency": "USD" - }, - "scope": "ORDER" + } } ], "base_price_money": { @@ -80,15 +75,21 @@ One of `errors` or `order` is present in a given response (never both). "total_money": { "amount": 1648, "currency": "USD" + }, + "variation_total_price_money": { + "amount": 1599, + "currency": "USD" } }, { + "uid": "v8ZuEXpOJpb0bazLuvrLDB", "name": "New York Steak", "quantity": "2", "catalog_object_id": "BEMYCSMIJL46OCDV4KYIKXIB", "variation_name": "Larger", "modifiers": [ { + "uid": "Lo3qMMckDluu9Qsb58d4CC", "catalog_object_id": "CHQX7Y4KY6N5KINJKZCFURPZ", "name": "Well", "base_price_money": { @@ -101,51 +102,40 @@ One of `errors` or `order` is present in a given response (never both). } } ], - "taxes": [ + "applied_taxes": [ { - "name": "State Sales Tax", - "type": "ADDITIVE", - "percentage": "9", + "uid": "v1dAgrfUVUPTnVTf9sRPz", + "tax_uid": "state-sales-tax", "applied_money": { "amount": 374, "currency": "USD" } } ], - "discounts": [ + "applied_discounts": [ { - "catalog_object_id": "DB7L55ZH2BGWI4H23ULIWOQ7", - "name": "Membership Discount", - "type": "FIXED_PERCENTAGE", - "percentage": "0.5", + "uid": "nUXvdsIItfKko0dbYtY58C", + "discount_uid": "membership-discount", "applied_money": { "amount": 22, "currency": "USD" - }, - "scope": "ORDER" + } }, { - "name": "Labor Day Sale", - "type": "FIXED_PERCENTAGE", - "percentage": "5", + "uid": "qSdkOOOernlVQqsJ94SPjB", + "discount_uid": "labor-day-sale", "applied_money": { "amount": 224, "currency": "USD" - }, - "scope": "ORDER" + } }, { - "name": "Sale - $1.00 off", - "type": "FIXED_AMOUNT", - "amount_money": { - "amount": 100, - "currency": "USD" - }, + "uid": "y7bVl4njrWAnfDwmz19izB", + "discount_uid": "one-dollar-off", "applied_money": { "amount": 100, "currency": "USD" - }, - "scope": "LINE_ITEM" + } } ], "base_price_money": { @@ -167,11 +157,16 @@ One of `errors` or `order` is present in a given response (never both). "total_money": { "amount": 4528, "currency": "USD" + }, + "variation_total_price_money": { + "amount": 4400, + "currency": "USD" } } ], "taxes": [ { + "uid": "state-sales-tax", "name": "State Sales Tax", "type": "ADDITIVE", "percentage": "9", @@ -184,6 +179,7 @@ One of `errors` or `order` is present in a given response (never both). ], "discounts": [ { + "uid": "membership-discount", "catalog_object_id": "DB7L55ZH2BGWI4H23ULIWOQ7", "name": "Membership Discount", "type": "FIXED_PERCENTAGE", @@ -195,6 +191,7 @@ One of `errors` or `order` is present in a given response (never both). "scope": "ORDER" }, { + "uid": "labor-day-sale", "name": "Labor Day Sale", "type": "FIXED_PERCENTAGE", "percentage": "5", @@ -205,6 +202,7 @@ One of `errors` or `order` is present in a given response (never both). "scope": "ORDER" }, { + "uid": "one-dollar-off", "name": "Sale - $1.00 off", "type": "FIXED_AMOUNT", "amount_money": { @@ -218,6 +216,11 @@ One of `errors` or `order` is present in a given response (never both). "scope": "LINE_ITEM" } ], + "created_at": "2020-01-17T20:47:53.293Z", + "updated_at": "2020-01-17T20:47:53.293Z", + "state": "OPEN", + "version": 1, + "reference_id": "my-order-001", "total_money": { "amount": 6176, "currency": "USD" @@ -229,6 +232,39 @@ One of `errors` or `order` is present in a given response (never both). "total_discount_money": { "amount": 433, "currency": "USD" + }, + "total_tip_money": { + "amount": 0, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "net_amounts": { + "total_money": { + "amount": 6176, + "currency": "USD" + }, + "tax_money": { + "amount": 510, + "currency": "USD" + }, + "discount_money": { + "amount": 433, + "currency": "USD" + }, + "tip_money": { + "amount": 0, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + } + }, + "source": { + "name": "My App" } } } diff --git a/doc/models/currency.md b/doc/models/currency.md index 38f37b43..d4d8acff 100644 --- a/doc/models/currency.md +++ b/doc/models/currency.md @@ -9,187 +9,187 @@ to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). ### Fields -| Name | Description | -| --- | --- | -| `UNKNOWNCURRENCY` | - | -| `AED` | - | -| `AFN` | - | -| `ALL` | - | -| `AMD` | - | -| `ANG` | - | -| `AOA` | - | -| `ARS` | - | -| `AUD` | - | -| `AWG` | - | -| `AZN` | - | -| `BAM` | - | -| `BBD` | - | -| `BDT` | - | -| `BGN` | - | -| `BHD` | - | -| `BIF` | - | -| `BMD` | - | -| `BND` | - | -| `BOB` | - | -| `BOV` | - | -| `BRL` | - | -| `BSD` | - | -| `BTN` | - | -| `BWP` | - | -| `BYR` | - | -| `BZD` | - | -| `CAD` | - | -| `CDF` | - | -| `CHE` | - | -| `CHF` | - | -| `CHW` | - | -| `CLF` | - | -| `CLP` | - | -| `CNY` | - | -| `COP` | - | -| `COU` | - | -| `CRC` | - | -| `CUC` | - | -| `CUP` | - | -| `CVE` | - | -| `CZK` | - | -| `DJF` | - | -| `DKK` | - | -| `DOP` | - | -| `DZD` | - | -| `EGP` | - | -| `ERN` | - | -| `ETB` | - | -| `EUR` | - | -| `FJD` | - | -| `FKP` | - | -| `GBP` | - | -| `GEL` | - | -| `GHS` | - | -| `GIP` | - | -| `GMD` | - | -| `GNF` | - | -| `GTQ` | - | -| `GYD` | - | -| `HKD` | - | -| `HNL` | - | -| `HRK` | - | -| `HTG` | - | -| `HUF` | - | -| `IDR` | - | -| `ILS` | - | -| `INR` | - | -| `IQD` | - | -| `IRR` | - | -| `ISK` | - | -| `JMD` | - | -| `JOD` | - | -| `JPY` | - | -| `KES` | - | -| `KGS` | - | -| `KHR` | - | -| `KMF` | - | -| `KPW` | - | -| `KRW` | - | -| `KWD` | - | -| `KYD` | - | -| `KZT` | - | -| `LAK` | - | -| `LBP` | - | -| `LKR` | - | -| `LRD` | - | -| `LSL` | - | -| `LTL` | - | -| `LVL` | - | -| `LYD` | - | -| `MAD` | - | -| `MDL` | - | -| `MGA` | - | -| `MKD` | - | -| `MMK` | - | -| `MNT` | - | -| `MOP` | - | -| `MRO` | - | -| `MUR` | - | -| `MVR` | - | -| `MWK` | - | -| `MXN` | - | -| `MXV` | - | -| `MYR` | - | -| `MZN` | - | -| `NAD` | - | -| `NGN` | - | -| `NIO` | - | -| `NOK` | - | -| `NPR` | - | -| `NZD` | - | -| `OMR` | - | -| `PAB` | - | -| `PEN` | - | -| `PGK` | - | -| `PHP` | - | -| `PKR` | - | -| `PLN` | - | -| `PYG` | - | -| `QAR` | - | -| `RON` | - | -| `RSD` | - | -| `RUB` | - | -| `RWF` | - | -| `SAR` | - | -| `SBD` | - | -| `SCR` | - | -| `SDG` | - | -| `SEK` | - | -| `SGD` | - | -| `SHP` | - | -| `SLL` | - | -| `SOS` | - | -| `SRD` | - | -| `SSP` | - | -| `STD` | - | -| `SVC` | - | -| `SYP` | - | -| `SZL` | - | -| `THB` | - | -| `TJS` | - | -| `TMT` | - | -| `TND` | - | -| `TOP` | - | -| `TRY` | - | -| `TTD` | - | -| `TWD` | - | -| `TZS` | - | -| `UAH` | - | -| `UGX` | - | -| `USD` | - | -| `USN` | - | -| `USS` | - | -| `UYI` | - | -| `UYU` | - | -| `UZS` | - | -| `VEF` | - | -| `VND` | - | -| `VUV` | - | -| `WST` | - | -| `XAF` | - | -| `XAG` | - | -| `XAU` | - | -| `XBA` | - | -| `XBB` | - | -| `XBC` | - | -| `XBD` | - | -| `XCD` | - | -| `XDR` | - | -| `XOF` | - | -| `XPD` | - | -| `XPF` | - | -| `XPT` | - | -| `XTS` | - | -| `XXX` | - | -| `YER` | - | -| `ZAR` | - | -| `ZMK` | - | -| `ZMW` | - | -| `BTC` | - | +| Name | +| --- | +| `UNKNOWNCURRENCY` | +| `AED` | +| `AFN` | +| `ALL` | +| `AMD` | +| `ANG` | +| `AOA` | +| `ARS` | +| `AUD` | +| `AWG` | +| `AZN` | +| `BAM` | +| `BBD` | +| `BDT` | +| `BGN` | +| `BHD` | +| `BIF` | +| `BMD` | +| `BND` | +| `BOB` | +| `BOV` | +| `BRL` | +| `BSD` | +| `BTN` | +| `BWP` | +| `BYR` | +| `BZD` | +| `CAD` | +| `CDF` | +| `CHE` | +| `CHF` | +| `CHW` | +| `CLF` | +| `CLP` | +| `CNY` | +| `COP` | +| `COU` | +| `CRC` | +| `CUC` | +| `CUP` | +| `CVE` | +| `CZK` | +| `DJF` | +| `DKK` | +| `DOP` | +| `DZD` | +| `EGP` | +| `ERN` | +| `ETB` | +| `EUR` | +| `FJD` | +| `FKP` | +| `GBP` | +| `GEL` | +| `GHS` | +| `GIP` | +| `GMD` | +| `GNF` | +| `GTQ` | +| `GYD` | +| `HKD` | +| `HNL` | +| `HRK` | +| `HTG` | +| `HUF` | +| `IDR` | +| `ILS` | +| `INR` | +| `IQD` | +| `IRR` | +| `ISK` | +| `JMD` | +| `JOD` | +| `JPY` | +| `KES` | +| `KGS` | +| `KHR` | +| `KMF` | +| `KPW` | +| `KRW` | +| `KWD` | +| `KYD` | +| `KZT` | +| `LAK` | +| `LBP` | +| `LKR` | +| `LRD` | +| `LSL` | +| `LTL` | +| `LVL` | +| `LYD` | +| `MAD` | +| `MDL` | +| `MGA` | +| `MKD` | +| `MMK` | +| `MNT` | +| `MOP` | +| `MRO` | +| `MUR` | +| `MVR` | +| `MWK` | +| `MXN` | +| `MXV` | +| `MYR` | +| `MZN` | +| `NAD` | +| `NGN` | +| `NIO` | +| `NOK` | +| `NPR` | +| `NZD` | +| `OMR` | +| `PAB` | +| `PEN` | +| `PGK` | +| `PHP` | +| `PKR` | +| `PLN` | +| `PYG` | +| `QAR` | +| `RON` | +| `RSD` | +| `RUB` | +| `RWF` | +| `SAR` | +| `SBD` | +| `SCR` | +| `SDG` | +| `SEK` | +| `SGD` | +| `SHP` | +| `SLL` | +| `SOS` | +| `SRD` | +| `SSP` | +| `STD` | +| `SVC` | +| `SYP` | +| `SZL` | +| `THB` | +| `TJS` | +| `TMT` | +| `TND` | +| `TOP` | +| `TRY` | +| `TTD` | +| `TWD` | +| `TZS` | +| `UAH` | +| `UGX` | +| `USD` | +| `USN` | +| `USS` | +| `UYI` | +| `UYU` | +| `UZS` | +| `VEF` | +| `VND` | +| `VUV` | +| `WST` | +| `XAF` | +| `XAG` | +| `XAU` | +| `XBA` | +| `XBB` | +| `XBC` | +| `XBD` | +| `XCD` | +| `XDR` | +| `XOF` | +| `XPD` | +| `XPF` | +| `XPT` | +| `XTS` | +| `XXX` | +| `YER` | +| `ZAR` | +| `ZMK` | +| `ZMW` | +| `BTC` | diff --git a/doc/models/employee.md b/doc/models/employee.md index c5ee4e00..8544023f 100644 --- a/doc/models/employee.md +++ b/doc/models/employee.md @@ -17,6 +17,7 @@ An employee object that is used by the external API. | `PhoneNumber` | `string` | Optional | The employee's phone number in E.164 format, i.e. "+12125554250" | | `LocationIds` | `IList` | Optional | A list of location IDs where this employee has access to. | | `Status` | [`string`](/doc/models/employee-status.md) | Optional | The status of the Employee being retrieved. | +| `IsOwner` | `bool?` | Optional | Whether this employee is the owner of the merchant. Each merchant
has one owner employee, and that employee has full authority over
the account. | | `CreatedAt` | `string` | Optional | A read-only timestamp in RFC 3339 format. | | `UpdatedAt` | `string` | Optional | A read-only timestamp in RFC 3339 format. | @@ -31,6 +32,7 @@ An employee object that is used by the external API. "phone_number": null, "location_ids": null, "status": null, + "is_owner": null, "created_at": null, "updated_at": null } diff --git a/doc/models/error-code.md b/doc/models/error-code.md index 0b5a7bcd..e8b8228d 100644 --- a/doc/models/error-code.md +++ b/doc/models/error-code.md @@ -63,26 +63,26 @@ Square API. | `UNSUPPORTEDENTRYMETHOD` | The entry method for the credit card (swipe, dip, tap) is not supported. | | `INVALIDENCRYPTEDCARD` | The encrypted card information is invalid. | | `INVALIDCARD` | The credit card cannot be validated based on the provided details. | -| `GENERICDECLINE` | The credit card was decline by the issuer for an unspecified
reason. | +| `GENERICDECLINE` | An unexpected error occurred. | | `CVVFAILURE` | The card issuer declined the request because the CVV value is invalid. | | `ADDRESSVERIFICATIONFAILURE` | The card issuer declined the request because the postal code is invalid. | | `INVALIDACCOUNT` | The card issuer was not able to locate account on record. | | `CURRENCYMISMATCH` | The currency associated with the payment is not valid for the provided
funding source. For example, a gift card funded in USD cannot be used to process
payments in GBP. | | `INSUFFICIENTFUNDS` | The funding source has insufficient funds to cover the payment. | -| `INSUFFICIENTPERMISSIONS` | The Square account associated with the payment does not have
the permissions necessary to accept the payment. For example, Square may
limit which merchants are allowed to process gift card payments. | -| `CARDHOLDERINSUFFICIENTPERMISSIONS` | The funding source associated with the payment has limitations on
how it can be used. For example, it is only valid for specific merchants
or transaction types. | -| `INVALIDLOCATION` | The associated Square account is not allowed to take payments in this region. | -| `TRANSACTIONLIMIT` | The payment amount violates an associated transaction limit, i.e.,
it is too low or too high. For example, the card used is a prepaid credit
card. | -| `VOICEFAILURE` | The transaction was declined because the card issuer requires voice
authorization from the cardholder. | +| `INSUFFICIENTPERMISSIONS` | The Square account does not have the permissions to accept
this payment. For example, Square may limit which merchants are
allowed to receive gift card payments. | +| `CARDHOLDERINSUFFICIENTPERMISSIONS` | The card issuer has declined the transaction due to restrictions on where the card can be used.
For example, a gift card is limited to a single merchant. | +| `INVALIDLOCATION` | The Square account cannot take payments in the specified region.
A Square account can take payments only from the region where the account was created. | +| `TRANSACTIONLIMIT` | The card issuer has determined the payment amount is either too high or too low.
The API returns the error code mostly for credit cards (for example, the card reached
the credit limit). However, sometimes the issuer bank can indicate the error for debit
or prepaid cards (for example, card has insufficient funds). | +| `VOICEFAILURE` | The card issuer declined the request because the issuer requires voice authorization from the cardholder. | | `PANFAILURE` | The specified card number is invalid. For example, it is of
incorrect length or is incorrectly formatted. | | `EXPIRATIONFAILURE` | The card expiration date is either invalid or indicates that the
card is expired. | -| `CARDNOTSUPPORTED` | The card is not supported in the geographic region associated with
the Square account. For example, the card is accepted in the US but not in
Japan. | +| `CARDNOTSUPPORTED` | The card is not supported either in the geographic region or by
the MCC [merchant category code](https://developer.squareup.com/docs/docs/api/connect/v2#navsection-connectapibasics) | | `INVALIDPIN` | The card issuer declined the request because the PIN is invalid. | -| `INVALIDPOSTALCODE` | The postal code is improperly formatted. | -| `INVALIDFEES` | The total fee amount associated with the payment is too high. | -| `MANUALLYENTEREDPAYMENTNOTSUPPORTED` | The payment was declined because manually keying-in the card
information is disallowed. The card must be swiped, tapped, or dipped. | -| `PAYMENTLIMITEXCEEDED` | Square declined the request because the payment amount exceeds the
processing limit for the associated Square account. | -| `GIFTCARDAVAILABLEAMOUNT` | A gift card payment was declined because the card had insufficient funds. | +| `INVALIDPOSTALCODE` | The postal code is incorrectly formatted. | +| `INVALIDFEES` | The app_fee_money on a payment is too high. | +| `MANUALLYENTEREDPAYMENTNOTSUPPORTED` | The card must be swiped, tapped, or dipped. Payments attempted by manually entering the card number are declined. | +| `PAYMENTLIMITEXCEEDED` | Square declined the request because the payment amount exceeded the processing limit for this merchant. | +| `GIFTCARDAVAILABLEAMOUNT` | When using a gift card as a payment source in a `CreatePayment` request, you can allow
taking partial payment by adding the `accept_partial_authorization` parameter in the request.
If the gift card does not have sufficient balance to pay the entire `amount_money` specified
in the request, the request will succeed (an APPROVED payment for the remaining balance will be
returned). For more information, see [Partial amount with Square gift cards](https://developer.squareup.com/docs/docs/payments-api/take-payments#partial-payment-gift-card).\r\n\r\n
However, taking such a partial payment does not work if your request also includes `tip_money`,
`app_fee_money`, or both. Square declines such payment and returns this error.\r\n* The error
details provide the amount that was available on the gift card at the time of the request.
The amount is a string representation in the smallest denomination of the applicable currency.
For example, in USD the amount is specified in cents.\r\n* The error code appears in an array
along with the INSUFFICIENT_FUNDS error.\r\n\r\nThe following is an example set of
errors:\r\n```\r\n{\r\n \"errors\": [\r\n {\r\n \"code\": \"INSUFFICIENT_FUNDS\",\r\n \"detail\": \"Gift card does not have sufficient balance for requested amount and tip.\",\r\n \"category\": \"PAYMENT_METHOD_ERROR\"\r\n },\r\n {\r\n \"code\": \"GIFT_CARD_AVAILABLE_AMOUNT\",\r\n \"detail\": \"4494\",\r\n \"category\": \"PAYMENT_METHOD_ERROR\"\r\n }\r\n ]\r\n}\r\n```\r\n\r\n
In addition to the errors, it shows the gift card balance at 44.94 USD. You can review this amount and submit a new `CreatePayment` request with `tip_money` and `amount_money` that fit within the available balance. | | `DELAYEDTRANSACTIONEXPIRED` | The application tried to update a delayed-capture payment that has expired. | | `DELAYEDTRANSACTIONCANCELED` | The application tried to cancel a delayed-capture payment that was already cancelled. | | `DELAYEDTRANSACTIONCAPTURED` | The application tried to capture a delayed-capture payment that was already captured. | @@ -105,9 +105,6 @@ Square API. | `BADCERTIFICATE` | Bad certificate. | | `INVALIDSQUAREVERSIONFORMAT` | The provided Square-Version is incorrectly formatted. | | `APIVERSIONINCOMPATIBLE` | The provided Square-Version is incompatibile with the requested action. | -| `INVALIDURL` | The provided API URL is invalid. | -| `HTTPSONLY` | HTTPS only. | -| `UNREACHABLEURL` | The provided URL is unreachable. | | `CARDDECLINED` | 402 Request failed - the card was declined. | | `VERIFYCVVFAILURE` | 402 Request failed - the CVV could not be verified. | | `VERIFYAVSFAILURE` | 402 Request failed - the AVS could not be verified. | diff --git a/doc/models/error.md b/doc/models/error.md index 8da44b5d..cb2167d9 100644 --- a/doc/models/error.md +++ b/doc/models/error.md @@ -22,7 +22,7 @@ See [Handling errors](#handlingerrors) for more information. ```json { "category": "INVALID_REQUEST_ERROR", - "code": "VALUE_TOO_LOW", + "code": "REFUND_AMOUNT_INVALID", "detail": null, "field": null } diff --git a/doc/models/obtain-token-request.md b/doc/models/obtain-token-request.md index 96cc698c..614b74ce 100644 --- a/doc/models/obtain-token-request.md +++ b/doc/models/obtain-token-request.md @@ -20,13 +20,10 @@ ```json { - "client_id": "client_id8", - "client_secret": "client_secret8", - "code": null, - "redirect_uri": null, - "grant_type": "grant_type4", - "refresh_token": null, - "migration_token": null + "client_id": "APPLICATION_ID", + "client_secret": "APPLICATION_SECRET", + "code": "CODE_FROM_AUTHORIZE", + "grant_type": "authorization_code" } ``` diff --git a/doc/models/obtain-token-response.md b/doc/models/obtain-token-response.md index 9bd40ef0..0733982d 100644 --- a/doc/models/obtain-token-response.md +++ b/doc/models/obtain-token-response.md @@ -24,7 +24,8 @@ "access_token": "ACCESS_TOKEN", "token_type": "bearer", "expires_at": "2006-01-02T15:04:05Z", - "merchant_id": "MERCHANT_ID" + "merchant_id": "MERCHANT_ID", + "refresh_token": "REFRESH_TOKEN" } ``` diff --git a/doc/models/refund-payment-request.md b/doc/models/refund-payment-request.md index 03d30c71..327e5f08 100644 --- a/doc/models/refund-payment-request.md +++ b/doc/models/refund-payment-request.md @@ -13,7 +13,7 @@ Refunds a payment. | `IdempotencyKey` | `string` | | A unique string that identifies this RefundPayment request. Key can be any valid string but
must be unique for every RefundPayment request.
For more information, see [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency). | | `AmountMoney` | [`Models.Money`](/doc/models/money.md) | | 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` | [`Models.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. | -| `PaymentId` | `string` | Optional | Unique ID of the payment being refunded. | +| `PaymentId` | `string` | | Unique ID of the payment being refunded. | | `Reason` | `string` | Optional | A description of the reason for the refund. | ### Example (as JSON) diff --git a/doc/models/v1-adjust-inventory-request-adjustment-type.md b/doc/models/v1-adjust-inventory-request-adjustment-type.md index 311caaea..71ac42ff 100644 --- a/doc/models/v1-adjust-inventory-request-adjustment-type.md +++ b/doc/models/v1-adjust-inventory-request-adjustment-type.md @@ -6,9 +6,9 @@ ### Fields -| Name | Description | -| --- | --- | -| `SALE` | - | -| `RECEIVESTOCK` | - | -| `MANUALADJUST` | - | +| Name | +| --- | +| `SALE` | +| `RECEIVESTOCK` | +| `MANUALADJUST` | diff --git a/doc/models/v1-bank-account-type.md b/doc/models/v1-bank-account-type.md index e6bfd671..a42a6af7 100644 --- a/doc/models/v1-bank-account-type.md +++ b/doc/models/v1-bank-account-type.md @@ -6,12 +6,12 @@ ### Fields -| Name | Description | -| --- | --- | -| `BUSINESSCHECKING` | - | -| `CHECKING` | - | -| `INVESTMENT` | - | -| `LOAN` | - | -| `SAVINGS` | - | -| `OTHER` | - | +| Name | +| --- | +| `BUSINESSCHECKING` | +| `CHECKING` | +| `INVESTMENT` | +| `LOAN` | +| `SAVINGS` | +| `OTHER` | diff --git a/doc/models/v1-cash-drawer-event-event-type.md b/doc/models/v1-cash-drawer-event-event-type.md index 4f298218..0ea73885 100644 --- a/doc/models/v1-cash-drawer-event-event-type.md +++ b/doc/models/v1-cash-drawer-event-event-type.md @@ -6,15 +6,15 @@ ### Fields -| Name | Description | -| --- | --- | -| `NOSALE` | - | -| `CASHTENDERPAYMENT` | - | -| `OTHERTENDERPAYMENT` | - | -| `CASHTENDERCANCELEDPAYMENT` | - | -| `OTHERTENDERCANCELEDPAYMENT` | - | -| `CASHTENDERREFUND` | - | -| `OTHERTENDERREFUND` | - | -| `PAIDIN` | - | -| `PAIDOUT` | - | +| Name | +| --- | +| `NOSALE` | +| `CASHTENDERPAYMENT` | +| `OTHERTENDERPAYMENT` | +| `CASHTENDERCANCELEDPAYMENT` | +| `OTHERTENDERCANCELEDPAYMENT` | +| `CASHTENDERREFUND` | +| `OTHERTENDERREFUND` | +| `PAIDIN` | +| `PAIDOUT` | diff --git a/doc/models/v1-cash-drawer-shift-event-type.md b/doc/models/v1-cash-drawer-shift-event-type.md index b4306e25..5aca0e44 100644 --- a/doc/models/v1-cash-drawer-shift-event-type.md +++ b/doc/models/v1-cash-drawer-shift-event-type.md @@ -6,9 +6,9 @@ ### Fields -| Name | Description | -| --- | --- | -| `OPEN` | - | -| `ENDED` | - | -| `CLOSED` | - | +| Name | +| --- | +| `OPEN` | +| `ENDED` | +| `CLOSED` | diff --git a/doc/models/v1-create-refund-request-type.md b/doc/models/v1-create-refund-request-type.md index b17bfce7..1b711cef 100644 --- a/doc/models/v1-create-refund-request-type.md +++ b/doc/models/v1-create-refund-request-type.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `FULL` | - | -| `PARTIAL` | - | +| Name | +| --- | +| `FULL` | +| `PARTIAL` | diff --git a/doc/models/v1-discount-color.md b/doc/models/v1-discount-color.md index 2ecb026b..08479349 100644 --- a/doc/models/v1-discount-color.md +++ b/doc/models/v1-discount-color.md @@ -6,15 +6,15 @@ ### Fields -| Name | Description | -| --- | --- | -| `Enum9da2a6` | - | -| `Enum4ab200` | - | -| `Enum0b8000` | - | -| `Enum2952cc` | - | -| `A82ee5` | - | -| `E5457a` | - | -| `B21212` | - | -| `Enum593c00` | - | -| `E5BF00` | - | +| Name | +| --- | +| `Enum9da2a6` | +| `Enum4ab200` | +| `Enum0b8000` | +| `Enum2952cc` | +| `A82ee5` | +| `E5457a` | +| `B21212` | +| `Enum593c00` | +| `E5BF00` | diff --git a/doc/models/v1-discount-discount-type.md b/doc/models/v1-discount-discount-type.md index 65b06461..816d784e 100644 --- a/doc/models/v1-discount-discount-type.md +++ b/doc/models/v1-discount-discount-type.md @@ -6,9 +6,9 @@ ### Fields -| Name | Description | -| --- | --- | -| `FIXED` | - | -| `VARIABLEPERCENTAGE` | - | -| `VARIABLEAMOUNT` | - | +| Name | +| --- | +| `FIXED` | +| `VARIABLEPERCENTAGE` | +| `VARIABLEAMOUNT` | diff --git a/doc/models/v1-employee-role-permissions.md b/doc/models/v1-employee-role-permissions.md index 273ead5c..17d4d16d 100644 --- a/doc/models/v1-employee-role-permissions.md +++ b/doc/models/v1-employee-role-permissions.md @@ -6,13 +6,13 @@ ### Fields -| Name | Description | -| --- | --- | -| `REGISTERACCESSSALESHISTORY` | - | -| `REGISTERAPPLYRESTRICTEDDISCOUNTS` | - | -| `REGISTERCHANGESETTINGS` | - | -| `REGISTEREDITITEM` | - | -| `REGISTERISSUEREFUNDS` | - | -| `REGISTEROPENCASHDRAWEROUTSIDESALE` | - | -| `REGISTERVIEWSUMMARYREPORTS` | - | +| Name | +| --- | +| `REGISTERACCESSSALESHISTORY` | +| `REGISTERAPPLYRESTRICTEDDISCOUNTS` | +| `REGISTERCHANGESETTINGS` | +| `REGISTEREDITITEM` | +| `REGISTERISSUEREFUNDS` | +| `REGISTEROPENCASHDRAWEROUTSIDESALE` | +| `REGISTERVIEWSUMMARYREPORTS` | diff --git a/doc/models/v1-employee-status.md b/doc/models/v1-employee-status.md index a9724c6b..6186c981 100644 --- a/doc/models/v1-employee-status.md +++ b/doc/models/v1-employee-status.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `ACTIVE` | - | -| `INACTIVE` | - | +| Name | +| --- | +| `ACTIVE` | +| `INACTIVE` | diff --git a/doc/models/v1-fee-adjustment-type.md b/doc/models/v1-fee-adjustment-type.md index c9697668..61da4b2b 100644 --- a/doc/models/v1-fee-adjustment-type.md +++ b/doc/models/v1-fee-adjustment-type.md @@ -6,7 +6,7 @@ ### Fields -| Name | Description | -| --- | --- | -| `TAX` | - | +| Name | +| --- | +| `TAX` | diff --git a/doc/models/v1-fee-calculation-phase.md b/doc/models/v1-fee-calculation-phase.md index f6bf16a7..e93703fb 100644 --- a/doc/models/v1-fee-calculation-phase.md +++ b/doc/models/v1-fee-calculation-phase.md @@ -6,9 +6,9 @@ ### Fields -| Name | Description | -| --- | --- | -| `FEESUBTOTALPHASE` | - | -| `OTHER` | - | -| `FEETOTALPHASE` | - | +| Name | +| --- | +| `FEESUBTOTALPHASE` | +| `OTHER` | +| `FEETOTALPHASE` | diff --git a/doc/models/v1-fee-inclusion-type.md b/doc/models/v1-fee-inclusion-type.md index ca2113b9..a75f6784 100644 --- a/doc/models/v1-fee-inclusion-type.md +++ b/doc/models/v1-fee-inclusion-type.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `ADDITIVE` | - | -| `INCLUSIVE` | - | +| Name | +| --- | +| `ADDITIVE` | +| `INCLUSIVE` | diff --git a/doc/models/v1-fee-type.md b/doc/models/v1-fee-type.md index 41e636dc..b29623b9 100644 --- a/doc/models/v1-fee-type.md +++ b/doc/models/v1-fee-type.md @@ -6,14 +6,14 @@ ### Fields -| Name | Description | -| --- | --- | -| `CAGST` | - | -| `CAHST` | - | -| `CAPST` | - | -| `CAQST` | - | -| `JPCONSUMPTIONTAX` | - | -| `CAPEIPST` | - | -| `USSALESTAX` | - | -| `OTHER` | - | +| Name | +| --- | +| `CAGST` | +| `CAHST` | +| `CAPST` | +| `CAQST` | +| `JPCONSUMPTIONTAX` | +| `CAPEIPST` | +| `USSALESTAX` | +| `OTHER` | diff --git a/doc/models/v1-item-color.md b/doc/models/v1-item-color.md index a3a5e5fc..2d7036d9 100644 --- a/doc/models/v1-item-color.md +++ b/doc/models/v1-item-color.md @@ -6,15 +6,15 @@ ### Fields -| Name | Description | -| --- | --- | -| `Enum9da2a6` | - | -| `Enum4ab200` | - | -| `Enum0b8000` | - | -| `Enum2952cc` | - | -| `A82ee5` | - | -| `E5457a` | - | -| `B21212` | - | -| `Enum593c00` | - | -| `E5BF00` | - | +| Name | +| --- | +| `Enum9da2a6` | +| `Enum4ab200` | +| `Enum0b8000` | +| `Enum2952cc` | +| `A82ee5` | +| `E5457a` | +| `B21212` | +| `Enum593c00` | +| `E5BF00` | diff --git a/doc/models/v1-item-type.md b/doc/models/v1-item-type.md index 29110ca3..1c3f2efa 100644 --- a/doc/models/v1-item-type.md +++ b/doc/models/v1-item-type.md @@ -6,9 +6,9 @@ ### Fields -| Name | Description | -| --- | --- | -| `NORMAL` | - | -| `GIFTCARD` | - | -| `OTHER` | - | +| Name | +| --- | +| `NORMAL` | +| `GIFTCARD` | +| `OTHER` | diff --git a/doc/models/v1-item-visibility.md b/doc/models/v1-item-visibility.md index 60dcffb1..54ce94c7 100644 --- a/doc/models/v1-item-visibility.md +++ b/doc/models/v1-item-visibility.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `PUBLIC` | - | -| `PRIVATE` | - | +| Name | +| --- | +| `PUBLIC` | +| `PRIVATE` | diff --git a/doc/models/v1-list-employees-request-status.md b/doc/models/v1-list-employees-request-status.md index aab84f24..71564b29 100644 --- a/doc/models/v1-list-employees-request-status.md +++ b/doc/models/v1-list-employees-request-status.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `ACTIVE` | - | -| `INACTIVE` | - | +| Name | +| --- | +| `ACTIVE` | +| `INACTIVE` | diff --git a/doc/models/v1-list-settlements-request-status.md b/doc/models/v1-list-settlements-request-status.md index 72f343e1..ecf90037 100644 --- a/doc/models/v1-list-settlements-request-status.md +++ b/doc/models/v1-list-settlements-request-status.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `SENT` | - | -| `FAILED` | - | +| Name | +| --- | +| `SENT` | +| `FAILED` | diff --git a/doc/models/v1-list-settlements-request.md b/doc/models/v1-list-settlements-request.md index b6812421..ff99be35 100644 --- a/doc/models/v1-list-settlements-request.md +++ b/doc/models/v1-list-settlements-request.md @@ -11,7 +11,7 @@ | `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. | +| `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. | diff --git a/doc/models/v1-merchant-account-type.md b/doc/models/v1-merchant-account-type.md index 7e94d545..9273463b 100644 --- a/doc/models/v1-merchant-account-type.md +++ b/doc/models/v1-merchant-account-type.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `LOCATION` | - | -| `BUSINESS` | - | +| Name | +| --- | +| `LOCATION` | +| `BUSINESS` | diff --git a/doc/models/v1-merchant-business-type.md b/doc/models/v1-merchant-business-type.md index 5113914f..15cde1c5 100644 --- a/doc/models/v1-merchant-business-type.md +++ b/doc/models/v1-merchant-business-type.md @@ -6,56 +6,56 @@ ### Fields -| Name | Description | -| --- | --- | -| `ACCOUNTING` | - | -| `APPARELANDACCESSORYSHOPS` | - | -| `ARTDEALERSGALLERIES` | - | -| `ARTDESIGNANDPHOTOGRAPHY` | - | -| `BARCLUBLOUNGE` | - | -| `BEAUTYANDBARBERSHOPS` | - | -| `BOOKSTORES` | - | -| `BUSINESSSERVICES` | - | -| `CATERING` | - | -| `CHARITABLESOCIALSERVICEORGANIZATIONS` | - | -| `CHARITIBLEORGS` | - | -| `CLEANINGSERVICES` | - | -| `COMPUTEREQUIPMENTSOFTWAREMAINTENANCEREPAIRSERVICES` | - | -| `CONSULTANT` | - | -| `CONTRACTORS` | - | -| `DELIVERYSERVICES` | - | -| `DENTISTRY` | - | -| `EDUCATION` | - | -| `FOODSTORESCONVENIENCESTORESANDSPECIALTYMARKETS` | - | -| `FOODTRUCKCART` | - | -| `FURNITUREHOMEANDOFFICEEQUIPMENT` | - | -| `FURNITUREHOMEGOODS` | - | -| `HOTELSANDLODGING` | - | -| `INDIVIDUALUSE` | - | -| `JEWELRYANDWATCHES` | - | -| `LANDSCAPINGANDHORTICULTURALSERVICES` | - | -| `LANGUAGESCHOOLS` | - | -| `LEGALSERVICES` | - | -| `MEDICALPRACTITIONERS` | - | -| `MEDICALSERVICESANDHEALTHPRACTITIONERS` | - | -| `MEMBERSHIPORGANIZATIONS` | - | -| `MUSICANDENTERTAINMENT` | - | -| `OTHER` | - | -| `OUTDOORMARKETS` | - | -| `PERSONALSERVICES` | - | -| `POLITICALORGANIZATIONS` | - | -| `PROFESSIONALSERVICES` | - | -| `REALESTATE` | - | -| `RECREATIONSERVICES` | - | -| `REPAIRSHOPSANDRELATEDSERVICES` | - | -| `RESTAURANTS` | - | -| `RETAILSHOPS` | - | -| `SCHOOLSANDEDUCATIONALSERVICES` | - | -| `SPORTINGGOODS` | - | -| `TAXICABSANDLIMOUSINES` | - | -| `TICKETSALES` | - | -| `TOURISM` | - | -| `TRAVELTOURISM` | - | -| `VETERINARYSERVICES` | - | -| `WEBDEVDESIGN` | - | +| Name | +| --- | +| `ACCOUNTING` | +| `APPARELANDACCESSORYSHOPS` | +| `ARTDEALERSGALLERIES` | +| `ARTDESIGNANDPHOTOGRAPHY` | +| `BARCLUBLOUNGE` | +| `BEAUTYANDBARBERSHOPS` | +| `BOOKSTORES` | +| `BUSINESSSERVICES` | +| `CATERING` | +| `CHARITABLESOCIALSERVICEORGANIZATIONS` | +| `CHARITIBLEORGS` | +| `CLEANINGSERVICES` | +| `COMPUTEREQUIPMENTSOFTWAREMAINTENANCEREPAIRSERVICES` | +| `CONSULTANT` | +| `CONTRACTORS` | +| `DELIVERYSERVICES` | +| `DENTISTRY` | +| `EDUCATION` | +| `FOODSTORESCONVENIENCESTORESANDSPECIALTYMARKETS` | +| `FOODTRUCKCART` | +| `FURNITUREHOMEANDOFFICEEQUIPMENT` | +| `FURNITUREHOMEGOODS` | +| `HOTELSANDLODGING` | +| `INDIVIDUALUSE` | +| `JEWELRYANDWATCHES` | +| `LANDSCAPINGANDHORTICULTURALSERVICES` | +| `LANGUAGESCHOOLS` | +| `LEGALSERVICES` | +| `MEDICALPRACTITIONERS` | +| `MEDICALSERVICESANDHEALTHPRACTITIONERS` | +| `MEMBERSHIPORGANIZATIONS` | +| `MUSICANDENTERTAINMENT` | +| `OTHER` | +| `OUTDOORMARKETS` | +| `PERSONALSERVICES` | +| `POLITICALORGANIZATIONS` | +| `PROFESSIONALSERVICES` | +| `REALESTATE` | +| `RECREATIONSERVICES` | +| `REPAIRSHOPSANDRELATEDSERVICES` | +| `RESTAURANTS` | +| `RETAILSHOPS` | +| `SCHOOLSANDEDUCATIONALSERVICES` | +| `SPORTINGGOODS` | +| `TAXICABSANDLIMOUSINES` | +| `TICKETSALES` | +| `TOURISM` | +| `TRAVELTOURISM` | +| `VETERINARYSERVICES` | +| `WEBDEVDESIGN` | diff --git a/doc/models/v1-modifier-list-selection-type.md b/doc/models/v1-modifier-list-selection-type.md index 45d25dbd..54ab35c9 100644 --- a/doc/models/v1-modifier-list-selection-type.md +++ b/doc/models/v1-modifier-list-selection-type.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `SINGLE` | - | -| `MULTIPLE` | - | +| Name | +| --- | +| `SINGLE` | +| `MULTIPLE` | diff --git a/doc/models/v1-order-history-entry-action.md b/doc/models/v1-order-history-entry-action.md index 35b961eb..44d9c521 100644 --- a/doc/models/v1-order-history-entry-action.md +++ b/doc/models/v1-order-history-entry-action.md @@ -6,13 +6,13 @@ ### Fields -| Name | Description | -| --- | --- | -| `ORDERPLACED` | - | -| `DECLINED` | - | -| `PAYMENTRECEIVED` | - | -| `CANCELED` | - | -| `COMPLETED` | - | -| `REFUNDED` | - | -| `EXPIRED` | - | +| Name | +| --- | +| `ORDERPLACED` | +| `DECLINED` | +| `PAYMENTRECEIVED` | +| `CANCELED` | +| `COMPLETED` | +| `REFUNDED` | +| `EXPIRED` | diff --git a/doc/models/v1-order-state.md b/doc/models/v1-order-state.md index e1adddcc..29281ee4 100644 --- a/doc/models/v1-order-state.md +++ b/doc/models/v1-order-state.md @@ -6,12 +6,12 @@ ### Fields -| Name | Description | -| --- | --- | -| `PENDING` | - | -| `OPEN` | - | -| `COMPLETED` | - | -| `CANCELED` | - | -| `REFUNDED` | - | -| `REJECTED` | - | +| Name | +| --- | +| `PENDING` | +| `OPEN` | +| `COMPLETED` | +| `CANCELED` | +| `REFUNDED` | +| `REJECTED` | diff --git a/doc/models/v1-page-cell-object-type.md b/doc/models/v1-page-cell-object-type.md index cab0334b..77aa77c4 100644 --- a/doc/models/v1-page-cell-object-type.md +++ b/doc/models/v1-page-cell-object-type.md @@ -6,10 +6,10 @@ ### Fields -| Name | Description | -| --- | --- | -| `ITEM` | - | -| `DISCOUNT` | - | -| `CATEGORY` | - | -| `PLACEHOLDER` | - | +| Name | +| --- | +| `ITEM` | +| `DISCOUNT` | +| `CATEGORY` | +| `PLACEHOLDER` | diff --git a/doc/models/v1-page-cell-placeholder-type.md b/doc/models/v1-page-cell-placeholder-type.md index eda48544..50ae6ce7 100644 --- a/doc/models/v1-page-cell-placeholder-type.md +++ b/doc/models/v1-page-cell-placeholder-type.md @@ -6,9 +6,9 @@ ### Fields -| Name | Description | -| --- | --- | -| `ALLITEMS` | - | -| `DISCOUNTSCATEGORY` | - | -| `REWARDSFINDER` | - | +| Name | +| --- | +| `ALLITEMS` | +| `DISCOUNTSCATEGORY` | +| `REWARDSFINDER` | diff --git a/doc/models/v1-payment-itemization-itemization-type.md b/doc/models/v1-payment-itemization-itemization-type.md index 5e44fbcd..58370036 100644 --- a/doc/models/v1-payment-itemization-itemization-type.md +++ b/doc/models/v1-payment-itemization-itemization-type.md @@ -6,12 +6,12 @@ ### Fields -| Name | Description | -| --- | --- | -| `ITEM` | - | -| `CUSTOMAMOUNT` | - | -| `GIFTCARDACTIVATION` | - | -| `GIFTCARDRELOAD` | - | -| `GIFTCARDUNKNOWN` | - | -| `OTHER` | - | +| Name | +| --- | +| `ITEM` | +| `CUSTOMAMOUNT` | +| `GIFTCARDACTIVATION` | +| `GIFTCARDRELOAD` | +| `GIFTCARDUNKNOWN` | +| `OTHER` | diff --git a/doc/models/v1-payment-surcharge-type.md b/doc/models/v1-payment-surcharge-type.md index dfa8a363..8bc41d92 100644 --- a/doc/models/v1-payment-surcharge-type.md +++ b/doc/models/v1-payment-surcharge-type.md @@ -6,9 +6,9 @@ ### Fields -| Name | Description | -| --- | --- | -| `UNKNOWN` | - | -| `AUTOGRATUITY` | - | -| `CUSTOM` | - | +| Name | +| --- | +| `UNKNOWN` | +| `AUTOGRATUITY` | +| `CUSTOM` | diff --git a/doc/models/v1-payment-tax-inclusion-type.md b/doc/models/v1-payment-tax-inclusion-type.md index fcfa0c52..e937517b 100644 --- a/doc/models/v1-payment-tax-inclusion-type.md +++ b/doc/models/v1-payment-tax-inclusion-type.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `ADDITIVE` | - | -| `INCLUSIVE` | - | +| Name | +| --- | +| `ADDITIVE` | +| `INCLUSIVE` | diff --git a/doc/models/v1-refund-type.md b/doc/models/v1-refund-type.md index 5a3869b3..97d1049f 100644 --- a/doc/models/v1-refund-type.md +++ b/doc/models/v1-refund-type.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `FULL` | - | -| `PARTIAL` | - | +| Name | +| --- | +| `FULL` | +| `PARTIAL` | diff --git a/doc/models/v1-settlement-entry-type.md b/doc/models/v1-settlement-entry-type.md index 694f4641..e5c1a691 100644 --- a/doc/models/v1-settlement-entry-type.md +++ b/doc/models/v1-settlement-entry-type.md @@ -23,7 +23,7 @@ | `SQUARECAPITALREVERSEDPAYMENT` | 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. | | `SUBSCRIPTIONFEE` | Fee charged for subscription to a Square product | | `SUBSCRIPTIONFEEREFUND` | Refund of a previously charged Square product subscription fee. | -| `OTHER` | - | +| `OTHER` | | | `INCENTEDPAYMENT` | A payment in which Square covers part of the funds for a purchase | | `RETURNEDACHENTRY` | A settlement failed to be processed and the settlement amount has been returned to the account | | `RETURNEDSQUARE275` | Refund for cancelling a Square Plus subscription | diff --git a/doc/models/v1-settlement-status.md b/doc/models/v1-settlement-status.md index ddc9ec18..60260676 100644 --- a/doc/models/v1-settlement-status.md +++ b/doc/models/v1-settlement-status.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `FAILED` | - | -| `SENT` | - | +| Name | +| --- | +| `FAILED` | +| `SENT` | diff --git a/doc/models/v1-tender-card-brand.md b/doc/models/v1-tender-card-brand.md index 5de8ea75..5cf5ba29 100644 --- a/doc/models/v1-tender-card-brand.md +++ b/doc/models/v1-tender-card-brand.md @@ -8,15 +8,15 @@ The brand of a credit card. ### Fields -| Name | Description | -| --- | --- | -| `OTHERBRAND` | - | -| `VISA` | - | -| `MASTERCARD` | - | -| `AMERICANEXPRESS` | - | -| `DISCOVER` | - | -| `DISCOVERDINERS` | - | -| `JCB` | - | -| `CHINAUNIONPAY` | - | -| `SQUAREGIFTCARD` | - | +| Name | +| --- | +| `OTHERBRAND` | +| `VISA` | +| `MASTERCARD` | +| `AMERICANEXPRESS` | +| `DISCOVER` | +| `DISCOVERDINERS` | +| `JCB` | +| `CHINAUNIONPAY` | +| `SQUAREGIFTCARD` | diff --git a/doc/models/v1-tender-entry-method.md b/doc/models/v1-tender-entry-method.md index 9f3058bd..2d5943d8 100644 --- a/doc/models/v1-tender-entry-method.md +++ b/doc/models/v1-tender-entry-method.md @@ -6,13 +6,13 @@ ### Fields -| Name | Description | -| --- | --- | -| `MANUAL` | - | -| `SCANNED` | - | -| `SQUARECASH` | - | -| `SQUAREWALLET` | - | -| `SWIPED` | - | -| `WEBFORM` | - | -| `OTHER` | - | +| Name | +| --- | +| `MANUAL` | +| `SCANNED` | +| `SQUARECASH` | +| `SQUAREWALLET` | +| `SWIPED` | +| `WEBFORM` | +| `OTHER` | diff --git a/doc/models/v1-tender-type.md b/doc/models/v1-tender-type.md index 8661cff8..68cc24a9 100644 --- a/doc/models/v1-tender-type.md +++ b/doc/models/v1-tender-type.md @@ -6,14 +6,14 @@ ### Fields -| Name | Description | -| --- | --- | -| `CREDITCARD` | - | -| `CASH` | - | -| `THIRDPARTYCARD` | - | -| `NOSALE` | - | -| `SQUAREWALLET` | - | -| `SQUAREGIFTCARD` | - | -| `UNKNOWN` | - | -| `OTHER` | - | +| Name | +| --- | +| `CREDITCARD` | +| `CASH` | +| `THIRDPARTYCARD` | +| `NOSALE` | +| `SQUAREWALLET` | +| `SQUAREGIFTCARD` | +| `UNKNOWN` | +| `OTHER` | diff --git a/doc/models/v1-update-modifier-list-request-selection-type.md b/doc/models/v1-update-modifier-list-request-selection-type.md index ed8624a2..5c31441d 100644 --- a/doc/models/v1-update-modifier-list-request-selection-type.md +++ b/doc/models/v1-update-modifier-list-request-selection-type.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `SINGLE` | - | -| `MULTIPLE` | - | +| Name | +| --- | +| `SINGLE` | +| `MULTIPLE` | diff --git a/doc/models/v1-update-order-request-action.md b/doc/models/v1-update-order-request-action.md index a1ab6e26..693aeb41 100644 --- a/doc/models/v1-update-order-request-action.md +++ b/doc/models/v1-update-order-request-action.md @@ -6,9 +6,9 @@ ### Fields -| Name | Description | -| --- | --- | -| `COMPLETE` | - | -| `CANCEL` | - | -| `REFUND` | - | +| Name | +| --- | +| `COMPLETE` | +| `CANCEL` | +| `REFUND` | diff --git a/doc/models/v1-variation-inventory-alert-type.md b/doc/models/v1-variation-inventory-alert-type.md index e21572c4..60d5e412 100644 --- a/doc/models/v1-variation-inventory-alert-type.md +++ b/doc/models/v1-variation-inventory-alert-type.md @@ -6,12 +6,12 @@ ### Fields -| Name | Description | -| --- | --- | -| `LOWQUANTITY` | - | -| `NONE` | - | -| `INVESTMENT` | - | -| `LOAN` | - | -| `SAVINGS` | - | -| `OTHER` | - | +| Name | +| --- | +| `LOWQUANTITY` | +| `NONE` | +| `INVESTMENT` | +| `LOAN` | +| `SAVINGS` | +| `OTHER` | diff --git a/doc/models/v1-variation-pricing-type.md b/doc/models/v1-variation-pricing-type.md index c74dd4f1..6fd70b30 100644 --- a/doc/models/v1-variation-pricing-type.md +++ b/doc/models/v1-variation-pricing-type.md @@ -6,8 +6,8 @@ ### Fields -| Name | Description | -| --- | --- | -| `FIXEDPRICING` | - | -| `VARIABLEPRICING` | - | +| Name | +| --- | +| `FIXEDPRICING` | +| `VARIABLEPRICING` | diff --git a/doc/o-auth.md b/doc/o-auth.md index 933c704a..a70bb9c8 100644 --- a/doc/o-auth.md +++ b/doc/o-auth.md @@ -66,7 +66,7 @@ string authorization = "Authorization8"; try { - RenewTokenResponse result = oAuthApi.RenewTokenAsync(clientId, body, authorization).Result; + RenewTokenResponse result = await oAuthApi.RenewTokenAsync(clientId, body, authorization); } catch (ApiException e){}; ``` @@ -118,7 +118,7 @@ string authorization = "Authorization8"; try { - RevokeTokenResponse result = oAuthApi.RevokeTokenAsync(body, authorization).Result; + RevokeTokenResponse result = await oAuthApi.RevokeTokenAsync(body, authorization); } catch (ApiException e){}; ``` @@ -159,14 +159,15 @@ ObtainTokenAsync(Models.ObtainTokenRequest body) ```csharp var body = new ObtainTokenRequest.Builder( - "client_id8", - "client_secret4", - "grant_type8") + "APPLICATION_ID", + "APPLICATION_SECRET", + "authorization_code") + .Code("CODE_FROM_AUTHORIZE") .Build(); try { - ObtainTokenResponse result = oAuthApi.ObtainTokenAsync(body).Result; + ObtainTokenResponse result = await oAuthApi.ObtainTokenAsync(body); } catch (ApiException e){}; ``` diff --git a/doc/orders.md b/doc/orders.md index 813ad24f..a86037f8 100644 --- a/doc/orders.md +++ b/doc/orders.md @@ -53,7 +53,7 @@ var body = new CreateOrderRequest.Builder() try { - CreateOrderResponse result = ordersApi.CreateOrderAsync(locationId, body).Result; + CreateOrderResponse result = await ordersApi.CreateOrderAsync(locationId, body); } catch (ApiException e){}; ``` @@ -92,7 +92,7 @@ var body = new BatchRetrieveOrdersRequest.Builder( try { - BatchRetrieveOrdersResponse result = ordersApi.BatchRetrieveOrdersAsync(locationId, body).Result; + BatchRetrieveOrdersResponse result = await ordersApi.BatchRetrieveOrdersAsync(locationId, body); } catch (ApiException e){}; ``` @@ -143,7 +143,7 @@ var body = new UpdateOrderRequest.Builder() try { - UpdateOrderResponse result = ordersApi.UpdateOrderAsync(locationId, orderId, body).Result; + UpdateOrderResponse result = await ordersApi.UpdateOrderAsync(locationId, orderId, body); } catch (ApiException e){}; ``` @@ -221,7 +221,7 @@ var body = new SearchOrdersRequest.Builder() try { - SearchOrdersResponse result = ordersApi.SearchOrdersAsync(body).Result; + SearchOrdersResponse result = await ordersApi.SearchOrdersAsync(body); } catch (ApiException e){}; ``` @@ -274,7 +274,7 @@ var body = new PayOrderRequest.Builder( try { - PayOrderResponse result = ordersApi.PayOrderAsync(orderId, body).Result; + PayOrderResponse result = await ordersApi.PayOrderAsync(orderId, body); } catch (ApiException e){}; ``` diff --git a/doc/payments.md b/doc/payments.md index b8c06798..9d071409 100644 --- a/doc/payments.md +++ b/doc/payments.md @@ -57,7 +57,7 @@ ListPaymentsAsync( ```csharp try { - ListPaymentsResponse result = paymentsApi.ListPaymentsAsync(null, null, null, null, null, null, null, null).Result; + ListPaymentsResponse result = await paymentsApi.ListPaymentsAsync(null, null, null, null, null, null, null, null); } catch (ApiException e){}; ``` @@ -117,7 +117,7 @@ var body = new CreatePaymentRequest.Builder( try { - CreatePaymentResponse result = paymentsApi.CreatePaymentAsync(body).Result; + CreatePaymentResponse result = await paymentsApi.CreatePaymentAsync(body); } catch (ApiException e){}; ``` @@ -158,7 +158,7 @@ var body = new CancelPaymentByIdempotencyKeyRequest.Builder( try { - CancelPaymentByIdempotencyKeyResponse result = paymentsApi.CancelPaymentByIdempotencyKeyAsync(body).Result; + CancelPaymentByIdempotencyKeyResponse result = await paymentsApi.CancelPaymentByIdempotencyKeyAsync(body); } catch (ApiException e){}; ``` @@ -188,7 +188,7 @@ string paymentId = "payment_id0"; try { - GetPaymentResponse result = paymentsApi.GetPaymentAsync(paymentId).Result; + GetPaymentResponse result = await paymentsApi.GetPaymentAsync(paymentId); } catch (ApiException e){}; ``` @@ -220,7 +220,7 @@ string paymentId = "payment_id0"; try { - CancelPaymentResponse result = paymentsApi.CancelPaymentAsync(paymentId).Result; + CancelPaymentResponse result = await paymentsApi.CancelPaymentAsync(paymentId); } catch (ApiException e){}; ``` @@ -255,7 +255,7 @@ string paymentId = "payment_id0"; try { - CompletePaymentResponse result = paymentsApi.CompletePaymentAsync(paymentId).Result; + CompletePaymentResponse result = await paymentsApi.CompletePaymentAsync(paymentId); } catch (ApiException e){}; ``` diff --git a/doc/refunds.md b/doc/refunds.md index 9c479420..c959fc02 100644 --- a/doc/refunds.md +++ b/doc/refunds.md @@ -52,7 +52,7 @@ ListPaymentRefundsAsync( ```csharp try { - ListPaymentRefundsResponse result = refundsApi.ListPaymentRefundsAsync(null, null, null, null, null, null, null).Result; + ListPaymentRefundsResponse result = await refundsApi.ListPaymentRefundsAsync(null, null, null, null, null, null, null); } catch (ApiException e){}; ``` @@ -86,13 +86,13 @@ var bodyAmountMoney = new Money.Builder() .Build(); var body = new RefundPaymentRequest.Builder( "a7e36d40-d24b-11e8-b568-0800200c9a66", - bodyAmountMoney) - .PaymentId("UNOE3kv2BZwqHlJ830RCt5YCuaB") + bodyAmountMoney, + "UNOE3kv2BZwqHlJ830RCt5YCuaB") .Build(); try { - RefundPaymentResponse result = refundsApi.RefundPaymentAsync(body).Result; + RefundPaymentResponse result = await refundsApi.RefundPaymentAsync(body); } catch (ApiException e){}; ``` @@ -122,7 +122,7 @@ string refundId = "refund_id4"; try { - GetPaymentRefundResponse result = refundsApi.GetPaymentRefundAsync(refundId).Result; + GetPaymentRefundResponse result = await refundsApi.GetPaymentRefundAsync(refundId); } catch (ApiException e){}; ``` diff --git a/doc/reporting.md b/doc/reporting.md index 8b5f92e2..1994fecc 100644 --- a/doc/reporting.md +++ b/doc/reporting.md @@ -50,7 +50,7 @@ string locationId = "location_id4"; try { - ListAdditionalRecipientReceivableRefundsResponse result = reportingApi.ListAdditionalRecipientReceivableRefundsAsync(locationId, null, null, null, null).Result; + ListAdditionalRecipientReceivableRefundsResponse result = await reportingApi.ListAdditionalRecipientReceivableRefundsAsync(locationId, null, null, null, null); } catch (ApiException e){}; ``` @@ -92,7 +92,7 @@ string locationId = "location_id4"; try { - ListAdditionalRecipientReceivablesResponse result = reportingApi.ListAdditionalRecipientReceivablesAsync(locationId, null, null, null, null).Result; + ListAdditionalRecipientReceivablesResponse result = await reportingApi.ListAdditionalRecipientReceivablesAsync(locationId, null, null, null, null); } catch (ApiException e){}; ``` diff --git a/doc/transactions.md b/doc/transactions.md index ec2f47d3..f62140d1 100644 --- a/doc/transactions.md +++ b/doc/transactions.md @@ -63,7 +63,7 @@ string locationId = "location_id4"; try { - ListRefundsResponse result = transactionsApi.ListRefundsAsync(locationId, null, null, null, null).Result; + ListRefundsResponse result = await transactionsApi.ListRefundsAsync(locationId, null, null, null, null); } catch (ApiException e){}; ``` @@ -109,7 +109,7 @@ string locationId = "location_id4"; try { - ListTransactionsResponse result = transactionsApi.ListTransactionsAsync(locationId, null, null, null, null).Result; + ListTransactionsResponse result = await transactionsApi.ListTransactionsAsync(locationId, null, null, null, null); } catch (ApiException e){}; ``` @@ -204,7 +204,7 @@ var body = new ChargeRequest.Builder( try { - ChargeResponse result = transactionsApi.ChargeAsync(locationId, body).Result; + ChargeResponse result = await transactionsApi.ChargeAsync(locationId, body); } catch (ApiException e){}; ``` @@ -238,7 +238,7 @@ string transactionId = "transaction_id8"; try { - RetrieveTransactionResponse result = transactionsApi.RetrieveTransactionAsync(locationId, transactionId).Result; + RetrieveTransactionResponse result = await transactionsApi.RetrieveTransactionAsync(locationId, transactionId); } catch (ApiException e){}; ``` @@ -274,7 +274,7 @@ string transactionId = "transaction_id8"; try { - CaptureTransactionResponse result = transactionsApi.CaptureTransactionAsync(locationId, transactionId).Result; + CaptureTransactionResponse result = await transactionsApi.CaptureTransactionAsync(locationId, transactionId); } catch (ApiException e){}; ``` @@ -327,7 +327,7 @@ var body = new CreateRefundRequest.Builder( try { - CreateRefundResponse result = transactionsApi.CreateRefundAsync(locationId, transactionId, body).Result; + CreateRefundResponse result = await transactionsApi.CreateRefundAsync(locationId, transactionId, body); } catch (ApiException e){}; ``` @@ -363,7 +363,7 @@ string transactionId = "transaction_id8"; try { - VoidTransactionResponse result = transactionsApi.VoidTransactionAsync(locationId, transactionId).Result; + VoidTransactionResponse result = await transactionsApi.VoidTransactionAsync(locationId, transactionId); } catch (ApiException e){}; ``` diff --git a/doc/v1-employees.md b/doc/v1-employees.md index 42066496..b2d68ea3 100644 --- a/doc/v1-employees.md +++ b/doc/v1-employees.md @@ -67,7 +67,7 @@ ListEmployeesAsync( ```csharp try { - List result = v1EmployeesApi.ListEmployeesAsync(null, null, null, null, null, null, null, null, null).Result; + List result = await v1EmployeesApi.ListEmployeesAsync(null, null, null, null, null, null, null, null, null); } catch (ApiException e){}; ``` @@ -109,7 +109,7 @@ var body = new V1Employee.Builder( try { - V1Employee result = v1EmployeesApi.CreateEmployeeAsync(body).Result; + V1Employee result = await v1EmployeesApi.CreateEmployeeAsync(body); } catch (ApiException e){}; ``` @@ -139,7 +139,7 @@ string employeeId = "employee_id0"; try { - V1Employee result = v1EmployeesApi.RetrieveEmployeeAsync(employeeId).Result; + V1Employee result = await v1EmployeesApi.RetrieveEmployeeAsync(employeeId); } catch (ApiException e){}; ``` @@ -174,7 +174,7 @@ var body = new V1Employee.Builder( try { - V1Employee result = v1EmployeesApi.UpdateEmployeeAsync(employeeId, body).Result; + V1Employee result = await v1EmployeesApi.UpdateEmployeeAsync(employeeId, body); } catch (ApiException e){}; ``` @@ -204,7 +204,7 @@ ListEmployeeRolesAsync(string order = null, int? limit = null, string batchToken ```csharp try { - List result = v1EmployeesApi.ListEmployeeRolesAsync(null, null, null).Result; + List result = await v1EmployeesApi.ListEmployeeRolesAsync(null, null, null); } catch (ApiException e){}; ``` @@ -253,7 +253,7 @@ var body = new V1EmployeeRole.Builder( try { - V1EmployeeRole result = v1EmployeesApi.CreateEmployeeRoleAsync(body).Result; + V1EmployeeRole result = await v1EmployeesApi.CreateEmployeeRoleAsync(body); } catch (ApiException e){}; ``` @@ -283,7 +283,7 @@ string roleId = "role_id6"; try { - V1EmployeeRole result = v1EmployeesApi.RetrieveEmployeeRoleAsync(roleId).Result; + V1EmployeeRole result = await v1EmployeesApi.RetrieveEmployeeRoleAsync(roleId); } catch (ApiException e){}; ``` @@ -322,7 +322,7 @@ var body = new V1EmployeeRole.Builder( try { - V1EmployeeRole result = v1EmployeesApi.UpdateEmployeeRoleAsync(roleId, body).Result; + V1EmployeeRole result = await v1EmployeesApi.UpdateEmployeeRoleAsync(roleId, body); } catch (ApiException e){}; ``` @@ -371,7 +371,7 @@ ListTimecardsAsync( ```csharp try { - List result = v1EmployeesApi.ListTimecardsAsync(null, null, null, null, null, null, null, null, null, null, null).Result; + List result = await v1EmployeesApi.ListTimecardsAsync(null, null, null, null, null, null, null, null, null, null, null); } catch (ApiException e){}; ``` @@ -413,7 +413,7 @@ var body = new V1Timecard.Builder( try { - V1Timecard result = v1EmployeesApi.CreateTimecardAsync(body).Result; + V1Timecard result = await v1EmployeesApi.CreateTimecardAsync(body); } catch (ApiException e){}; ``` @@ -457,7 +457,7 @@ string timecardId = "timecard_id0"; try { - object result = v1EmployeesApi.DeleteTimecardAsync(timecardId).Result; + object result = await v1EmployeesApi.DeleteTimecardAsync(timecardId); } catch (ApiException e){}; ``` @@ -492,7 +492,7 @@ string timecardId = "timecard_id0"; try { - V1Timecard result = v1EmployeesApi.RetrieveTimecardAsync(timecardId).Result; + V1Timecard result = await v1EmployeesApi.RetrieveTimecardAsync(timecardId); } catch (ApiException e){}; ``` @@ -528,7 +528,7 @@ var body = new V1Timecard.Builder( try { - V1Timecard result = v1EmployeesApi.UpdateTimecardAsync(timecardId, body).Result; + V1Timecard result = await v1EmployeesApi.UpdateTimecardAsync(timecardId, body); } catch (ApiException e){}; ``` @@ -565,7 +565,7 @@ string timecardId = "timecard_id0"; try { - List result = v1EmployeesApi.ListTimecardEventsAsync(timecardId).Result; + List result = await v1EmployeesApi.ListTimecardEventsAsync(timecardId); } catch (ApiException e){}; ``` @@ -602,7 +602,7 @@ string locationId = "location_id4"; try { - List result = v1EmployeesApi.ListCashDrawerShiftsAsync(locationId, null, null, null).Result; + List result = await v1EmployeesApi.ListCashDrawerShiftsAsync(locationId, null, null, null); } catch (ApiException e){}; ``` @@ -634,7 +634,7 @@ string shiftId = "shift_id0"; try { - V1CashDrawerShift result = v1EmployeesApi.RetrieveCashDrawerShiftAsync(locationId, shiftId).Result; + V1CashDrawerShift result = await v1EmployeesApi.RetrieveCashDrawerShiftAsync(locationId, shiftId); } catch (ApiException e){}; ``` diff --git a/doc/v1-items.md b/doc/v1-items.md index 81166268..101289bc 100644 --- a/doc/v1-items.md +++ b/doc/v1-items.md @@ -84,7 +84,7 @@ string locationId = "location_id4"; try { - List result = v1ItemsApi.ListCategoriesAsync(locationId).Result; + List result = await v1ItemsApi.ListCategoriesAsync(locationId); } catch (ApiException e){}; ``` @@ -125,7 +125,7 @@ var body = new V1Category.Builder() try { - V1Category result = v1ItemsApi.CreateCategoryAsync(locationId, body).Result; + V1Category result = await v1ItemsApi.CreateCategoryAsync(locationId, body); } catch (ApiException e){}; ``` @@ -169,7 +169,7 @@ string categoryId = "category_id8"; try { - V1Category result = v1ItemsApi.DeleteCategoryAsync(locationId, categoryId).Result; + V1Category result = await v1ItemsApi.DeleteCategoryAsync(locationId, categoryId); } catch (ApiException e){}; ``` @@ -212,7 +212,7 @@ var body = new V1Category.Builder() try { - V1Category result = v1ItemsApi.UpdateCategoryAsync(locationId, categoryId, body).Result; + V1Category result = await v1ItemsApi.UpdateCategoryAsync(locationId, categoryId, body); } catch (ApiException e){}; ``` @@ -250,7 +250,7 @@ string locationId = "location_id4"; try { - List result = v1ItemsApi.ListDiscountsAsync(locationId).Result; + List result = await v1ItemsApi.ListDiscountsAsync(locationId); } catch (ApiException e){}; ``` @@ -291,7 +291,7 @@ var body = new V1Discount.Builder() try { - V1Discount result = v1ItemsApi.CreateDiscountAsync(locationId, body).Result; + V1Discount result = await v1ItemsApi.CreateDiscountAsync(locationId, body); } catch (ApiException e){}; ``` @@ -335,7 +335,7 @@ string discountId = "discount_id8"; try { - V1Discount result = v1ItemsApi.DeleteDiscountAsync(locationId, discountId).Result; + V1Discount result = await v1ItemsApi.DeleteDiscountAsync(locationId, discountId); } catch (ApiException e){}; ``` @@ -378,7 +378,7 @@ var body = new V1Discount.Builder() try { - V1Discount result = v1ItemsApi.UpdateDiscountAsync(locationId, discountId, body).Result; + V1Discount result = await v1ItemsApi.UpdateDiscountAsync(locationId, discountId, body); } catch (ApiException e){}; ``` @@ -416,7 +416,7 @@ string locationId = "location_id4"; try { - List result = v1ItemsApi.ListFeesAsync(locationId).Result; + List result = await v1ItemsApi.ListFeesAsync(locationId); } catch (ApiException e){}; ``` @@ -457,7 +457,7 @@ var body = new V1Fee.Builder() try { - V1Fee result = v1ItemsApi.CreateFeeAsync(locationId, body).Result; + V1Fee result = await v1ItemsApi.CreateFeeAsync(locationId, body); } catch (ApiException e){}; ``` @@ -501,7 +501,7 @@ string feeId = "fee_id8"; try { - V1Fee result = v1ItemsApi.DeleteFeeAsync(locationId, feeId).Result; + V1Fee result = await v1ItemsApi.DeleteFeeAsync(locationId, feeId); } catch (ApiException e){}; ``` @@ -544,7 +544,7 @@ var body = new V1Fee.Builder() try { - V1Fee result = v1ItemsApi.UpdateFeeAsync(locationId, feeId, body).Result; + V1Fee result = await v1ItemsApi.UpdateFeeAsync(locationId, feeId, body); } catch (ApiException e){}; ``` @@ -585,7 +585,7 @@ string locationId = "location_id4"; try { - List result = v1ItemsApi.ListInventoryAsync(locationId, null, null).Result; + List result = await v1ItemsApi.ListInventoryAsync(locationId, null, null); } catch (ApiException e){}; ``` @@ -628,7 +628,7 @@ var body = new V1AdjustInventoryRequest.Builder() try { - V1InventoryEntry result = v1ItemsApi.AdjustInventoryAsync(locationId, variationId, body).Result; + V1InventoryEntry result = await v1ItemsApi.AdjustInventoryAsync(locationId, variationId, body); } catch (ApiException e){}; ``` @@ -667,7 +667,7 @@ string locationId = "location_id4"; try { - List result = v1ItemsApi.ListItemsAsync(locationId, null).Result; + List result = await v1ItemsApi.ListItemsAsync(locationId, null); } catch (ApiException e){}; ``` @@ -720,7 +720,7 @@ var body = new V1Item.Builder() try { - V1Item result = v1ItemsApi.CreateItemAsync(locationId, body).Result; + V1Item result = await v1ItemsApi.CreateItemAsync(locationId, body); } catch (ApiException e){}; ``` @@ -764,7 +764,7 @@ string itemId = "item_id0"; try { - V1Item result = v1ItemsApi.DeleteItemAsync(locationId, itemId).Result; + V1Item result = await v1ItemsApi.DeleteItemAsync(locationId, itemId); } catch (ApiException e){}; ``` @@ -805,7 +805,7 @@ string itemId = "item_id0"; try { - V1Item result = v1ItemsApi.RetrieveItemAsync(locationId, itemId).Result; + V1Item result = await v1ItemsApi.RetrieveItemAsync(locationId, itemId); } catch (ApiException e){}; ``` @@ -848,7 +848,7 @@ var body = new V1Item.Builder() try { - V1Item result = v1ItemsApi.UpdateItemAsync(locationId, itemId, body).Result; + V1Item result = await v1ItemsApi.UpdateItemAsync(locationId, itemId, body); } catch (ApiException e){}; ``` @@ -891,7 +891,7 @@ string feeId = "fee_id8"; try { - V1Item result = v1ItemsApi.RemoveFeeAsync(locationId, itemId, feeId).Result; + V1Item result = await v1ItemsApi.RemoveFeeAsync(locationId, itemId, feeId); } catch (ApiException e){}; ``` @@ -934,7 +934,7 @@ string feeId = "fee_id8"; try { - V1Item result = v1ItemsApi.ApplyFeeAsync(locationId, itemId, feeId).Result; + V1Item result = await v1ItemsApi.ApplyFeeAsync(locationId, itemId, feeId); } catch (ApiException e){}; ``` @@ -977,7 +977,7 @@ string itemId = "item_id0"; try { - V1Item result = v1ItemsApi.RemoveModifierListAsync(locationId, modifierListId, itemId).Result; + V1Item result = await v1ItemsApi.RemoveModifierListAsync(locationId, modifierListId, itemId); } catch (ApiException e){}; ``` @@ -1020,7 +1020,7 @@ string itemId = "item_id0"; try { - V1Item result = v1ItemsApi.ApplyModifierListAsync(locationId, modifierListId, itemId).Result; + V1Item result = await v1ItemsApi.ApplyModifierListAsync(locationId, modifierListId, itemId); } catch (ApiException e){}; ``` @@ -1063,7 +1063,7 @@ var body = new V1Variation.Builder() try { - V1Variation result = v1ItemsApi.CreateVariationAsync(locationId, itemId, body).Result; + V1Variation result = await v1ItemsApi.CreateVariationAsync(locationId, itemId, body); } catch (ApiException e){}; ``` @@ -1109,7 +1109,7 @@ string variationId = "variation_id2"; try { - V1Variation result = v1ItemsApi.DeleteVariationAsync(locationId, itemId, variationId).Result; + V1Variation result = await v1ItemsApi.DeleteVariationAsync(locationId, itemId, variationId); } catch (ApiException e){}; ``` @@ -1158,7 +1158,7 @@ var body = new V1Variation.Builder() try { - V1Variation result = v1ItemsApi.UpdateVariationAsync(locationId, itemId, variationId, body).Result; + V1Variation result = await v1ItemsApi.UpdateVariationAsync(locationId, itemId, variationId, body); } catch (ApiException e){}; ``` @@ -1196,7 +1196,7 @@ string locationId = "location_id4"; try { - List result = v1ItemsApi.ListModifierListsAsync(locationId).Result; + List result = await v1ItemsApi.ListModifierListsAsync(locationId); } catch (ApiException e){}; ``` @@ -1237,7 +1237,7 @@ var body = new V1ModifierList.Builder() try { - V1ModifierList result = v1ItemsApi.CreateModifierListAsync(locationId, body).Result; + V1ModifierList result = await v1ItemsApi.CreateModifierListAsync(locationId, body); } catch (ApiException e){}; ``` @@ -1282,7 +1282,7 @@ string modifierListId = "modifier_list_id6"; try { - V1ModifierList result = v1ItemsApi.DeleteModifierListAsync(locationId, modifierListId).Result; + V1ModifierList result = await v1ItemsApi.DeleteModifierListAsync(locationId, modifierListId); } catch (ApiException e){}; ``` @@ -1322,7 +1322,7 @@ string modifierListId = "modifier_list_id6"; try { - V1ModifierList result = v1ItemsApi.RetrieveModifierListAsync(locationId, modifierListId).Result; + V1ModifierList result = await v1ItemsApi.RetrieveModifierListAsync(locationId, modifierListId); } catch (ApiException e){}; ``` @@ -1365,7 +1365,7 @@ var body = new V1UpdateModifierListRequest.Builder() try { - V1ModifierList result = v1ItemsApi.UpdateModifierListAsync(locationId, modifierListId, body).Result; + V1ModifierList result = await v1ItemsApi.UpdateModifierListAsync(locationId, modifierListId, body); } catch (ApiException e){}; ``` @@ -1408,7 +1408,7 @@ var body = new V1ModifierOption.Builder() try { - V1ModifierOption result = v1ItemsApi.CreateModifierOptionAsync(locationId, modifierListId, body).Result; + V1ModifierOption result = await v1ItemsApi.CreateModifierOptionAsync(locationId, modifierListId, body); } catch (ApiException e){}; ``` @@ -1454,7 +1454,7 @@ string modifierOptionId = "modifier_option_id6"; try { - V1ModifierOption result = v1ItemsApi.DeleteModifierOptionAsync(locationId, modifierListId, modifierOptionId).Result; + V1ModifierOption result = await v1ItemsApi.DeleteModifierOptionAsync(locationId, modifierListId, modifierOptionId); } catch (ApiException e){}; ``` @@ -1503,7 +1503,7 @@ var body = new V1ModifierOption.Builder() try { - V1ModifierOption result = v1ItemsApi.UpdateModifierOptionAsync(locationId, modifierListId, modifierOptionId, body).Result; + V1ModifierOption result = await v1ItemsApi.UpdateModifierOptionAsync(locationId, modifierListId, modifierOptionId, body); } catch (ApiException e){}; ``` @@ -1542,7 +1542,7 @@ string locationId = "location_id4"; try { - List result = v1ItemsApi.ListPagesAsync(locationId).Result; + List result = await v1ItemsApi.ListPagesAsync(locationId); } catch (ApiException e){}; ``` @@ -1583,7 +1583,7 @@ var body = new V1Page.Builder() try { - V1Page result = v1ItemsApi.CreatePageAsync(locationId, body).Result; + V1Page result = await v1ItemsApi.CreatePageAsync(locationId, body); } catch (ApiException e){}; ``` @@ -1626,7 +1626,7 @@ string pageId = "page_id0"; try { - V1Page result = v1ItemsApi.DeletePageAsync(locationId, pageId).Result; + V1Page result = await v1ItemsApi.DeletePageAsync(locationId, pageId); } catch (ApiException e){}; ``` @@ -1669,7 +1669,7 @@ var body = new V1Page.Builder() try { - V1Page result = v1ItemsApi.UpdatePageAsync(locationId, pageId, body).Result; + V1Page result = await v1ItemsApi.UpdatePageAsync(locationId, pageId, body); } catch (ApiException e){}; ``` @@ -1719,7 +1719,7 @@ string pageId = "page_id0"; try { - V1Page result = v1ItemsApi.DeletePageCellAsync(locationId, pageId, null, null).Result; + V1Page result = await v1ItemsApi.DeletePageCellAsync(locationId, pageId, null, null); } catch (ApiException e){}; ``` @@ -1762,7 +1762,7 @@ var body = new V1PageCell.Builder() try { - V1Page result = v1ItemsApi.UpdatePageCellAsync(locationId, pageId, body).Result; + V1Page result = await v1ItemsApi.UpdatePageCellAsync(locationId, pageId, body); } catch (ApiException e){}; ``` diff --git a/doc/v1-locations.md b/doc/v1-locations.md index b96c4153..98c15b6f 100644 --- a/doc/v1-locations.md +++ b/doc/v1-locations.md @@ -38,7 +38,7 @@ RetrieveBusinessAsync() ```csharp try { - V1Merchant result = v1LocationsApi.RetrieveBusinessAsync().Result; + V1Merchant result = await v1LocationsApi.RetrieveBusinessAsync(); } catch (ApiException e){}; ``` @@ -69,7 +69,7 @@ ListLocationsAsync() ```csharp try { - List result = v1LocationsApi.ListLocationsAsync().Result; + List result = await v1LocationsApi.ListLocationsAsync(); } catch (ApiException e){}; ``` diff --git a/doc/v1-transactions.md b/doc/v1-transactions.md index 80c3cdf2..1dabd35a 100644 --- a/doc/v1-transactions.md +++ b/doc/v1-transactions.md @@ -47,7 +47,7 @@ string locationId = "location_id4"; try { - List result = v1TransactionsApi.ListBankAccountsAsync(locationId).Result; + List result = await v1TransactionsApi.ListBankAccountsAsync(locationId); } catch (ApiException e){}; ``` @@ -79,7 +79,7 @@ string bankAccountId = "bank_account_id0"; try { - V1BankAccount result = v1TransactionsApi.RetrieveBankAccountAsync(locationId, bankAccountId).Result; + V1BankAccount result = await v1TransactionsApi.RetrieveBankAccountAsync(locationId, bankAccountId); } catch (ApiException e){}; ``` @@ -116,7 +116,7 @@ string locationId = "location_id4"; try { - List result = v1TransactionsApi.ListOrdersAsync(locationId, null, null, null).Result; + List result = await v1TransactionsApi.ListOrdersAsync(locationId, null, null, null); } catch (ApiException e){}; ``` @@ -148,7 +148,7 @@ string orderId = "order_id6"; try { - V1Order result = v1TransactionsApi.RetrieveOrderAsync(locationId, orderId).Result; + V1Order result = await v1TransactionsApi.RetrieveOrderAsync(locationId, orderId); } catch (ApiException e){}; ``` @@ -184,7 +184,7 @@ var body = new V1UpdateOrderRequest.Builder( try { - V1Order result = v1TransactionsApi.UpdateOrderAsync(locationId, orderId, body).Result; + V1Order result = await v1TransactionsApi.UpdateOrderAsync(locationId, orderId, body); } catch (ApiException e){}; ``` @@ -237,7 +237,7 @@ string locationId = "location_id4"; try { - List result = v1TransactionsApi.ListPaymentsAsync(locationId, null, null, null, null, null, null).Result; + List result = await v1TransactionsApi.ListPaymentsAsync(locationId, null, null, null, null, null, null); } catch (ApiException e){}; ``` @@ -269,7 +269,7 @@ string paymentId = "payment_id0"; try { - V1Payment result = v1TransactionsApi.RetrievePaymentAsync(locationId, paymentId).Result; + V1Payment result = await v1TransactionsApi.RetrievePaymentAsync(locationId, paymentId); } catch (ApiException e){}; ``` @@ -310,7 +310,7 @@ string locationId = "location_id4"; try { - List result = v1TransactionsApi.ListRefundsAsync(locationId, null, null, null, null, null).Result; + List result = await v1TransactionsApi.ListRefundsAsync(locationId, null, null, null, null, null); } catch (ApiException e){}; ``` @@ -357,7 +357,7 @@ var body = new V1CreateRefundRequest.Builder( try { - V1Refund result = v1TransactionsApi.CreateRefundAsync(locationId, body).Result; + V1Refund result = await v1TransactionsApi.CreateRefundAsync(locationId, body); } catch (ApiException e){}; ``` @@ -386,11 +386,11 @@ ListSettlementsAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the location to list settlements for. | -| `order` | [`string`](/doc/models/sort-order.md) | Query, Optional | TThe order in which payments are listed in the response. | +| `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 payments to return in a single response. This value cannot exceed 200. | +| `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. | @@ -405,7 +405,7 @@ string locationId = "location_id4"; try { - List result = v1TransactionsApi.ListSettlementsAsync(locationId, null, null, null, null, null, null).Result; + List result = await v1TransactionsApi.ListSettlementsAsync(locationId, null, null, null, null, null, null); } catch (ApiException e){}; ``` @@ -453,7 +453,7 @@ string settlementId = "settlement_id0"; try { - V1Settlement result = v1TransactionsApi.RetrieveSettlementAsync(locationId, settlementId).Result; + V1Settlement result = await v1TransactionsApi.RetrieveSettlementAsync(locationId, settlementId); } catch (ApiException e){}; ```