diff --git a/doc/api/apple-pay.md b/doc/api/apple-pay.md index 3d254c78..bc8be616 100644 --- a/doc/api/apple-pay.md +++ b/doc/api/apple-pay.md @@ -41,11 +41,11 @@ CompletableFuture registerDomainAsync( ## Example Usage ```java -RegisterDomainRequest body = new RegisterDomainRequest.Builder( +RegisterDomainRequest body = new RegisterDomainRequest.Builder( "example.com" -) +) .build(); - + applePayApi.registerDomainAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/bank-accounts.md b/doc/api/bank-accounts.md index ffb0f1b7..0ce8ff04 100644 --- a/doc/api/bank-accounts.md +++ b/doc/api/bank-accounts.md @@ -74,7 +74,7 @@ CompletableFuture getBankAccountByV1IdAsync( ## Example Usage ```java -String v1BankAccountId = "v1_bank_account_id8"; +String v1BankAccountId = "v1_bank_account_id8"; bankAccountsApi.getBankAccountByV1IdAsync(v1BankAccountId).thenAccept(result -> { // TODO success callback handler @@ -110,7 +110,7 @@ CompletableFuture getBankAccountAsync( ## Example Usage ```java -String bankAccountId = "bank_account_id0"; +String bankAccountId = "bank_account_id0"; bankAccountsApi.getBankAccountAsync(bankAccountId).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/booking-custom-attributes.md b/doc/api/booking-custom-attributes.md index 86402e46..8bb28f84 100644 --- a/doc/api/booking-custom-attributes.md +++ b/doc/api/booking-custom-attributes.md @@ -89,12 +89,12 @@ CompletableFuture createBookingC ## Example Usage ```java -CreateBookingCustomAttributeDefinitionRequest body = new CreateBookingCustomAttributeDefinitionRequest.Builder( - new CustomAttributeDefinition.Builder() +CreateBookingCustomAttributeDefinitionRequest body = new CreateBookingCustomAttributeDefinitionRequest.Builder( + new CustomAttributeDefinition.Builder() .build() -) +) .build(); - + bookingCustomAttributesApi.createBookingCustomAttributeDefinitionAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -134,7 +134,7 @@ CompletableFuture deleteBookingC ## Example Usage ```java -String key = "key0"; +String key = "key0"; bookingCustomAttributesApi.deleteBookingCustomAttributeDefinitionAsync(key).thenAccept(result -> { // TODO success callback handler @@ -174,7 +174,7 @@ CompletableFuture retrieveBook ## Example Usage ```java -String key = "key0"; +String key = "key0"; bookingCustomAttributesApi.retrieveBookingCustomAttributeDefinitionAsync(key, null).thenAccept(result -> { // TODO success callback handler @@ -217,13 +217,13 @@ CompletableFuture updateBookingC ## Example Usage ```java -String key = "key0"; -UpdateBookingCustomAttributeDefinitionRequest body = new UpdateBookingCustomAttributeDefinitionRequest.Builder( - new CustomAttributeDefinition.Builder() +String key = "key0"; +UpdateBookingCustomAttributeDefinitionRequest body = new UpdateBookingCustomAttributeDefinitionRequest.Builder( + new CustomAttributeDefinition.Builder() .build() -) +) .build(); - + bookingCustomAttributesApi.updateBookingCustomAttributeDefinitionAsync(key, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -263,22 +263,22 @@ CompletableFuture bulkDeleteBookingCu ## Example Usage ```java -BulkDeleteBookingCustomAttributesRequest body = new BulkDeleteBookingCustomAttributesRequest.Builder( - new LinkedHashMap() {{ - put("key0", new BookingCustomAttributeDeleteRequest.Builder( +BulkDeleteBookingCustomAttributesRequest body = new BulkDeleteBookingCustomAttributesRequest.Builder( + new LinkedHashMap() {{ + put("key0", new BookingCustomAttributeDeleteRequest.Builder( "booking_id4", "key0" - ) - .build()); - put("key1", new BookingCustomAttributeDeleteRequest.Builder( + ) + .build()); + put("key1", new BookingCustomAttributeDeleteRequest.Builder( "booking_id4", "key0" - ) - .build()); + ) + .build()); }} -) +) .build(); - + bookingCustomAttributesApi.bulkDeleteBookingCustomAttributesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -318,24 +318,24 @@ CompletableFuture bulkUpsertBookingCu ## Example Usage ```java -BulkUpsertBookingCustomAttributesRequest body = new BulkUpsertBookingCustomAttributesRequest.Builder( - new LinkedHashMap() {{ - put("key0", new BookingCustomAttributeUpsertRequest.Builder( +BulkUpsertBookingCustomAttributesRequest body = new BulkUpsertBookingCustomAttributesRequest.Builder( + new LinkedHashMap() {{ + put("key0", new BookingCustomAttributeUpsertRequest.Builder( "booking_id4", - new CustomAttribute.Builder() + new CustomAttribute.Builder() .build() - ) - .build()); - put("key1", new BookingCustomAttributeUpsertRequest.Builder( + ) + .build()); + put("key1", new BookingCustomAttributeUpsertRequest.Builder( "booking_id4", - new CustomAttribute.Builder() + new CustomAttribute.Builder() .build() - ) - .build()); + ) + .build()); }} -) +) .build(); - + bookingCustomAttributesApi.bulkUpsertBookingCustomAttributesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -378,8 +378,8 @@ CompletableFuture listBookingCustomAttribut ## Example Usage ```java -String bookingId = "booking_id4"; -Boolean withDefinitions = false; +String bookingId = "booking_id4"; +Boolean withDefinitions = false; bookingCustomAttributesApi.listBookingCustomAttributesAsync(bookingId, null, null, withDefinitions).thenAccept(result -> { // TODO success callback handler @@ -422,8 +422,8 @@ CompletableFuture deleteBookingCustomAttri ## Example Usage ```java -String bookingId = "booking_id4"; -String key = "key0"; +String bookingId = "booking_id4"; +String key = "key0"; bookingCustomAttributesApi.deleteBookingCustomAttributeAsync(bookingId, key).thenAccept(result -> { // TODO success callback handler @@ -467,9 +467,9 @@ CompletableFuture retrieveBookingCustomA ## Example Usage ```java -String bookingId = "booking_id4"; -String key = "key0"; -Boolean withDefinition = false; +String bookingId = "booking_id4"; +String key = "key0"; +Boolean withDefinition = false; bookingCustomAttributesApi.retrieveBookingCustomAttributeAsync(bookingId, key, withDefinition, null).thenAccept(result -> { // TODO success callback handler @@ -514,14 +514,14 @@ CompletableFuture upsertBookingCustomAttri ## Example Usage ```java -String bookingId = "booking_id4"; -String key = "key0"; -UpsertBookingCustomAttributeRequest body = new UpsertBookingCustomAttributeRequest.Builder( - new CustomAttribute.Builder() +String bookingId = "booking_id4"; +String key = "key0"; +UpsertBookingCustomAttributeRequest body = new UpsertBookingCustomAttributeRequest.Builder( + new CustomAttribute.Builder() .build() -) +) .build(); - + bookingCustomAttributesApi.upsertBookingCustomAttributeAsync(bookingId, key, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/bookings.md b/doc/api/bookings.md index c95bdf7b..c0be9084 100644 --- a/doc/api/bookings.md +++ b/doc/api/bookings.md @@ -109,12 +109,12 @@ CompletableFuture createBookingAsync( ## Example Usage ```java -CreateBookingRequest body = new CreateBookingRequest.Builder( - new Booking.Builder() +CreateBookingRequest body = new CreateBookingRequest.Builder( + new Booking.Builder() .build() -) +) .build(); - + bookingsApi.createBookingAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -151,18 +151,18 @@ CompletableFuture searchAvailabilityAsync( ## Example Usage ```java -SearchAvailabilityRequest body = new SearchAvailabilityRequest.Builder( - new SearchAvailabilityQuery.Builder( - new SearchAvailabilityFilter.Builder( - new TimeRange.Builder() +SearchAvailabilityRequest body = new SearchAvailabilityRequest.Builder( + new SearchAvailabilityQuery.Builder( + new SearchAvailabilityFilter.Builder( + new TimeRange.Builder() .build() - ) + ) .build() - ) + ) .build() -) +) .build(); - + bookingsApi.searchAvailabilityAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -199,15 +199,15 @@ CompletableFuture bulkRetrieveBookingsAsync( ## Example Usage ```java -BulkRetrieveBookingsRequest body = new BulkRetrieveBookingsRequest.Builder( - Arrays.asList( +BulkRetrieveBookingsRequest body = new BulkRetrieveBookingsRequest.Builder( + Arrays.asList( "booking_ids8", "booking_ids9", "booking_ids0" ) -) +) .build(); - + bookingsApi.bulkRetrieveBookingsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -302,7 +302,7 @@ CompletableFuture retrieveLocationBookin ## Example Usage ```java -String locationId = "location_id4"; +String locationId = "location_id4"; bookingsApi.retrieveLocationBookingProfileAsync(locationId).thenAccept(result -> { // TODO success callback handler @@ -343,7 +343,7 @@ CompletableFuture listTeamMemberBookingPr ## Example Usage ```java -Boolean bookableOnly = false; +Boolean bookableOnly = false; bookingsApi.listTeamMemberBookingProfilesAsync(bookableOnly, null, null, null).thenAccept(result -> { // TODO success callback handler @@ -378,15 +378,15 @@ CompletableFuture bulkRetrieveTea ## Example Usage ```java -BulkRetrieveTeamMemberBookingProfilesRequest body = new BulkRetrieveTeamMemberBookingProfilesRequest.Builder( - Arrays.asList( +BulkRetrieveTeamMemberBookingProfilesRequest body = new BulkRetrieveTeamMemberBookingProfilesRequest.Builder( + Arrays.asList( "team_member_ids3", "team_member_ids4", "team_member_ids5" ) -) +) .build(); - + bookingsApi.bulkRetrieveTeamMemberBookingProfilesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -420,7 +420,7 @@ CompletableFuture retrieveTeamMemberBo ## Example Usage ```java -String teamMemberId = "team_member_id0"; +String teamMemberId = "team_member_id0"; bookingsApi.retrieveTeamMemberBookingProfileAsync(teamMemberId).thenAccept(result -> { // TODO success callback handler @@ -458,7 +458,7 @@ CompletableFuture retrieveBookingAsync( ## Example Usage ```java -String bookingId = "booking_id4"; +String bookingId = "booking_id4"; bookingsApi.retrieveBookingAsync(bookingId).thenAccept(result -> { // TODO success callback handler @@ -501,13 +501,13 @@ CompletableFuture updateBookingAsync( ## Example Usage ```java -String bookingId = "booking_id4"; -UpdateBookingRequest body = new UpdateBookingRequest.Builder( - new Booking.Builder() +String bookingId = "booking_id4"; +UpdateBookingRequest body = new UpdateBookingRequest.Builder( + new Booking.Builder() .build() -) +) .build(); - + bookingsApi.updateBookingAsync(bookingId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -549,10 +549,10 @@ CompletableFuture cancelBookingAsync( ## Example Usage ```java -String bookingId = "booking_id4"; -CancelBookingRequest body = new CancelBookingRequest.Builder() +String bookingId = "booking_id4"; +CancelBookingRequest body = new CancelBookingRequest.Builder() .build(); - + bookingsApi.cancelBookingAsync(bookingId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/cards.md b/doc/api/cards.md index 62b5cd1e..89cd9825 100644 --- a/doc/api/cards.md +++ b/doc/api/cards.md @@ -47,7 +47,7 @@ CompletableFuture listCardsAsync( ## Example Usage ```java -Boolean includeDisabled = false; +Boolean includeDisabled = false; cardsApi.listCardsAsync(null, null, includeDisabled, null, null).thenAccept(result -> { // TODO success callback handler @@ -82,25 +82,25 @@ CompletableFuture createCardAsync( ## Example Usage ```java -CreateCardRequest body = new CreateCardRequest.Builder( +CreateCardRequest body = new CreateCardRequest.Builder( "4935a656-a929-4792-b97c-8848be85c27c", "cnon:uIbfJXhXETSP197M3GB", - new Card.Builder() - .cardholderName("Amelia Earhart") - .billingAddress(new Address.Builder() - .addressLine1("500 Electric Ave") - .addressLine2("Suite 600") - .locality("New York") - .administrativeDistrictLevel1("NY") - .postalCode("10003") - .country("US") - .build()) - .customerId("VDKXEEKPJN48QDG3BGGFAK05P8") - .referenceId("user-id-1") + new Card.Builder() + .cardholderName("Amelia Earhart") + .billingAddress(new Address.Builder() + .addressLine1("500 Electric Ave") + .addressLine2("Suite 600") + .locality("New York") + .administrativeDistrictLevel1("NY") + .postalCode("10003") + .country("US") + .build()) + .customerId("VDKXEEKPJN48QDG3BGGFAK05P8") + .referenceId("user-id-1") .build() -) +) .build(); - + cardsApi.createCardAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -134,7 +134,7 @@ CompletableFuture retrieveCardAsync( ## Example Usage ```java -String cardId = "card_id4"; +String cardId = "card_id4"; cardsApi.retrieveCardAsync(cardId).thenAccept(result -> { // TODO success callback handler @@ -170,7 +170,7 @@ CompletableFuture disableCardAsync( ## Example Usage ```java -String cardId = "card_id4"; +String cardId = "card_id4"; cardsApi.disableCardAsync(cardId).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/cash-drawers.md b/doc/api/cash-drawers.md index a3d17179..7cb17b8d 100644 --- a/doc/api/cash-drawers.md +++ b/doc/api/cash-drawers.md @@ -48,7 +48,7 @@ CompletableFuture listCashDrawerShiftsAsync( ## Example Usage ```java -String locationId = "location_id4"; +String locationId = "location_id4"; cashDrawersApi.listCashDrawerShiftsAsync(locationId, null, null, null, null, null).thenAccept(result -> { // TODO success callback handler @@ -86,8 +86,8 @@ CompletableFuture retrieveCashDrawerShiftAsync( ## Example Usage ```java -String locationId = "location_id4"; -String shiftId = "shift_id0"; +String locationId = "location_id4"; +String shiftId = "shift_id0"; cashDrawersApi.retrieveCashDrawerShiftAsync(locationId, shiftId).thenAccept(result -> { // TODO success callback handler @@ -128,8 +128,8 @@ CompletableFuture listCashDrawerShiftEventsAs ## Example Usage ```java -String locationId = "location_id4"; -String shiftId = "shift_id0"; +String locationId = "location_id4"; +String shiftId = "shift_id0"; cashDrawersApi.listCashDrawerShiftEventsAsync(locationId, shiftId, null, null).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/catalog.md b/doc/api/catalog.md index cdd4c0b5..cd5ae678 100644 --- a/doc/api/catalog.md +++ b/doc/api/catalog.md @@ -61,13 +61,13 @@ CompletableFuture batchDeleteCatalogObjectsAs ## Example Usage ```java -BatchDeleteCatalogObjectsRequest body = new BatchDeleteCatalogObjectsRequest.Builder() - .objectIds(Arrays.asList( +BatchDeleteCatalogObjectsRequest body = new BatchDeleteCatalogObjectsRequest.Builder() + .objectIds(Arrays.asList( "W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK" - )) + )) .build(); - + catalogApi.batchDeleteCatalogObjectsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -106,15 +106,15 @@ CompletableFuture batchRetrieveCatalogObjec ## Example Usage ```java -BatchRetrieveCatalogObjectsRequest body = new BatchRetrieveCatalogObjectsRequest.Builder( - Arrays.asList( +BatchRetrieveCatalogObjectsRequest body = new BatchRetrieveCatalogObjectsRequest.Builder( + Arrays.asList( "W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK" ) -) -.includeRelatedObjects(true) +) +.includeRelatedObjects(true) .build(); - + catalogApi.batchRetrieveCatalogObjectsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -160,126 +160,126 @@ CompletableFuture batchUpsertCatalogObjectsAs ## Example Usage ```java -BatchUpsertCatalogObjectsRequest body = new BatchUpsertCatalogObjectsRequest.Builder( +BatchUpsertCatalogObjectsRequest body = new BatchUpsertCatalogObjectsRequest.Builder( "789ff020-f723-43a9-b4b5-43b5dc1fa3dc", - Arrays.asList( - new CatalogObjectBatch.Builder( - Arrays.asList( - new CatalogObject.Builder( + Arrays.asList( + new CatalogObjectBatch.Builder( + Arrays.asList( + new CatalogObject.Builder( "ITEM", "#Tea" - ) - .presentAtAllLocations(true) - .itemData(new CatalogItem.Builder() - .name("Tea") - .taxIds(Arrays.asList( + ) + .presentAtAllLocations(true) + .itemData(new CatalogItem.Builder() + .name("Tea") + .taxIds(Arrays.asList( "#SalesTax" - )) - .variations(Arrays.asList( - new CatalogObject.Builder( + )) + .variations(Arrays.asList( + new CatalogObject.Builder( "ITEM_VARIATION", "#Tea_Mug" - ) - .presentAtAllLocations(true) - .itemVariationData(new CatalogItemVariation.Builder() - .itemId("#Tea") - .name("Mug") - .pricingType("FIXED_PRICING") - .priceMoney(new Money.Builder() - .amount(150L) - .currency("USD") - .build()) - .build()) + ) + .presentAtAllLocations(true) + .itemVariationData(new CatalogItemVariation.Builder() + .itemId("#Tea") + .name("Mug") + .pricingType("FIXED_PRICING") + .priceMoney(new Money.Builder() + .amount(150L) + .currency("USD") + .build()) + .build()) .build() - )) - .categories(Arrays.asList( - new CatalogObjectCategory.Builder() - .id("#Beverages") + )) + .categories(Arrays.asList( + new CatalogObjectCategory.Builder() + .id("#Beverages") .build() - )) - .descriptionHtml("

Hot Leaf Juice

") - .build()) + )) + .descriptionHtml("

Hot Leaf Juice

") + .build()) .build(), - new CatalogObject.Builder( + new CatalogObject.Builder( "ITEM", "#Coffee" - ) - .presentAtAllLocations(true) - .itemData(new CatalogItem.Builder() - .name("Coffee") - .taxIds(Arrays.asList( + ) + .presentAtAllLocations(true) + .itemData(new CatalogItem.Builder() + .name("Coffee") + .taxIds(Arrays.asList( "#SalesTax" - )) - .variations(Arrays.asList( - new CatalogObject.Builder( + )) + .variations(Arrays.asList( + new CatalogObject.Builder( "ITEM_VARIATION", "#Coffee_Regular" - ) - .presentAtAllLocations(true) - .itemVariationData(new CatalogItemVariation.Builder() - .itemId("#Coffee") - .name("Regular") - .pricingType("FIXED_PRICING") - .priceMoney(new Money.Builder() - .amount(250L) - .currency("USD") - .build()) - .build()) + ) + .presentAtAllLocations(true) + .itemVariationData(new CatalogItemVariation.Builder() + .itemId("#Coffee") + .name("Regular") + .pricingType("FIXED_PRICING") + .priceMoney(new Money.Builder() + .amount(250L) + .currency("USD") + .build()) + .build()) .build(), - new CatalogObject.Builder( + new CatalogObject.Builder( "ITEM_VARIATION", "#Coffee_Large" - ) - .presentAtAllLocations(true) - .itemVariationData(new CatalogItemVariation.Builder() - .itemId("#Coffee") - .name("Large") - .pricingType("FIXED_PRICING") - .priceMoney(new Money.Builder() - .amount(350L) - .currency("USD") - .build()) - .build()) + ) + .presentAtAllLocations(true) + .itemVariationData(new CatalogItemVariation.Builder() + .itemId("#Coffee") + .name("Large") + .pricingType("FIXED_PRICING") + .priceMoney(new Money.Builder() + .amount(350L) + .currency("USD") + .build()) + .build()) .build() - )) - .categories(Arrays.asList( - new CatalogObjectCategory.Builder() - .id("#Beverages") + )) + .categories(Arrays.asList( + new CatalogObjectCategory.Builder() + .id("#Beverages") .build() - )) - .descriptionHtml("

Hot Bean Juice

") - .build()) + )) + .descriptionHtml("

Hot Bean Juice

") + .build()) .build(), - new CatalogObject.Builder( + new CatalogObject.Builder( "CATEGORY", "#Beverages" - ) - .presentAtAllLocations(true) - .categoryData(new CatalogCategory.Builder() - .name("Beverages") - .build()) + ) + .presentAtAllLocations(true) + .categoryData(new CatalogCategory.Builder() + .name("Beverages") + .build()) .build(), - new CatalogObject.Builder( + new CatalogObject.Builder( "TAX", "#SalesTax" - ) - .presentAtAllLocations(true) - .taxData(new CatalogTax.Builder() - .name("Sales Tax") - .calculationPhase("TAX_SUBTOTAL_PHASE") - .inclusionType("ADDITIVE") - .percentage("5.0") - .appliesToCustomAmounts(true) - .enabled(true) - .build()) + ) + .presentAtAllLocations(true) + .taxData(new CatalogTax.Builder() + .name("Sales Tax") + .calculationPhase("TAX_SUBTOTAL_PHASE") + .inclusionType("ADDITIVE") + .percentage("5.0") + .appliesToCustomAmounts(true) + .enabled(true) + .build()) .build() ) - ) + ) .build() ) -) +) .build(); - + catalogApi.batchUpsertCatalogObjectsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -320,20 +320,20 @@ CompletableFuture createCatalogImageAsync( ## Example Usage ```java -CreateCatalogImageRequest request = new CreateCatalogImageRequest.Builder( +CreateCatalogImageRequest request = new CreateCatalogImageRequest.Builder( "528dea59-7bfb-43c1-bd48-4a6bba7dd61f86", - new CatalogObject.Builder( + new CatalogObject.Builder( "IMAGE", "#TEMP_ID" - ) - .imageData(new CatalogImage.Builder() - .caption("A picture of a cup of coffee") - .build()) + ) + .imageData(new CatalogImage.Builder() + .caption("A picture of a cup of coffee") + .build()) .build() -) -.objectId("ND6EA5AAJEO5WL3JNNIAQA32") +) +.objectId("ND6EA5AAJEO5WL3JNNIAQA32") .build(); - + catalogApi.createCatalogImageAsync(request, null).thenAccept(result -> { // TODO success callback handler @@ -375,12 +375,12 @@ CompletableFuture updateCatalogImageAsync( ## Example Usage ```java -String imageId = "image_id4"; -UpdateCatalogImageRequest request = new UpdateCatalogImageRequest.Builder( +String imageId = "image_id4"; +UpdateCatalogImageRequest request = new UpdateCatalogImageRequest.Builder( "528dea59-7bfb-43c1-bd48-4a6bba7dd61f86" -) +) .build(); - + catalogApi.updateCatalogImageAsync(imageId, request, null).thenAccept(result -> { // TODO success callback handler @@ -490,47 +490,47 @@ CompletableFuture upsertCatalogObjectAsync( ## Example Usage ```java -UpsertCatalogObjectRequest body = new UpsertCatalogObjectRequest.Builder( +UpsertCatalogObjectRequest body = new UpsertCatalogObjectRequest.Builder( "af3d1afc-7212-4300-b463-0bfc5314a5ae", - new CatalogObject.Builder( + new CatalogObject.Builder( "ITEM", "#Cocoa" - ) - .itemData(new CatalogItem.Builder() - .name("Cocoa") - .abbreviation("Ch") - .variations(Arrays.asList( - new CatalogObject.Builder( + ) + .itemData(new CatalogItem.Builder() + .name("Cocoa") + .abbreviation("Ch") + .variations(Arrays.asList( + new CatalogObject.Builder( "ITEM_VARIATION", "#Small" - ) - .itemVariationData(new CatalogItemVariation.Builder() - .itemId("#Cocoa") - .name("Small") - .pricingType("VARIABLE_PRICING") - .build()) + ) + .itemVariationData(new CatalogItemVariation.Builder() + .itemId("#Cocoa") + .name("Small") + .pricingType("VARIABLE_PRICING") + .build()) .build(), - new CatalogObject.Builder( + new CatalogObject.Builder( "ITEM_VARIATION", "#Large" - ) - .itemVariationData(new CatalogItemVariation.Builder() - .itemId("#Cocoa") - .name("Large") - .pricingType("FIXED_PRICING") - .priceMoney(new Money.Builder() - .amount(400L) - .currency("USD") - .build()) - .build()) + ) + .itemVariationData(new CatalogItemVariation.Builder() + .itemId("#Cocoa") + .name("Large") + .pricingType("FIXED_PRICING") + .priceMoney(new Money.Builder() + .amount(400L) + .currency("USD") + .build()) + .build()) .build() - )) - .descriptionHtml("

Hot Chocolate

") - .build()) + )) + .descriptionHtml("

Hot Chocolate

") + .build()) .build() -) +) .build(); - + catalogApi.upsertCatalogObjectAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -573,7 +573,7 @@ CompletableFuture deleteCatalogObjectAsync( ## Example Usage ```java -String objectId = "object_id8"; +String objectId = "object_id8"; catalogApi.deleteCatalogObjectAsync(objectId).thenAccept(result -> { // TODO success callback handler @@ -620,9 +620,9 @@ CompletableFuture retrieveCatalogObjectAsync( ## Example Usage ```java -String objectId = "object_id8"; -Boolean includeRelatedObjects = false; -Boolean includeCategoryPathToRoot = false; +String objectId = "object_id8"; +Boolean includeRelatedObjects = false; +Boolean includeCategoryPathToRoot = false; catalogApi.retrieveCatalogObjectAsync(objectId, includeRelatedObjects, null, includeCategoryPathToRoot).thenAccept(result -> { // TODO success callback handler @@ -666,20 +666,20 @@ CompletableFuture searchCatalogObjectsAsync( ## Example Usage ```java -SearchCatalogObjectsRequest body = new SearchCatalogObjectsRequest.Builder() - .objectTypes(Arrays.asList( +SearchCatalogObjectsRequest body = new SearchCatalogObjectsRequest.Builder() + .objectTypes(Arrays.asList( "ITEM" - )) - .query(new CatalogQuery.Builder() - .prefixQuery(new CatalogQueryPrefix.Builder( + )) + .query(new CatalogQuery.Builder() + .prefixQuery(new CatalogQueryPrefix.Builder( "name", "tea" - ) - .build()) - .build()) - .limit(100) + ) + .build()) + .build()) + .limit(100) .build(); - + catalogApi.searchCatalogObjectsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -722,45 +722,45 @@ CompletableFuture searchCatalogItemsAsync( ## Example Usage ```java -SearchCatalogItemsRequest body = new SearchCatalogItemsRequest.Builder() - .textFilter("red") - .categoryIds(Arrays.asList( +SearchCatalogItemsRequest body = new SearchCatalogItemsRequest.Builder() + .textFilter("red") + .categoryIds(Arrays.asList( "WINE_CATEGORY_ID" - )) - .stockLevels(Arrays.asList( + )) + .stockLevels(Arrays.asList( "OUT", "LOW" - )) - .enabledLocationIds(Arrays.asList( + )) + .enabledLocationIds(Arrays.asList( "ATL_LOCATION_ID" - )) - .limit(100) - .sortOrder("ASC") - .productTypes(Arrays.asList( + )) + .limit(100) + .sortOrder("ASC") + .productTypes(Arrays.asList( "REGULAR" - )) - .customAttributeFilters(Arrays.asList( - new CustomAttributeFilter.Builder() - .customAttributeDefinitionId("VEGAN_DEFINITION_ID") - .boolFilter(true) + )) + .customAttributeFilters(Arrays.asList( + new CustomAttributeFilter.Builder() + .customAttributeDefinitionId("VEGAN_DEFINITION_ID") + .boolFilter(true) .build(), - new CustomAttributeFilter.Builder() - .customAttributeDefinitionId("BRAND_DEFINITION_ID") - .stringFilter("Dark Horse") + new CustomAttributeFilter.Builder() + .customAttributeDefinitionId("BRAND_DEFINITION_ID") + .stringFilter("Dark Horse") .build(), - new CustomAttributeFilter.Builder() - .key("VINTAGE") - .numberFilter(new Range.Builder() - .min("2017") - .max("2018") - .build()) + new CustomAttributeFilter.Builder() + .key("VINTAGE") + .numberFilter(new Range.Builder() + .min("2017") + .max("2018") + .build()) .build(), - new CustomAttributeFilter.Builder() - .customAttributeDefinitionId("VARIETAL_DEFINITION_ID") + new CustomAttributeFilter.Builder() + .customAttributeDefinitionId("VARIETAL_DEFINITION_ID") .build() - )) + )) .build(); - + catalogApi.searchCatalogItemsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -796,21 +796,21 @@ CompletableFuture updateItemModifierListsAsync( ## Example Usage ```java -UpdateItemModifierListsRequest body = new UpdateItemModifierListsRequest.Builder( - Arrays.asList( +UpdateItemModifierListsRequest body = new UpdateItemModifierListsRequest.Builder( + Arrays.asList( "H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6" ) -) -.modifierListsToEnable(Arrays.asList( +) +.modifierListsToEnable(Arrays.asList( "H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6" - )) -.modifierListsToDisable(Arrays.asList( + )) +.modifierListsToDisable(Arrays.asList( "7WRC16CJZDVLSNDQ35PP6YAD" - )) + )) .build(); - + catalogApi.updateItemModifierListsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -846,20 +846,20 @@ CompletableFuture updateItemTaxesAsync( ## Example Usage ```java -UpdateItemTaxesRequest body = new UpdateItemTaxesRequest.Builder( - Arrays.asList( +UpdateItemTaxesRequest body = new UpdateItemTaxesRequest.Builder( + Arrays.asList( "H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6" ) -) -.taxesToEnable(Arrays.asList( +) +.taxesToEnable(Arrays.asList( "4WRCNHCJZDVLSNDQ35PP6YAD" - )) -.taxesToDisable(Arrays.asList( + )) +.taxesToDisable(Arrays.asList( "AQCEGCEBBQONINDOHRGZISEX" - )) + )) .build(); - + catalogApi.updateItemTaxesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/checkout.md b/doc/api/checkout.md index d779be63..1b56d42d 100644 --- a/doc/api/checkout.md +++ b/doc/api/checkout.md @@ -53,106 +53,106 @@ CompletableFuture createCheckoutAsync( ## Example Usage ```java -String locationId = "location_id4"; -CreateCheckoutRequest body = new CreateCheckoutRequest.Builder( +String locationId = "location_id4"; +CreateCheckoutRequest body = new CreateCheckoutRequest.Builder( "86ae1696-b1e3-4328-af6d-f1e04d947ad6", - new CreateOrderRequest.Builder() - .order(new Order.Builder( + new CreateOrderRequest.Builder() + .order(new Order.Builder( "location_id" - ) - .referenceId("reference_id") - .customerId("customer_id") - .lineItems(Arrays.asList( - new OrderLineItem.Builder( + ) + .referenceId("reference_id") + .customerId("customer_id") + .lineItems(Arrays.asList( + new OrderLineItem.Builder( "2" - ) - .name("Printed T Shirt") - .appliedTaxes(Arrays.asList( - new OrderLineItemAppliedTax.Builder( + ) + .name("Printed T Shirt") + .appliedTaxes(Arrays.asList( + new OrderLineItemAppliedTax.Builder( "38ze1696-z1e3-5628-af6d-f1e04d947fg3" - ) + ) .build() - )) - .appliedDiscounts(Arrays.asList( - new OrderLineItemAppliedDiscount.Builder( + )) + .appliedDiscounts(Arrays.asList( + new OrderLineItemAppliedDiscount.Builder( "56ae1696-z1e3-9328-af6d-f1e04d947gd4" - ) + ) .build() - )) - .basePriceMoney(new Money.Builder() - .amount(1500L) - .currency("USD") - .build()) + )) + .basePriceMoney(new Money.Builder() + .amount(1500L) + .currency("USD") + .build()) .build(), - new OrderLineItem.Builder( + new OrderLineItem.Builder( "1" - ) - .name("Slim Jeans") - .basePriceMoney(new Money.Builder() - .amount(2500L) - .currency("USD") - .build()) + ) + .name("Slim Jeans") + .basePriceMoney(new Money.Builder() + .amount(2500L) + .currency("USD") + .build()) .build(), - new OrderLineItem.Builder( + new OrderLineItem.Builder( "3" - ) - .name("Woven Sweater") - .basePriceMoney(new Money.Builder() - .amount(3500L) - .currency("USD") - .build()) + ) + .name("Woven Sweater") + .basePriceMoney(new Money.Builder() + .amount(3500L) + .currency("USD") + .build()) .build() - )) - .taxes(Arrays.asList( - new OrderLineItemTax.Builder() - .uid("38ze1696-z1e3-5628-af6d-f1e04d947fg3") - .type("INCLUSIVE") - .percentage("7.75") - .scope("LINE_ITEM") + )) + .taxes(Arrays.asList( + new OrderLineItemTax.Builder() + .uid("38ze1696-z1e3-5628-af6d-f1e04d947fg3") + .type("INCLUSIVE") + .percentage("7.75") + .scope("LINE_ITEM") .build() - )) - .discounts(Arrays.asList( - new OrderLineItemDiscount.Builder() - .uid("56ae1696-z1e3-9328-af6d-f1e04d947gd4") - .type("FIXED_AMOUNT") - .amountMoney(new Money.Builder() - .amount(100L) - .currency("USD") - .build()) - .scope("LINE_ITEM") + )) + .discounts(Arrays.asList( + new OrderLineItemDiscount.Builder() + .uid("56ae1696-z1e3-9328-af6d-f1e04d947gd4") + .type("FIXED_AMOUNT") + .amountMoney(new Money.Builder() + .amount(100L) + .currency("USD") + .build()) + .scope("LINE_ITEM") .build() - )) - .build()) - .idempotencyKey("12ae1696-z1e3-4328-af6d-f1e04d947gd4") + )) + .build()) + .idempotencyKey("12ae1696-z1e3-4328-af6d-f1e04d947gd4") .build() -) -.askForShippingAddress(true) -.merchantSupportEmail("merchant+support@website.com") -.prePopulateBuyerEmail("example@email.com") -.prePopulateShippingAddress(new Address.Builder() - .addressLine1("1455 Market St.") - .addressLine2("Suite 600") - .locality("San Francisco") - .administrativeDistrictLevel1("CA") - .postalCode("94103") - .country("US") - .firstName("Jane") - .lastName("Doe") - .build()) -.redirectUrl("https://merchant.website.com/order-confirm") -.additionalRecipients(Arrays.asList( - new ChargeRequestAdditionalRecipient.Builder( +) +.askForShippingAddress(true) +.merchantSupportEmail("merchant+support@website.com") +.prePopulateBuyerEmail("example@email.com") +.prePopulateShippingAddress(new Address.Builder() + .addressLine1("1455 Market St.") + .addressLine2("Suite 600") + .locality("San Francisco") + .administrativeDistrictLevel1("CA") + .postalCode("94103") + .country("US") + .firstName("Jane") + .lastName("Doe") + .build()) +.redirectUrl("https://merchant.website.com/order-confirm") +.additionalRecipients(Arrays.asList( + new ChargeRequestAdditionalRecipient.Builder( "057P5VYJ4A5X1", "Application fees", - new Money.Builder() - .amount(60L) - .currency("USD") + new Money.Builder() + .amount(60L) + .currency("USD") .build() - ) + ) .build() - )) + )) .build(); - + checkoutApi.createCheckoutAsync(locationId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -186,7 +186,7 @@ CompletableFuture retrieveLocationSettingsAsyn ## Example Usage ```java -String locationId = "location_id4"; +String locationId = "location_id4"; checkoutApi.retrieveLocationSettingsAsync(locationId).thenAccept(result -> { // TODO success callback handler @@ -223,13 +223,13 @@ CompletableFuture updateLocationSettingsAsync( ## Example Usage ```java -String locationId = "location_id4"; -UpdateLocationSettingsRequest body = new UpdateLocationSettingsRequest.Builder( - new CheckoutLocationSettings.Builder() +String locationId = "location_id4"; +UpdateLocationSettingsRequest body = new UpdateLocationSettingsRequest.Builder( + new CheckoutLocationSettings.Builder() .build() -) +) .build(); - + checkoutApi.updateLocationSettingsAsync(locationId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -289,12 +289,12 @@ CompletableFuture updateMerchantSettingsAsync( ## Example Usage ```java -UpdateMerchantSettingsRequest body = new UpdateMerchantSettingsRequest.Builder( - new CheckoutMerchantSettings.Builder() +UpdateMerchantSettingsRequest body = new UpdateMerchantSettingsRequest.Builder( + new CheckoutMerchantSettings.Builder() .build() -) +) .build(); - + checkoutApi.updateMerchantSettingsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -320,7 +320,7 @@ CompletableFuture listPaymentLinksAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `cursor` | `String` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
If a cursor is not provided, the endpoint returns the first page of the results.
For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). | +| `cursor` | `String` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
If a cursor is not provided, the endpoint returns the first page of the results.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | | `limit` | `Integer` | Query, Optional | A limit on the number of results to return per page. The limit is advisory and
the implementation might return more or less results. If the supplied limit is negative, zero, or
greater than the maximum limit of 1000, it is ignored.

Default value: `100` | ## Response Type @@ -363,19 +363,19 @@ CompletableFuture createPaymentLinkAsync( ## Example Usage ```java -CreatePaymentLinkRequest body = new CreatePaymentLinkRequest.Builder() - .idempotencyKey("cd9e25dc-d9f2-4430-aedb-61605070e95f") - .quickPay(new QuickPay.Builder( +CreatePaymentLinkRequest body = new CreatePaymentLinkRequest.Builder() + .idempotencyKey("cd9e25dc-d9f2-4430-aedb-61605070e95f") + .quickPay(new QuickPay.Builder( "Auto Detailing", - new Money.Builder() - .amount(10000L) - .currency("USD") + new Money.Builder() + .amount(10000L) + .currency("USD") .build(), "A9Y43N9ABXZBP" - ) - .build()) + ) + .build()) .build(); - + checkoutApi.createPaymentLinkAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -409,7 +409,7 @@ CompletableFuture deletePaymentLinkAsync( ## Example Usage ```java -String id = "id0"; +String id = "id0"; checkoutApi.deletePaymentLinkAsync(id).thenAccept(result -> { // TODO success callback handler @@ -444,7 +444,7 @@ CompletableFuture retrievePaymentLinkAsync( ## Example Usage ```java -String id = "id0"; +String id = "id0"; checkoutApi.retrievePaymentLinkAsync(id).thenAccept(result -> { // TODO success callback handler @@ -483,18 +483,18 @@ CompletableFuture updatePaymentLinkAsync( ## Example Usage ```java -String id = "id0"; -UpdatePaymentLinkRequest body = new UpdatePaymentLinkRequest.Builder( - new PaymentLink.Builder( +String id = "id0"; +UpdatePaymentLinkRequest body = new UpdatePaymentLinkRequest.Builder( + new PaymentLink.Builder( 1 - ) - .checkoutOptions(new CheckoutOptions.Builder() - .askForShippingAddress(true) - .build()) + ) + .checkoutOptions(new CheckoutOptions.Builder() + .askForShippingAddress(true) + .build()) .build() -) +) .build(); - + checkoutApi.updatePaymentLinkAsync(id, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/customer-custom-attributes.md b/doc/api/customer-custom-attributes.md index a4a49c65..203ca240 100644 --- a/doc/api/customer-custom-attributes.md +++ b/doc/api/customer-custom-attributes.md @@ -94,16 +94,16 @@ CompletableFuture createCustome ## Example Usage ```java -CreateCustomerCustomAttributeDefinitionRequest body = new CreateCustomerCustomAttributeDefinitionRequest.Builder( - new CustomAttributeDefinition.Builder() - .key("favoritemovie") - .name("Favorite Movie") - .description("The favorite movie of the customer.") - .visibility("VISIBILITY_HIDDEN") +CreateCustomerCustomAttributeDefinitionRequest body = new CreateCustomerCustomAttributeDefinitionRequest.Builder( + new CustomAttributeDefinition.Builder() + .key("favoritemovie") + .name("Favorite Movie") + .description("The favorite movie of the customer.") + .visibility("VISIBILITY_HIDDEN") .build() -) +) .build(); - + customerCustomAttributesApi.createCustomerCustomAttributeDefinitionAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -142,7 +142,7 @@ CompletableFuture deleteCustome ## Example Usage ```java -String key = "key0"; +String key = "key0"; customerCustomAttributesApi.deleteCustomerCustomAttributeDefinitionAsync(key).thenAccept(result -> { // TODO success callback handler @@ -183,7 +183,7 @@ CompletableFuture retrieveCus ## Example Usage ```java -String key = "key0"; +String key = "key0"; customerCustomAttributesApi.retrieveCustomerCustomAttributeDefinitionAsync(key, null).thenAccept(result -> { // TODO success callback handler @@ -226,15 +226,15 @@ CompletableFuture updateCustome ## Example Usage ```java -String key = "key0"; -UpdateCustomerCustomAttributeDefinitionRequest body = new UpdateCustomerCustomAttributeDefinitionRequest.Builder( - new CustomAttributeDefinition.Builder() - .description("Update the description as desired.") - .visibility("VISIBILITY_READ_ONLY") +String key = "key0"; +UpdateCustomerCustomAttributeDefinitionRequest body = new UpdateCustomerCustomAttributeDefinitionRequest.Builder( + new CustomAttributeDefinition.Builder() + .description("Update the description as desired.") + .visibility("VISIBILITY_READ_ONLY") .build() -) +) .build(); - + customerCustomAttributesApi.updateCustomerCustomAttributeDefinitionAsync(key, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -281,24 +281,24 @@ CompletableFuture bulkUpsertCustomer ## Example Usage ```java -BulkUpsertCustomerCustomAttributesRequest body = new BulkUpsertCustomerCustomAttributesRequest.Builder( - new LinkedHashMap() {{ - put("key0", new BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.Builder( +BulkUpsertCustomerCustomAttributesRequest body = new BulkUpsertCustomerCustomAttributesRequest.Builder( + new LinkedHashMap() {{ + put("key0", new BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.Builder( "customer_id8", - new CustomAttribute.Builder() + new CustomAttribute.Builder() .build() - ) - .build()); - put("key1", new BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.Builder( + ) + .build()); + put("key1", new BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.Builder( "customer_id8", - new CustomAttribute.Builder() + new CustomAttribute.Builder() .build() - ) - .build()); + ) + .build()); }} -) +) .build(); - + customerCustomAttributesApi.bulkUpsertCustomerCustomAttributesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -345,8 +345,8 @@ CompletableFuture listCustomerCustomAttrib ## Example Usage ```java -String customerId = "customer_id8"; -Boolean withDefinitions = false; +String customerId = "customer_id8"; +Boolean withDefinitions = false; customerCustomAttributesApi.listCustomerCustomAttributesAsync(customerId, null, null, withDefinitions).thenAccept(result -> { // TODO success callback handler @@ -387,8 +387,8 @@ CompletableFuture deleteCustomerCustomAtt ## Example Usage ```java -String customerId = "customer_id8"; -String key = "key0"; +String customerId = "customer_id8"; +String key = "key0"; customerCustomAttributesApi.deleteCustomerCustomAttributeAsync(customerId, key).thenAccept(result -> { // TODO success callback handler @@ -436,9 +436,9 @@ CompletableFuture retrieveCustomerCusto ## Example Usage ```java -String customerId = "customer_id8"; -String key = "key0"; -Boolean withDefinition = false; +String customerId = "customer_id8"; +String key = "key0"; +Boolean withDefinition = false; customerCustomAttributesApi.retrieveCustomerCustomAttributeAsync(customerId, key, withDefinition, null).thenAccept(result -> { // TODO success callback handler @@ -485,14 +485,14 @@ CompletableFuture upsertCustomerCustomAtt ## Example Usage ```java -String customerId = "customer_id8"; -String key = "key0"; -UpsertCustomerCustomAttributeRequest body = new UpsertCustomerCustomAttributeRequest.Builder( - new CustomAttribute.Builder() +String customerId = "customer_id8"; +String key = "key0"; +UpsertCustomerCustomAttributeRequest body = new UpsertCustomerCustomAttributeRequest.Builder( + new CustomAttribute.Builder() .build() -) +) .build(); - + customerCustomAttributesApi.upsertCustomerCustomAttributeAsync(customerId, key, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/customer-groups.md b/doc/api/customer-groups.md index 3b90baf0..8d897210 100644 --- a/doc/api/customer-groups.md +++ b/doc/api/customer-groups.md @@ -76,14 +76,14 @@ CompletableFuture createCustomerGroupAsync( ## Example Usage ```java -CreateCustomerGroupRequest body = new CreateCustomerGroupRequest.Builder( - new CustomerGroup.Builder( +CreateCustomerGroupRequest body = new CreateCustomerGroupRequest.Builder( + new CustomerGroup.Builder( "Loyal Customers" - ) + ) .build() -) +) .build(); - + customerGroupsApi.createCustomerGroupAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -117,7 +117,7 @@ CompletableFuture deleteCustomerGroupAsync( ## Example Usage ```java -String groupId = "group_id0"; +String groupId = "group_id0"; customerGroupsApi.deleteCustomerGroupAsync(groupId).thenAccept(result -> { // TODO success callback handler @@ -152,7 +152,7 @@ CompletableFuture retrieveCustomerGroupAsync( ## Example Usage ```java -String groupId = "group_id0"; +String groupId = "group_id0"; customerGroupsApi.retrieveCustomerGroupAsync(groupId).thenAccept(result -> { // TODO success callback handler @@ -189,15 +189,15 @@ CompletableFuture updateCustomerGroupAsync( ## Example Usage ```java -String groupId = "group_id0"; -UpdateCustomerGroupRequest body = new UpdateCustomerGroupRequest.Builder( - new CustomerGroup.Builder( +String groupId = "group_id0"; +UpdateCustomerGroupRequest body = new UpdateCustomerGroupRequest.Builder( + new CustomerGroup.Builder( "Loyal Customers" - ) + ) .build() -) +) .build(); - + customerGroupsApi.updateCustomerGroupAsync(groupId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/customer-segments.md b/doc/api/customer-segments.md index 952ec04a..b74ef505 100644 --- a/doc/api/customer-segments.md +++ b/doc/api/customer-segments.md @@ -71,7 +71,7 @@ CompletableFuture retrieveCustomerSegmentAsync( ## Example Usage ```java -String segmentId = "segment_id4"; +String segmentId = "segment_id4"; customerSegmentsApi.retrieveCustomerSegmentAsync(segmentId).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/customers.md b/doc/api/customers.md index 9c84ebe0..f5bd89e4 100644 --- a/doc/api/customers.md +++ b/doc/api/customers.md @@ -12,6 +12,10 @@ CustomersApi customersApi = client.getCustomersApi(); * [List Customers](../../doc/api/customers.md#list-customers) * [Create Customer](../../doc/api/customers.md#create-customer) +* [Bulk Create Customers](../../doc/api/customers.md#bulk-create-customers) +* [Bulk Delete Customers](../../doc/api/customers.md#bulk-delete-customers) +* [Bulk Retrieve Customers](../../doc/api/customers.md#bulk-retrieve-customers) +* [Bulk Update Customers](../../doc/api/customers.md#bulk-update-customers) * [Search Customers](../../doc/api/customers.md#search-customers) * [Delete Customer](../../doc/api/customers.md#delete-customer) * [Retrieve Customer](../../doc/api/customers.md#retrieve-customer) @@ -56,7 +60,7 @@ CompletableFuture listCustomersAsync( ## Example Usage ```java -Boolean count = false; +Boolean count = false; customersApi.listCustomersAsync(null, null, null, null, count).thenAccept(result -> { // TODO success callback handler @@ -100,23 +104,23 @@ CompletableFuture createCustomerAsync( ## Example Usage ```java -CreateCustomerRequest body = new CreateCustomerRequest.Builder() - .givenName("Amelia") - .familyName("Earhart") - .emailAddress("Amelia.Earhart@example.com") - .address(new Address.Builder() - .addressLine1("500 Electric Ave") - .addressLine2("Suite 600") - .locality("New York") - .administrativeDistrictLevel1("NY") - .postalCode("10003") - .country("US") - .build()) - .phoneNumber("+1-212-555-4240") - .referenceId("YOUR_REFERENCE_ID") - .note("a customer") +CreateCustomerRequest body = new CreateCustomerRequest.Builder() + .givenName("Amelia") + .familyName("Earhart") + .emailAddress("Amelia.Earhart@example.com") + .address(new Address.Builder() + .addressLine1("500 Electric Ave") + .addressLine2("Suite 600") + .locality("New York") + .administrativeDistrictLevel1("NY") + .postalCode("10003") + .country("US") + .build()) + .phoneNumber("+1-212-555-4240") + .referenceId("YOUR_REFERENCE_ID") + .note("a customer") .build(); - + customersApi.createCustomerAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -128,6 +132,229 @@ customersApi.createCustomerAsync(body).thenAccept(result -> { ``` +# Bulk Create Customers + +Creates multiple [customer profiles](../../doc/models/customer.md) for a business. + +This endpoint takes a map of individual create requests and returns a map of responses. + +You must provide at least one of the following values in each create request: + +- `given_name` +- `family_name` +- `company_name` +- `email_address` +- `phone_number` + +```java +CompletableFuture bulkCreateCustomersAsync( + final BulkCreateCustomersRequest body) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkCreateCustomersRequest`](../../doc/models/bulk-create-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +[`BulkCreateCustomersResponse`](../../doc/models/bulk-create-customers-response.md) + +## Example Usage + +```java +BulkCreateCustomersRequest body = new BulkCreateCustomersRequest.Builder( + new LinkedHashMap() {{ + put("8bb76c4f-e35d-4c5b-90de-1194cd9179f0", new BulkCreateCustomerData.Builder() + .givenName("Amelia") + .familyName("Earhart") + .emailAddress("Amelia.Earhart@example.com") + .address(new Address.Builder() + .addressLine1("500 Electric Ave") + .addressLine2("Suite 600") + .locality("New York") + .administrativeDistrictLevel1("NY") + .postalCode("10003") + .country("US") + .build()) + .phoneNumber("+1-212-555-4240") + .referenceId("YOUR_REFERENCE_ID") + .note("a customer") + .build()); + put("d1689f23-b25d-4932-b2f0-aed00f5e2029", new BulkCreateCustomerData.Builder() + .givenName("Marie") + .familyName("Curie") + .emailAddress("Marie.Curie@example.com") + .address(new Address.Builder() + .addressLine1("500 Electric Ave") + .addressLine2("Suite 601") + .locality("New York") + .administrativeDistrictLevel1("NY") + .postalCode("10003") + .country("US") + .build()) + .phoneNumber("+1-212-444-4240") + .referenceId("YOUR_REFERENCE_ID") + .note("another customer") + .build()); + }} +) +.build(); + +customersApi.bulkCreateCustomersAsync(body).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + + +# Bulk Delete Customers + +Deletes multiple customer profiles. + +The endpoint takes a list of customer IDs and returns a map of responses. + +```java +CompletableFuture bulkDeleteCustomersAsync( + final BulkDeleteCustomersRequest body) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkDeleteCustomersRequest`](../../doc/models/bulk-delete-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +[`BulkDeleteCustomersResponse`](../../doc/models/bulk-delete-customers-response.md) + +## Example Usage + +```java +BulkDeleteCustomersRequest body = new BulkDeleteCustomersRequest.Builder( + Arrays.asList( + "8DDA5NZVBZFGAX0V3HPF81HHE0", + "N18CPRVXR5214XPBBA6BZQWF3C", + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" + ) +) +.build(); + +customersApi.bulkDeleteCustomersAsync(body).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + + +# Bulk Retrieve Customers + +Retrieves multiple customer profiles. + +This endpoint takes a list of customer IDs and returns a map of responses. + +```java +CompletableFuture bulkRetrieveCustomersAsync( + final BulkRetrieveCustomersRequest body) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkRetrieveCustomersRequest`](../../doc/models/bulk-retrieve-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +[`BulkRetrieveCustomersResponse`](../../doc/models/bulk-retrieve-customers-response.md) + +## Example Usage + +```java +BulkRetrieveCustomersRequest body = new BulkRetrieveCustomersRequest.Builder( + Arrays.asList( + "8DDA5NZVBZFGAX0V3HPF81HHE0", + "N18CPRVXR5214XPBBA6BZQWF3C", + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" + ) +) +.build(); + +customersApi.bulkRetrieveCustomersAsync(body).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + + +# Bulk Update Customers + +Updates multiple customer profiles. + +This endpoint takes a map of individual update requests and returns a map of responses. + +You cannot use this endpoint to change cards on file. To make changes, use the [Cards API](../../doc/api/cards.md) or [Gift Cards API](../../doc/api/gift-cards.md). + +```java +CompletableFuture bulkUpdateCustomersAsync( + final BulkUpdateCustomersRequest body) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkUpdateCustomersRequest`](../../doc/models/bulk-update-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +[`BulkUpdateCustomersResponse`](../../doc/models/bulk-update-customers-response.md) + +## Example Usage + +```java +BulkUpdateCustomersRequest body = new BulkUpdateCustomersRequest.Builder( + new LinkedHashMap() {{ + put("8DDA5NZVBZFGAX0V3HPF81HHE0", new BulkUpdateCustomerData.Builder() + .emailAddress("New.Amelia.Earhart@example.com") + .phoneNumber("phone_number2") + .note("updated customer note") + .version(2L) + .build()); + put("N18CPRVXR5214XPBBA6BZQWF3C", new BulkUpdateCustomerData.Builder() + .givenName("Marie") + .familyName("Curie") + .version(0L) + .build()); + }} +) +.build(); + +customersApi.bulkUpdateCustomersAsync(body).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + + # Search Customers Searches the customer profiles associated with a Square account using one or more supported query filters. @@ -158,36 +385,36 @@ CompletableFuture searchCustomersAsync( ## Example Usage ```java -SearchCustomersRequest body = new SearchCustomersRequest.Builder() - .limit(2L) - .query(new CustomerQuery.Builder() - .filter(new CustomerFilter.Builder() - .creationSource(new CustomerCreationSourceFilter.Builder() - .values(Arrays.asList( +SearchCustomersRequest body = new SearchCustomersRequest.Builder() + .limit(2L) + .query(new CustomerQuery.Builder() + .filter(new CustomerFilter.Builder() + .creationSource(new CustomerCreationSourceFilter.Builder() + .values(Arrays.asList( "THIRD_PARTY" - )) - .rule("INCLUDE") - .build()) - .createdAt(new TimeRange.Builder() - .startAt("2018-01-01T00:00:00-00:00") - .endAt("2018-02-01T00:00:00-00:00") - .build()) - .emailAddress(new CustomerTextFilter.Builder() - .fuzzy("example.com") - .build()) - .groupIds(new FilterValue.Builder() - .all(Arrays.asList( + )) + .rule("INCLUDE") + .build()) + .createdAt(new TimeRange.Builder() + .startAt("2018-01-01T00:00:00-00:00") + .endAt("2018-02-01T00:00:00-00:00") + .build()) + .emailAddress(new CustomerTextFilter.Builder() + .fuzzy("example.com") + .build()) + .groupIds(new FilterValue.Builder() + .all(Arrays.asList( "545AXB44B4XXWMVQ4W8SBT3HHF" - )) - .build()) - .build()) - .sort(new CustomerSort.Builder() - .field("CREATED_AT") - .order("ASC") - .build()) - .build()) + )) + .build()) + .build()) + .sort(new CustomerSort.Builder() + .field("CREATED_AT") + .order("ASC") + .build()) + .build()) .build(); - + customersApi.searchCustomersAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -203,9 +430,6 @@ customersApi.searchCustomersAsync(body).thenAccept(result -> { Deletes a customer profile from a business. This operation also unlinks any associated cards on file. -As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. -If included, the value must be set to the current version of the customer profile. - To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. ```java @@ -228,7 +452,7 @@ CompletableFuture deleteCustomerAsync( ## Example Usage ```java -String customerId = "customer_id8"; +String customerId = "customer_id8"; customersApi.deleteCustomerAsync(customerId, null).thenAccept(result -> { // TODO success callback handler @@ -263,7 +487,7 @@ CompletableFuture retrieveCustomerAsync( ## Example Usage ```java -String customerId = "customer_id8"; +String customerId = "customer_id8"; customersApi.retrieveCustomerAsync(customerId).thenAccept(result -> { // TODO success callback handler @@ -279,11 +503,7 @@ customersApi.retrieveCustomerAsync(customerId).thenAccept(result -> { # Update Customer Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request. -To add or update a field, specify the new value. To remove a field, specify `null` -(recommended) or specify an empty string (string fields only). - -As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. -If included, the value must be set to the current version of the customer profile. +To add or update a field, specify the new value. To remove a field, specify `null`. To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. @@ -309,14 +529,14 @@ CompletableFuture updateCustomerAsync( ## Example Usage ```java -String customerId = "customer_id8"; -UpdateCustomerRequest body = new UpdateCustomerRequest.Builder() - .emailAddress("New.Amelia.Earhart@example.com") - .phoneNumber("") - .note("updated customer note") - .version(2L) +String customerId = "customer_id8"; +UpdateCustomerRequest body = new UpdateCustomerRequest.Builder() + .emailAddress("New.Amelia.Earhart@example.com") + .phoneNumber("phone_number2") + .note("updated customer note") + .version(2L) .build(); - + customersApi.updateCustomerAsync(customerId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -358,21 +578,21 @@ CompletableFuture createCustomerCardAsync( ## Example Usage ```java -String customerId = "customer_id8"; -CreateCustomerCardRequest body = new CreateCustomerCardRequest.Builder( +String customerId = "customer_id8"; +CreateCustomerCardRequest body = new CreateCustomerCardRequest.Builder( "YOUR_CARD_NONCE" -) -.billingAddress(new Address.Builder() - .addressLine1("500 Electric Ave") - .addressLine2("Suite 600") - .locality("New York") - .administrativeDistrictLevel1("NY") - .postalCode("10003") - .country("US") - .build()) -.cardholderName("Amelia Earhart") +) +.billingAddress(new Address.Builder() + .addressLine1("500 Electric Ave") + .addressLine2("Suite 600") + .locality("New York") + .administrativeDistrictLevel1("NY") + .postalCode("10003") + .country("US") + .build()) +.cardholderName("Amelia Earhart") .build(); - + customersApi.createCustomerCardAsync(customerId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -410,8 +630,8 @@ CompletableFuture deleteCustomerCardAsync( ## Example Usage ```java -String customerId = "customer_id8"; -String cardId = "card_id4"; +String customerId = "customer_id8"; +String cardId = "card_id4"; customersApi.deleteCustomerCardAsync(customerId, cardId).thenAccept(result -> { // TODO success callback handler @@ -451,8 +671,8 @@ CompletableFuture removeGroupFromCustomerAsync( ## Example Usage ```java -String customerId = "customer_id8"; -String groupId = "group_id0"; +String customerId = "customer_id8"; +String groupId = "group_id0"; customersApi.removeGroupFromCustomerAsync(customerId, groupId).thenAccept(result -> { // TODO success callback handler @@ -492,8 +712,8 @@ CompletableFuture addGroupToCustomerAsync( ## Example Usage ```java -String customerId = "customer_id8"; -String groupId = "group_id0"; +String customerId = "customer_id8"; +String groupId = "group_id0"; customersApi.addGroupToCustomerAsync(customerId, groupId).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/devices.md b/doc/api/devices.md index f4ccd485..6e291992 100644 --- a/doc/api/devices.md +++ b/doc/api/devices.md @@ -119,17 +119,17 @@ CompletableFuture createDeviceCodeAsync( ## Example Usage ```java -CreateDeviceCodeRequest body = new CreateDeviceCodeRequest.Builder( +CreateDeviceCodeRequest body = new CreateDeviceCodeRequest.Builder( "01bb00a6-0c86-4770-94ed-f5fca973cd56", - new DeviceCode.Builder( + new DeviceCode.Builder( "TERMINAL_API" - ) - .name("Counter 1") - .locationId("B5E4484SHHNYH") + ) + .name("Counter 1") + .locationId("B5E4484SHHNYH") .build() -) +) .build(); - + devicesApi.createDeviceCodeAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -163,7 +163,7 @@ CompletableFuture getDeviceCodeAsync( ## Example Usage ```java -String id = "id0"; +String id = "id0"; devicesApi.getDeviceCodeAsync(id).thenAccept(result -> { // TODO success callback handler @@ -198,7 +198,7 @@ CompletableFuture getDeviceAsync( ## Example Usage ```java -String deviceId = "device_id6"; +String deviceId = "device_id6"; devicesApi.getDeviceAsync(deviceId).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/disputes.md b/doc/api/disputes.md index cbf2be15..0bf239e2 100644 --- a/doc/api/disputes.md +++ b/doc/api/disputes.md @@ -80,7 +80,7 @@ CompletableFuture retrieveDisputeAsync( ## Example Usage ```java -String disputeId = "dispute_id2"; +String disputeId = "dispute_id2"; disputesApi.retrieveDisputeAsync(disputeId).thenAccept(result -> { // TODO success callback handler @@ -119,7 +119,7 @@ CompletableFuture acceptDisputeAsync( ## Example Usage ```java -String disputeId = "dispute_id2"; +String disputeId = "dispute_id2"; disputesApi.acceptDisputeAsync(disputeId).thenAccept(result -> { // TODO success callback handler @@ -156,7 +156,7 @@ CompletableFuture listDisputeEvidenceAsync( ## Example Usage ```java -String disputeId = "dispute_id2"; +String disputeId = "dispute_id2"; disputesApi.listDisputeEvidenceAsync(disputeId, null).thenAccept(result -> { // TODO success callback handler @@ -196,7 +196,7 @@ CompletableFuture createDisputeEvidenceFileAs ## Example Usage ```java -String disputeId = "dispute_id2"; +String disputeId = "dispute_id2"; disputesApi.createDisputeEvidenceFileAsync(disputeId, null, null).thenAccept(result -> { // TODO success callback handler @@ -233,14 +233,14 @@ CompletableFuture createDisputeEvidenceTextAs ## Example Usage ```java -String disputeId = "dispute_id2"; -CreateDisputeEvidenceTextRequest body = new CreateDisputeEvidenceTextRequest.Builder( +String disputeId = "dispute_id2"; +CreateDisputeEvidenceTextRequest body = new CreateDisputeEvidenceTextRequest.Builder( "ed3ee3933d946f1514d505d173c82648", "1Z8888888888888888" -) -.evidenceType("TRACKING_NUMBER") +) +.evidenceType("TRACKING_NUMBER") .build(); - + disputesApi.createDisputeEvidenceTextAsync(disputeId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -277,8 +277,8 @@ CompletableFuture deleteDisputeEvidenceAsync( ## Example Usage ```java -String disputeId = "dispute_id2"; -String evidenceId = "evidence_id2"; +String disputeId = "dispute_id2"; +String evidenceId = "evidence_id2"; disputesApi.deleteDisputeEvidenceAsync(disputeId, evidenceId).thenAccept(result -> { // TODO success callback handler @@ -317,8 +317,8 @@ CompletableFuture retrieveDisputeEvidenceAsync( ## Example Usage ```java -String disputeId = "dispute_id2"; -String evidenceId = "evidence_id2"; +String disputeId = "dispute_id2"; +String evidenceId = "evidence_id2"; disputesApi.retrieveDisputeEvidenceAsync(disputeId, evidenceId).thenAccept(result -> { // TODO success callback handler @@ -359,7 +359,7 @@ CompletableFuture submitEvidenceAsync( ## Example Usage ```java -String disputeId = "dispute_id2"; +String disputeId = "dispute_id2"; disputesApi.submitEvidenceAsync(disputeId).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/employees.md b/doc/api/employees.md index 4bb69dbb..51659d1c 100644 --- a/doc/api/employees.md +++ b/doc/api/employees.md @@ -75,7 +75,7 @@ CompletableFuture retrieveEmployeeAsync( ## Example Usage ```java -String id = "id0"; +String id = "id0"; employeesApi.retrieveEmployeeAsync(id).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/gift-card-activities.md b/doc/api/gift-card-activities.md index 11935702..9d6587ae 100644 --- a/doc/api/gift-card-activities.md +++ b/doc/api/gift-card-activities.md @@ -88,21 +88,21 @@ CompletableFuture createGiftCardActivityAsync( ## Example Usage ```java -CreateGiftCardActivityRequest body = new CreateGiftCardActivityRequest.Builder( +CreateGiftCardActivityRequest body = new CreateGiftCardActivityRequest.Builder( "U16kfr-kA70er-q4Rsym-7U7NnY", - new GiftCardActivity.Builder( + new GiftCardActivity.Builder( "ACTIVATE", "81FN9BNFZTKS4" - ) - .giftCardId("gftc:6d55a72470d940c6ba09c0ab8ad08d20") - .activateActivityDetails(new GiftCardActivityActivate.Builder() - .orderId("jJNGHm4gLI6XkFbwtiSLqK72KkAZY") - .lineItemUid("eIWl7X0nMuO9Ewbh0ChIx") - .build()) + ) + .giftCardId("gftc:6d55a72470d940c6ba09c0ab8ad08d20") + .activateActivityDetails(new GiftCardActivityActivate.Builder() + .orderId("jJNGHm4gLI6XkFbwtiSLqK72KkAZY") + .lineItemUid("eIWl7X0nMuO9Ewbh0ChIx") + .build()) .build() -) +) .build(); - + giftCardActivitiesApi.createGiftCardActivityAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/gift-cards.md b/doc/api/gift-cards.md index 89c9139c..a36ad0f2 100644 --- a/doc/api/gift-cards.md +++ b/doc/api/gift-cards.md @@ -85,16 +85,16 @@ CompletableFuture createGiftCardAsync( ## Example Usage ```java -CreateGiftCardRequest body = new CreateGiftCardRequest.Builder( +CreateGiftCardRequest body = new CreateGiftCardRequest.Builder( "NC9Tm69EjbjtConu", "81FN9BNFZTKS4", - new GiftCard.Builder( + new GiftCard.Builder( "DIGITAL" - ) + ) .build() -) +) .build(); - + giftCardsApi.createGiftCardAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -128,11 +128,11 @@ CompletableFuture retrieveGiftCardFromGANAsync( ## Example Usage ```java -RetrieveGiftCardFromGANRequest body = new RetrieveGiftCardFromGANRequest.Builder( +RetrieveGiftCardFromGANRequest body = new RetrieveGiftCardFromGANRequest.Builder( "7783320001001635" -) +) .build(); - + giftCardsApi.retrieveGiftCardFromGANAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -166,11 +166,11 @@ CompletableFuture retrieveGiftCardFromNonceAs ## Example Usage ```java -RetrieveGiftCardFromNonceRequest body = new RetrieveGiftCardFromNonceRequest.Builder( +RetrieveGiftCardFromNonceRequest body = new RetrieveGiftCardFromNonceRequest.Builder( "cnon:7783322135245171" -) +) .build(); - + giftCardsApi.retrieveGiftCardFromNonceAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -206,12 +206,12 @@ CompletableFuture linkCustomerToGiftCardAsync( ## Example Usage ```java -String giftCardId = "gift_card_id8"; -LinkCustomerToGiftCardRequest body = new LinkCustomerToGiftCardRequest.Builder( +String giftCardId = "gift_card_id8"; +LinkCustomerToGiftCardRequest body = new LinkCustomerToGiftCardRequest.Builder( "GKY0FZ3V717AH8Q2D821PNT2ZW" -) +) .build(); - + giftCardsApi.linkCustomerToGiftCardAsync(giftCardId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -247,12 +247,12 @@ CompletableFuture unlinkCustomerFromGiftCard ## Example Usage ```java -String giftCardId = "gift_card_id8"; -UnlinkCustomerFromGiftCardRequest body = new UnlinkCustomerFromGiftCardRequest.Builder( +String giftCardId = "gift_card_id8"; +UnlinkCustomerFromGiftCardRequest body = new UnlinkCustomerFromGiftCardRequest.Builder( "GKY0FZ3V717AH8Q2D821PNT2ZW" -) +) .build(); - + giftCardsApi.unlinkCustomerFromGiftCardAsync(giftCardId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -286,7 +286,7 @@ CompletableFuture retrieveGiftCardAsync( ## Example Usage ```java -String id = "id0"; +String id = "id0"; giftCardsApi.retrieveGiftCardAsync(id).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/inventory.md b/doc/api/inventory.md index 0c5cab1a..4ca40e49 100644 --- a/doc/api/inventory.md +++ b/doc/api/inventory.md @@ -50,7 +50,7 @@ CompletableFuture deprecatedRetrieveInvento ## Example Usage ```java -String adjustmentId = "adjustment_id0"; +String adjustmentId = "adjustment_id0"; inventoryApi.deprecatedRetrieveInventoryAdjustmentAsync(adjustmentId).thenAccept(result -> { // TODO success callback handler @@ -86,7 +86,7 @@ CompletableFuture retrieveInventoryAdjustme ## Example Usage ```java -String adjustmentId = "adjustment_id0"; +String adjustmentId = "adjustment_id0"; inventoryApi.retrieveInventoryAdjustmentAsync(adjustmentId).thenAccept(result -> { // TODO success callback handler @@ -124,26 +124,26 @@ CompletableFuture deprecatedBatchChangeInventoryAs ## Example Usage ```java -BatchChangeInventoryRequest body = new BatchChangeInventoryRequest.Builder( +BatchChangeInventoryRequest body = new BatchChangeInventoryRequest.Builder( "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe" -) -.changes(Arrays.asList( - new InventoryChange.Builder() - .type("PHYSICAL_COUNT") - .physicalCount(new InventoryPhysicalCount.Builder() - .referenceId("1536bfbf-efed-48bf-b17d-a197141b2a92") - .catalogObjectId("W62UWFY35CWMYGVWK6TWJDNI") - .state("IN_STOCK") - .locationId("C6W5YS5QM06F5") - .quantity("53") - .teamMemberId("LRK57NSQ5X7PUD05") - .occurredAt("2016-11-16T22:25:24.878Z") - .build()) +) +.changes(Arrays.asList( + new InventoryChange.Builder() + .type("PHYSICAL_COUNT") + .physicalCount(new InventoryPhysicalCount.Builder() + .referenceId("1536bfbf-efed-48bf-b17d-a197141b2a92") + .catalogObjectId("W62UWFY35CWMYGVWK6TWJDNI") + .state("IN_STOCK") + .locationId("C6W5YS5QM06F5") + .quantity("53") + .teamMemberId("LRK57NSQ5X7PUD05") + .occurredAt("2016-11-16T22:25:24.878Z") + .build()) .build() - )) -.ignoreUnchangedCounts(true) + )) +.ignoreUnchangedCounts(true) .build(); - + inventoryApi.deprecatedBatchChangeInventoryAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -180,23 +180,23 @@ CompletableFuture deprecatedBatchRetrieve ## Example Usage ```java -BatchRetrieveInventoryChangesRequest body = new BatchRetrieveInventoryChangesRequest.Builder() - .catalogObjectIds(Arrays.asList( +BatchRetrieveInventoryChangesRequest body = new BatchRetrieveInventoryChangesRequest.Builder() + .catalogObjectIds(Arrays.asList( "W62UWFY35CWMYGVWK6TWJDNI" - )) - .locationIds(Arrays.asList( + )) + .locationIds(Arrays.asList( "C6W5YS5QM06F5" - )) - .types(Arrays.asList( + )) + .types(Arrays.asList( "PHYSICAL_COUNT" - )) - .states(Arrays.asList( + )) + .states(Arrays.asList( "IN_STOCK" - )) - .updatedAfter("2016-11-01T00:00:00.000Z") - .updatedBefore("2016-12-01T00:00:00.000Z") + )) + .updatedAfter("2016-11-01T00:00:00.000Z") + .updatedBefore("2016-12-01T00:00:00.000Z") .build(); - + inventoryApi.deprecatedBatchRetrieveInventoryChangesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -233,16 +233,16 @@ CompletableFuture deprecatedBatchRetrieveI ## Example Usage ```java -BatchRetrieveInventoryCountsRequest body = new BatchRetrieveInventoryCountsRequest.Builder() - .catalogObjectIds(Arrays.asList( +BatchRetrieveInventoryCountsRequest body = new BatchRetrieveInventoryCountsRequest.Builder() + .catalogObjectIds(Arrays.asList( "W62UWFY35CWMYGVWK6TWJDNI" - )) - .locationIds(Arrays.asList( + )) + .locationIds(Arrays.asList( "59TNP9SA8VGDA" - )) - .updatedAfter("2016-11-16T00:00:00.000Z") + )) + .updatedAfter("2016-11-16T00:00:00.000Z") .build(); - + inventoryApi.deprecatedBatchRetrieveInventoryCountsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -280,26 +280,26 @@ CompletableFuture batchChangeInventoryAsync( ## Example Usage ```java -BatchChangeInventoryRequest body = new BatchChangeInventoryRequest.Builder( +BatchChangeInventoryRequest body = new BatchChangeInventoryRequest.Builder( "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe" -) -.changes(Arrays.asList( - new InventoryChange.Builder() - .type("PHYSICAL_COUNT") - .physicalCount(new InventoryPhysicalCount.Builder() - .referenceId("1536bfbf-efed-48bf-b17d-a197141b2a92") - .catalogObjectId("W62UWFY35CWMYGVWK6TWJDNI") - .state("IN_STOCK") - .locationId("C6W5YS5QM06F5") - .quantity("53") - .teamMemberId("LRK57NSQ5X7PUD05") - .occurredAt("2016-11-16T22:25:24.878Z") - .build()) +) +.changes(Arrays.asList( + new InventoryChange.Builder() + .type("PHYSICAL_COUNT") + .physicalCount(new InventoryPhysicalCount.Builder() + .referenceId("1536bfbf-efed-48bf-b17d-a197141b2a92") + .catalogObjectId("W62UWFY35CWMYGVWK6TWJDNI") + .state("IN_STOCK") + .locationId("C6W5YS5QM06F5") + .quantity("53") + .teamMemberId("LRK57NSQ5X7PUD05") + .occurredAt("2016-11-16T22:25:24.878Z") + .build()) .build() - )) -.ignoreUnchangedCounts(true) + )) +.ignoreUnchangedCounts(true) .build(); - + inventoryApi.batchChangeInventoryAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -340,23 +340,23 @@ CompletableFuture batchRetrieveInventoryC ## Example Usage ```java -BatchRetrieveInventoryChangesRequest body = new BatchRetrieveInventoryChangesRequest.Builder() - .catalogObjectIds(Arrays.asList( +BatchRetrieveInventoryChangesRequest body = new BatchRetrieveInventoryChangesRequest.Builder() + .catalogObjectIds(Arrays.asList( "W62UWFY35CWMYGVWK6TWJDNI" - )) - .locationIds(Arrays.asList( + )) + .locationIds(Arrays.asList( "C6W5YS5QM06F5" - )) - .types(Arrays.asList( + )) + .types(Arrays.asList( "PHYSICAL_COUNT" - )) - .states(Arrays.asList( + )) + .states(Arrays.asList( "IN_STOCK" - )) - .updatedAfter("2016-11-01T00:00:00.000Z") - .updatedBefore("2016-12-01T00:00:00.000Z") + )) + .updatedAfter("2016-11-01T00:00:00.000Z") + .updatedBefore("2016-12-01T00:00:00.000Z") .build(); - + inventoryApi.batchRetrieveInventoryChangesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -400,16 +400,16 @@ CompletableFuture batchRetrieveInventoryCo ## Example Usage ```java -BatchRetrieveInventoryCountsRequest body = new BatchRetrieveInventoryCountsRequest.Builder() - .catalogObjectIds(Arrays.asList( +BatchRetrieveInventoryCountsRequest body = new BatchRetrieveInventoryCountsRequest.Builder() + .catalogObjectIds(Arrays.asList( "W62UWFY35CWMYGVWK6TWJDNI" - )) - .locationIds(Arrays.asList( + )) + .locationIds(Arrays.asList( "59TNP9SA8VGDA" - )) - .updatedAfter("2016-11-16T00:00:00.000Z") + )) + .updatedAfter("2016-11-16T00:00:00.000Z") .build(); - + inventoryApi.batchRetrieveInventoryCountsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -446,7 +446,7 @@ CompletableFuture deprecatedRetrieveInve ## Example Usage ```java -String physicalCountId = "physical_count_id2"; +String physicalCountId = "physical_count_id2"; inventoryApi.deprecatedRetrieveInventoryPhysicalCountAsync(physicalCountId).thenAccept(result -> { // TODO success callback handler @@ -482,7 +482,7 @@ CompletableFuture retrieveInventoryPhysi ## Example Usage ```java -String physicalCountId = "physical_count_id2"; +String physicalCountId = "physical_count_id2"; inventoryApi.retrieveInventoryPhysicalCountAsync(physicalCountId).thenAccept(result -> { // TODO success callback handler @@ -518,7 +518,7 @@ CompletableFuture retrieveInventoryTransferAs ## Example Usage ```java -String transferId = "transfer_id6"; +String transferId = "transfer_id6"; inventoryApi.retrieveInventoryTransferAsync(transferId).thenAccept(result -> { // TODO success callback handler @@ -560,7 +560,7 @@ CompletableFuture retrieveInventoryCountAsync( ## Example Usage ```java -String catalogObjectId = "catalog_object_id6"; +String catalogObjectId = "catalog_object_id6"; inventoryApi.retrieveInventoryCountAsync(catalogObjectId, null, null).thenAccept(result -> { // TODO success callback handler @@ -613,7 +613,7 @@ CompletableFuture retrieveInventoryChangesAsyn ## Example Usage ```java -String catalogObjectId = "catalog_object_id6"; +String catalogObjectId = "catalog_object_id6"; inventoryApi.retrieveInventoryChangesAsync(catalogObjectId, null, null).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/invoices.md b/doc/api/invoices.md index 37e1a31a..7f638e6d 100644 --- a/doc/api/invoices.md +++ b/doc/api/invoices.md @@ -50,7 +50,7 @@ CompletableFuture listInvoicesAsync( ## Example Usage ```java -String locationId = "location_id4"; +String locationId = "location_id4"; invoicesApi.listInvoicesAsync(locationId, null, null).thenAccept(result -> { // TODO success callback handler @@ -89,58 +89,58 @@ CompletableFuture createInvoiceAsync( ## Example Usage ```java -CreateInvoiceRequest body = new CreateInvoiceRequest.Builder( - new Invoice.Builder() - .locationId("ES0RJRZYEC39A") - .orderId("CAISENgvlJ6jLWAzERDzjyHVybY") - .primaryRecipient(new InvoiceRecipient.Builder() - .customerId("JDKYHBWT1D4F8MFH63DBMEN8Y4") - .build()) - .paymentRequests(Arrays.asList( - new InvoicePaymentRequest.Builder() - .requestType("BALANCE") - .dueDate("2030-01-24") - .tippingEnabled(true) - .automaticPaymentSource("NONE") - .reminders(Arrays.asList( - new InvoicePaymentReminder.Builder() - .relativeScheduledDays(-1) - .message("Your invoice is due tomorrow") +CreateInvoiceRequest body = new CreateInvoiceRequest.Builder( + new Invoice.Builder() + .locationId("ES0RJRZYEC39A") + .orderId("CAISENgvlJ6jLWAzERDzjyHVybY") + .primaryRecipient(new InvoiceRecipient.Builder() + .customerId("JDKYHBWT1D4F8MFH63DBMEN8Y4") + .build()) + .paymentRequests(Arrays.asList( + new InvoicePaymentRequest.Builder() + .requestType("BALANCE") + .dueDate("2030-01-24") + .tippingEnabled(true) + .automaticPaymentSource("NONE") + .reminders(Arrays.asList( + new InvoicePaymentReminder.Builder() + .relativeScheduledDays(-1) + .message("Your invoice is due tomorrow") .build() - )) + )) .build() - )) - .deliveryMethod("EMAIL") - .invoiceNumber("inv-100") - .title("Event Planning Services") - .description("We appreciate your business!") - .scheduledAt("2030-01-13T10:00:00Z") - .acceptedPaymentMethods(new InvoiceAcceptedPaymentMethods.Builder() - .card(true) - .squareGiftCard(false) - .bankAccount(false) - .buyNowPayLater(false) - .cashAppPay(false) - .build()) - .customFields(Arrays.asList( - new InvoiceCustomField.Builder() - .label("Event Reference Number") - .value("Ref. #1234") - .placement("ABOVE_LINE_ITEMS") + )) + .deliveryMethod("EMAIL") + .invoiceNumber("inv-100") + .title("Event Planning Services") + .description("We appreciate your business!") + .scheduledAt("2030-01-13T10:00:00Z") + .acceptedPaymentMethods(new InvoiceAcceptedPaymentMethods.Builder() + .card(true) + .squareGiftCard(false) + .bankAccount(false) + .buyNowPayLater(false) + .cashAppPay(false) + .build()) + .customFields(Arrays.asList( + new InvoiceCustomField.Builder() + .label("Event Reference Number") + .value("Ref. #1234") + .placement("ABOVE_LINE_ITEMS") .build(), - new InvoiceCustomField.Builder() - .label("Terms of Service") - .value("The terms of service are...") - .placement("BELOW_LINE_ITEMS") + new InvoiceCustomField.Builder() + .label("Terms of Service") + .value("The terms of service are...") + .placement("BELOW_LINE_ITEMS") .build() - )) - .saleOrServiceDate("2030-01-24") - .storePaymentMethodEnabled(false) + )) + .saleOrServiceDate("2030-01-24") + .storePaymentMethodEnabled(false) .build() -) -.idempotencyKey("ce3748f9-5fc1-4762-aa12-aae5e843f1f4") +) +.idempotencyKey("ce3748f9-5fc1-4762-aa12-aae5e843f1f4") .build(); - + invoicesApi.createInvoiceAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -180,27 +180,27 @@ CompletableFuture searchInvoicesAsync( ## Example Usage ```java -SearchInvoicesRequest body = new SearchInvoicesRequest.Builder( - new InvoiceQuery.Builder( - new InvoiceFilter.Builder( - Arrays.asList( +SearchInvoicesRequest body = new SearchInvoicesRequest.Builder( + new InvoiceQuery.Builder( + new InvoiceFilter.Builder( + Arrays.asList( "ES0RJRZYEC39A" ) - ) - .customerIds(Arrays.asList( + ) + .customerIds(Arrays.asList( "JDKYHBWT1D4F8MFH63DBMEN8Y4" - )) + )) .build() - ) - .sort(new InvoiceSort.Builder( + ) + .sort(new InvoiceSort.Builder( "INVOICE_SORT_DATE" - ) - .order("DESC") - .build()) + ) + .order("DESC") + .build()) .build() -) +) .build(); - + invoicesApi.searchInvoicesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -238,7 +238,7 @@ CompletableFuture deleteInvoiceAsync( ## Example Usage ```java -String invoiceId = "invoice_id0"; +String invoiceId = "invoice_id0"; invoicesApi.deleteInvoiceAsync(invoiceId, null).thenAccept(result -> { // TODO success callback handler @@ -273,7 +273,7 @@ CompletableFuture getInvoiceAsync( ## Example Usage ```java -String invoiceId = "invoice_id0"; +String invoiceId = "invoice_id0"; invoicesApi.getInvoiceAsync(invoiceId).thenAccept(result -> { // TODO success callback handler @@ -313,24 +313,24 @@ CompletableFuture updateInvoiceAsync( ## Example Usage ```java -String invoiceId = "invoice_id0"; -UpdateInvoiceRequest body = new UpdateInvoiceRequest.Builder( - new Invoice.Builder() - .version(1) - .paymentRequests(Arrays.asList( - new InvoicePaymentRequest.Builder() - .uid("2da7964f-f3d2-4f43-81e8-5aa220bf3355") - .tippingEnabled(false) +String invoiceId = "invoice_id0"; +UpdateInvoiceRequest body = new UpdateInvoiceRequest.Builder( + new Invoice.Builder() + .version(1) + .paymentRequests(Arrays.asList( + new InvoicePaymentRequest.Builder() + .uid("2da7964f-f3d2-4f43-81e8-5aa220bf3355") + .tippingEnabled(false) .build() - )) + )) .build() -) -.idempotencyKey("4ee82288-0910-499e-ab4c-5d0071dad1be") -.fieldsToClear(Arrays.asList( +) +.idempotencyKey("4ee82288-0910-499e-ab4c-5d0071dad1be") +.fieldsToClear(Arrays.asList( "payments_requests[2da7964f-f3d2-4f43-81e8-5aa220bf3355].reminders" - )) + )) .build(); - + invoicesApi.updateInvoiceAsync(invoiceId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -373,12 +373,12 @@ CompletableFuture createInvoiceAttachmentAsync( ## Example Usage ```java -String invoiceId = "invoice_id0"; -CreateInvoiceAttachmentRequest request = new CreateInvoiceAttachmentRequest.Builder() - .idempotencyKey("ae5e84f9-4742-4fc1-ba12-a3ce3748f1c3") - .description("Service contract") +String invoiceId = "invoice_id0"; +CreateInvoiceAttachmentRequest request = new CreateInvoiceAttachmentRequest.Builder() + .idempotencyKey("ae5e84f9-4742-4fc1-ba12-a3ce3748f1c3") + .description("Service contract") .build(); - + invoicesApi.createInvoiceAttachmentAsync(invoiceId, request, null).thenAccept(result -> { // TODO success callback handler @@ -416,8 +416,8 @@ CompletableFuture deleteInvoiceAttachmentAsync( ## Example Usage ```java -String invoiceId = "invoice_id0"; -String attachmentId = "attachment_id6"; +String invoiceId = "invoice_id0"; +String attachmentId = "attachment_id6"; invoicesApi.deleteInvoiceAttachmentAsync(invoiceId, attachmentId).thenAccept(result -> { // TODO success callback handler @@ -457,12 +457,12 @@ CompletableFuture cancelInvoiceAsync( ## Example Usage ```java -String invoiceId = "invoice_id0"; -CancelInvoiceRequest body = new CancelInvoiceRequest.Builder( +String invoiceId = "invoice_id0"; +CancelInvoiceRequest body = new CancelInvoiceRequest.Builder( 0 -) +) .build(); - + invoicesApi.cancelInvoiceAsync(invoiceId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -485,8 +485,11 @@ nothing. Square also makes the invoice available on a Square-hosted invoice page The invoice `status` also changes from `DRAFT` to a status based on the invoice configuration. For example, the status changes to `UNPAID` if -Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion of the -invoice amount. +Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the +invoice amount. + +In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ` +and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments. ```java CompletableFuture publishInvoiceAsync( @@ -508,13 +511,13 @@ CompletableFuture publishInvoiceAsync( ## Example Usage ```java -String invoiceId = "invoice_id0"; -PublishInvoiceRequest body = new PublishInvoiceRequest.Builder( +String invoiceId = "invoice_id0"; +PublishInvoiceRequest body = new PublishInvoiceRequest.Builder( 1 -) -.idempotencyKey("32da42d0-1997-41b0-826b-f09464fc2c2e") +) +.idempotencyKey("32da42d0-1997-41b0-826b-f09464fc2c2e") .build(); - + invoicesApi.publishInvoiceAsync(invoiceId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/labor.md b/doc/api/labor.md index dc374610..5e055d48 100644 --- a/doc/api/labor.md +++ b/doc/api/labor.md @@ -100,18 +100,18 @@ CompletableFuture createBreakTypeAsync( ## Example Usage ```java -CreateBreakTypeRequest body = new CreateBreakTypeRequest.Builder( - new BreakType.Builder( +CreateBreakTypeRequest body = new CreateBreakTypeRequest.Builder( + new BreakType.Builder( "CGJN03P1D08GF", "Lunch Break", "PT30M", true - ) + ) .build() -) -.idempotencyKey("PAD3NG5KSN2GL") +) +.idempotencyKey("PAD3NG5KSN2GL") .build(); - + laborApi.createBreakTypeAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -147,7 +147,7 @@ CompletableFuture deleteBreakTypeAsync( ## Example Usage ```java -String id = "id0"; +String id = "id0"; laborApi.deleteBreakTypeAsync(id).thenAccept(result -> { // TODO success callback handler @@ -182,7 +182,7 @@ CompletableFuture getBreakTypeAsync( ## Example Usage ```java -String id = "id0"; +String id = "id0"; laborApi.getBreakTypeAsync(id).thenAccept(result -> { // TODO success callback handler @@ -219,19 +219,19 @@ CompletableFuture updateBreakTypeAsync( ## Example Usage ```java -String id = "id0"; -UpdateBreakTypeRequest body = new UpdateBreakTypeRequest.Builder( - new BreakType.Builder( +String id = "id0"; +UpdateBreakTypeRequest body = new UpdateBreakTypeRequest.Builder( + new BreakType.Builder( "26M7H24AZ9N6R", "Lunch", "PT50M", true - ) - .version(1) + ) + .version(1) .build() -) +) .build(); - + laborApi.updateBreakTypeAsync(id, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -306,7 +306,7 @@ CompletableFuture getEmployeeWageAsync( ## Example Usage ```java -String id = "id0"; +String id = "id0"; laborApi.getEmployeeWageAsync(id).thenAccept(result -> { // TODO success callback handler @@ -359,41 +359,41 @@ CompletableFuture createShiftAsync( ## Example Usage ```java -CreateShiftRequest body = new CreateShiftRequest.Builder( - new Shift.Builder( +CreateShiftRequest body = new CreateShiftRequest.Builder( + new Shift.Builder( "PAA1RJZZKXBFG", "2019-01-25T03:11:00-05:00" - ) - .endAt("2019-01-25T13:11:00-05:00") - .wage(new ShiftWage.Builder() - .title("Barista") - .hourlyRate(new Money.Builder() - .amount(1100L) - .currency("USD") - .build()) - .tipEligible(true) - .build()) - .breaks(Arrays.asList( - new Break.Builder( + ) + .endAt("2019-01-25T13:11:00-05:00") + .wage(new ShiftWage.Builder() + .title("Barista") + .hourlyRate(new Money.Builder() + .amount(1100L) + .currency("USD") + .build()) + .tipEligible(true) + .build()) + .breaks(Arrays.asList( + new Break.Builder( "2019-01-25T06:11:00-05:00", "REGS1EQR1TPZ5", "Tea Break", "PT5M", true - ) - .endAt("2019-01-25T06:16:00-05:00") + ) + .endAt("2019-01-25T06:16:00-05:00") .build() - )) - .teamMemberId("ormj0jJJZ5OZIzxrZYJI") - .declaredCashTipMoney(new Money.Builder() - .amount(500L) - .currency("USD") - .build()) + )) + .teamMemberId("ormj0jJJZ5OZIzxrZYJI") + .declaredCashTipMoney(new Money.Builder() + .amount(500L) + .currency("USD") + .build()) .build() -) -.idempotencyKey("HIDSNG5KS478L") +) +.idempotencyKey("HIDSNG5KS478L") .build(); - + laborApi.createShiftAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -442,22 +442,22 @@ CompletableFuture searchShiftsAsync( ## Example Usage ```java -SearchShiftsRequest body = new SearchShiftsRequest.Builder() - .query(new ShiftQuery.Builder() - .filter(new ShiftFilter.Builder() - .workday(new ShiftWorkday.Builder() - .dateRange(new DateRange.Builder() - .startDate("2019-01-20") - .endDate("2019-02-03") - .build()) - .matchShiftsBy("START_AT") - .defaultTimezone("America/Los_Angeles") - .build()) - .build()) - .build()) - .limit(100) +SearchShiftsRequest body = new SearchShiftsRequest.Builder() + .query(new ShiftQuery.Builder() + .filter(new ShiftFilter.Builder() + .workday(new ShiftWorkday.Builder() + .dateRange(new DateRange.Builder() + .startDate("2019-01-20") + .endDate("2019-02-03") + .build()) + .matchShiftsBy("START_AT") + .defaultTimezone("America/Los_Angeles") + .build()) + .build()) + .build()) + .limit(100) .build(); - + laborApi.searchShiftsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -491,7 +491,7 @@ CompletableFuture deleteShiftAsync( ## Example Usage ```java -String id = "id0"; +String id = "id0"; laborApi.deleteShiftAsync(id).thenAccept(result -> { // TODO success callback handler @@ -526,7 +526,7 @@ CompletableFuture getShiftAsync( ## Example Usage ```java -String id = "id0"; +String id = "id0"; laborApi.getShiftAsync(id).thenAccept(result -> { // TODO success callback handler @@ -569,43 +569,43 @@ CompletableFuture updateShiftAsync( ## Example Usage ```java -String id = "id0"; -UpdateShiftRequest body = new UpdateShiftRequest.Builder( - new Shift.Builder( +String id = "id0"; +UpdateShiftRequest body = new UpdateShiftRequest.Builder( + new Shift.Builder( "PAA1RJZZKXBFG", "2019-01-25T03:11:00-05:00" - ) - .endAt("2019-01-25T13:11:00-05:00") - .wage(new ShiftWage.Builder() - .title("Bartender") - .hourlyRate(new Money.Builder() - .amount(1500L) - .currency("USD") - .build()) - .tipEligible(true) - .build()) - .breaks(Arrays.asList( - new Break.Builder( + ) + .endAt("2019-01-25T13:11:00-05:00") + .wage(new ShiftWage.Builder() + .title("Bartender") + .hourlyRate(new Money.Builder() + .amount(1500L) + .currency("USD") + .build()) + .tipEligible(true) + .build()) + .breaks(Arrays.asList( + new Break.Builder( "2019-01-25T06:11:00-05:00", "REGS1EQR1TPZ5", "Tea Break", "PT5M", true - ) - .id("X7GAQYVVRRG6P") - .endAt("2019-01-25T06:16:00-05:00") + ) + .id("X7GAQYVVRRG6P") + .endAt("2019-01-25T06:16:00-05:00") .build() - )) - .version(1) - .teamMemberId("ormj0jJJZ5OZIzxrZYJI") - .declaredCashTipMoney(new Money.Builder() - .amount(500L) - .currency("USD") - .build()) + )) + .version(1) + .teamMemberId("ormj0jJJZ5OZIzxrZYJI") + .declaredCashTipMoney(new Money.Builder() + .amount(500L) + .currency("USD") + .build()) .build() -) +) .build(); - + laborApi.updateShiftAsync(id, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -676,7 +676,7 @@ CompletableFuture getTeamMemberWageAsync( ## Example Usage ```java -String id = "id0"; +String id = "id0"; laborApi.getTeamMemberWageAsync(id).thenAccept(result -> { // TODO success callback handler @@ -748,17 +748,17 @@ CompletableFuture updateWorkweekConfigAsync( ## Example Usage ```java -String id = "id0"; -UpdateWorkweekConfigRequest body = new UpdateWorkweekConfigRequest.Builder( - new WorkweekConfig.Builder( +String id = "id0"; +UpdateWorkweekConfigRequest body = new UpdateWorkweekConfigRequest.Builder( + new WorkweekConfig.Builder( "MON", "10:00" - ) - .version(10) + ) + .version(10) .build() -) +) .build(); - + laborApi.updateWorkweekConfigAsync(id, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/location-custom-attributes.md b/doc/api/location-custom-attributes.md index d5896271..bcad87ce 100644 --- a/doc/api/location-custom-attributes.md +++ b/doc/api/location-custom-attributes.md @@ -91,16 +91,16 @@ CompletableFuture createLocatio ## Example Usage ```java -CreateLocationCustomAttributeDefinitionRequest body = new CreateLocationCustomAttributeDefinitionRequest.Builder( - new CustomAttributeDefinition.Builder() - .key("bestseller") - .name("Bestseller") - .description("Bestselling item at location") - .visibility("VISIBILITY_READ_WRITE_VALUES") +CreateLocationCustomAttributeDefinitionRequest body = new CreateLocationCustomAttributeDefinitionRequest.Builder( + new CustomAttributeDefinition.Builder() + .key("bestseller") + .name("Bestseller") + .description("Bestselling item at location") + .visibility("VISIBILITY_READ_WRITE_VALUES") .build() -) +) .build(); - + locationCustomAttributesApi.createLocationCustomAttributeDefinitionAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -137,7 +137,7 @@ CompletableFuture deleteLocatio ## Example Usage ```java -String key = "key0"; +String key = "key0"; locationCustomAttributesApi.deleteLocationCustomAttributeDefinitionAsync(key).thenAccept(result -> { // TODO success callback handler @@ -176,7 +176,7 @@ CompletableFuture retrieveLoc ## Example Usage ```java -String key = "key0"; +String key = "key0"; locationCustomAttributesApi.retrieveLocationCustomAttributeDefinitionAsync(key, null).thenAccept(result -> { // TODO success callback handler @@ -216,15 +216,15 @@ CompletableFuture updateLocatio ## Example Usage ```java -String key = "key0"; -UpdateLocationCustomAttributeDefinitionRequest body = new UpdateLocationCustomAttributeDefinitionRequest.Builder( - new CustomAttributeDefinition.Builder() - .description("Update the description as desired.") - .visibility("VISIBILITY_READ_ONLY") +String key = "key0"; +UpdateLocationCustomAttributeDefinitionRequest body = new UpdateLocationCustomAttributeDefinitionRequest.Builder( + new CustomAttributeDefinition.Builder() + .description("Update the description as desired.") + .visibility("VISIBILITY_READ_ONLY") .build() -) +) .build(); - + locationCustomAttributesApi.updateLocationCustomAttributeDefinitionAsync(key, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -260,21 +260,21 @@ CompletableFuture bulkDeleteLocation ## Example Usage ```java -BulkDeleteLocationCustomAttributesRequest body = new BulkDeleteLocationCustomAttributesRequest.Builder( - new LinkedHashMap() {{ - put("id1", new BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.Builder() - .key("bestseller") - .build()); - put("id2", new BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.Builder() - .key("bestseller") - .build()); - put("id3", new BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.Builder() - .key("phone-number") - .build()); +BulkDeleteLocationCustomAttributesRequest body = new BulkDeleteLocationCustomAttributesRequest.Builder( + new LinkedHashMap() {{ + put("id1", new BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.Builder() + .key("bestseller") + .build()); + put("id2", new BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.Builder() + .key("bestseller") + .build()); + put("id3", new BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.Builder() + .key("phone-number") + .build()); }} -) +) .build(); - + locationCustomAttributesApi.bulkDeleteLocationCustomAttributesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -317,24 +317,24 @@ CompletableFuture bulkUpsertLocation ## Example Usage ```java -BulkUpsertLocationCustomAttributesRequest body = new BulkUpsertLocationCustomAttributesRequest.Builder( - new LinkedHashMap() {{ - put("key0", new BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.Builder( +BulkUpsertLocationCustomAttributesRequest body = new BulkUpsertLocationCustomAttributesRequest.Builder( + new LinkedHashMap() {{ + put("key0", new BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.Builder( "location_id4", - new CustomAttribute.Builder() + new CustomAttribute.Builder() .build() - ) - .build()); - put("key1", new BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.Builder( + ) + .build()); + put("key1", new BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.Builder( "location_id4", - new CustomAttribute.Builder() + new CustomAttribute.Builder() .build() - ) - .build()); + ) + .build()); }} -) +) .build(); - + locationCustomAttributesApi.bulkUpsertLocationCustomAttributesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -381,8 +381,8 @@ CompletableFuture listLocationCustomAttrib ## Example Usage ```java -String locationId = "location_id4"; -Boolean withDefinitions = false; +String locationId = "location_id4"; +Boolean withDefinitions = false; locationCustomAttributesApi.listLocationCustomAttributesAsync(locationId, null, null, null, withDefinitions).thenAccept(result -> { // TODO success callback handler @@ -421,8 +421,8 @@ CompletableFuture deleteLocationCustomAtt ## Example Usage ```java -String locationId = "location_id4"; -String key = "key0"; +String locationId = "location_id4"; +String key = "key0"; locationCustomAttributesApi.deleteLocationCustomAttributeAsync(locationId, key).thenAccept(result -> { // TODO success callback handler @@ -467,9 +467,9 @@ CompletableFuture retrieveLocationCusto ## Example Usage ```java -String locationId = "location_id4"; -String key = "key0"; -Boolean withDefinition = false; +String locationId = "location_id4"; +String key = "key0"; +Boolean withDefinition = false; locationCustomAttributesApi.retrieveLocationCustomAttributeAsync(locationId, key, withDefinition, null).thenAccept(result -> { // TODO success callback handler @@ -513,14 +513,14 @@ CompletableFuture upsertLocationCustomAtt ## Example Usage ```java -String locationId = "location_id4"; -String key = "key0"; -UpsertLocationCustomAttributeRequest body = new UpsertLocationCustomAttributeRequest.Builder( - new CustomAttribute.Builder() +String locationId = "location_id4"; +String key = "key0"; +UpsertLocationCustomAttributeRequest body = new UpsertLocationCustomAttributeRequest.Builder( + new CustomAttribute.Builder() .build() -) +) .build(); - + locationCustomAttributesApi.upsertLocationCustomAttributeAsync(locationId, key, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/locations.md b/doc/api/locations.md index faf22d9e..4f0bd4df 100644 --- a/doc/api/locations.md +++ b/doc/api/locations.md @@ -19,7 +19,7 @@ LocationsApi locationsApi = client.getLocationsApi(); # List Locations Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api), -including those with an inactive status. +including those with an inactive status. Locations are listed alphabetically by `name`. ```java CompletableFuture listLocationsAsync() @@ -71,19 +71,19 @@ CompletableFuture createLocationAsync( ## Example Usage ```java -CreateLocationRequest body = new CreateLocationRequest.Builder() - .location(new Location.Builder() - .name("Midtown") - .address(new Address.Builder() - .addressLine1("1234 Peachtree St. NE") - .locality("Atlanta") - .administrativeDistrictLevel1("GA") - .postalCode("30309") - .build()) - .description("Midtown Atlanta store") - .build()) +CreateLocationRequest body = new CreateLocationRequest.Builder() + .location(new Location.Builder() + .name("Midtown") + .address(new Address.Builder() + .addressLine1("1234 Peachtree St. NE") + .locality("Atlanta") + .administrativeDistrictLevel1("GA") + .postalCode("30309") + .build()) + .description("Midtown Atlanta store") + .build()) .build(); - + locationsApi.createLocationAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -118,7 +118,7 @@ CompletableFuture retrieveLocationAsync( ## Example Usage ```java -String locationId = "location_id4"; +String locationId = "location_id4"; locationsApi.retrieveLocationAsync(locationId).thenAccept(result -> { // TODO success callback handler @@ -155,32 +155,32 @@ CompletableFuture updateLocationAsync( ## Example Usage ```java -String locationId = "location_id4"; -UpdateLocationRequest body = new UpdateLocationRequest.Builder() - .location(new Location.Builder() - .businessHours(new BusinessHours.Builder() - .periods(Arrays.asList( - new BusinessHoursPeriod.Builder() - .dayOfWeek("FRI") - .startLocalTime("07:00") - .endLocalTime("18:00") +String locationId = "location_id4"; +UpdateLocationRequest body = new UpdateLocationRequest.Builder() + .location(new Location.Builder() + .businessHours(new BusinessHours.Builder() + .periods(Arrays.asList( + new BusinessHoursPeriod.Builder() + .dayOfWeek("FRI") + .startLocalTime("07:00") + .endLocalTime("18:00") .build(), - new BusinessHoursPeriod.Builder() - .dayOfWeek("SAT") - .startLocalTime("07:00") - .endLocalTime("18:00") + new BusinessHoursPeriod.Builder() + .dayOfWeek("SAT") + .startLocalTime("07:00") + .endLocalTime("18:00") .build(), - new BusinessHoursPeriod.Builder() - .dayOfWeek("SUN") - .startLocalTime("09:00") - .endLocalTime("15:00") + new BusinessHoursPeriod.Builder() + .dayOfWeek("SUN") + .startLocalTime("09:00") + .endLocalTime("15:00") .build() - )) - .build()) - .description("Midtown Atlanta store - Open weekends") - .build()) + )) + .build()) + .description("Midtown Atlanta store - Open weekends") + .build()) .build(); - + locationsApi.updateLocationAsync(locationId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/loyalty.md b/doc/api/loyalty.md index 5254c7a3..31a9fbc0 100644 --- a/doc/api/loyalty.md +++ b/doc/api/loyalty.md @@ -52,18 +52,18 @@ CompletableFuture createLoyaltyAccountAsync( ## Example Usage ```java -CreateLoyaltyAccountRequest body = new CreateLoyaltyAccountRequest.Builder( - new LoyaltyAccount.Builder( +CreateLoyaltyAccountRequest body = new CreateLoyaltyAccountRequest.Builder( + new LoyaltyAccount.Builder( "d619f755-2d17-41f3-990d-c04ecedd64dd" - ) - .mapping(new LoyaltyAccountMapping.Builder() - .phoneNumber("+14155551234") - .build()) + ) + .mapping(new LoyaltyAccountMapping.Builder() + .phoneNumber("+14155551234") + .build()) .build(), "ec78c477-b1c3-4899-a209-a4e71337c996" -) +) .build(); - + loyaltyApi.createLoyaltyAccountAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -101,17 +101,17 @@ CompletableFuture searchLoyaltyAccountsAsync( ## Example Usage ```java -SearchLoyaltyAccountsRequest body = new SearchLoyaltyAccountsRequest.Builder() - .query(new SearchLoyaltyAccountsRequestLoyaltyAccountQuery.Builder() - .mappings(Arrays.asList( - new LoyaltyAccountMapping.Builder() - .phoneNumber("+14155551234") +SearchLoyaltyAccountsRequest body = new SearchLoyaltyAccountsRequest.Builder() + .query(new SearchLoyaltyAccountsRequestLoyaltyAccountQuery.Builder() + .mappings(Arrays.asList( + new LoyaltyAccountMapping.Builder() + .phoneNumber("+14155551234") .build() - )) - .build()) - .limit(10) + )) + .build()) + .limit(10) .build(); - + loyaltyApi.searchLoyaltyAccountsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -145,7 +145,7 @@ CompletableFuture retrieveLoyaltyAccountAsync( ## Example Usage ```java -String accountId = "account_id2"; +String accountId = "account_id2"; loyaltyApi.retrieveLoyaltyAccountAsync(accountId).thenAccept(result -> { // TODO success callback handler @@ -195,16 +195,16 @@ CompletableFuture accumulateLoyaltyPointsAsync( ## Example Usage ```java -String accountId = "account_id2"; -AccumulateLoyaltyPointsRequest body = new AccumulateLoyaltyPointsRequest.Builder( - new LoyaltyEventAccumulatePoints.Builder() - .orderId("RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY") +String accountId = "account_id2"; +AccumulateLoyaltyPointsRequest body = new AccumulateLoyaltyPointsRequest.Builder( + new LoyaltyEventAccumulatePoints.Builder() + .orderId("RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY") .build(), "58b90739-c3e8-4b11-85f7-e636d48d72cb", "P034NEENMD09F" -) +) .build(); - + loyaltyApi.accumulateLoyaltyPointsAsync(accountId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -244,17 +244,17 @@ CompletableFuture adjustLoyaltyPointsAsync( ## Example Usage ```java -String accountId = "account_id2"; -AdjustLoyaltyPointsRequest body = new AdjustLoyaltyPointsRequest.Builder( +String accountId = "account_id2"; +AdjustLoyaltyPointsRequest body = new AdjustLoyaltyPointsRequest.Builder( "bc29a517-3dc9-450e-aa76-fae39ee849d1", - new LoyaltyEventAdjustPoints.Builder( + new LoyaltyEventAdjustPoints.Builder( 10 - ) - .reason("Complimentary points") + ) + .reason("Complimentary points") .build() -) +) .build(); - + loyaltyApi.adjustLoyaltyPointsAsync(accountId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -295,18 +295,18 @@ CompletableFuture searchLoyaltyEventsAsync( ## Example Usage ```java -SearchLoyaltyEventsRequest body = new SearchLoyaltyEventsRequest.Builder() - .query(new LoyaltyEventQuery.Builder() - .filter(new LoyaltyEventFilter.Builder() - .orderFilter(new LoyaltyEventOrderFilter.Builder( +SearchLoyaltyEventsRequest body = new SearchLoyaltyEventsRequest.Builder() + .query(new LoyaltyEventQuery.Builder() + .filter(new LoyaltyEventFilter.Builder() + .orderFilter(new LoyaltyEventOrderFilter.Builder( "PyATxhYLfsMqpVkcKJITPydgEYfZY" - ) - .build()) - .build()) - .build()) - .limit(30) + ) + .build()) + .build()) + .build()) + .limit(30) .build(); - + loyaltyApi.searchLoyaltyEventsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -373,7 +373,7 @@ CompletableFuture retrieveLoyaltyProgramAsync( ## Example Usage ```java -String programId = "program_id0"; +String programId = "program_id0"; loyaltyApi.retrieveLoyaltyProgramAsync(programId).thenAccept(result -> { // TODO success callback handler @@ -424,12 +424,12 @@ CompletableFuture calculateLoyaltyPointsAsync( ## Example Usage ```java -String programId = "program_id0"; -CalculateLoyaltyPointsRequest body = new CalculateLoyaltyPointsRequest.Builder() - .orderId("RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY") - .loyaltyAccountId("79b807d2-d786-46a9-933b-918028d7a8c5") +String programId = "program_id0"; +CalculateLoyaltyPointsRequest body = new CalculateLoyaltyPointsRequest.Builder() + .orderId("RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY") + .loyaltyAccountId("79b807d2-d786-46a9-933b-918028d7a8c5") .build(); - + loyaltyApi.calculateLoyaltyPointsAsync(programId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -470,7 +470,7 @@ CompletableFuture listLoyaltyPromotionsAsync( ## Example Usage ```java -String programId = "program_id0"; +String programId = "program_id0"; loyaltyApi.listLoyaltyPromotionsAsync(programId, null, null, null).thenAccept(result -> { // TODO success callback handler @@ -512,41 +512,41 @@ CompletableFuture createLoyaltyPromotionAsync( ## Example Usage ```java -String programId = "program_id0"; -CreateLoyaltyPromotionRequest body = new CreateLoyaltyPromotionRequest.Builder( - new LoyaltyPromotion.Builder( +String programId = "program_id0"; +CreateLoyaltyPromotionRequest body = new CreateLoyaltyPromotionRequest.Builder( + new LoyaltyPromotion.Builder( "Tuesday Happy Hour Promo", - new LoyaltyPromotionIncentive.Builder( + new LoyaltyPromotionIncentive.Builder( "POINTS_MULTIPLIER" - ) - .pointsMultiplierData(new LoyaltyPromotionIncentivePointsMultiplierData.Builder() - .multiplier("3.0") - .build()) + ) + .pointsMultiplierData(new LoyaltyPromotionIncentivePointsMultiplierData.Builder() + .multiplier("3.0") + .build()) .build(), - new LoyaltyPromotionAvailableTimeData.Builder( - Arrays.asList( + new LoyaltyPromotionAvailableTimeData.Builder( + Arrays.asList( "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" ) - ) + ) .build() - ) - .triggerLimit(new LoyaltyPromotionTriggerLimit.Builder( + ) + .triggerLimit(new LoyaltyPromotionTriggerLimit.Builder( 1 - ) - .interval("DAY") - .build()) - .minimumSpendAmountMoney(new Money.Builder() - .amount(2000L) - .currency("USD") - .build()) - .qualifyingCategoryIds(Arrays.asList( + ) + .interval("DAY") + .build()) + .minimumSpendAmountMoney(new Money.Builder() + .amount(2000L) + .currency("USD") + .build()) + .qualifyingCategoryIds(Arrays.asList( "XTQPYLR3IIU9C44VRCB3XD12" - )) + )) .build(), "ec78c477-b1c3-4899-a209-a4e71337c996" -) +) .build(); - + loyaltyApi.createLoyaltyPromotionAsync(programId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -582,8 +582,8 @@ CompletableFuture retrieveLoyaltyPromotionAsyn ## Example Usage ```java -String promotionId = "promotion_id0"; -String programId = "program_id0"; +String promotionId = "promotion_id0"; +String programId = "program_id0"; loyaltyApi.retrieveLoyaltyPromotionAsync(promotionId, programId).thenAccept(result -> { // TODO success callback handler @@ -625,8 +625,8 @@ CompletableFuture cancelLoyaltyPromotionAsync( ## Example Usage ```java -String promotionId = "promotion_id0"; -String programId = "program_id0"; +String promotionId = "promotion_id0"; +String programId = "program_id0"; loyaltyApi.cancelLoyaltyPromotionAsync(promotionId, programId).thenAccept(result -> { // TODO success callback handler @@ -668,17 +668,17 @@ CompletableFuture createLoyaltyRewardAsync( ## Example Usage ```java -CreateLoyaltyRewardRequest body = new CreateLoyaltyRewardRequest.Builder( - new LoyaltyReward.Builder( +CreateLoyaltyRewardRequest body = new CreateLoyaltyRewardRequest.Builder( + new LoyaltyReward.Builder( "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", "e1b39225-9da5-43d1-a5db-782cdd8ad94f" - ) - .orderId("RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY") + ) + .orderId("RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY") .build(), "18c2e5ea-a620-4b1f-ad60-7b167285e451" -) +) .build(); - + loyaltyApi.createLoyaltyRewardAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -718,14 +718,14 @@ CompletableFuture searchLoyaltyRewardsAsync( ## Example Usage ```java -SearchLoyaltyRewardsRequest body = new SearchLoyaltyRewardsRequest.Builder() - .query(new SearchLoyaltyRewardsRequestLoyaltyRewardQuery.Builder( +SearchLoyaltyRewardsRequest body = new SearchLoyaltyRewardsRequest.Builder() + .query(new SearchLoyaltyRewardsRequestLoyaltyRewardQuery.Builder( "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" - ) - .build()) - .limit(10) + ) + .build()) + .limit(10) .build(); - + loyaltyApi.searchLoyaltyRewardsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -767,7 +767,7 @@ CompletableFuture deleteLoyaltyRewardAsync( ## Example Usage ```java -String rewardId = "reward_id4"; +String rewardId = "reward_id4"; loyaltyApi.deleteLoyaltyRewardAsync(rewardId).thenAccept(result -> { // TODO success callback handler @@ -802,7 +802,7 @@ CompletableFuture retrieveLoyaltyRewardAsync( ## Example Usage ```java -String rewardId = "reward_id4"; +String rewardId = "reward_id4"; loyaltyApi.retrieveLoyaltyRewardAsync(rewardId).thenAccept(result -> { // TODO success callback handler @@ -849,13 +849,13 @@ CompletableFuture redeemLoyaltyRewardAsync( ## Example Usage ```java -String rewardId = "reward_id4"; -RedeemLoyaltyRewardRequest body = new RedeemLoyaltyRewardRequest.Builder( +String rewardId = "reward_id4"; +RedeemLoyaltyRewardRequest body = new RedeemLoyaltyRewardRequest.Builder( "98adc7f7-6963-473b-b29c-f3c9cdd7d994", "P034NEENMD09F" -) +) .build(); - + loyaltyApi.redeemLoyaltyRewardAsync(rewardId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/merchant-custom-attributes.md b/doc/api/merchant-custom-attributes.md index 31d445a7..bd15771f 100644 --- a/doc/api/merchant-custom-attributes.md +++ b/doc/api/merchant-custom-attributes.md @@ -91,16 +91,16 @@ CompletableFuture createMerchan ## Example Usage ```java -CreateMerchantCustomAttributeDefinitionRequest body = new CreateMerchantCustomAttributeDefinitionRequest.Builder( - new CustomAttributeDefinition.Builder() - .key("alternative_seller_name") - .name("Alternative Merchant Name") - .description("This is the other name this merchant goes by.") - .visibility("VISIBILITY_READ_ONLY") +CreateMerchantCustomAttributeDefinitionRequest body = new CreateMerchantCustomAttributeDefinitionRequest.Builder( + new CustomAttributeDefinition.Builder() + .key("alternative_seller_name") + .name("Alternative Merchant Name") + .description("This is the other name this merchant goes by.") + .visibility("VISIBILITY_READ_ONLY") .build() -) +) .build(); - + merchantCustomAttributesApi.createMerchantCustomAttributeDefinitionAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -137,7 +137,7 @@ CompletableFuture deleteMerchan ## Example Usage ```java -String key = "key0"; +String key = "key0"; merchantCustomAttributesApi.deleteMerchantCustomAttributeDefinitionAsync(key).thenAccept(result -> { // TODO success callback handler @@ -176,7 +176,7 @@ CompletableFuture retrieveMer ## Example Usage ```java -String key = "key0"; +String key = "key0"; merchantCustomAttributesApi.retrieveMerchantCustomAttributeDefinitionAsync(key, null).thenAccept(result -> { // TODO success callback handler @@ -216,15 +216,15 @@ CompletableFuture updateMerchan ## Example Usage ```java -String key = "key0"; -UpdateMerchantCustomAttributeDefinitionRequest body = new UpdateMerchantCustomAttributeDefinitionRequest.Builder( - new CustomAttributeDefinition.Builder() - .description("Update the description as desired.") - .visibility("VISIBILITY_READ_ONLY") +String key = "key0"; +UpdateMerchantCustomAttributeDefinitionRequest body = new UpdateMerchantCustomAttributeDefinitionRequest.Builder( + new CustomAttributeDefinition.Builder() + .description("Update the description as desired.") + .visibility("VISIBILITY_READ_ONLY") .build() -) +) .build(); - + merchantCustomAttributesApi.updateMerchantCustomAttributeDefinitionAsync(key, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -260,18 +260,18 @@ CompletableFuture bulkDeleteMerchant ## Example Usage ```java -BulkDeleteMerchantCustomAttributesRequest body = new BulkDeleteMerchantCustomAttributesRequest.Builder( - new LinkedHashMap() {{ - put("id1", new BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.Builder() - .key("alternative_seller_name") - .build()); - put("id2", new BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.Builder() - .key("has_seen_tutorial") - .build()); +BulkDeleteMerchantCustomAttributesRequest body = new BulkDeleteMerchantCustomAttributesRequest.Builder( + new LinkedHashMap() {{ + put("id1", new BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.Builder() + .key("alternative_seller_name") + .build()); + put("id2", new BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.Builder() + .key("has_seen_tutorial") + .build()); }} -) +) .build(); - + merchantCustomAttributesApi.bulkDeleteMerchantCustomAttributesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -314,24 +314,24 @@ CompletableFuture bulkUpsertMerchant ## Example Usage ```java -BulkUpsertMerchantCustomAttributesRequest body = new BulkUpsertMerchantCustomAttributesRequest.Builder( - new LinkedHashMap() {{ - put("key0", new BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.Builder( +BulkUpsertMerchantCustomAttributesRequest body = new BulkUpsertMerchantCustomAttributesRequest.Builder( + new LinkedHashMap() {{ + put("key0", new BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.Builder( "merchant_id0", - new CustomAttribute.Builder() + new CustomAttribute.Builder() .build() - ) - .build()); - put("key1", new BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.Builder( + ) + .build()); + put("key1", new BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.Builder( "merchant_id0", - new CustomAttribute.Builder() + new CustomAttribute.Builder() .build() - ) - .build()); + ) + .build()); }} -) +) .build(); - + merchantCustomAttributesApi.bulkUpsertMerchantCustomAttributesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -378,8 +378,8 @@ CompletableFuture listMerchantCustomAttrib ## Example Usage ```java -String merchantId = "merchant_id0"; -Boolean withDefinitions = false; +String merchantId = "merchant_id0"; +Boolean withDefinitions = false; merchantCustomAttributesApi.listMerchantCustomAttributesAsync(merchantId, null, null, null, withDefinitions).thenAccept(result -> { // TODO success callback handler @@ -418,8 +418,8 @@ CompletableFuture deleteMerchantCustomAtt ## Example Usage ```java -String merchantId = "merchant_id0"; -String key = "key0"; +String merchantId = "merchant_id0"; +String key = "key0"; merchantCustomAttributesApi.deleteMerchantCustomAttributeAsync(merchantId, key).thenAccept(result -> { // TODO success callback handler @@ -464,9 +464,9 @@ CompletableFuture retrieveMerchantCusto ## Example Usage ```java -String merchantId = "merchant_id0"; -String key = "key0"; -Boolean withDefinition = false; +String merchantId = "merchant_id0"; +String key = "key0"; +Boolean withDefinition = false; merchantCustomAttributesApi.retrieveMerchantCustomAttributeAsync(merchantId, key, withDefinition, null).thenAccept(result -> { // TODO success callback handler @@ -510,14 +510,14 @@ CompletableFuture upsertMerchantCustomAtt ## Example Usage ```java -String merchantId = "merchant_id0"; -String key = "key0"; -UpsertMerchantCustomAttributeRequest body = new UpsertMerchantCustomAttributeRequest.Builder( - new CustomAttribute.Builder() +String merchantId = "merchant_id0"; +String key = "key0"; +UpsertMerchantCustomAttributeRequest body = new UpsertMerchantCustomAttributeRequest.Builder( + new CustomAttribute.Builder() .build() -) +) .build(); - + merchantCustomAttributesApi.upsertMerchantCustomAttributeAsync(merchantId, key, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/merchants.md b/doc/api/merchants.md index 07704ae7..425da9d3 100644 --- a/doc/api/merchants.md +++ b/doc/api/merchants.md @@ -78,7 +78,7 @@ CompletableFuture retrieveMerchantAsync( ## Example Usage ```java -String merchantId = "merchant_id0"; +String merchantId = "merchant_id0"; merchantsApi.retrieveMerchantAsync(merchantId).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/mobile-authorization.md b/doc/api/mobile-authorization.md index 8b05c1d3..b325ee95 100644 --- a/doc/api/mobile-authorization.md +++ b/doc/api/mobile-authorization.md @@ -42,10 +42,10 @@ CompletableFuture createMobileAuthorizati ## Example Usage ```java -CreateMobileAuthorizationCodeRequest body = new CreateMobileAuthorizationCodeRequest.Builder() - .locationId("YOUR_LOCATION_ID") +CreateMobileAuthorizationCodeRequest body = new CreateMobileAuthorizationCodeRequest.Builder() + .locationId("YOUR_LOCATION_ID") .build(); - + mobileAuthorizationApi.createMobileAuthorizationCodeAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/o-auth.md b/doc/api/o-auth.md index 4a06b582..b3e19201 100644 --- a/doc/api/o-auth.md +++ b/doc/api/o-auth.md @@ -64,12 +64,12 @@ CompletableFuture renewTokenAsync( ## Example Usage ```java -String clientId = "client_id8"; -RenewTokenRequest body = new RenewTokenRequest.Builder() - .accessToken("ACCESS_TOKEN") +String clientId = "client_id8"; +RenewTokenRequest body = new RenewTokenRequest.Builder() + .accessToken("ACCESS_TOKEN") .build(); - -String authorization = "Client CLIENT_SECRET"; + +String authorization = "Client CLIENT_SECRET"; oAuthApi.renewTokenAsync(clientId, body, authorization).thenAccept(result -> { // TODO success callback handler @@ -121,12 +121,12 @@ CompletableFuture revokeTokenAsync( ## Example Usage ```java -RevokeTokenRequest body = new RevokeTokenRequest.Builder() - .clientId("CLIENT_ID") - .accessToken("ACCESS_TOKEN") +RevokeTokenRequest body = new RevokeTokenRequest.Builder() + .clientId("CLIENT_ID") + .accessToken("ACCESS_TOKEN") .build(); - -String authorization = "Client CLIENT_SECRET"; + +String authorization = "Client CLIENT_SECRET"; oAuthApi.revokeTokenAsync(body, authorization).thenAccept(result -> { // TODO success callback handler @@ -179,14 +179,14 @@ CompletableFuture obtainTokenAsync( ## Example Usage ```java -ObtainTokenRequest body = new ObtainTokenRequest.Builder( +ObtainTokenRequest body = new ObtainTokenRequest.Builder( "APPLICATION_ID", "authorization_code" -) -.clientSecret("APPLICATION_SECRET") -.code("CODE_FROM_AUTHORIZE") +) +.clientSecret("APPLICATION_SECRET") +.code("CODE_FROM_AUTHORIZE") .build(); - + oAuthApi.obtainTokenAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -235,7 +235,7 @@ CompletableFuture retrieveTokenStatusAsync( ## Example Usage ```java -String authorization = "Client CLIENT_SECRET"; +String authorization = "Client CLIENT_SECRET"; oAuthApi.retrieveTokenStatusAsync(authorization).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/order-custom-attributes.md b/doc/api/order-custom-attributes.md index 6ea28ef1..2a8d75d8 100644 --- a/doc/api/order-custom-attributes.md +++ b/doc/api/order-custom-attributes.md @@ -91,17 +91,17 @@ CompletableFuture createOrderCusto ## Example Usage ```java -CreateOrderCustomAttributeDefinitionRequest body = new CreateOrderCustomAttributeDefinitionRequest.Builder( - new CustomAttributeDefinition.Builder() - .key("cover-count") - .name("Cover count") - .description("The number of people seated at a table") - .visibility("VISIBILITY_READ_WRITE_VALUES") +CreateOrderCustomAttributeDefinitionRequest body = new CreateOrderCustomAttributeDefinitionRequest.Builder( + new CustomAttributeDefinition.Builder() + .key("cover-count") + .name("Cover count") + .description("The number of people seated at a table") + .visibility("VISIBILITY_READ_WRITE_VALUES") .build() -) -.idempotencyKey("IDEMPOTENCY_KEY") +) +.idempotencyKey("IDEMPOTENCY_KEY") .build(); - + orderCustomAttributesApi.createOrderCustomAttributeDefinitionAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -137,7 +137,7 @@ CompletableFuture deleteOrderCusto ## Example Usage ```java -String key = "key0"; +String key = "key0"; orderCustomAttributesApi.deleteOrderCustomAttributeDefinitionAsync(key).thenAccept(result -> { // TODO success callback handler @@ -178,7 +178,7 @@ CompletableFuture retrieveOrderC ## Example Usage ```java -String key = "key0"; +String key = "key0"; orderCustomAttributesApi.retrieveOrderCustomAttributeDefinitionAsync(key, null).thenAccept(result -> { // TODO success callback handler @@ -217,17 +217,17 @@ CompletableFuture updateOrderCusto ## Example Usage ```java -String key = "key0"; -UpdateOrderCustomAttributeDefinitionRequest body = new UpdateOrderCustomAttributeDefinitionRequest.Builder( - new CustomAttributeDefinition.Builder() - .key("cover-count") - .visibility("VISIBILITY_READ_ONLY") - .version(1) +String key = "key0"; +UpdateOrderCustomAttributeDefinitionRequest body = new UpdateOrderCustomAttributeDefinitionRequest.Builder( + new CustomAttributeDefinition.Builder() + .key("cover-count") + .visibility("VISIBILITY_READ_ONLY") + .version(1) .build() -) -.idempotencyKey("IDEMPOTENCY_KEY") +) +.idempotencyKey("IDEMPOTENCY_KEY") .build(); - + orderCustomAttributesApi.updateOrderCustomAttributeDefinitionAsync(key, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -274,22 +274,22 @@ CompletableFuture bulkDeleteOrderCustom ## Example Usage ```java -BulkDeleteOrderCustomAttributesRequest body = new BulkDeleteOrderCustomAttributesRequest.Builder( - new LinkedHashMap() {{ - put("cover-count", new BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.Builder( +BulkDeleteOrderCustomAttributesRequest body = new BulkDeleteOrderCustomAttributesRequest.Builder( + new LinkedHashMap() {{ + put("cover-count", new BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.Builder( "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" - ) - .key("cover-count") - .build()); - put("table-number", new BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.Builder( + ) + .key("cover-count") + .build()); + put("table-number", new BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.Builder( "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" - ) - .key("table-number") - .build()); + ) + .key("table-number") + .build()); }} -) +) .build(); - + orderCustomAttributesApi.bulkDeleteOrderCustomAttributesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -336,24 +336,24 @@ CompletableFuture bulkUpsertOrderCustom ## Example Usage ```java -BulkUpsertOrderCustomAttributesRequest body = new BulkUpsertOrderCustomAttributesRequest.Builder( - new LinkedHashMap() {{ - put("key0", new BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.Builder( - new CustomAttribute.Builder() +BulkUpsertOrderCustomAttributesRequest body = new BulkUpsertOrderCustomAttributesRequest.Builder( + new LinkedHashMap() {{ + put("key0", new BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.Builder( + new CustomAttribute.Builder() .build(), "order_id4" - ) - .build()); - put("key1", new BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.Builder( - new CustomAttribute.Builder() + ) + .build()); + put("key1", new BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.Builder( + new CustomAttribute.Builder() .build(), "order_id4" - ) - .build()); + ) + .build()); }} -) +) .build(); - + orderCustomAttributesApi.bulkUpsertOrderCustomAttributesAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -402,8 +402,8 @@ CompletableFuture listOrderCustomAttributesAs ## Example Usage ```java -String orderId = "order_id6"; -Boolean withDefinitions = false; +String orderId = "order_id6"; +Boolean withDefinitions = false; orderCustomAttributesApi.listOrderCustomAttributesAsync(orderId, null, null, null, withDefinitions).thenAccept(result -> { // TODO success callback handler @@ -444,8 +444,8 @@ CompletableFuture deleteOrderCustomAttribute ## Example Usage ```java -String orderId = "order_id6"; -String customAttributeKey = "custom_attribute_key2"; +String orderId = "order_id6"; +String customAttributeKey = "custom_attribute_key2"; orderCustomAttributesApi.deleteOrderCustomAttributeAsync(orderId, customAttributeKey).thenAccept(result -> { // TODO success callback handler @@ -493,9 +493,9 @@ CompletableFuture retrieveOrderCustomAttri ## Example Usage ```java -String orderId = "order_id6"; -String customAttributeKey = "custom_attribute_key2"; -Boolean withDefinition = false; +String orderId = "order_id6"; +String customAttributeKey = "custom_attribute_key2"; +Boolean withDefinition = false; orderCustomAttributesApi.retrieveOrderCustomAttributeAsync(orderId, customAttributeKey, null, withDefinition).thenAccept(result -> { // TODO success callback handler @@ -542,14 +542,14 @@ CompletableFuture upsertOrderCustomAttribute ## Example Usage ```java -String orderId = "order_id6"; -String customAttributeKey = "custom_attribute_key2"; -UpsertOrderCustomAttributeRequest body = new UpsertOrderCustomAttributeRequest.Builder( - new CustomAttribute.Builder() +String orderId = "order_id6"; +String customAttributeKey = "custom_attribute_key2"; +UpsertOrderCustomAttributeRequest body = new UpsertOrderCustomAttributeRequest.Builder( + new CustomAttribute.Builder() .build() -) +) .build(); - + orderCustomAttributesApi.upsertOrderCustomAttributeAsync(orderId, customAttributeKey, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/orders.md b/doc/api/orders.md index 60f0e4f0..0b8be9dd 100644 --- a/doc/api/orders.md +++ b/doc/api/orders.md @@ -48,72 +48,72 @@ CompletableFuture createOrderAsync( ## Example Usage ```java -CreateOrderRequest body = new CreateOrderRequest.Builder() - .order(new Order.Builder( +CreateOrderRequest body = new CreateOrderRequest.Builder() + .order(new Order.Builder( "057P5VYJ4A5X1" - ) - .referenceId("my-order-001") - .lineItems(Arrays.asList( - new OrderLineItem.Builder( + ) + .referenceId("my-order-001") + .lineItems(Arrays.asList( + new OrderLineItem.Builder( "1" - ) - .name("New York Strip Steak") - .basePriceMoney(new Money.Builder() - .amount(1599L) - .currency("USD") - .build()) + ) + .name("New York Strip Steak") + .basePriceMoney(new Money.Builder() + .amount(1599L) + .currency("USD") + .build()) .build(), - new OrderLineItem.Builder( + new OrderLineItem.Builder( "2" - ) - .catalogObjectId("BEMYCSMIJL46OCDV4KYIKXIB") - .modifiers(Arrays.asList( - new OrderLineItemModifier.Builder() - .catalogObjectId("CHQX7Y4KY6N5KINJKZCFURPZ") + ) + .catalogObjectId("BEMYCSMIJL46OCDV4KYIKXIB") + .modifiers(Arrays.asList( + new OrderLineItemModifier.Builder() + .catalogObjectId("CHQX7Y4KY6N5KINJKZCFURPZ") .build() - )) - .appliedDiscounts(Arrays.asList( - new OrderLineItemAppliedDiscount.Builder( + )) + .appliedDiscounts(Arrays.asList( + new OrderLineItemAppliedDiscount.Builder( "one-dollar-off" - ) + ) .build() - )) + )) .build() - )) - .taxes(Arrays.asList( - new OrderLineItemTax.Builder() - .uid("state-sales-tax") - .name("State Sales Tax") - .percentage("9") - .scope("ORDER") + )) + .taxes(Arrays.asList( + new OrderLineItemTax.Builder() + .uid("state-sales-tax") + .name("State Sales Tax") + .percentage("9") + .scope("ORDER") .build() - )) - .discounts(Arrays.asList( - new OrderLineItemDiscount.Builder() - .uid("labor-day-sale") - .name("Labor Day Sale") - .percentage("5") - .scope("ORDER") + )) + .discounts(Arrays.asList( + new OrderLineItemDiscount.Builder() + .uid("labor-day-sale") + .name("Labor Day Sale") + .percentage("5") + .scope("ORDER") .build(), - new OrderLineItemDiscount.Builder() - .uid("membership-discount") - .catalogObjectId("DB7L55ZH2BGWI4H23ULIWOQ7") - .scope("ORDER") + new OrderLineItemDiscount.Builder() + .uid("membership-discount") + .catalogObjectId("DB7L55ZH2BGWI4H23ULIWOQ7") + .scope("ORDER") .build(), - new OrderLineItemDiscount.Builder() - .uid("one-dollar-off") - .name("Sale - $1.00 off") - .amountMoney(new Money.Builder() - .amount(100L) - .currency("USD") - .build()) - .scope("LINE_ITEM") + new OrderLineItemDiscount.Builder() + .uid("one-dollar-off") + .name("Sale - $1.00 off") + .amountMoney(new Money.Builder() + .amount(100L) + .currency("USD") + .build()) + .scope("LINE_ITEM") .build() - )) - .build()) - .idempotencyKey("8193148c-9586-11e6-99f9-28cfe92138cf") + )) + .build()) + .idempotencyKey("8193148c-9586-11e6-99f9-28cfe92138cf") .build(); - + ordersApi.createOrderAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -149,15 +149,15 @@ CompletableFuture batchRetrieveOrdersAsync( ## Example Usage ```java -BatchRetrieveOrdersRequest body = new BatchRetrieveOrdersRequest.Builder( - Arrays.asList( +BatchRetrieveOrdersRequest body = new BatchRetrieveOrdersRequest.Builder( + Arrays.asList( "CAISEM82RcpmcFBM0TfOyiHV3es", "CAISENgvlJ6jLWAzERDzjyHVybY" ) -) -.locationId("057P5VYJ4A5X1") +) +.locationId("057P5VYJ4A5X1") .build(); - + ordersApi.batchRetrieveOrdersAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -191,41 +191,41 @@ CompletableFuture calculateOrderAsync( ## Example Usage ```java -CalculateOrderRequest body = new CalculateOrderRequest.Builder( - new Order.Builder( +CalculateOrderRequest body = new CalculateOrderRequest.Builder( + new Order.Builder( "D7AVYMEAPJ3A3" - ) - .lineItems(Arrays.asList( - new OrderLineItem.Builder( + ) + .lineItems(Arrays.asList( + new OrderLineItem.Builder( "1" - ) - .name("Item 1") - .basePriceMoney(new Money.Builder() - .amount(500L) - .currency("USD") - .build()) + ) + .name("Item 1") + .basePriceMoney(new Money.Builder() + .amount(500L) + .currency("USD") + .build()) .build(), - new OrderLineItem.Builder( + new OrderLineItem.Builder( "2" - ) - .name("Item 2") - .basePriceMoney(new Money.Builder() - .amount(300L) - .currency("USD") - .build()) + ) + .name("Item 2") + .basePriceMoney(new Money.Builder() + .amount(300L) + .currency("USD") + .build()) .build() - )) - .discounts(Arrays.asList( - new OrderLineItemDiscount.Builder() - .name("50% Off") - .percentage("50") - .scope("ORDER") + )) + .discounts(Arrays.asList( + new OrderLineItemDiscount.Builder() + .name("50% Off") + .percentage("50") + .scope("ORDER") .build() - )) + )) .build() -) +) .build(); - + ordersApi.calculateOrderAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -260,13 +260,13 @@ CompletableFuture cloneOrderAsync( ## Example Usage ```java -CloneOrderRequest body = new CloneOrderRequest.Builder( +CloneOrderRequest body = new CloneOrderRequest.Builder( "ZAISEM52YcpmcWAzERDOyiWS123" -) -.version(3) -.idempotencyKey("UNIQUE_STRING") +) +.version(3) +.idempotencyKey("UNIQUE_STRING") .build(); - + ordersApi.cloneOrderAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -316,36 +316,36 @@ CompletableFuture searchOrdersAsync( ## Example Usage ```java -SearchOrdersRequest body = new SearchOrdersRequest.Builder() - .locationIds(Arrays.asList( +SearchOrdersRequest body = new SearchOrdersRequest.Builder() + .locationIds(Arrays.asList( "057P5VYJ4A5X1", "18YC4JDH91E1H" - )) - .query(new SearchOrdersQuery.Builder() - .filter(new SearchOrdersFilter.Builder() - .stateFilter(new SearchOrdersStateFilter.Builder( - Arrays.asList( + )) + .query(new SearchOrdersQuery.Builder() + .filter(new SearchOrdersFilter.Builder() + .stateFilter(new SearchOrdersStateFilter.Builder( + Arrays.asList( "COMPLETED" ) - ) - .build()) - .dateTimeFilter(new SearchOrdersDateTimeFilter.Builder() - .closedAt(new TimeRange.Builder() - .startAt("2018-03-03T20:00:00+00:00") - .endAt("2019-03-04T21:54:45+00:00") - .build()) - .build()) - .build()) - .sort(new SearchOrdersSort.Builder( + ) + .build()) + .dateTimeFilter(new SearchOrdersDateTimeFilter.Builder() + .closedAt(new TimeRange.Builder() + .startAt("2018-03-03T20:00:00+00:00") + .endAt("2019-03-04T21:54:45+00:00") + .build()) + .build()) + .build()) + .sort(new SearchOrdersSort.Builder( "CLOSED_AT" - ) - .sortOrder("DESC") - .build()) - .build()) - .limit(3) - .returnEntries(true) + ) + .sortOrder("DESC") + .build()) + .build()) + .limit(3) + .returnEntries(true) .build(); - + ordersApi.searchOrdersAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -379,7 +379,7 @@ CompletableFuture retrieveOrderAsync( ## Example Usage ```java -String orderId = "order_id6"; +String orderId = "order_id6"; ordersApi.retrieveOrderAsync(orderId).thenAccept(result -> { // TODO success callback handler @@ -430,10 +430,10 @@ CompletableFuture updateOrderAsync( ## Example Usage ```java -String orderId = "order_id6"; -UpdateOrderRequest body = new UpdateOrderRequest.Builder() +String orderId = "order_id6"; +UpdateOrderRequest body = new UpdateOrderRequest.Builder() .build(); - + ordersApi.updateOrderAsync(orderId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -482,16 +482,16 @@ CompletableFuture payOrderAsync( ## Example Usage ```java -String orderId = "order_id6"; -PayOrderRequest body = new PayOrderRequest.Builder( +String orderId = "order_id6"; +PayOrderRequest body = new PayOrderRequest.Builder( "c043a359-7ad9-4136-82a9-c3f1d66dcbff" -) -.paymentIds(Arrays.asList( +) +.paymentIds(Arrays.asList( "EnZdNAlWCmfh6Mt5FMNST1o7taB", "0LRiVlbXVwe8ozu4KbZxd12mvaB" - )) + )) .build(); - + ordersApi.payOrderAsync(orderId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/payments.md b/doc/api/payments.md index e1fa29ca..39bf9f71 100644 --- a/doc/api/payments.md +++ b/doc/api/payments.md @@ -102,25 +102,25 @@ CompletableFuture createPaymentAsync( ## Example Usage ```java -CreatePaymentRequest body = new CreatePaymentRequest.Builder( +CreatePaymentRequest body = new CreatePaymentRequest.Builder( "ccof:GaJGNaZa8x4OgDJn4GB", "7b0f3ec5-086a-4871-8f13-3c81b3875218" -) -.amountMoney(new Money.Builder() - .amount(1000L) - .currency("USD") - .build()) -.appFeeMoney(new Money.Builder() - .amount(10L) - .currency("USD") - .build()) -.autocomplete(true) -.customerId("W92WH6P11H4Z77CTET0RNTGFW8") -.locationId("L88917AVBK2S5") -.referenceId("123456") -.note("Brief description") +) +.amountMoney(new Money.Builder() + .amount(1000L) + .currency("USD") + .build()) +.appFeeMoney(new Money.Builder() + .amount(10L) + .currency("USD") + .build()) +.autocomplete(true) +.customerId("W92WH6P11H4Z77CTET0RNTGFW8") +.locationId("L88917AVBK2S5") +.referenceId("123456") +.note("Brief description") .build(); - + paymentsApi.createPaymentAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -164,11 +164,11 @@ CompletableFuture cancelPaymentByIdempote ## Example Usage ```java -CancelPaymentByIdempotencyKeyRequest body = new CancelPaymentByIdempotencyKeyRequest.Builder( +CancelPaymentByIdempotencyKeyRequest body = new CancelPaymentByIdempotencyKeyRequest.Builder( "a7e36d40-d24b-11e8-b568-0800200c9a66" -) +) .build(); - + paymentsApi.cancelPaymentByIdempotencyKeyAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -202,7 +202,7 @@ CompletableFuture getPaymentAsync( ## Example Usage ```java -String paymentId = "payment_id0"; +String paymentId = "payment_id0"; paymentsApi.getPaymentAsync(paymentId).thenAccept(result -> { // TODO success callback handler @@ -240,23 +240,23 @@ CompletableFuture updatePaymentAsync( ## Example Usage ```java -String paymentId = "payment_id0"; -UpdatePaymentRequest body = new UpdatePaymentRequest.Builder( +String paymentId = "payment_id0"; +UpdatePaymentRequest body = new UpdatePaymentRequest.Builder( "956f8b13-e4ec-45d6-85e8-d1d95ef0c5de" -) -.payment(new Payment.Builder() - .amountMoney(new Money.Builder() - .amount(1000L) - .currency("USD") - .build()) - .tipMoney(new Money.Builder() - .amount(100L) - .currency("USD") - .build()) - .versionToken("ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o") - .build()) +) +.payment(new Payment.Builder() + .amountMoney(new Money.Builder() + .amount(1000L) + .currency("USD") + .build()) + .tipMoney(new Money.Builder() + .amount(100L) + .currency("USD") + .build()) + .versionToken("ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o") + .build()) .build(); - + paymentsApi.updatePaymentAsync(paymentId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -291,7 +291,7 @@ CompletableFuture cancelPaymentAsync( ## Example Usage ```java -String paymentId = "payment_id0"; +String paymentId = "payment_id0"; paymentsApi.cancelPaymentAsync(paymentId).thenAccept(result -> { // TODO success callback handler @@ -331,10 +331,10 @@ CompletableFuture completePaymentAsync( ## Example Usage ```java -String paymentId = "payment_id0"; -CompletePaymentRequest body = new CompletePaymentRequest.Builder() +String paymentId = "payment_id0"; +CompletePaymentRequest body = new CompletePaymentRequest.Builder() .build(); - + paymentsApi.completePaymentAsync(paymentId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/payouts.md b/doc/api/payouts.md index b9843b57..ea434e43 100644 --- a/doc/api/payouts.md +++ b/doc/api/payouts.md @@ -85,7 +85,7 @@ CompletableFuture getPayoutAsync( ## Example Usage ```java -String payoutId = "payout_id6"; +String payoutId = "payout_id6"; payoutsApi.getPayoutAsync(payoutId).thenAccept(result -> { // TODO success callback handler @@ -127,7 +127,7 @@ CompletableFuture listPayoutEntriesAsync( ## Example Usage ```java -String payoutId = "payout_id6"; +String payoutId = "payout_id6"; payoutsApi.listPayoutEntriesAsync(payoutId, null, null, null).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/refunds.md b/doc/api/refunds.md index 7e995538..1542c6b8 100644 --- a/doc/api/refunds.md +++ b/doc/api/refunds.md @@ -92,21 +92,21 @@ CompletableFuture refundPaymentAsync( ## Example Usage ```java -RefundPaymentRequest body = new RefundPaymentRequest.Builder( +RefundPaymentRequest body = new RefundPaymentRequest.Builder( "9b7f2dcf-49da-4411-b23e-a2d6af21333a", - new Money.Builder() - .amount(1000L) - .currency("USD") + new Money.Builder() + .amount(1000L) + .currency("USD") .build() -) -.appFeeMoney(new Money.Builder() - .amount(10L) - .currency("USD") - .build()) -.paymentId("R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY") -.reason("Example") +) +.appFeeMoney(new Money.Builder() + .amount(10L) + .currency("USD") + .build()) +.paymentId("R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY") +.reason("Example") .build(); - + refundsApi.refundPaymentAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -140,7 +140,7 @@ CompletableFuture getPaymentRefundAsync( ## Example Usage ```java -String refundId = "refund_id4"; +String refundId = "refund_id4"; refundsApi.getPaymentRefundAsync(refundId).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/snippets.md b/doc/api/snippets.md index 29bcfe7a..eafe7962 100644 --- a/doc/api/snippets.md +++ b/doc/api/snippets.md @@ -41,7 +41,7 @@ CompletableFuture deleteSnippetAsync( ## Example Usage ```java -String siteId = "site_id6"; +String siteId = "site_id6"; snippetsApi.deleteSnippetAsync(siteId).thenAccept(result -> { // TODO success callback handler @@ -80,7 +80,7 @@ CompletableFuture retrieveSnippetAsync( ## Example Usage ```java -String siteId = "site_id6"; +String siteId = "site_id6"; snippetsApi.retrieveSnippetAsync(siteId).thenAccept(result -> { // TODO success callback handler @@ -122,15 +122,15 @@ CompletableFuture upsertSnippetAsync( ## Example Usage ```java -String siteId = "site_id6"; -UpsertSnippetRequest body = new UpsertSnippetRequest.Builder( - new Snippet.Builder( +String siteId = "site_id6"; +UpsertSnippetRequest body = new UpsertSnippetRequest.Builder( + new Snippet.Builder( "" - ) + ) .build() -) +) .build(); - + snippetsApi.upsertSnippetAsync(siteId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/subscriptions.md b/doc/api/subscriptions.md index 2bcdd440..2d1d03a4 100644 --- a/doc/api/subscriptions.md +++ b/doc/api/subscriptions.md @@ -53,26 +53,26 @@ CompletableFuture createSubscriptionAsync( ## Example Usage ```java -CreateSubscriptionRequest body = new CreateSubscriptionRequest.Builder( +CreateSubscriptionRequest body = new CreateSubscriptionRequest.Builder( "S8GWD5R9QB376", "CHFGVKYY8RSV93M5KCYTG4PN0G" -) -.idempotencyKey("8193148c-9586-11e6-99f9-28cfe92138cf") -.planVariationId("6JHXF3B2CW3YKHDV4XEM674H") -.startDate("2023-06-20") -.cardId("ccof:qy5x8hHGYsgLrp4Q4GB") -.timezone("America/Los_Angeles") -.source(new SubscriptionSource.Builder() - .name("My Application") - .build()) -.phases(Arrays.asList( - new Phase.Builder() - .ordinal(0L) - .orderTemplateId("U2NaowWxzXwpsZU697x7ZHOAnCNZY") +) +.idempotencyKey("8193148c-9586-11e6-99f9-28cfe92138cf") +.planVariationId("6JHXF3B2CW3YKHDV4XEM674H") +.startDate("2023-06-20") +.cardId("ccof:qy5x8hHGYsgLrp4Q4GB") +.timezone("America/Los_Angeles") +.source(new SubscriptionSource.Builder() + .name("My Application") + .build()) +.phases(Arrays.asList( + new Phase.Builder() + .ordinal(0L) + .orderTemplateId("U2NaowWxzXwpsZU697x7ZHOAnCNZY") .build() - )) + )) .build(); - + subscriptionsApi.createSubscriptionAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -107,13 +107,13 @@ CompletableFuture bulkSwapPlanAsync( ## Example Usage ```java -BulkSwapPlanRequest body = new BulkSwapPlanRequest.Builder( +BulkSwapPlanRequest body = new BulkSwapPlanRequest.Builder( "FQ7CDXXWSLUJRPM3GFJSJGZ7", "6JHXF3B2CW3YKHDV4XEM674H", "S8GWD5R9QB376" -) +) .build(); - + subscriptionsApi.bulkSwapPlanAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -160,22 +160,22 @@ CompletableFuture searchSubscriptionsAsync( ## Example Usage ```java -SearchSubscriptionsRequest body = new SearchSubscriptionsRequest.Builder() - .query(new SearchSubscriptionsQuery.Builder() - .filter(new SearchSubscriptionsFilter.Builder() - .customerIds(Arrays.asList( +SearchSubscriptionsRequest body = new SearchSubscriptionsRequest.Builder() + .query(new SearchSubscriptionsQuery.Builder() + .filter(new SearchSubscriptionsFilter.Builder() + .customerIds(Arrays.asList( "CHFGVKYY8RSV93M5KCYTG4PN0G" - )) - .locationIds(Arrays.asList( + )) + .locationIds(Arrays.asList( "S8GWD5R9QB376" - )) - .sourceNames(Arrays.asList( + )) + .sourceNames(Arrays.asList( "My App" - )) - .build()) - .build()) + )) + .build()) + .build()) .build(); - + subscriptionsApi.searchSubscriptionsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -211,7 +211,7 @@ CompletableFuture retrieveSubscriptionAsync( ## Example Usage ```java -String subscriptionId = "subscription_id0"; +String subscriptionId = "subscription_id0"; subscriptionsApi.retrieveSubscriptionAsync(subscriptionId, null).thenAccept(result -> { // TODO success callback handler @@ -249,14 +249,14 @@ CompletableFuture updateSubscriptionAsync( ## Example Usage ```java -String subscriptionId = "subscription_id0"; -UpdateSubscriptionRequest body = new UpdateSubscriptionRequest.Builder() - .subscription(new Subscription.Builder() - .canceledDate("canceled_date6") - .cardId("{NEW CARD ID}") - .build()) +String subscriptionId = "subscription_id0"; +UpdateSubscriptionRequest body = new UpdateSubscriptionRequest.Builder() + .subscription(new Subscription.Builder() + .canceledDate("canceled_date6") + .cardId("{NEW CARD ID}") + .build()) .build(); - + subscriptionsApi.updateSubscriptionAsync(subscriptionId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -292,8 +292,8 @@ CompletableFuture deleteSubscriptionActionAsyn ## Example Usage ```java -String subscriptionId = "subscription_id0"; -String actionId = "action_id6"; +String subscriptionId = "subscription_id0"; +String actionId = "action_id6"; subscriptionsApi.deleteSubscriptionActionAsync(subscriptionId, actionId).thenAccept(result -> { // TODO success callback handler @@ -331,11 +331,11 @@ CompletableFuture changeBillingAnchorDateAsync( ## Example Usage ```java -String subscriptionId = "subscription_id0"; -ChangeBillingAnchorDateRequest body = new ChangeBillingAnchorDateRequest.Builder() - .monthlyBillingAnchorDate(1) +String subscriptionId = "subscription_id0"; +ChangeBillingAnchorDateRequest body = new ChangeBillingAnchorDateRequest.Builder() + .monthlyBillingAnchorDate(1) .build(); - + subscriptionsApi.changeBillingAnchorDateAsync(subscriptionId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -371,7 +371,7 @@ CompletableFuture cancelSubscriptionAsync( ## Example Usage ```java -String subscriptionId = "subscription_id0"; +String subscriptionId = "subscription_id0"; subscriptionsApi.cancelSubscriptionAsync(subscriptionId).thenAccept(result -> { // TODO success callback handler @@ -410,7 +410,7 @@ CompletableFuture listSubscriptionEventsAsync( ## Example Usage ```java -String subscriptionId = "subscription_id0"; +String subscriptionId = "subscription_id0"; subscriptionsApi.listSubscriptionEventsAsync(subscriptionId, null, null).thenAccept(result -> { // TODO success callback handler @@ -447,10 +447,10 @@ CompletableFuture pauseSubscriptionAsync( ## Example Usage ```java -String subscriptionId = "subscription_id0"; -PauseSubscriptionRequest body = new PauseSubscriptionRequest.Builder() +String subscriptionId = "subscription_id0"; +PauseSubscriptionRequest body = new PauseSubscriptionRequest.Builder() .build(); - + subscriptionsApi.pauseSubscriptionAsync(subscriptionId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -486,10 +486,10 @@ CompletableFuture resumeSubscriptionAsync( ## Example Usage ```java -String subscriptionId = "subscription_id0"; -ResumeSubscriptionRequest body = new ResumeSubscriptionRequest.Builder() +String subscriptionId = "subscription_id0"; +ResumeSubscriptionRequest body = new ResumeSubscriptionRequest.Builder() .build(); - + subscriptionsApi.resumeSubscriptionAsync(subscriptionId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -526,18 +526,18 @@ CompletableFuture swapPlanAsync( ## Example Usage ```java -String subscriptionId = "subscription_id0"; -SwapPlanRequest body = new SwapPlanRequest.Builder() - .newPlanVariationId("FQ7CDXXWSLUJRPM3GFJSJGZ7") - .phases(Arrays.asList( - new PhaseInput.Builder( +String subscriptionId = "subscription_id0"; +SwapPlanRequest body = new SwapPlanRequest.Builder() + .newPlanVariationId("FQ7CDXXWSLUJRPM3GFJSJGZ7") + .phases(Arrays.asList( + new PhaseInput.Builder( 0L - ) - .orderTemplateId("uhhnjH9osVv3shUADwaC0b3hNxQZY") + ) + .orderTemplateId("uhhnjH9osVv3shUADwaC0b3hNxQZY") .build() - )) + )) .build(); - + subscriptionsApi.swapPlanAsync(subscriptionId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/team.md b/doc/api/team.md index cd3e9f0d..868ad673 100644 --- a/doc/api/team.md +++ b/doc/api/team.md @@ -48,25 +48,25 @@ CompletableFuture createTeamMemberAsync( ## Example Usage ```java -CreateTeamMemberRequest body = new CreateTeamMemberRequest.Builder() - .idempotencyKey("idempotency-key-0") - .teamMember(new TeamMember.Builder() - .referenceId("reference_id_1") - .status("ACTIVE") - .givenName("Joe") - .familyName("Doe") - .emailAddress("joe_doe@gmail.com") - .phoneNumber("+14159283333") - .assignedLocations(new TeamMemberAssignedLocations.Builder() - .assignmentType("EXPLICIT_LOCATIONS") - .locationIds(Arrays.asList( +CreateTeamMemberRequest body = new CreateTeamMemberRequest.Builder() + .idempotencyKey("idempotency-key-0") + .teamMember(new TeamMember.Builder() + .referenceId("reference_id_1") + .status("ACTIVE") + .givenName("Joe") + .familyName("Doe") + .emailAddress("joe_doe@gmail.com") + .phoneNumber("+14159283333") + .assignedLocations(new TeamMemberAssignedLocations.Builder() + .assignmentType("EXPLICIT_LOCATIONS") + .locationIds(Arrays.asList( "YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT" - )) - .build()) - .build()) + )) + .build()) + .build()) .build(); - + teamApi.createTeamMemberAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -105,40 +105,40 @@ CompletableFuture bulkCreateTeamMembersAsync( ## Example Usage ```java -BulkCreateTeamMembersRequest body = new BulkCreateTeamMembersRequest.Builder( - new LinkedHashMap() {{ - put("idempotency-key-1", new CreateTeamMemberRequest.Builder() - .teamMember(new TeamMember.Builder() - .referenceId("reference_id_1") - .givenName("Joe") - .familyName("Doe") - .emailAddress("joe_doe@gmail.com") - .phoneNumber("+14159283333") - .assignedLocations(new TeamMemberAssignedLocations.Builder() - .assignmentType("EXPLICIT_LOCATIONS") - .locationIds(Arrays.asList( +BulkCreateTeamMembersRequest body = new BulkCreateTeamMembersRequest.Builder( + new LinkedHashMap() {{ + put("idempotency-key-1", new CreateTeamMemberRequest.Builder() + .teamMember(new TeamMember.Builder() + .referenceId("reference_id_1") + .givenName("Joe") + .familyName("Doe") + .emailAddress("joe_doe@gmail.com") + .phoneNumber("+14159283333") + .assignedLocations(new TeamMemberAssignedLocations.Builder() + .assignmentType("EXPLICIT_LOCATIONS") + .locationIds(Arrays.asList( "YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT" - )) - .build()) - .build()) - .build()); - put("idempotency-key-2", new CreateTeamMemberRequest.Builder() - .teamMember(new TeamMember.Builder() - .referenceId("reference_id_2") - .givenName("Jane") - .familyName("Smith") - .emailAddress("jane_smith@gmail.com") - .phoneNumber("+14159223334") - .assignedLocations(new TeamMemberAssignedLocations.Builder() - .assignmentType("ALL_CURRENT_AND_FUTURE_LOCATIONS") - .build()) - .build()) - .build()); + )) + .build()) + .build()) + .build()); + put("idempotency-key-2", new CreateTeamMemberRequest.Builder() + .teamMember(new TeamMember.Builder() + .referenceId("reference_id_2") + .givenName("Jane") + .familyName("Smith") + .emailAddress("jane_smith@gmail.com") + .phoneNumber("+14159223334") + .assignedLocations(new TeamMemberAssignedLocations.Builder() + .assignmentType("ALL_CURRENT_AND_FUTURE_LOCATIONS") + .build()) + .build()) + .build()); }} -) +) .build(); - + teamApi.bulkCreateTeamMembersAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -176,44 +176,44 @@ CompletableFuture bulkUpdateTeamMembersAsync( ## Example Usage ```java -BulkUpdateTeamMembersRequest body = new BulkUpdateTeamMembersRequest.Builder( - new LinkedHashMap() {{ - put("AFMwA08kR-MIF-3Vs0OE", new UpdateTeamMemberRequest.Builder() - .teamMember(new TeamMember.Builder() - .referenceId("reference_id_2") - .isOwner(false) - .status("ACTIVE") - .givenName("Jane") - .familyName("Smith") - .emailAddress("jane_smith@gmail.com") - .phoneNumber("+14159223334") - .assignedLocations(new TeamMemberAssignedLocations.Builder() - .assignmentType("ALL_CURRENT_AND_FUTURE_LOCATIONS") - .build()) - .build()) - .build()); - put("fpgteZNMaf0qOK-a4t6P", new UpdateTeamMemberRequest.Builder() - .teamMember(new TeamMember.Builder() - .referenceId("reference_id_1") - .isOwner(false) - .status("ACTIVE") - .givenName("Joe") - .familyName("Doe") - .emailAddress("joe_doe@gmail.com") - .phoneNumber("+14159283333") - .assignedLocations(new TeamMemberAssignedLocations.Builder() - .assignmentType("EXPLICIT_LOCATIONS") - .locationIds(Arrays.asList( +BulkUpdateTeamMembersRequest body = new BulkUpdateTeamMembersRequest.Builder( + new LinkedHashMap() {{ + put("AFMwA08kR-MIF-3Vs0OE", new UpdateTeamMemberRequest.Builder() + .teamMember(new TeamMember.Builder() + .referenceId("reference_id_2") + .isOwner(false) + .status("ACTIVE") + .givenName("Jane") + .familyName("Smith") + .emailAddress("jane_smith@gmail.com") + .phoneNumber("+14159223334") + .assignedLocations(new TeamMemberAssignedLocations.Builder() + .assignmentType("ALL_CURRENT_AND_FUTURE_LOCATIONS") + .build()) + .build()) + .build()); + put("fpgteZNMaf0qOK-a4t6P", new UpdateTeamMemberRequest.Builder() + .teamMember(new TeamMember.Builder() + .referenceId("reference_id_1") + .isOwner(false) + .status("ACTIVE") + .givenName("Joe") + .familyName("Doe") + .emailAddress("joe_doe@gmail.com") + .phoneNumber("+14159283333") + .assignedLocations(new TeamMemberAssignedLocations.Builder() + .assignmentType("EXPLICIT_LOCATIONS") + .locationIds(Arrays.asList( "YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT" - )) - .build()) - .build()) - .build()); + )) + .build()) + .build()) + .build()); }} -) +) .build(); - + teamApi.bulkUpdateTeamMembersAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -251,18 +251,18 @@ CompletableFuture searchTeamMembersAsync( ## Example Usage ```java -SearchTeamMembersRequest body = new SearchTeamMembersRequest.Builder() - .query(new SearchTeamMembersQuery.Builder() - .filter(new SearchTeamMembersFilter.Builder() - .locationIds(Arrays.asList( +SearchTeamMembersRequest body = new SearchTeamMembersRequest.Builder() + .query(new SearchTeamMembersQuery.Builder() + .filter(new SearchTeamMembersFilter.Builder() + .locationIds(Arrays.asList( "0G5P3VGACMMQZ" - )) - .status("ACTIVE") - .build()) - .build()) - .limit(10) + )) + .status("ACTIVE") + .build()) + .build()) + .limit(10) .build(); - + teamApi.searchTeamMembersAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -297,7 +297,7 @@ CompletableFuture retrieveTeamMemberAsync( ## Example Usage ```java -String teamMemberId = "team_member_id0"; +String teamMemberId = "team_member_id0"; teamApi.retrieveTeamMemberAsync(teamMemberId).thenAccept(result -> { // TODO success callback handler @@ -335,25 +335,25 @@ CompletableFuture updateTeamMemberAsync( ## Example Usage ```java -String teamMemberId = "team_member_id0"; -UpdateTeamMemberRequest body = new UpdateTeamMemberRequest.Builder() - .teamMember(new TeamMember.Builder() - .referenceId("reference_id_1") - .status("ACTIVE") - .givenName("Joe") - .familyName("Doe") - .emailAddress("joe_doe@gmail.com") - .phoneNumber("+14159283333") - .assignedLocations(new TeamMemberAssignedLocations.Builder() - .assignmentType("EXPLICIT_LOCATIONS") - .locationIds(Arrays.asList( +String teamMemberId = "team_member_id0"; +UpdateTeamMemberRequest body = new UpdateTeamMemberRequest.Builder() + .teamMember(new TeamMember.Builder() + .referenceId("reference_id_1") + .status("ACTIVE") + .givenName("Joe") + .familyName("Doe") + .emailAddress("joe_doe@gmail.com") + .phoneNumber("+14159283333") + .assignedLocations(new TeamMemberAssignedLocations.Builder() + .assignmentType("EXPLICIT_LOCATIONS") + .locationIds(Arrays.asList( "YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT" - )) - .build()) - .build()) + )) + .build()) + .build()) .build(); - + teamApi.updateTeamMemberAsync(teamMemberId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -389,7 +389,7 @@ CompletableFuture retrieveWageSettingAsync( ## Example Usage ```java -String teamMemberId = "team_member_id0"; +String teamMemberId = "team_member_id0"; teamApi.retrieveWageSettingAsync(teamMemberId).thenAccept(result -> { // TODO success callback handler @@ -430,35 +430,35 @@ CompletableFuture updateWageSettingAsync( ## Example Usage ```java -String teamMemberId = "team_member_id0"; -UpdateWageSettingRequest body = new UpdateWageSettingRequest.Builder( - new WageSetting.Builder() - .jobAssignments(Arrays.asList( - new JobAssignment.Builder( +String teamMemberId = "team_member_id0"; +UpdateWageSettingRequest body = new UpdateWageSettingRequest.Builder( + new WageSetting.Builder() + .jobAssignments(Arrays.asList( + new JobAssignment.Builder( "Manager", "SALARY" - ) - .annualRate(new Money.Builder() - .amount(3000000L) - .currency("USD") - .build()) - .weeklyHours(40) + ) + .annualRate(new Money.Builder() + .amount(3000000L) + .currency("USD") + .build()) + .weeklyHours(40) .build(), - new JobAssignment.Builder( + new JobAssignment.Builder( "Cashier", "HOURLY" - ) - .hourlyRate(new Money.Builder() - .amount(1200L) - .currency("USD") - .build()) + ) + .hourlyRate(new Money.Builder() + .amount(1200L) + .currency("USD") + .build()) .build() - )) - .isOvertimeExempt(true) + )) + .isOvertimeExempt(true) .build() -) +) .build(); - + teamApi.updateWageSettingAsync(teamMemberId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/api/terminal.md b/doc/api/terminal.md index 3d81778b..2b907d4b 100644 --- a/doc/api/terminal.md +++ b/doc/api/terminal.md @@ -49,21 +49,21 @@ CompletableFuture createTerminalActionAsync( ## Example Usage ```java -CreateTerminalActionRequest body = new CreateTerminalActionRequest.Builder( +CreateTerminalActionRequest body = new CreateTerminalActionRequest.Builder( "thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e", - new TerminalAction.Builder() - .deviceId("{{DEVICE_ID}}") - .deadlineDuration("PT5M") - .type("SAVE_CARD") - .saveCardOptions(new SaveCardOptions.Builder( + new TerminalAction.Builder() + .deviceId("{{DEVICE_ID}}") + .deadlineDuration("PT5M") + .type("SAVE_CARD") + .saveCardOptions(new SaveCardOptions.Builder( "{{CUSTOMER_ID}}" - ) - .referenceId("user-id-1") - .build()) + ) + .referenceId("user-id-1") + .build()) .build() -) +) .build(); - + terminalApi.createTerminalActionAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -97,20 +97,20 @@ CompletableFuture searchTerminalActionsAsync( ## Example Usage ```java -SearchTerminalActionsRequest body = new SearchTerminalActionsRequest.Builder() - .query(new TerminalActionQuery.Builder() - .filter(new TerminalActionQueryFilter.Builder() - .createdAt(new TimeRange.Builder() - .startAt("2022-04-01T00:00:00.000Z") - .build()) - .build()) - .sort(new TerminalActionQuerySort.Builder() - .sortOrder("DESC") - .build()) - .build()) - .limit(2) +SearchTerminalActionsRequest body = new SearchTerminalActionsRequest.Builder() + .query(new TerminalActionQuery.Builder() + .filter(new TerminalActionQueryFilter.Builder() + .createdAt(new TimeRange.Builder() + .startAt("2022-04-01T00:00:00.000Z") + .build()) + .build()) + .sort(new TerminalActionQuerySort.Builder() + .sortOrder("DESC") + .build()) + .build()) + .limit(2) .build(); - + terminalApi.searchTerminalActionsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -144,7 +144,7 @@ CompletableFuture getTerminalActionAsync( ## Example Usage ```java -String actionId = "action_id6"; +String actionId = "action_id6"; terminalApi.getTerminalActionAsync(actionId).thenAccept(result -> { // TODO success callback handler @@ -179,7 +179,7 @@ CompletableFuture cancelTerminalActionAsync( ## Example Usage ```java -String actionId = "action_id6"; +String actionId = "action_id6"; terminalApi.cancelTerminalActionAsync(actionId).thenAccept(result -> { // TODO success callback handler @@ -216,7 +216,7 @@ CompletableFuture dismissTerminalActionAsync( ## Example Usage ```java -String actionId = "action_id6"; +String actionId = "action_id6"; terminalApi.dismissTerminalActionAsync(actionId).thenAccept(result -> { // TODO success callback handler @@ -252,24 +252,24 @@ CompletableFuture createTerminalCheckoutAsync( ## Example Usage ```java -CreateTerminalCheckoutRequest body = new CreateTerminalCheckoutRequest.Builder( +CreateTerminalCheckoutRequest body = new CreateTerminalCheckoutRequest.Builder( "28a0c3bc-7839-11ea-bc55-0242ac130003", - new TerminalCheckout.Builder( - new Money.Builder() - .amount(2610L) - .currency("USD") + new TerminalCheckout.Builder( + new Money.Builder() + .amount(2610L) + .currency("USD") .build(), - new DeviceCheckoutOptions.Builder( + new DeviceCheckoutOptions.Builder( "dbb5d83a-7838-11ea-bc55-0242ac130003" - ) + ) .build() - ) - .referenceId("id11572") - .note("A brief note") + ) + .referenceId("id11572") + .note("A brief note") .build() -) +) .build(); - + terminalApi.createTerminalCheckoutAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -303,15 +303,15 @@ CompletableFuture searchTerminalCheckoutsAsync( ## Example Usage ```java -SearchTerminalCheckoutsRequest body = new SearchTerminalCheckoutsRequest.Builder() - .query(new TerminalCheckoutQuery.Builder() - .filter(new TerminalCheckoutQueryFilter.Builder() - .status("COMPLETED") - .build()) - .build()) - .limit(2) +SearchTerminalCheckoutsRequest body = new SearchTerminalCheckoutsRequest.Builder() + .query(new TerminalCheckoutQuery.Builder() + .filter(new TerminalCheckoutQueryFilter.Builder() + .status("COMPLETED") + .build()) + .build()) + .limit(2) .build(); - + terminalApi.searchTerminalCheckoutsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -345,7 +345,7 @@ CompletableFuture getTerminalCheckoutAsync( ## Example Usage ```java -String checkoutId = "checkout_id8"; +String checkoutId = "checkout_id8"; terminalApi.getTerminalCheckoutAsync(checkoutId).thenAccept(result -> { // TODO success callback handler @@ -380,7 +380,7 @@ CompletableFuture cancelTerminalCheckoutAsync( ## Example Usage ```java -String checkoutId = "checkout_id8"; +String checkoutId = "checkout_id8"; terminalApi.cancelTerminalCheckoutAsync(checkoutId).thenAccept(result -> { // TODO success callback handler @@ -415,7 +415,7 @@ CompletableFuture dismissTerminalCheckoutAsync( ## Example Usage ```java -String checkoutId = "checkout_id8"; +String checkoutId = "checkout_id8"; terminalApi.dismissTerminalCheckoutAsync(checkoutId).thenAccept(result -> { // TODO success callback handler @@ -450,21 +450,21 @@ CompletableFuture createTerminalRefundAsync( ## Example Usage ```java -CreateTerminalRefundRequest body = new CreateTerminalRefundRequest.Builder( +CreateTerminalRefundRequest body = new CreateTerminalRefundRequest.Builder( "402a640b-b26f-401f-b406-46f839590c04" -) -.refund(new TerminalRefund.Builder( +) +.refund(new TerminalRefund.Builder( "5O5OvgkcNUhl7JBuINflcjKqUzXZY", - new Money.Builder() - .amount(111L) - .currency("CAD") + new Money.Builder() + .amount(111L) + .currency("CAD") .build(), "Returning items", "f72dfb8e-4d65-4e56-aade-ec3fb8d33291" - ) - .build()) + ) + .build()) .build(); - + terminalApi.createTerminalRefundAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -498,15 +498,15 @@ CompletableFuture searchTerminalRefundsAsync( ## Example Usage ```java -SearchTerminalRefundsRequest body = new SearchTerminalRefundsRequest.Builder() - .query(new TerminalRefundQuery.Builder() - .filter(new TerminalRefundQueryFilter.Builder() - .status("COMPLETED") - .build()) - .build()) - .limit(1) +SearchTerminalRefundsRequest body = new SearchTerminalRefundsRequest.Builder() + .query(new TerminalRefundQuery.Builder() + .filter(new TerminalRefundQueryFilter.Builder() + .status("COMPLETED") + .build()) + .build()) + .limit(1) .build(); - + terminalApi.searchTerminalRefundsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -540,7 +540,7 @@ CompletableFuture getTerminalRefundAsync( ## Example Usage ```java -String terminalRefundId = "terminal_refund_id0"; +String terminalRefundId = "terminal_refund_id0"; terminalApi.getTerminalRefundAsync(terminalRefundId).thenAccept(result -> { // TODO success callback handler @@ -575,7 +575,7 @@ CompletableFuture cancelTerminalRefundAsync( ## Example Usage ```java -String terminalRefundId = "terminal_refund_id0"; +String terminalRefundId = "terminal_refund_id0"; terminalApi.cancelTerminalRefundAsync(terminalRefundId).thenAccept(result -> { // TODO success callback handler @@ -610,7 +610,7 @@ CompletableFuture dismissTerminalRefundAsync( ## Example Usage ```java -String terminalRefundId = "terminal_refund_id0"; +String terminalRefundId = "terminal_refund_id0"; terminalApi.dismissTerminalRefundAsync(terminalRefundId).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/transactions.md b/doc/api/transactions.md index 05416d90..8f7a771e 100644 --- a/doc/api/transactions.md +++ b/doc/api/transactions.md @@ -53,7 +53,7 @@ CompletableFuture listTransactionsAsync( ## Example Usage ```java -String locationId = "location_id4"; +String locationId = "location_id4"; transactionsApi.listTransactionsAsync(locationId, null, null, null, null).thenAccept(result -> { // TODO success callback handler @@ -92,8 +92,8 @@ CompletableFuture retrieveTransactionAsync( ## Example Usage ```java -String locationId = "location_id4"; -String transactionId = "transaction_id8"; +String locationId = "location_id4"; +String transactionId = "transaction_id8"; transactionsApi.retrieveTransactionAsync(locationId, transactionId).thenAccept(result -> { // TODO success callback handler @@ -136,8 +136,8 @@ CompletableFuture captureTransactionAsync( ## Example Usage ```java -String locationId = "location_id4"; -String transactionId = "transaction_id8"; +String locationId = "location_id4"; +String transactionId = "transaction_id8"; transactionsApi.captureTransactionAsync(locationId, transactionId).thenAccept(result -> { // TODO success callback handler @@ -180,8 +180,8 @@ CompletableFuture voidTransactionAsync( ## Example Usage ```java -String locationId = "location_id4"; -String transactionId = "transaction_id8"; +String locationId = "location_id4"; +String transactionId = "transaction_id8"; transactionsApi.voidTransactionAsync(locationId, transactionId).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/v1-transactions.md b/doc/api/v1-transactions.md index 29d2b441..65e52101 100644 --- a/doc/api/v1-transactions.md +++ b/doc/api/v1-transactions.md @@ -12,13 +12,7 @@ V1TransactionsApi v1TransactionsApi = client.getV1TransactionsApi(); * [V1 List Orders](../../doc/api/v1-transactions.md#v1-list-orders) * [V1 Retrieve Order](../../doc/api/v1-transactions.md#v1-retrieve-order) -* [V1 Update Order](../../doc/api/v1-transactions.md#v1-update-order) -* [V1 List Payments](../../doc/api/v1-transactions.md#v1-list-payments) -* [V1 Retrieve Payment](../../doc/api/v1-transactions.md#v1-retrieve-payment) -* [V1 List Refunds](../../doc/api/v1-transactions.md#v1-list-refunds) -* [V1 Create Refund](../../doc/api/v1-transactions.md#v1-create-refund) -* [V1 List Settlements](../../doc/api/v1-transactions.md#v1-list-settlements) -* [V1 Retrieve Settlement](../../doc/api/v1-transactions.md#v1-retrieve-settlement) +* [V1 Update Order](../../doc/api/v1-transactions.md#v1-update-order) # V1 List Orders @@ -51,7 +45,7 @@ CompletableFuture> v1ListOrdersAsync( ## Example Usage ```java -String locationId = "location_id4"; +String locationId = "location_id4"; v1TransactionsApi.v1ListOrdersAsync(locationId, null, null, null).thenAccept(result -> { // TODO success callback handler @@ -90,8 +84,8 @@ CompletableFuture v1RetrieveOrderAsync( ## Example Usage ```java -String locationId = "location_id4"; -String orderId = "order_id6"; +String locationId = "location_id4"; +String orderId = "order_id6"; v1TransactionsApi.v1RetrieveOrderAsync(locationId, orderId).thenAccept(result -> { // TODO success callback handler @@ -132,327 +126,14 @@ CompletableFuture v1UpdateOrderAsync( ## Example Usage ```java -String locationId = "location_id4"; -String orderId = "order_id6"; -V1UpdateOrderRequest body = new V1UpdateOrderRequest.Builder( +String locationId = "location_id4"; +String orderId = "order_id6"; +V1UpdateOrderRequest body = new V1UpdateOrderRequest.Builder( "REFUND" -) +) .build(); - -v1TransactionsApi.v1UpdateOrderAsync(locationId, orderId, body).thenAccept(result -> { - // TODO success callback handler - System.out.println(result); -}).exceptionally(exception -> { - // TODO failure callback handler - exception.printStackTrace(); - return null; -}); -``` - - -# V1 List Payments - -**This endpoint is deprecated.** - -Provides summary information for all payments taken for a given -Square account during a date range. Date ranges cannot exceed 1 year in -length. See Date ranges for details of inclusive and exclusive dates. - -*Note**: Details for payments processed with Square Point of Sale while -in offline mode may not be transmitted to Square for up to 72 hours. -Offline payments have a `created_at` value that reflects the time the -payment was originally processed, not the time it was subsequently -transmitted to Square. Consequently, the ListPayments endpoint might -list an offline payment chronologically between online payments that -were seen in a previous request. - -```java -CompletableFuture> v1ListPaymentsAsync( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String batchToken, - final Boolean includePartial) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `String` | Template, Required | The ID of the location to list payments for. If you specify me, this endpoint returns payments aggregated from all of the business's locations. | -| `order` | [`String`](../../doc/models/sort-order.md) | Query, Optional | The order in which payments are listed in the response. | -| `beginTime` | `String` | Query, Optional | The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year. | -| `endTime` | `String` | Query, Optional | The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. | -| `limit` | `Integer` | Query, Optional | The maximum number of payments to return in a single response. This value cannot exceed 200. | -| `batchToken` | `String` | Query, Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | -| `includePartial` | `Boolean` | Query, Optional | Indicates whether or not to include partial payments in the response. Partial payments will have the tenders collected so far, but the itemizations will be empty until the payment is completed. | - -## Response Type - -[`List`](../../doc/models/v1-payment.md) - -## Example Usage - -```java -String locationId = "location_id4"; -Boolean includePartial = false; - -v1TransactionsApi.v1ListPaymentsAsync(locationId, null, null, null, null, null, includePartial).thenAccept(result -> { - // TODO success callback handler - System.out.println(result); -}).exceptionally(exception -> { - // TODO failure callback handler - exception.printStackTrace(); - return null; -}); -``` - - -# V1 Retrieve Payment - -**This endpoint is deprecated.** - -Provides comprehensive information for a single payment. - -```java -CompletableFuture v1RetrievePaymentAsync( - final String locationId, - final String paymentId) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `String` | Template, Required | The ID of the payment's associated location. | -| `paymentId` | `String` | Template, Required | The Square-issued payment ID. payment_id comes from Payment objects returned by the List Payments endpoint, Settlement objects returned by the List Settlements endpoint, or Refund objects returned by the List Refunds endpoint. | - -## Response Type - -[`V1Payment`](../../doc/models/v1-payment.md) - -## Example Usage - -```java -String locationId = "location_id4"; -String paymentId = "payment_id0"; - -v1TransactionsApi.v1RetrievePaymentAsync(locationId, paymentId).thenAccept(result -> { - // TODO success callback handler - System.out.println(result); -}).exceptionally(exception -> { - // TODO failure callback handler - exception.printStackTrace(); - return null; -}); -``` - - -# V1 List Refunds - -**This endpoint is deprecated.** - -Provides the details for all refunds initiated by a merchant or any of the merchant's mobile staff during a date range. Date ranges cannot exceed one year in length. - -```java -CompletableFuture> v1ListRefundsAsync( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String batchToken) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `String` | Template, Required | The ID of the location to list refunds for. | -| `order` | [`String`](../../doc/models/sort-order.md) | Query, Optional | The order in which payments are listed in the response. | -| `beginTime` | `String` | Query, Optional | The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year. | -| `endTime` | `String` | Query, Optional | The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. | -| `limit` | `Integer` | Query, Optional | The approximate number of refunds to return in a single response. Default: 100. Max: 200. Response may contain more results than the prescribed limit when refunds are made simultaneously to multiple tenders in a payment or when refunds are generated in an exchange to account for the value of returned goods. | -| `batchToken` | `String` | Query, Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | - -## Response Type - -[`List`](../../doc/models/v1-refund.md) - -## Example Usage - -```java -String locationId = "location_id4"; - -v1TransactionsApi.v1ListRefundsAsync(locationId, null, null, null, null, null).thenAccept(result -> { - // TODO success callback handler - System.out.println(result); -}).exceptionally(exception -> { - // TODO failure callback handler - exception.printStackTrace(); - return null; -}); -``` - - -# V1 Create Refund - -**This endpoint is deprecated.** - -Issues a refund for a previously processed payment. You must issue -a refund within 60 days of the associated payment. - -You cannot issue a partial refund for a split tender payment. You must -instead issue a full or partial refund for a particular tender, by -providing the applicable tender id to the V1CreateRefund endpoint. -Issuing a full refund for a split tender payment refunds all tenders -associated with the payment. - -Issuing a refund for a card payment is not reversible. For development -purposes, you can create fake cash payments in Square Point of Sale and -refund them. - -```java -CompletableFuture v1CreateRefundAsync( - final String locationId, - final V1CreateRefundRequest body) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `String` | Template, Required | The ID of the original payment's associated location. | -| `body` | [`V1CreateRefundRequest`](../../doc/models/v1-create-refund-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -[`V1Refund`](../../doc/models/v1-refund.md) - -## Example Usage - -```java -String locationId = "location_id4"; -V1CreateRefundRequest body = new V1CreateRefundRequest.Builder( - "payment_id6", - "FULL", - "reason8" -) -.build(); - -v1TransactionsApi.v1CreateRefundAsync(locationId, body).thenAccept(result -> { - // TODO success callback handler - System.out.println(result); -}).exceptionally(exception -> { - // TODO failure callback handler - exception.printStackTrace(); - return null; -}); -``` - - -# V1 List Settlements - -**This endpoint is deprecated.** - -Provides summary information for all deposits and withdrawals -initiated by Square to a linked bank account during a date range. Date -ranges cannot exceed one year in length. - -*Note**: the ListSettlements endpoint does not provide entry -information. - -```java -CompletableFuture> v1ListSettlementsAsync( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String status, - final String batchToken) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `String` | Template, Required | The ID of the location to list settlements for. If you specify me, this endpoint returns settlements aggregated from all of the business's locations. | -| `order` | [`String`](../../doc/models/sort-order.md) | Query, Optional | The order in which settlements are listed in the response. | -| `beginTime` | `String` | Query, Optional | The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year. | -| `endTime` | `String` | Query, Optional | The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. | -| `limit` | `Integer` | Query, Optional | The maximum number of settlements to return in a single response. This value cannot exceed 200. | -| `status` | [`String`](../../doc/models/v1-list-settlements-request-status.md) | Query, Optional | Provide this parameter to retrieve only settlements with a particular status (SENT or FAILED). | -| `batchToken` | `String` | Query, Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | - -## Response Type - -[`List`](../../doc/models/v1-settlement.md) - -## Example Usage - -```java -String locationId = "location_id4"; - -v1TransactionsApi.v1ListSettlementsAsync(locationId, null, null, null, null, null, null).thenAccept(result -> { - // TODO success callback handler - System.out.println(result); -}).exceptionally(exception -> { - // TODO failure callback handler - exception.printStackTrace(); - return null; -}); -``` - - -# V1 Retrieve Settlement - -**This endpoint is deprecated.** - -Provides comprehensive information for a single settlement. - -The returned `Settlement` objects include an `entries` field that lists -the transactions that contribute to the settlement total. Most -settlement entries correspond to a payment payout, but settlement -entries are also generated for less common events, like refunds, manual -adjustments, or chargeback holds. - -Square initiates its regular deposits as indicated in the -[Deposit Options with Square](https://squareup.com/help/us/en/article/3807) -help article. Details for a regular deposit are usually not available -from Connect API endpoints before 10 p.m. PST the same day. -Square does not know when an initiated settlement **completes**, only -whether it has failed. A completed settlement is typically reflected in -a bank account within 3 business days, but in exceptional cases it may -take longer. - -```java -CompletableFuture v1RetrieveSettlementAsync( - final String locationId, - final String settlementId) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `String` | Template, Required | The ID of the settlements's associated location. | -| `settlementId` | `String` | Template, Required | The settlement's Square-issued ID. You obtain this value from Settlement objects returned by the List Settlements endpoint. | - -## Response Type - -[`V1Settlement`](../../doc/models/v1-settlement.md) - -## Example Usage - -```java -String locationId = "location_id4"; -String settlementId = "settlement_id0"; - -v1TransactionsApi.v1RetrieveSettlementAsync(locationId, settlementId).thenAccept(result -> { +v1TransactionsApi.v1UpdateOrderAsync(locationId, orderId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { diff --git a/doc/api/vendors.md b/doc/api/vendors.md index 6fd6fa1b..a8485438 100644 --- a/doc/api/vendors.md +++ b/doc/api/vendors.md @@ -41,16 +41,16 @@ CompletableFuture bulkCreateVendorsAsync( ## Example Usage ```java -BulkCreateVendorsRequest body = new BulkCreateVendorsRequest.Builder( - new LinkedHashMap() {{ - put("key0", new Vendor.Builder() - .build()); - put("key1", new Vendor.Builder() - .build()); +BulkCreateVendorsRequest body = new BulkCreateVendorsRequest.Builder( + new LinkedHashMap() {{ + put("key0", new Vendor.Builder() + .build()); + put("key1", new Vendor.Builder() + .build()); }} -) +) .build(); - + vendorsApi.bulkCreateVendorsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -84,12 +84,12 @@ CompletableFuture bulkRetrieveVendorsAsync( ## Example Usage ```java -BulkRetrieveVendorsRequest body = new BulkRetrieveVendorsRequest.Builder() - .vendorIds(Arrays.asList( +BulkRetrieveVendorsRequest body = new BulkRetrieveVendorsRequest.Builder() + .vendorIds(Arrays.asList( "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4" - )) + )) .build(); - + vendorsApi.bulkRetrieveVendorsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -123,22 +123,22 @@ CompletableFuture bulkUpdateVendorsAsync( ## Example Usage ```java -BulkUpdateVendorsRequest body = new BulkUpdateVendorsRequest.Builder( - new LinkedHashMap() {{ - put("key0", new UpdateVendorRequest.Builder( - new Vendor.Builder() +BulkUpdateVendorsRequest body = new BulkUpdateVendorsRequest.Builder( + new LinkedHashMap() {{ + put("key0", new UpdateVendorRequest.Builder( + new Vendor.Builder() .build() - ) - .build()); - put("key1", new UpdateVendorRequest.Builder( - new Vendor.Builder() + ) + .build()); + put("key1", new UpdateVendorRequest.Builder( + new Vendor.Builder() .build() - ) - .build()); + ) + .build()); }} -) +) .build(); - + vendorsApi.bulkUpdateVendorsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -172,11 +172,11 @@ CompletableFuture createVendorAsync( ## Example Usage ```java -CreateVendorRequest body = new CreateVendorRequest.Builder( +CreateVendorRequest body = new CreateVendorRequest.Builder( "idempotency_key2" -) +) .build(); - + vendorsApi.createVendorAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -210,9 +210,9 @@ CompletableFuture searchVendorsAsync( ## Example Usage ```java -SearchVendorsRequest body = new SearchVendorsRequest.Builder() +SearchVendorsRequest body = new SearchVendorsRequest.Builder() .build(); - + vendorsApi.searchVendorsAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -246,7 +246,7 @@ CompletableFuture retrieveVendorAsync( ## Example Usage ```java -String vendorId = "vendor_id8"; +String vendorId = "vendor_id8"; vendorsApi.retrieveVendorAsync(vendorId).thenAccept(result -> { // TODO success callback handler @@ -283,18 +283,18 @@ CompletableFuture updateVendorAsync( ## Example Usage ```java -UpdateVendorRequest body = new UpdateVendorRequest.Builder( - new Vendor.Builder() - .id("INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4") - .name("Jack's Chicken Shack") - .version(1) - .status("ACTIVE") +UpdateVendorRequest body = new UpdateVendorRequest.Builder( + new Vendor.Builder() + .id("INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4") + .name("Jack's Chicken Shack") + .version(1) + .status("ACTIVE") .build() -) -.idempotencyKey("8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe") +) +.idempotencyKey("8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe") .build(); - -String vendorId = "vendor_id8"; + +String vendorId = "vendor_id8"; vendorsApi.updateVendorAsync(body, vendorId).thenAccept(result -> { // TODO success callback handler diff --git a/doc/api/webhook-subscriptions.md b/doc/api/webhook-subscriptions.md index 80b2bc69..225fe38d 100644 --- a/doc/api/webhook-subscriptions.md +++ b/doc/api/webhook-subscriptions.md @@ -81,7 +81,7 @@ CompletableFuture listWebhookSubscriptionsAsyn ## Example Usage ```java -Boolean includeDisabled = false; +Boolean includeDisabled = false; webhookSubscriptionsApi.listWebhookSubscriptionsAsync(null, includeDisabled, null, null).thenAccept(result -> { // TODO success callback handler @@ -116,20 +116,20 @@ CompletableFuture createWebhookSubscriptionAs ## Example Usage ```java -CreateWebhookSubscriptionRequest body = new CreateWebhookSubscriptionRequest.Builder( - new WebhookSubscription.Builder() - .name("Example Webhook Subscription") - .eventTypes(Arrays.asList( +CreateWebhookSubscriptionRequest body = new CreateWebhookSubscriptionRequest.Builder( + new WebhookSubscription.Builder() + .name("Example Webhook Subscription") + .eventTypes(Arrays.asList( "payment.created", "payment.updated" - )) - .notificationUrl("https://example-webhook-url.com") - .apiVersion("2021-12-15") + )) + .notificationUrl("https://example-webhook-url.com") + .apiVersion("2021-12-15") .build() -) -.idempotencyKey("63f84c6c-2200-4c99-846c-2670a1311fbf") +) +.idempotencyKey("63f84c6c-2200-4c99-846c-2670a1311fbf") .build(); - + webhookSubscriptionsApi.createWebhookSubscriptionAsync(body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -163,7 +163,7 @@ CompletableFuture deleteWebhookSubscriptionAs ## Example Usage ```java -String subscriptionId = "subscription_id0"; +String subscriptionId = "subscription_id0"; webhookSubscriptionsApi.deleteWebhookSubscriptionAsync(subscriptionId).thenAccept(result -> { // TODO success callback handler @@ -198,7 +198,7 @@ CompletableFuture retrieveWebhookSubscripti ## Example Usage ```java -String subscriptionId = "subscription_id0"; +String subscriptionId = "subscription_id0"; webhookSubscriptionsApi.retrieveWebhookSubscriptionAsync(subscriptionId).thenAccept(result -> { // TODO success callback handler @@ -235,14 +235,14 @@ CompletableFuture updateWebhookSubscriptionAs ## Example Usage ```java -String subscriptionId = "subscription_id0"; -UpdateWebhookSubscriptionRequest body = new UpdateWebhookSubscriptionRequest.Builder() - .subscription(new WebhookSubscription.Builder() - .name("Updated Example Webhook Subscription") - .enabled(false) - .build()) +String subscriptionId = "subscription_id0"; +UpdateWebhookSubscriptionRequest body = new UpdateWebhookSubscriptionRequest.Builder() + .subscription(new WebhookSubscription.Builder() + .name("Updated Example Webhook Subscription") + .enabled(false) + .build()) .build(); - + webhookSubscriptionsApi.updateWebhookSubscriptionAsync(subscriptionId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -278,11 +278,11 @@ CompletableFuture updateWebhookSu ## Example Usage ```java -String subscriptionId = "subscription_id0"; -UpdateWebhookSubscriptionSignatureKeyRequest body = new UpdateWebhookSubscriptionSignatureKeyRequest.Builder() - .idempotencyKey("ed80ae6b-0654-473b-bbab-a39aee89a60d") +String subscriptionId = "subscription_id0"; +UpdateWebhookSubscriptionSignatureKeyRequest body = new UpdateWebhookSubscriptionSignatureKeyRequest.Builder() + .idempotencyKey("ed80ae6b-0654-473b-bbab-a39aee89a60d") .build(); - + webhookSubscriptionsApi.updateWebhookSubscriptionSignatureKeyAsync(subscriptionId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); @@ -318,11 +318,11 @@ CompletableFuture testWebhookSubscriptionAsync( ## Example Usage ```java -String subscriptionId = "subscription_id0"; -TestWebhookSubscriptionRequest body = new TestWebhookSubscriptionRequest.Builder() - .eventType("payment.created") +String subscriptionId = "subscription_id0"; +TestWebhookSubscriptionRequest body = new TestWebhookSubscriptionRequest.Builder() + .eventType("payment.created") .build(); - + webhookSubscriptionsApi.testWebhookSubscriptionAsync(subscriptionId, body).thenAccept(result -> { // TODO success callback handler System.out.println(result); diff --git a/doc/auth/oauth-2-bearer-token.md b/doc/auth/oauth-2-bearer-token.md new file mode 100644 index 00000000..6f5f1299 --- /dev/null +++ b/doc/auth/oauth-2-bearer-token.md @@ -0,0 +1,33 @@ + +# OAuth 2 Bearer token + + + +Documentation for accessing and setting credentials for global. + +## Auth Credentials + +| Name | Type | Description | Setter | Getter | +| --- | --- | --- | --- | --- | +| AccessToken | `String` | The OAuth 2.0 Access Token to use for API requests. | `accessToken` | `getAccessToken()` | + + + +**Note:** Auth credentials can be set using `bearerAuthCredentials` in the client builder and accessed through `getBearerAuthCredentials` method in the client instance. + +## Usage Example + +### Client Initialization + +You must provide credentials in the client as shown in the following code snippet. + +```java +SquareClient client = new SquareClient.Builder() + .bearerAuthCredentials(new BearerAuthModel.Builder( + "AccessToken" + ) + .build()) + .build(); +``` + + diff --git a/doc/client.md b/doc/client.md index 6064b8a6..5d8c51b1 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,13 +5,13 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `squareVersion` | `String` | Square Connect API versions
*Default*: `"2024-01-18"` | +| `squareVersion` | `String` | Square Connect API versions
*Default*: `"2024-02-22"` | | `customUrl` | `String` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`
*Default*: `"https://connect.squareup.com"` | | `environment` | `string` | The API environment.
**Default: `production`** | | `httpClientConfig` | [`ReadonlyHttpClientConfiguration`](http-client-configuration.md) | Http Client Configuration instance. | | `additionalHeaders` | [`Headers`](headers.md) | Additional headers to add to each API request.
*Default*: `new Headers()` | | `userAgentDetail` | `String` | Additional detail which can be appended with User-Agent header.
*Default*: `"null"` | -| `accessToken` | `String` | The OAuth 2.0 Access Token to use for API requests. | +| `bearerAuthCredentials` | [`BearerAuthCredentials`](auth/oauth-2-bearer-token.md) | The Credentials Setter for OAuth 2 Bearer token | The API client can be initialized as follows: @@ -19,8 +19,11 @@ The API client can be initialized as follows: SquareClient client = new SquareClient.Builder() .httpClientConfig(configBuilder -> configBuilder .timeout(0)) - .squareVersion("2024-01-18") - .accessToken("AccessToken") + .squareVersion("2024-02-22") + .bearerAuthCredentials(new BearerAuthModel.Builder( + "AccessToken" + ) + .build()) .environment(Environment.PRODUCTION) .customUrl("https://connect.squareup.com") .build(); @@ -33,6 +36,7 @@ package com.example; import com.squareup.square.SquareClient; import com.squareup.square.api.LocationsApi; +import com.squareup.square.authentication.BearerAuthModel; public class Program { @@ -40,8 +44,11 @@ public class Program { SquareClient client = new SquareClient.Builder() .httpClientConfig(configBuilder -> configBuilder .timeout(0)) - .squareVersion("2024-01-18") - .accessToken("AccessToken") + .squareVersion("2024-02-22") + .bearerAuthCredentials(new BearerAuthModel.Builder( + "AccessToken" + ) + .build()) .build(); LocationsApi locationsApi = client.getLocationsApi(); @@ -120,7 +127,7 @@ The gateway for the SDK. This class acts as a factory for the Apis and also hold | `getHttpClientConfig()` | Http Client Configuration instance. | [`ReadonlyHttpClientConfiguration`](http-client-configuration.md) | | `getAdditionalHeaders()` | Additional headers to add to each API request. | [`Headers`](headers.md) | | `getUserAgentDetail()` | Additional detail which can be appended with User-Agent header. | `String` | -| `getBearerAuthCredentials()` | The credentials to use with BearerAuth. | `BearerAuthCredentials` | +| `getBearerAuthCredentials()` | The credentials to use with BearerAuth. | [`BearerAuthCredentials`](auth/oauth-2-bearer-token.md) | | `getAccessToken()` | OAuth 2.0 Access Token. | `String` | | `getSdkVersion()` | Current SDK Version. | `String` | | `getBaseUri(Server server)` | Get base URI by current environment | `String` | diff --git a/doc/configuration-interface.md b/doc/configuration-interface.md index 3383b333..a0ae9430 100644 --- a/doc/configuration-interface.md +++ b/doc/configuration-interface.md @@ -1,7 +1,7 @@ # Configuration Interface -This is the base class for all exceptions that represent an error response from the server. +This is the interface for client class that holds the configuration getters. ## Methods @@ -13,7 +13,6 @@ This is the base class for all exceptions that represent an error response from | `getHttpClientConfig()` | Http Client Configuration instance. | [`ReadonlyHttpClientConfiguration`](http-client-configuration.md) | | `getAdditionalHeaders()` | Additional headers to add to each API request. | [`Headers`](headers.md) | | `getUserAgentDetail()` | Additional detail which can be appended with User-Agent header. | `String` | -| `getAccessToken()` | OAuth 2.0 Access Token. | `String` | | `getBaseUri(Server server)` | Get base URI by current environment. | `String` | | `getBaseUri()` | Get base URI by current environment. | `String` | diff --git a/doc/models/activity-type.md b/doc/models/activity-type.md index ebee6fa0..cdb12dfa 100644 --- a/doc/models/activity-type.md +++ b/doc/models/activity-type.md @@ -12,40 +12,56 @@ | `ADJUSTMENT` | A manual adjustment applied to the seller's account by Square. | | `APP_FEE_REFUND` | A refund for an application fee on a payment. | | `APP_FEE_REVENUE` | Revenue generated from an application fee on a payment. | -| `AUTOMATIC_SAVINGS` | An automatic transfer from the payment processing balance to the Square Savings account.
These are, generally, proportional to the seller's sales. | -| `AUTOMATIC_SAVINGS_REVERSED` | An automatic transfer from the Square Savings account back to the processing balance.
These are, generally, proportional to the seller's refunds. | +| `AUTOMATIC_SAVINGS` | An automatic transfer from the payment processing balance to the Square Savings account. These are generally proportional to the seller's sales. | +| `AUTOMATIC_SAVINGS_REVERSED` | An automatic transfer from the Square Savings account back to the processing balance. These are generally proportional to the seller's refunds. | | `CHARGE` | A credit card payment capture. | | `DEPOSIT_FEE` | Any fees involved with deposits such as instant deposits. | | `DISPUTE` | The balance change due to a dispute event. | | `ESCHEATMENT` | An escheatment entry for remittance. | -| `FEE` | The Square processing fee. | +| `FEE` | The cost plus adjustment fee. | | `FREE_PROCESSING` | Square offers free payments processing for a variety of business scenarios, including seller
referrals or when Square wants to apologize (for example, for a bug, customer service, or repricing complication).
This entry represents a credit to the seller for the purposes of free processing. | | `HOLD_ADJUSTMENT` | An adjustment made by Square related to holding a payment. | -| `INITIAL_BALANCE_CHANGE` | An external change to a seller's balance. Initial, in the sense that it
causes the creation of the other activity types, such as hold and refund. | +| `INITIAL_BALANCE_CHANGE` | An external change to a seller's balance (initial, in the sense that it causes the creation of the other activity types, such as a hold and refund). | | `MONEY_TRANSFER` | The balance change from a money transfer. | | `MONEY_TRANSFER_REVERSAL` | The reversal of a money transfer. | -| `OPEN_DISPUTE` | The balance change for a chargeback that has been filed. | -| `OTHER` | Any other type that does not belong in the rest of the types. | -| `OTHER_ADJUSTMENT` | Any other type of adjustment that does not fall under existing types. | -| `PAID_SERVICE_FEE` | A fee paid to a third-party merchant. | -| `PAID_SERVICE_FEE_REFUND` | A fee paid to a third-party merchant. | +| `OPEN_DISPUTE` | The balance change for a chargeback that's been filed. | +| `OTHER` | Any other type that doesn't belong in the rest of the types. | +| `OTHER_ADJUSTMENT` | Any other type of adjustment that doesn't fall under existing types. | +| `PAID_SERVICE_FEE` | A fee paid to a third-party seller. | +| `PAID_SERVICE_FEE_REFUND` | A fee refunded to a third-party seller. | | `REDEMPTION_CODE` | Repayment for a redemption code. | | `REFUND` | A refund for an existing card payment. | | `RELEASE_ADJUSTMENT` | An adjustment made by Square related to releasing a payment. | -| `RESERVE_HOLD` | Fees paid for funding risk reserve. | -| `RESERVE_RELEASE` | Fees released from risk reserve. | +| `RESERVE_HOLD` | Fees paid for a funding risk reserve. | +| `RESERVE_RELEASE` | Fees released from a risk reserve. | | `RETURNED_PAYOUT` | An entry created when Square receives a response for the ACH file that Square sent indicating that the
settlement of the original entry failed. | -| `SQUARE_CAPITAL_PAYMENT` | A capital merchant cash advance (MCA) assessment. These are, generally,
proportional to the merchant's sales but can be issued for other reasons related to the MCA. | -| `SQUARE_CAPITAL_REVERSED_PAYMENT` | A capital merchant cash advance (MCA) assessment refund. These are, generally,
proportional to the merchant's refunds but can be issued for other reasons related to the MCA. | +| `SQUARE_CAPITAL_PAYMENT` | A capital merchant cash advance (MCA) assessment. These are generally proportional to the merchant's sales but can be issued for other reasons related to the MCA. | +| `SQUARE_CAPITAL_REVERSED_PAYMENT` | A capital merchant cash advance (MCA) assessment refund. These are generally proportional to the merchant's refunds but can be issued for other reasons related to the MCA. | | `SUBSCRIPTION_FEE` | A fee charged for subscription to a Square product. | -| `SUBSCRIPTION_FEE_PAID_REFUND` | A Square subscription fee that has been refunded. | +| `SUBSCRIPTION_FEE_PAID_REFUND` | A Square subscription fee that's been refunded. | | `SUBSCRIPTION_FEE_REFUND` | The refund of a previously charged Square product subscription fee. | | `TAX_ON_FEE` | The tax paid on fee amounts. | | `THIRD_PARTY_FEE` | Fees collected by a third-party platform. | | `THIRD_PARTY_FEE_REFUND` | Refunded fees from a third-party platform. | -| `PAYOUT` | Balance change due to money transfer. | -| `AUTOMATIC_BITCOIN_CONVERSIONS` | Indicates the withholding of a portion of each payment by Square that has been
automatically converted into bitcoin using Cash App. The seller manages their bitcoin in
their Cash App account. | -| `AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED` | Indicates a return of the payment withholding that had been scheduled to be converted
into bitcoin using Cash App to the Square payments balance. | -| `CREDIT_CARD_REPAYMENT` | The repayment made toward the outstanding balance on the seller's Square credit card. | -| `CREDIT_CARD_REPAYMENT_REVERSED` | The reversal of the repayment made toward the outstanding balance on the seller's
Square credit card. | +| `PAYOUT` | The balance change due to money transfer. | +| `AUTOMATIC_BITCOIN_CONVERSIONS` | Indicates that the portion of each payment withheld by Square was automatically converted into bitcoin using Cash App. The seller manages their bitcoin in their Cash App account. | +| `AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED` | Indicates that a withheld payment, which was scheduled to be converted into bitcoin using Cash App, was deposited back to the Square payments balance. | +| `CREDIT_CARD_REPAYMENT` | Indicates that a repayment toward the outstanding balance on the seller's Square credit card was made. | +| `CREDIT_CARD_REPAYMENT_REVERSED` | Indicates that a repayment toward the outstanding balance on the seller's Square credit card was reversed. | +| `LOCAL_OFFERS_CASHBACK` | Cashback amount given by a Square Local Offers seller to their customer for a purchase. | +| `LOCAL_OFFERS_FEE` | A commission fee paid by a Square Local Offers seller to Square for a purchase discovered through Square Local Offers. | +| `PERCENTAGE_PROCESSING_ENROLLMENT` | When activating Percentage Processing, a credit is applied to the seller’s account to offset any negative balance caused by a dispute. | +| `PERCENTAGE_PROCESSING_DEACTIVATION` | Deducting the outstanding Percentage Processing balance from the seller’s account. It's the final installment in repaying the dispute-induced negative balance through percentage processing. | +| `PERCENTAGE_PROCESSING_REPAYMENT` | Withheld funds from a payment to cover a negative balance. It's an installment to repay the amount from a dispute that had been offset during Percentage Processing enrollment. | +| `PERCENTAGE_PROCESSING_REPAYMENT_REVERSED` | The reversal of a percentage processing repayment that happens for example when a refund is issued for a payment. | +| `PROCESSING_FEE` | The processing fee for a payment. If sellers opt for Gross Settlement, i.e., direct bank withdrawal instead of deducting fees from daily sales, the processing fee is recorded separately as a new payout entry, not part of the CHARGE payout entry. | +| `PROCESSING_FEE_REFUND` | The processing fee for a payment refund issued by sellers enrolled in Gross Settlement. The refunded processing fee is recorded separately as a new payout entry, not part of the REFUND payout entry. | +| `UNDO_PROCESSING_FEE_REFUND` | When undoing a processing fee refund in a Gross Settlement payment, this payout entry type is used. | +| `GIFT_CARD_LOAD_FEE` | Fee collected during the sale or reload of a gift card. This fee, which is a portion of the amount loaded on the gift card, is deducted from the merchant's payment balance. | +| `GIFT_CARD_LOAD_FEE_REFUND` | Refund for fee charged during the sale or reload of a gift card. | +| `UNDO_GIFT_CARD_LOAD_FEE_REFUND` | The undo of a refund for a fee charged during the sale or reload of a gift card. | +| `BALANCE_FOLDERS_TRANSFER` | A transfer of funds to a banking folder. In the United States, the folder name is 'Checking Folder'; in Canada, it's 'Balance Folder.' | +| `BALANCE_FOLDERS_TRANSFER_REVERSED` | A reversal of transfer of funds from a banking folder. In the United States, the folder name is 'Checking Folder'; in Canada, it's 'Balance Folder.' | +| `GIFT_CARD_POOL_TRANSFER` | A transfer of gift card funds to a central gift card pool account. In franchises, when gift cards are loaded or reloaded at any location, the money transfers to the franchisor's account. | +| `GIFT_CARD_POOL_TRANSFER_REVERSED` | A reversal of transfer of gift card funds from a central gift card pool account. In franchises, when gift cards are loaded or reloaded at any location, the money transfers to the franchisor's account. | diff --git a/doc/models/bulk-create-customer-data.md b/doc/models/bulk-create-customer-data.md new file mode 100644 index 00000000..d4bc109a --- /dev/null +++ b/doc/models/bulk-create-customer-data.md @@ -0,0 +1,38 @@ + +# Bulk Create Customer Data + +Defines the customer data provided in individual create requests for a +[BulkCreateCustomers](../../doc/api/customers.md#bulk-create-customers) operation. + +## Structure + +`BulkCreateCustomerData` + +## Fields + +| Name | Type | Tags | Description | Getter | +| --- | --- | --- | --- | --- | +| `GivenName` | `String` | Optional | The given name (that is, the first name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | String getGivenName() | +| `FamilyName` | `String` | Optional | The family name (that is, the last name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | String getFamilyName() | +| `CompanyName` | `String` | Optional | A business name associated with the customer profile.
**Constraints**: *Maximum Length*: `500` | String getCompanyName() | +| `Nickname` | `String` | Optional | A nickname for the customer profile.
**Constraints**: *Maximum Length*: `100` | String getNickname() | +| `EmailAddress` | `String` | Optional | The email address associated with the customer profile.
**Constraints**: *Maximum Length*: `254` | String getEmailAddress() | +| `Address` | [`Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | Address getAddress() | +| `PhoneNumber` | `String` | Optional | The phone number associated with the customer profile. The phone number must be valid
and can contain 9–16 digits, with an optional `+` prefix and country code. For more information,
see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). | String getPhoneNumber() | +| `ReferenceId` | `String` | Optional | An optional second ID used to associate the customer profile with an
entity in another system.
**Constraints**: *Maximum Length*: `100` | String getReferenceId() | +| `Note` | `String` | Optional | A custom note associated with the customer profile. | String getNote() | +| `Birthday` | `String` | Optional | The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format.
For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21.
Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or
`0000` if a birth year is not specified. | String getBirthday() | +| `TaxIds` | [`CustomerTaxIds`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom.
For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). | CustomerTaxIds getTaxIds() | + +## Example (as JSON) + +```json +{ + "given_name": "given_name4", + "family_name": "family_name4", + "company_name": "company_name8", + "nickname": "nickname8", + "email_address": "email_address0" +} +``` + diff --git a/doc/models/bulk-create-customers-request.md b/doc/models/bulk-create-customers-request.md new file mode 100644 index 00000000..fb34eca3 --- /dev/null +++ b/doc/models/bulk-create-customers-request.md @@ -0,0 +1,61 @@ + +# Bulk Create Customers Request + +Defines the body parameters that can be included in requests to the +[BulkCreateCustomers](../../doc/api/customers.md#bulk-create-customers) endpoint. + +## Structure + +`BulkCreateCustomersRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | +| --- | --- | --- | --- | --- | +| `Customers` | [`Map`](../../doc/models/bulk-create-customer-data.md) | Required | A map of 1 to 100 individual create requests, represented by `idempotency key: { customer data }`
key-value pairs.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Values have a maximum length of 255 characters.

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

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

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

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

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

Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`,
`EXTERNAL`, and `SQUARE_ACCOUNT`.
**Constraints**: *Maximum Length*: `50` | String getDestinationType() | | `DestinationDetails` | [`DestinationDetails`](../../doc/models/destination-details.md) | Optional | Details about a refund's destination. | DestinationDetails getDestinationDetails() | | `AmountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | Money getAmountMoney() | | `AppFeeMoney` | [`Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | Money getAppFeeMoney() | diff --git a/doc/models/payout-entry.md b/doc/models/payout-entry.md index 7698e576..fadb09cb 100644 --- a/doc/models/payout-entry.md +++ b/doc/models/payout-entry.md @@ -49,7 +49,7 @@ The total amount of the payout will equal the sum of the payout entries for a ba "id": "id8", "payout_id": "payout_id4", "effective_at": "effective_at8", - "type": "DEPOSIT_FEE", + "type": "SQUARE_CAPITAL_REVERSED_PAYMENT", "gross_amount_money": { "amount": 186, "currency": "BWP" diff --git a/doc/models/retrieve-merchant-settings-response.md b/doc/models/retrieve-merchant-settings-response.md index bccf2382..15bb8343 100644 --- a/doc/models/retrieve-merchant-settings-response.md +++ b/doc/models/retrieve-merchant-settings-response.md @@ -20,7 +20,6 @@ "merchant_id": "MERCHANT_ID", "payment_methods": { "afterpay_clearpay": { - "available": true, "enabled": true, "item_eligibility_range": { "max": { @@ -44,15 +43,12 @@ } }, "apple_pay": { - "available": true, "enabled": true }, "cash_app_pay": { - "available": true, "enabled": true }, "google_pay": { - "available": true, "enabled": true }, "cash_app": { diff --git a/doc/models/search-orders-response.md b/doc/models/search-orders-response.md index e1e6a0a8..9503646e 100644 --- a/doc/models/search-orders-response.md +++ b/doc/models/search-orders-response.md @@ -14,7 +14,7 @@ Either the `order_entries` or `orders` field is set, depending on whether | --- | --- | --- | --- | --- | | `OrderEntries` | [`List`](../../doc/models/order-entry.md) | Optional | A list of [OrderEntries](entity:OrderEntry) that fit the query
conditions. The list is populated only if `return_entries` is set to `true` in the request. | List getOrderEntries() | | `Orders` | [`List`](../../doc/models/order.md) | Optional | A list of
[Order](entity:Order) objects that match the query conditions. The list is populated only if
`return_entries` is set to `false` in the request. | List getOrders() | -| `Cursor` | `String` | Optional | The pagination cursor to be used in a subsequent request. If unset,
this is the final response.
For more information, see [Pagination](https://developer.squareup.com/docs/basics/build-basics/common-api-patterns/pagination). | String getCursor() | +| `Cursor` | `String` | Optional | The pagination cursor to be used in a subsequent request. If unset,
this is the final response.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | String getCursor() | | `Errors` | [`List`](../../doc/models/error.md) | Optional | [Errors](entity:Error) encountered during the search. | List getErrors() | ## Example (as JSON) diff --git a/doc/models/update-customer-request.md b/doc/models/update-customer-request.md index 3607bdc3..969f8390 100644 --- a/doc/models/update-customer-request.md +++ b/doc/models/update-customer-request.md @@ -31,7 +31,7 @@ Defines the body parameters that can be included in a request to the { "email_address": "New.Amelia.Earhart@example.com", "note": "updated customer note", - "phone_number": "", + "phone_number": null, "version": 2, "given_name": "given_name0", "family_name": "family_name8", diff --git a/doc/models/update-customer-response.md b/doc/models/update-customer-response.md index 697a5ddd..0cd37aa8 100644 --- a/doc/models/update-customer-response.md +++ b/doc/models/update-customer-response.md @@ -2,7 +2,8 @@ # Update Customer Response Defines the fields that are included in the response body of -a request to the `UpdateCustomer` endpoint. +a request to the [UpdateCustomer](../../doc/api/customers.md#update-customer) or +[BulkUpdateCustomers](../../doc/api/customers.md#bulk-update-customers) endpoint. Either `errors` or `customer` is present in a given response (never both). diff --git a/doc/models/update-merchant-settings-response.md b/doc/models/update-merchant-settings-response.md index 9fc9ad8a..774ef4ac 100644 --- a/doc/models/update-merchant-settings-response.md +++ b/doc/models/update-merchant-settings-response.md @@ -20,7 +20,6 @@ "merchant_id": "MERCHANT_ID", "payment_methods": { "afterpay_clearpay": { - "available": true, "enabled": true, "item_eligibility_range": { "max": { @@ -44,15 +43,12 @@ } }, "apple_pay": { - "available": true, "enabled": false }, "cash_app_pay": { - "available": true, "enabled": true }, "google_pay": { - "available": true, "enabled": true }, "cash_app": { diff --git a/doc/models/v1-create-refund-request-type.md b/doc/models/v1-create-refund-request-type.md deleted file mode 100644 index 98d0dde0..00000000 --- a/doc/models/v1-create-refund-request-type.md +++ /dev/null @@ -1,14 +0,0 @@ - -# V1 Create Refund Request Type - -## Enumeration - -`V1CreateRefundRequestType` - -## Fields - -| Name | -| --- | -| `FULL` | -| `PARTIAL` | - diff --git a/doc/models/v1-create-refund-request.md b/doc/models/v1-create-refund-request.md deleted file mode 100644 index f3573a43..00000000 --- a/doc/models/v1-create-refund-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# V1 Create Refund Request - -V1CreateRefundRequest - -## Structure - -`V1CreateRefundRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `PaymentId` | `String` | Required | The ID of the payment to refund. If you are creating a `PARTIAL`
refund for a split tender payment, instead provide the id of the
particular tender you want to refund. | String getPaymentId() | -| `Type` | [`String`](../../doc/models/v1-create-refund-request-type.md) | Required | - | String getType() | -| `Reason` | `String` | Required | The reason for the refund. | String getReason() | -| `RefundedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getRefundedMoney() | -| `RequestIdempotenceKey` | `String` | Optional | An optional key to ensure idempotence if you issue the same PARTIAL refund request more than once. | String getRequestIdempotenceKey() | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id2", - "type": "FULL", - "reason": "reason2", - "refunded_money": { - "amount": 214, - "currency_code": "SRD" - }, - "request_idempotence_key": "request_idempotence_key6" -} -``` - diff --git a/doc/models/v1-list-payments-request.md b/doc/models/v1-list-payments-request.md deleted file mode 100644 index ef7b98bd..00000000 --- a/doc/models/v1-list-payments-request.md +++ /dev/null @@ -1,30 +0,0 @@ - -# V1 List Payments Request - -## Structure - -`V1ListPaymentsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Order` | [`String`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | String getOrder() | -| `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. | String getBeginTime() | -| `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. | String getEndTime() | -| `Limit` | `Integer` | Optional | The maximum number of payments to return in a single response. This value cannot exceed 200. | Integer getLimit() | -| `BatchToken` | `String` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | String getBatchToken() | -| `IncludePartial` | `Boolean` | Optional | Indicates whether or not to include partial payments in the response. Partial payments will have the tenders collected so far, but the itemizations will be empty until the payment is completed. | Boolean getIncludePartial() | - -## Example (as JSON) - -```json -{ - "order": "DESC", - "begin_time": "begin_time8", - "end_time": "end_time2", - "limit": 104, - "batch_token": "batch_token8" -} -``` - diff --git a/doc/models/v1-list-payments-response.md b/doc/models/v1-list-payments-response.md deleted file mode 100644 index 374515dc..00000000 --- a/doc/models/v1-list-payments-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# V1 List Payments Response - -## Structure - -`V1ListPaymentsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Items` | [`List`](../../doc/models/v1-payment.md) | Optional | - | List getItems() | - -## Example (as JSON) - -```json -{ - "items": [ - { - "id": "id8", - "merchant_id": "merchant_id8", - "created_at": "created_at6", - "creator_id": "creator_id8", - "device": { - "id": "id6", - "name": "name6" - } - }, - { - "id": "id8", - "merchant_id": "merchant_id8", - "created_at": "created_at6", - "creator_id": "creator_id8", - "device": { - "id": "id6", - "name": "name6" - } - } - ] -} -``` - diff --git a/doc/models/v1-list-refunds-request.md b/doc/models/v1-list-refunds-request.md deleted file mode 100644 index 894b7a9a..00000000 --- a/doc/models/v1-list-refunds-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# V1 List Refunds Request - -## Structure - -`V1ListRefundsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Order` | [`String`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | String getOrder() | -| `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. | String getBeginTime() | -| `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. | String getEndTime() | -| `Limit` | `Integer` | Optional | The approximate number of refunds to return in a single response. Default: 100. Max: 200. Response may contain more results than the prescribed limit when refunds are made simultaneously to multiple tenders in a payment or when refunds are generated in an exchange to account for the value of returned goods. | Integer getLimit() | -| `BatchToken` | `String` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | String getBatchToken() | - -## Example (as JSON) - -```json -{ - "order": "DESC", - "begin_time": "begin_time0", - "end_time": "end_time4", - "limit": 66, - "batch_token": "batch_token0" -} -``` - diff --git a/doc/models/v1-list-refunds-response.md b/doc/models/v1-list-refunds-response.md deleted file mode 100644 index b4126d9d..00000000 --- a/doc/models/v1-list-refunds-response.md +++ /dev/null @@ -1,70 +0,0 @@ - -# V1 List Refunds Response - -## Structure - -`V1ListRefundsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Items` | [`List`](../../doc/models/v1-refund.md) | Optional | - | List getItems() | - -## Example (as JSON) - -```json -{ - "items": [ - { - "type": "FULL", - "reason": "reason6", - "refunded_money": { - "amount": 214, - "currency_code": "SRD" - }, - "refunded_processing_fee_money": { - "amount": 0, - "currency_code": "BGN" - }, - "refunded_tax_money": { - "amount": 148, - "currency_code": "SRD" - } - }, - { - "type": "FULL", - "reason": "reason6", - "refunded_money": { - "amount": 214, - "currency_code": "SRD" - }, - "refunded_processing_fee_money": { - "amount": 0, - "currency_code": "BGN" - }, - "refunded_tax_money": { - "amount": 148, - "currency_code": "SRD" - } - }, - { - "type": "FULL", - "reason": "reason6", - "refunded_money": { - "amount": 214, - "currency_code": "SRD" - }, - "refunded_processing_fee_money": { - "amount": 0, - "currency_code": "BGN" - }, - "refunded_tax_money": { - "amount": 148, - "currency_code": "SRD" - } - } - ] -} -``` - diff --git a/doc/models/v1-list-settlements-request-status.md b/doc/models/v1-list-settlements-request-status.md deleted file mode 100644 index 8fb6c25e..00000000 --- a/doc/models/v1-list-settlements-request-status.md +++ /dev/null @@ -1,14 +0,0 @@ - -# V1 List Settlements Request Status - -## Enumeration - -`V1ListSettlementsRequestStatus` - -## Fields - -| Name | -| --- | -| `SENT` | -| `FAILED` | - diff --git a/doc/models/v1-list-settlements-request.md b/doc/models/v1-list-settlements-request.md deleted file mode 100644 index 54b0e005..00000000 --- a/doc/models/v1-list-settlements-request.md +++ /dev/null @@ -1,30 +0,0 @@ - -# V1 List Settlements Request - -## Structure - -`V1ListSettlementsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Order` | [`String`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | String getOrder() | -| `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. | String getBeginTime() | -| `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. | String getEndTime() | -| `Limit` | `Integer` | Optional | The maximum number of settlements to return in a single response. This value cannot exceed 200. | Integer getLimit() | -| `Status` | [`String`](../../doc/models/v1-list-settlements-request-status.md) | Optional | - | String getStatus() | -| `BatchToken` | `String` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | String getBatchToken() | - -## Example (as JSON) - -```json -{ - "order": "DESC", - "begin_time": "begin_time8", - "end_time": "end_time2", - "limit": 226, - "status": "SENT" -} -``` - diff --git a/doc/models/v1-list-settlements-response.md b/doc/models/v1-list-settlements-response.md deleted file mode 100644 index e8e13fa3..00000000 --- a/doc/models/v1-list-settlements-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# V1 List Settlements Response - -## Structure - -`V1ListSettlementsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Items` | [`List`](../../doc/models/v1-settlement.md) | Optional | - | List getItems() | - -## Example (as JSON) - -```json -{ - "items": [ - { - "id": "id8", - "status": "FAILED", - "total_money": { - "amount": 250, - "currency_code": "KZT" - }, - "initiated_at": "initiated_at0", - "bank_account_id": "bank_account_id8" - }, - { - "id": "id8", - "status": "FAILED", - "total_money": { - "amount": 250, - "currency_code": "KZT" - }, - "initiated_at": "initiated_at0", - "bank_account_id": "bank_account_id8" - }, - { - "id": "id8", - "status": "FAILED", - "total_money": { - "amount": 250, - "currency_code": "KZT" - }, - "initiated_at": "initiated_at0", - "bank_account_id": "bank_account_id8" - } - ] -} -``` - diff --git a/doc/models/v1-payment-discount.md b/doc/models/v1-payment-discount.md deleted file mode 100644 index 11730663..00000000 --- a/doc/models/v1-payment-discount.md +++ /dev/null @@ -1,30 +0,0 @@ - -# V1 Payment Discount - -V1PaymentDiscount - -## Structure - -`V1PaymentDiscount` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Name` | `String` | Optional | The discount's name. | String getName() | -| `AppliedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getAppliedMoney() | -| `DiscountId` | `String` | Optional | The ID of the applied discount, if available. Discounts applied in older versions of Square Register might not have an ID. | String getDiscountId() | - -## Example (as JSON) - -```json -{ - "name": "name4", - "applied_money": { - "amount": 196, - "currency_code": "IQD" - }, - "discount_id": "discount_id2" -} -``` - diff --git a/doc/models/v1-payment-item-detail.md b/doc/models/v1-payment-item-detail.md deleted file mode 100644 index d82ab38b..00000000 --- a/doc/models/v1-payment-item-detail.md +++ /dev/null @@ -1,29 +0,0 @@ - -# V1 Payment Item Detail - -V1PaymentItemDetail - -## Structure - -`V1PaymentItemDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `CategoryName` | `String` | Optional | The name of the item's merchant-defined category, if any. | String getCategoryName() | -| `Sku` | `String` | Optional | The item's merchant-defined SKU, if any. | String getSku() | -| `ItemId` | `String` | Optional | The unique ID of the item purchased, if any. | String getItemId() | -| `ItemVariationId` | `String` | Optional | The unique ID of the item variation purchased, if any. | String getItemVariationId() | - -## Example (as JSON) - -```json -{ - "category_name": "category_name4", - "sku": "sku0", - "item_id": "item_id4", - "item_variation_id": "item_variation_id8" -} -``` - diff --git a/doc/models/v1-payment-itemization-itemization-type.md b/doc/models/v1-payment-itemization-itemization-type.md deleted file mode 100644 index bba82467..00000000 --- a/doc/models/v1-payment-itemization-itemization-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# V1 Payment Itemization Itemization Type - -## Enumeration - -`V1PaymentItemizationItemizationType` - -## Fields - -| Name | -| --- | -| `ITEM` | -| `CUSTOM_AMOUNT` | -| `GIFT_CARD_ACTIVATION` | -| `GIFT_CARD_RELOAD` | -| `GIFT_CARD_UNKNOWN` | -| `OTHER` | - diff --git a/doc/models/v1-payment-itemization.md b/doc/models/v1-payment-itemization.md deleted file mode 100644 index 8351fa23..00000000 --- a/doc/models/v1-payment-itemization.md +++ /dev/null @@ -1,60 +0,0 @@ - -# V1 Payment Itemization - -Payment include an`itemizations` field that lists the items purchased, -along with associated fees, modifiers, and discounts. Each itemization has an -`itemization_type` field that indicates which of the following the itemization -represents: - -
    -
  • An item variation from the merchant's item library
  • -
  • A custom monetary amount
  • -
  • -An action performed on a Square gift card, such as activating or -reloading it. -
  • -
-*Note**: itemization information included in a `Payment` object reflects -details collected **at the time of the payment**. Details such as the name or -price of items might have changed since the payment was processed. - -## Structure - -`V1PaymentItemization` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Name` | `String` | Optional | The item's name. | String getName() | -| `Quantity` | `Double` | Optional | The quantity of the item purchased. This can be a decimal value. | Double getQuantity() | -| `ItemizationType` | [`String`](../../doc/models/v1-payment-itemization-itemization-type.md) | Optional | - | String getItemizationType() | -| `ItemDetail` | [`V1PaymentItemDetail`](../../doc/models/v1-payment-item-detail.md) | Optional | V1PaymentItemDetail | V1PaymentItemDetail getItemDetail() | -| `Notes` | `String` | Optional | Notes entered by the merchant about the item at the time of payment, if any. | String getNotes() | -| `ItemVariationName` | `String` | Optional | The name of the item variation purchased, if any. | String getItemVariationName() | -| `TotalMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getTotalMoney() | -| `SingleQuantityMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getSingleQuantityMoney() | -| `GrossSalesMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getGrossSalesMoney() | -| `DiscountMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getDiscountMoney() | -| `NetSalesMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getNetSalesMoney() | -| `Taxes` | [`List`](../../doc/models/v1-payment-tax.md) | Optional | All taxes applied to this itemization. | List getTaxes() | -| `Discounts` | [`List`](../../doc/models/v1-payment-discount.md) | Optional | All discounts applied to this itemization. | List getDiscounts() | -| `Modifiers` | [`List`](../../doc/models/v1-payment-modifier.md) | Optional | All modifier options applied to this itemization. | List getModifiers() | - -## Example (as JSON) - -```json -{ - "name": "name4", - "quantity": 253.5, - "itemization_type": "GIFT_CARD_UNKNOWN", - "item_detail": { - "category_name": "category_name0", - "sku": "sku6", - "item_id": "item_id2", - "item_variation_id": "item_variation_id2" - }, - "notes": "notes4" -} -``` - diff --git a/doc/models/v1-payment-modifier.md b/doc/models/v1-payment-modifier.md deleted file mode 100644 index fcefa644..00000000 --- a/doc/models/v1-payment-modifier.md +++ /dev/null @@ -1,30 +0,0 @@ - -# V1 Payment Modifier - -V1PaymentModifier - -## Structure - -`V1PaymentModifier` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Name` | `String` | Optional | The modifier option's name. | String getName() | -| `AppliedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getAppliedMoney() | -| `ModifierOptionId` | `String` | Optional | The ID of the applied modifier option, if available. Modifier options applied in older versions of Square Register might not have an ID. | String getModifierOptionId() | - -## Example (as JSON) - -```json -{ - "name": "name0", - "applied_money": { - "amount": 196, - "currency_code": "IQD" - }, - "modifier_option_id": "modifier_option_id6" -} -``` - diff --git a/doc/models/v1-payment-surcharge-type.md b/doc/models/v1-payment-surcharge-type.md deleted file mode 100644 index b37dacde..00000000 --- a/doc/models/v1-payment-surcharge-type.md +++ /dev/null @@ -1,15 +0,0 @@ - -# V1 Payment Surcharge Type - -## Enumeration - -`V1PaymentSurchargeType` - -## Fields - -| Name | -| --- | -| `UNKNOWN` | -| `AUTO_GRATUITY` | -| `CUSTOM` | - diff --git a/doc/models/v1-payment-surcharge.md b/doc/models/v1-payment-surcharge.md deleted file mode 100644 index f0f214a8..00000000 --- a/doc/models/v1-payment-surcharge.md +++ /dev/null @@ -1,40 +0,0 @@ - -# V1 Payment Surcharge - -V1PaymentSurcharge - -## Structure - -`V1PaymentSurcharge` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Name` | `String` | Optional | The name of the surcharge. | String getName() | -| `AppliedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getAppliedMoney() | -| `Rate` | `String` | Optional | The amount of the surcharge as a percentage. The percentage is provided as a string representing the decimal equivalent of the percentage. For example, "0.7" corresponds to a 7% surcharge. Exactly one of rate or amount_money should be set. | String getRate() | -| `AmountMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getAmountMoney() | -| `Type` | [`String`](../../doc/models/v1-payment-surcharge-type.md) | Optional | - | String getType() | -| `Taxable` | `Boolean` | Optional | Indicates whether the surcharge is taxable. | Boolean getTaxable() | -| `Taxes` | [`List`](../../doc/models/v1-payment-tax.md) | Optional | The list of taxes that should be applied to the surcharge. | List getTaxes() | -| `SurchargeId` | `String` | Optional | A Square-issued unique identifier associated with the surcharge. | String getSurchargeId() | - -## Example (as JSON) - -```json -{ - "name": "name6", - "applied_money": { - "amount": 196, - "currency_code": "IQD" - }, - "rate": "rate4", - "amount_money": { - "amount": 186, - "currency_code": "UZS" - }, - "type": "AUTO_GRATUITY" -} -``` - diff --git a/doc/models/v1-payment-tax-inclusion-type.md b/doc/models/v1-payment-tax-inclusion-type.md deleted file mode 100644 index 63c730ff..00000000 --- a/doc/models/v1-payment-tax-inclusion-type.md +++ /dev/null @@ -1,14 +0,0 @@ - -# V1 Payment Tax Inclusion Type - -## Enumeration - -`V1PaymentTaxInclusionType` - -## Fields - -| Name | -| --- | -| `ADDITIVE` | -| `INCLUSIVE` | - diff --git a/doc/models/v1-payment-tax.md b/doc/models/v1-payment-tax.md deleted file mode 100644 index 0ef08183..00000000 --- a/doc/models/v1-payment-tax.md +++ /dev/null @@ -1,42 +0,0 @@ - -# V1 Payment Tax - -V1PaymentTax - -## Structure - -`V1PaymentTax` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Errors` | [`List`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | List getErrors() | -| `Name` | `String` | Optional | The merchant-defined name of the tax. | String getName() | -| `AppliedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getAppliedMoney() | -| `Rate` | `String` | Optional | The rate of the tax, as a string representation of a decimal number. A value of 0.07 corresponds to a rate of 7%. | String getRate() | -| `InclusionType` | [`String`](../../doc/models/v1-payment-tax-inclusion-type.md) | Optional | - | String getInclusionType() | -| `FeeId` | `String` | Optional | The ID of the tax, if available. Taxes applied in older versions of Square Register might not have an ID. | String getFeeId() | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "MAP_KEY_LENGTH_TOO_LONG", - "detail": "detail6", - "field": "field4" - } - ], - "name": "name6", - "applied_money": { - "amount": 196, - "currency_code": "IQD" - }, - "rate": "rate4", - "inclusion_type": "ADDITIVE" -} -``` - diff --git a/doc/models/v1-payment.md b/doc/models/v1-payment.md deleted file mode 100644 index 9a07ff4a..00000000 --- a/doc/models/v1-payment.md +++ /dev/null @@ -1,75 +0,0 @@ - -# V1 Payment - -A payment represents a paid transaction between a Square merchant and a -customer. Payment details are usually available from Connect API endpoints -within a few minutes after the transaction completes. - -Each Payment object includes several fields that end in `_money`. These fields -describe the various amounts of money that contribute to the payment total: - -
    -
  • -Monetary values are positive if they represent an -increase in the amount of money the merchant receives (e.g., -tax_money, tip_money). -
  • -
  • -Monetary values are negative if they represent an -decrease in the amount of money the merchant receives (e.g., -discount_money, refunded_money). -
  • -
- - -## Structure - -`V1Payment` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Id` | `String` | Optional | The payment's unique identifier. | String getId() | -| `MerchantId` | `String` | Optional | The unique identifier of the merchant that took the payment. | String getMerchantId() | -| `CreatedAt` | `String` | Optional | The time when the payment was created, in ISO 8601 format. Reflects the time of the first payment if the object represents an incomplete partial payment, and the time of the last or complete payment otherwise. | String getCreatedAt() | -| `CreatorId` | `String` | Optional | The unique identifier of the Square account that took the payment. | String getCreatorId() | -| `Device` | [`V1Device`](../../doc/models/v1-device.md) | Optional | - | V1Device getDevice() | -| `PaymentUrl` | `String` | Optional | The URL of the payment's detail page in the merchant dashboard. The merchant must be signed in to the merchant dashboard to view this page. | String getPaymentUrl() | -| `ReceiptUrl` | `String` | Optional | The URL of the receipt for the payment. Note that for split tender
payments, this URL corresponds to the receipt for the first tender
listed in the payment's tender field. Each Tender object has its own
receipt_url field you can use to get the other receipts associated with
a split tender payment. | String getReceiptUrl() | -| `InclusiveTaxMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getInclusiveTaxMoney() | -| `AdditiveTaxMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getAdditiveTaxMoney() | -| `TaxMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getTaxMoney() | -| `TipMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getTipMoney() | -| `DiscountMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getDiscountMoney() | -| `TotalCollectedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getTotalCollectedMoney() | -| `ProcessingFeeMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getProcessingFeeMoney() | -| `NetTotalMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getNetTotalMoney() | -| `RefundedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getRefundedMoney() | -| `SwedishRoundingMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getSwedishRoundingMoney() | -| `GrossSalesMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getGrossSalesMoney() | -| `NetSalesMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getNetSalesMoney() | -| `InclusiveTax` | [`List`](../../doc/models/v1-payment-tax.md) | Optional | All of the inclusive taxes associated with the payment. | List getInclusiveTax() | -| `AdditiveTax` | [`List`](../../doc/models/v1-payment-tax.md) | Optional | All of the additive taxes associated with the payment. | List getAdditiveTax() | -| `Tender` | [`List`](../../doc/models/v1-tender.md) | Optional | All of the tenders associated with the payment. | List getTender() | -| `Refunds` | [`List`](../../doc/models/v1-refund.md) | Optional | All of the refunds applied to the payment. Note that the value of all refunds on a payment can exceed the value of all tenders if a merchant chooses to refund money to a tender after previously accepting returned goods as part of an exchange. | List getRefunds() | -| `Itemizations` | [`List`](../../doc/models/v1-payment-itemization.md) | Optional | The items purchased in the payment. | List getItemizations() | -| `SurchargeMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getSurchargeMoney() | -| `Surcharges` | [`List`](../../doc/models/v1-payment-surcharge.md) | Optional | A list of all surcharges associated with the payment. | List getSurcharges() | -| `IsPartial` | `Boolean` | Optional | Indicates whether or not the payment is only partially paid for.
If true, this payment will have the tenders collected so far, but the
itemizations will be empty until the payment is completed. | Boolean getIsPartial() | - -## Example (as JSON) - -```json -{ - "id": "id2", - "merchant_id": "merchant_id8", - "created_at": "created_at0", - "creator_id": "creator_id2", - "device": { - "id": "id6", - "name": "name6" - } -} -``` - diff --git a/doc/models/v1-refund-type.md b/doc/models/v1-refund-type.md deleted file mode 100644 index ce15f003..00000000 --- a/doc/models/v1-refund-type.md +++ /dev/null @@ -1,14 +0,0 @@ - -# V1 Refund Type - -## Enumeration - -`V1RefundType` - -## Fields - -| Name | -| --- | -| `FULL` | -| `PARTIAL` | - diff --git a/doc/models/v1-refund.md b/doc/models/v1-refund.md deleted file mode 100644 index b7a27b88..00000000 --- a/doc/models/v1-refund.md +++ /dev/null @@ -1,53 +0,0 @@ - -# V1 Refund - -V1Refund - -## Structure - -`V1Refund` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Type` | [`String`](../../doc/models/v1-refund-type.md) | Optional | - | String getType() | -| `Reason` | `String` | Optional | The merchant-specified reason for the refund. | String getReason() | -| `RefundedMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getRefundedMoney() | -| `RefundedProcessingFeeMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getRefundedProcessingFeeMoney() | -| `RefundedTaxMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getRefundedTaxMoney() | -| `RefundedAdditiveTaxMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getRefundedAdditiveTaxMoney() | -| `RefundedAdditiveTax` | [`List`](../../doc/models/v1-payment-tax.md) | Optional | All of the additive taxes associated with the refund. | List getRefundedAdditiveTax() | -| `RefundedInclusiveTaxMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getRefundedInclusiveTaxMoney() | -| `RefundedInclusiveTax` | [`List`](../../doc/models/v1-payment-tax.md) | Optional | All of the inclusive taxes associated with the refund. | List getRefundedInclusiveTax() | -| `RefundedTipMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getRefundedTipMoney() | -| `RefundedDiscountMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getRefundedDiscountMoney() | -| `RefundedSurchargeMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getRefundedSurchargeMoney() | -| `RefundedSurcharges` | [`List`](../../doc/models/v1-payment-surcharge.md) | Optional | A list of all surcharges associated with the refund. | List getRefundedSurcharges() | -| `CreatedAt` | `String` | Optional | The time when the merchant initiated the refund for Square to process, in ISO 8601 format. | String getCreatedAt() | -| `ProcessedAt` | `String` | Optional | The time when Square processed the refund on behalf of the merchant, in ISO 8601 format. | String getProcessedAt() | -| `PaymentId` | `String` | Optional | A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders. | String getPaymentId() | -| `MerchantId` | `String` | Optional | - | String getMerchantId() | -| `IsExchange` | `Boolean` | Optional | Indicates whether or not the refund is associated with an exchange. If is_exchange is true, the refund reflects the value of goods returned in the exchange not the total money refunded. | Boolean getIsExchange() | - -## Example (as JSON) - -```json -{ - "type": "FULL", - "reason": "reason4", - "refunded_money": { - "amount": 214, - "currency_code": "SRD" - }, - "refunded_processing_fee_money": { - "amount": 0, - "currency_code": "BGN" - }, - "refunded_tax_money": { - "amount": 148, - "currency_code": "SRD" - } -} -``` - diff --git a/doc/models/v1-settlement-entry-type.md b/doc/models/v1-settlement-entry-type.md deleted file mode 100644 index d22504fc..00000000 --- a/doc/models/v1-settlement-entry-type.md +++ /dev/null @@ -1,33 +0,0 @@ - -# V1 Settlement Entry Type - -## Enumeration - -`V1SettlementEntryType` - -## Fields - -| Name | Description | -| --- | --- | -| `ADJUSTMENT` | A manual adjustment applied to the merchant's account by Square | -| `BALANCE_CHARGE` | A payment from an existing Square balance, such as a gift card | -| `CHARGE` | A credit card payment CAPTURE | -| `FREE_PROCESSING` | Square offers Free Payments Processing for a variety of business scenarios including seller referral or when we want to apologize for a bug, customer service, repricing complication, etc. This entry represents a credit to the merchant for the purposes of Free Processing. | -| `HOLD_ADJUSTMENT` | An adjustment made by Square related to holding/releasing a payment | -| `PAID_SERVICE_FEE` | a fee paid to a 3rd party merchant | -| `PAID_SERVICE_FEE_REFUND` | a refund for a 3rd party merchant fee | -| `REDEMPTION_CODE` | Repayment for a redemption code | -| `REFUND` | A refund for an existing card payment | -| `RETURNED_PAYOUT` | An entry created when we receive a response for the ACH file we sent indicating that the settlement of the original entry failed. | -| `SQUARE_CAPITAL_ADVANCE` | Initial deposit to a merchant for a Capital merchant cash advance (MCA). | -| `SQUARE_CAPITAL_PAYMENT` | Capital merchant cash advance (MCA) assessment. These are, generally, proportional to the merchant's sales but may be issued for other reasons related to the MCA. | -| `SQUARE_CAPITAL_REVERSED_PAYMENT` | Capital merchant cash advance (MCA) assessment refund. These are, generally, proportional to the merchant's refunds but may be issued for other reasons related to the MCA. | -| `SUBSCRIPTION_FEE` | Fee charged for subscription to a Square product | -| `SUBSCRIPTION_FEE_REFUND` | Refund of a previously charged Square product subscription fee. | -| `OTHER` | | -| `INCENTED_PAYMENT` | A payment in which Square covers part of the funds for a purchase | -| `RETURNED_ACH_ENTRY` | A settlement failed to be processed and the settlement amount has been returned to the account | -| `RETURNED_SQUARE_275` | Refund for cancelling a Square Plus subscription | -| `SQUARE_275` | Fee charged for a Square Plus subscription ($275) | -| `SQUARE_CARD` | Settlements to or withdrawals from the Square Card (an asset) | - diff --git a/doc/models/v1-settlement-entry.md b/doc/models/v1-settlement-entry.md deleted file mode 100644 index 4325730e..00000000 --- a/doc/models/v1-settlement-entry.md +++ /dev/null @@ -1,35 +0,0 @@ - -# V1 Settlement Entry - -V1SettlementEntry - -## Structure - -`V1SettlementEntry` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `PaymentId` | `String` | Optional | The settlement's unique identifier. | String getPaymentId() | -| `Type` | [`String`](../../doc/models/v1-settlement-entry-type.md) | Optional | - | String getType() | -| `AmountMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getAmountMoney() | -| `FeeMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getFeeMoney() | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id0", - "type": "RETURNED_PAYOUT", - "amount_money": { - "amount": 186, - "currency_code": "UZS" - }, - "fee_money": { - "amount": 108, - "currency_code": "ILS" - } -} -``` - diff --git a/doc/models/v1-settlement-status.md b/doc/models/v1-settlement-status.md deleted file mode 100644 index a699ad16..00000000 --- a/doc/models/v1-settlement-status.md +++ /dev/null @@ -1,14 +0,0 @@ - -# V1 Settlement Status - -## Enumeration - -`V1SettlementStatus` - -## Fields - -| Name | -| --- | -| `FAILED` | -| `SENT` | - diff --git a/doc/models/v1-settlement.md b/doc/models/v1-settlement.md deleted file mode 100644 index f7a4633d..00000000 --- a/doc/models/v1-settlement.md +++ /dev/null @@ -1,35 +0,0 @@ - -# V1 Settlement - -V1Settlement - -## Structure - -`V1Settlement` - -## Fields - -| Name | Type | Tags | Description | Getter | -| --- | --- | --- | --- | --- | -| `Id` | `String` | Optional | The settlement's unique identifier. | String getId() | -| `Status` | [`String`](../../doc/models/v1-settlement-status.md) | Optional | - | String getStatus() | -| `TotalMoney` | [`V1Money`](../../doc/models/v1-money.md) | Optional | - | V1Money getTotalMoney() | -| `InitiatedAt` | `String` | Optional | The time when the settlement was submitted for deposit or withdrawal, in ISO 8601 format. | String getInitiatedAt() | -| `BankAccountId` | `String` | Optional | The Square-issued unique identifier for the bank account associated with the settlement. | String getBankAccountId() | -| `Entries` | [`List`](../../doc/models/v1-settlement-entry.md) | Optional | The entries included in this settlement. | List getEntries() | - -## Example (as JSON) - -```json -{ - "id": "id2", - "status": "FAILED", - "total_money": { - "amount": 250, - "currency_code": "KZT" - }, - "initiated_at": "initiated_at4", - "bank_account_id": "bank_account_id2" -} -``` - diff --git a/pom.xml b/pom.xml index e0af0800..bb37f9ff 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.squareup square - 37.0.1.20240118 + 38.0.0.20240222 jar Square Java client library for the Square API @@ -40,17 +40,17 @@ io.apimatic core-interfaces - [0.1, 0.2) + [0.2, 0.3) io.apimatic core - [0.4, 0.5) + [0.5, 0.6) io.apimatic okhttp-client-adapter - [0.1, 0.2) + [0.2, 0.3) junit @@ -129,6 +129,19 @@ false + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + diff --git a/src/main/java/com/squareup/square/BearerAuthManager.java b/src/main/java/com/squareup/square/BearerAuthManager.java deleted file mode 100644 index 5399b0a7..00000000 --- a/src/main/java/com/squareup/square/BearerAuthManager.java +++ /dev/null @@ -1,50 +0,0 @@ - -package com.squareup.square; - -import io.apimatic.core.authentication.HeaderAuth; -import java.util.Collections; - -/** - * Utility class for authorization and token management. - */ -public class BearerAuthManager extends HeaderAuth implements BearerAuthCredentials { - - private String accessToken; - - /** - * Constructor. - * @param accessToken String value for accessToken. - */ - public BearerAuthManager(String accessToken) { - super(Collections.singletonMap("Authorization", - "Bearer " + accessToken)); - this.accessToken = accessToken; - } - - /** - * String value for accessToken. - * @return accessToken - */ - public String getAccessToken() { - return accessToken; - } - - /** - * Checks if provided credentials matched with existing ones. - * @param accessToken String value for credentials. - * @return true if credentials matched. - */ - public boolean equals(String accessToken) { - return accessToken.equals(getAccessToken()); - } - - /** - * Converts this BearerAuthManager into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "BearerAuthManager [" + "accessToken=" + accessToken + "]"; - } - -} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/Configuration.java b/src/main/java/com/squareup/square/Configuration.java index 5e3b91a7..eddc51d4 100644 --- a/src/main/java/com/squareup/square/Configuration.java +++ b/src/main/java/com/squareup/square/Configuration.java @@ -1,6 +1,7 @@ package com.squareup.square; +import com.squareup.square.authentication.BearerAuthModel; import com.squareup.square.http.Headers; import com.squareup.square.http.client.ReadonlyHttpClientConfiguration; @@ -57,6 +58,18 @@ public interface Configuration { */ String getAccessToken(); + /** + * The credentials to use with BearerAuth. + * @return bearerAuthCredentials + */ + BearerAuthCredentials getBearerAuthCredentials(); + + /** + * The auth credential model for BearerAuth. + * @return the instance of BearerAuthModel + */ + BearerAuthModel getBearerAuthModel(); + /** * Get base URI by current environment. * @param server Server for which to get the base URI diff --git a/src/main/java/com/squareup/square/SquareClient.java b/src/main/java/com/squareup/square/SquareClient.java index 951e6d2b..7d5a4ee7 100644 --- a/src/main/java/com/squareup/square/SquareClient.java +++ b/src/main/java/com/squareup/square/SquareClient.java @@ -83,6 +83,8 @@ import com.squareup.square.api.V1TransactionsApi; import com.squareup.square.api.VendorsApi; import com.squareup.square.api.WebhookSubscriptionsApi; +import com.squareup.square.authentication.BearerAuthManager; +import com.squareup.square.authentication.BearerAuthModel; import com.squareup.square.http.Headers; import com.squareup.square.http.client.HttpCallback; import com.squareup.square.http.client.HttpClientConfiguration; @@ -151,7 +153,7 @@ public final class SquareClient implements SquareClientInterface { private static final CompatibilityFactory compatibilityFactory = new CompatibilityFactoryImpl(); - private static String userAgent = "Square-Java-SDK/37.0.1.20240118 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}"; + private static String userAgent = "Square-Java-SDK/38.0.0.20240222 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}"; /** * Current API environment. @@ -193,12 +195,16 @@ public final class SquareClient implements SquareClientInterface { */ private BearerAuthManager bearerAuthManager; + /** + * The instance of BearerAuthModel. + */ + private BearerAuthModel bearerAuthModel; + /** * Map of authentication Managers. */ private Map authentications; - /** * Callback to be called before and after the HTTP call for an endpoint is made. */ @@ -206,7 +212,7 @@ public final class SquareClient implements SquareClientInterface { private SquareClient(Environment environment, String customUrl, String squareVersion, HttpClient httpClient, ReadonlyHttpClientConfiguration httpClientConfig, - Headers additionalHeaders, String userAgentDetail, String accessToken, + Headers additionalHeaders, String userAgentDetail, BearerAuthModel bearerAuthModel, Map authentications, HttpCallback httpCallback) { this.environment = environment; this.customUrl = customUrl; @@ -224,19 +230,22 @@ private SquareClient(Environment environment, String customUrl, String squareVer userAgentConfig.put("{detail}", userAgentDetail != null? ApiHelper.tryUrlEncode(userAgentDetail, true): ""); + this.bearerAuthModel = bearerAuthModel; + if (this.authentications.containsKey("global")) { this.bearerAuthManager = (BearerAuthManager) this.authentications.get("global"); } if (!this.authentications.containsKey("global") - || !getBearerAuthCredentials().equals(accessToken)) { - this.bearerAuthManager = new BearerAuthManager(accessToken); + || !getBearerAuthCredentials().equals(bearerAuthModel.getAccessToken())) { + this.bearerAuthManager = new BearerAuthManager(bearerAuthModel); this.authentications.put("global", bearerAuthManager); } GlobalConfiguration globalConfig = new GlobalConfiguration.Builder() - .authentication(this.authentications).compatibilityFactory(compatibilityFactory) .httpClient(httpClient).baseUri(server -> getBaseUri(server)) + .compatibilityFactory(compatibilityFactory) + .authentication(this.authentications) .callback(httpCallback) .userAgent(userAgent) .userAgentConfig(userAgentConfig) @@ -681,10 +690,18 @@ public String getUserAgentDetail() { * The credentials to use with BearerAuth. * @return bearerAuthCredentials */ - private BearerAuthCredentials getBearerAuthCredentials() { + public BearerAuthCredentials getBearerAuthCredentials() { return bearerAuthManager; } + /** + * The auth credential model for BearerAuth. + * @return the instance of BearerAuthModel + */ + public BearerAuthModel getBearerAuthModel() { + return bearerAuthModel; + } + /** * OAuth 2.0 Access Token. * @return accessToken @@ -697,7 +714,7 @@ public String getAccessToken() { * @return sdkVersion */ public String getSdkVersion() { - return "37.0.1.20240118"; + return "38.0.0.20240222"; } /** @@ -796,7 +813,8 @@ public Builder newBuilder() { builder.httpClient = getHttpClient(); builder.additionalHeaders = getAdditionalHeaders(); builder.userAgentDetail = getUserAgentDetail(); - builder.accessToken = getBearerAuthCredentials().getAccessToken(); + builder.bearerAuthCredentials(getBearerAuthModel() + .toBuilder().build()); builder.authentications = authentications; builder.httpCallback = httpCallback; builder.httpClientConfig(configBldr -> configBldr = @@ -811,11 +829,11 @@ public static class Builder { private Environment environment = Environment.PRODUCTION; private String customUrl = "https://connect.squareup.com"; - private String squareVersion = "2024-01-18"; + private String squareVersion = "2024-02-22"; private HttpClient httpClient; private Headers additionalHeaders = new Headers(); private String userAgentDetail = null; - private String accessToken = ""; + private BearerAuthModel bearerAuthModel = new BearerAuthModel.Builder("").build(); private Map authentications = null; private HttpCallback httpCallback = null; private HttpClientConfiguration.Builder httpClientConfigBuilder = @@ -825,13 +843,25 @@ public static class Builder { /** * Credentials setter for BearerAuth. * @param accessToken String value for accessToken. - * @return Builder + * @deprecated This builder method is deprecated. + * Use {@link #bearerAuthCredentials(BearerAuthModel) bearerAuthCredentials} instead. + * @return The current instance of builder. */ + @Deprecated public Builder accessToken(String accessToken) { - if (accessToken == null) { - throw new NullPointerException("AccessToken cannot be null."); - } - this.accessToken = accessToken; + bearerAuthModel = bearerAuthModel.toBuilder() + .accessToken(accessToken) + .build(); + return this; + } + + /** + * Credentials setter for BearerAuthCredentials. + * @param bearerAuthModel The instance of BearerAuthModel. + * @return The current instance of builder. + */ + public Builder bearerAuthCredentials(BearerAuthModel bearerAuthModel) { + this.bearerAuthModel = bearerAuthModel; return this; } @@ -939,7 +969,7 @@ public SquareClient build() { httpClient = new OkClient(httpClientConfig.getConfiguration(), compatibilityFactory); return new SquareClient(environment, customUrl, squareVersion, httpClient, - httpClientConfig, additionalHeaders, userAgentDetail, accessToken, + httpClientConfig, additionalHeaders, userAgentDetail, bearerAuthModel, authentications, httpCallback); } } diff --git a/src/main/java/com/squareup/square/api/BaseApi.java b/src/main/java/com/squareup/square/api/BaseApi.java index accbbf8c..fdb1119f 100644 --- a/src/main/java/com/squareup/square/api/BaseApi.java +++ b/src/main/java/com/squareup/square/api/BaseApi.java @@ -13,7 +13,6 @@ * Base class for all Apis. */ public abstract class BaseApi { - protected final static String AUTHENTICATION_KEY = "global"; protected static final Map> GLOBAL_ERROR_CASES = new HashMap>(); private GlobalConfiguration globalConfig; diff --git a/src/main/java/com/squareup/square/api/CheckoutApi.java b/src/main/java/com/squareup/square/api/CheckoutApi.java index af2a154b..65d842ee 100644 --- a/src/main/java/com/squareup/square/api/CheckoutApi.java +++ b/src/main/java/com/squareup/square/api/CheckoutApi.java @@ -150,7 +150,7 @@ CompletableFuture updateMerchantSettingsAsync( * endpoint. Provide this cursor to retrieve the next set of results for the original * query. If a cursor is not provided, the endpoint returns the first page of the * results. For more information, see - * [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). + * [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). * @param limit Optional parameter: A limit on the number of results to return per page. The * limit is advisory and the implementation might return more or less results. If the * supplied limit is negative, zero, or greater than the maximum limit of 1000, it is @@ -169,7 +169,7 @@ ListPaymentLinksResponse listPaymentLinks( * endpoint. Provide this cursor to retrieve the next set of results for the original * query. If a cursor is not provided, the endpoint returns the first page of the * results. For more information, see - * [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). + * [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). * @param limit Optional parameter: A limit on the number of results to return per page. The * limit is advisory and the implementation might return more or less results. If the * supplied limit is negative, zero, or greater than the maximum limit of 1000, it is diff --git a/src/main/java/com/squareup/square/api/CustomersApi.java b/src/main/java/com/squareup/square/api/CustomersApi.java index 63e7e2a6..aeee8d36 100644 --- a/src/main/java/com/squareup/square/api/CustomersApi.java +++ b/src/main/java/com/squareup/square/api/CustomersApi.java @@ -3,6 +3,14 @@ import com.squareup.square.exceptions.ApiException; import com.squareup.square.models.AddGroupToCustomerResponse; +import com.squareup.square.models.BulkCreateCustomersRequest; +import com.squareup.square.models.BulkCreateCustomersResponse; +import com.squareup.square.models.BulkDeleteCustomersRequest; +import com.squareup.square.models.BulkDeleteCustomersResponse; +import com.squareup.square.models.BulkRetrieveCustomersRequest; +import com.squareup.square.models.BulkRetrieveCustomersResponse; +import com.squareup.square.models.BulkUpdateCustomersRequest; +import com.squareup.square.models.BulkUpdateCustomersResponse; import com.squareup.square.models.CreateCustomerCardRequest; import com.squareup.square.models.CreateCustomerCardResponse; import com.squareup.square.models.CreateCustomerRequest; @@ -110,6 +118,100 @@ CreateCustomerResponse createCustomer( CompletableFuture createCustomerAsync( final CreateCustomerRequest body); + /** + * Creates multiple [customer profiles]($m/Customer) for a business. This endpoint takes a map + * of individual create requests and returns a map of responses. You must provide at least one + * of the following values in each create request: - `given_name` - `family_name` - + * `company_name` - `email_address` - `phone_number`. + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkCreateCustomersResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + BulkCreateCustomersResponse bulkCreateCustomers( + final BulkCreateCustomersRequest body) throws ApiException, IOException; + + /** + * Creates multiple [customer profiles]($m/Customer) for a business. This endpoint takes a map + * of individual create requests and returns a map of responses. You must provide at least one + * of the following values in each create request: - `given_name` - `family_name` - + * `company_name` - `email_address` - `phone_number`. + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkCreateCustomersResponse response from the API call + */ + CompletableFuture bulkCreateCustomersAsync( + final BulkCreateCustomersRequest body); + + /** + * Deletes multiple customer profiles. The endpoint takes a list of customer IDs and returns a + * map of responses. + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkDeleteCustomersResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + BulkDeleteCustomersResponse bulkDeleteCustomers( + final BulkDeleteCustomersRequest body) throws ApiException, IOException; + + /** + * Deletes multiple customer profiles. The endpoint takes a list of customer IDs and returns a + * map of responses. + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkDeleteCustomersResponse response from the API call + */ + CompletableFuture bulkDeleteCustomersAsync( + final BulkDeleteCustomersRequest body); + + /** + * Retrieves multiple customer profiles. This endpoint takes a list of customer IDs and returns + * a map of responses. + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkRetrieveCustomersResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + BulkRetrieveCustomersResponse bulkRetrieveCustomers( + final BulkRetrieveCustomersRequest body) throws ApiException, IOException; + + /** + * Retrieves multiple customer profiles. This endpoint takes a list of customer IDs and returns + * a map of responses. + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkRetrieveCustomersResponse response from the API call + */ + CompletableFuture bulkRetrieveCustomersAsync( + final BulkRetrieveCustomersRequest body); + + /** + * Updates multiple customer profiles. This endpoint takes a map of individual update requests + * and returns a map of responses. You cannot use this endpoint to change cards on file. To make + * changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkUpdateCustomersResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + BulkUpdateCustomersResponse bulkUpdateCustomers( + final BulkUpdateCustomersRequest body) throws ApiException, IOException; + + /** + * Updates multiple customer profiles. This endpoint takes a map of individual update requests + * and returns a map of responses. You cannot use this endpoint to change cards on file. To make + * changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkUpdateCustomersResponse response from the API call + */ + CompletableFuture bulkUpdateCustomersAsync( + final BulkUpdateCustomersRequest body); + /** * Searches the customer profiles associated with a Square account using one or more supported * query filters. Calling `SearchCustomers` without any explicit query filter returns all @@ -144,11 +246,8 @@ CompletableFuture searchCustomersAsync( /** * Deletes a customer profile from a business. This operation also unlinks any associated cards - * on file. As a best practice, include the `version` field in the request to enable [optimistic - * concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) - * control. If included, the value must be set to the current version of the customer profile. - * To delete a customer profile that was created by merging existing profiles, you must use the - * ID of the newly created profile. + * on file. To delete a customer profile that was created by merging existing profiles, you must + * use the ID of the newly created profile. * @param customerId Required parameter: The ID of the customer to delete. * @param version Optional parameter: The current version of the customer profile. As a best * practice, you should include this parameter to enable [optimistic @@ -165,11 +264,8 @@ DeleteCustomerResponse deleteCustomer( /** * Deletes a customer profile from a business. This operation also unlinks any associated cards - * on file. As a best practice, include the `version` field in the request to enable [optimistic - * concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) - * control. If included, the value must be set to the current version of the customer profile. - * To delete a customer profile that was created by merging existing profiles, you must use the - * ID of the newly created profile. + * on file. To delete a customer profile that was created by merging existing profiles, you must + * use the ID of the newly created profile. * @param customerId Required parameter: The ID of the customer to delete. * @param version Optional parameter: The current version of the customer profile. As a best * practice, you should include this parameter to enable [optimistic @@ -203,13 +299,10 @@ CompletableFuture retrieveCustomerAsync( /** * Updates a customer profile. This endpoint supports sparse updates, so only new or changed * fields are required in the request. To add or update a field, specify the new value. To - * remove a field, specify `null` (recommended) or specify an empty string (string fields only). - * As a best practice, include the `version` field in the request to enable [optimistic - * concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) - * control. If included, the value must be set to the current version of the customer profile. - * To update a customer profile that was created by merging existing profiles, you must use the - * ID of the newly created profile. You cannot use this endpoint to change cards on file. To - * make changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). + * remove a field, specify `null`. To update a customer profile that was created by merging + * existing profiles, you must use the ID of the newly created profile. You cannot use this + * endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) or [Gift + * Cards API]($e/GiftCards). * @param customerId Required parameter: The ID of the customer to update. * @param body Required parameter: An object containing the fields to POST for the request. * See the corresponding object definition for field details. @@ -224,13 +317,10 @@ UpdateCustomerResponse updateCustomer( /** * Updates a customer profile. This endpoint supports sparse updates, so only new or changed * fields are required in the request. To add or update a field, specify the new value. To - * remove a field, specify `null` (recommended) or specify an empty string (string fields only). - * As a best practice, include the `version` field in the request to enable [optimistic - * concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) - * control. If included, the value must be set to the current version of the customer profile. - * To update a customer profile that was created by merging existing profiles, you must use the - * ID of the newly created profile. You cannot use this endpoint to change cards on file. To - * make changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). + * remove a field, specify `null`. To update a customer profile that was created by merging + * existing profiles, you must use the ID of the newly created profile. You cannot use this + * endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) or [Gift + * Cards API]($e/GiftCards). * @param customerId Required parameter: The ID of the customer to update. * @param body Required parameter: An object containing the fields to POST for the request. * See the corresponding object definition for field details. diff --git a/src/main/java/com/squareup/square/api/DefaultApplePayApi.java b/src/main/java/com/squareup/square/api/DefaultApplePayApi.java index a9d8f208..b968ece7 100644 --- a/src/main/java/com/squareup/square/api/DefaultApplePayApi.java +++ b/src/main/java/com/squareup/square/api/DefaultApplePayApi.java @@ -91,7 +91,8 @@ private ApiCall prepareRegisterDomainReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultBankAccountsApi.java b/src/main/java/com/squareup/square/api/DefaultBankAccountsApi.java index 8e38da89..28297eb5 100644 --- a/src/main/java/com/squareup/square/api/DefaultBankAccountsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultBankAccountsApi.java @@ -95,7 +95,8 @@ private ApiCall prepareListBankAccountsR .queryParam(param -> param.key("location_id") .value(locationId).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -152,7 +153,8 @@ private ApiCall prepareGetBankAccoun .templateParam(param -> param.key("v1_bank_account_id").value(v1BankAccountId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -203,7 +205,8 @@ private ApiCall prepareGetBankAccountReque .templateParam(param -> param.key("bank_account_id").value(bankAccountId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultBookingCustomAttributesApi.java b/src/main/java/com/squareup/square/api/DefaultBookingCustomAttributesApi.java index 286e2404..b0a12fee 100644 --- a/src/main/java/com/squareup/square/api/DefaultBookingCustomAttributesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultBookingCustomAttributesApi.java @@ -108,7 +108,8 @@ private ApiCall pre .queryParam(param -> param.key("cursor") .value(cursor).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -171,7 +172,8 @@ private ApiCall pr .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -230,7 +232,8 @@ private ApiCall pr .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -306,7 +309,8 @@ private ApiCall .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -376,7 +380,8 @@ private ApiCall pr .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -439,7 +444,8 @@ private ApiCall prepare .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -502,7 +508,8 @@ private ApiCall prepare .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -602,7 +609,8 @@ private ApiCall prepareListBo .templateParam(param -> param.key("booking_id").value(bookingId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -672,7 +680,8 @@ private ApiCall prepareDelet .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -770,7 +779,8 @@ private ApiCall prepareRet .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -853,7 +863,8 @@ private ApiCall prepareUpser .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultBookingsApi.java b/src/main/java/com/squareup/square/api/DefaultBookingsApi.java index cb4d6a25..df6f3d58 100644 --- a/src/main/java/com/squareup/square/api/DefaultBookingsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultBookingsApi.java @@ -148,7 +148,8 @@ private ApiCall prepareListBookingsRequest( .queryParam(param -> param.key("start_at_max") .value(startAtMax).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -217,7 +218,8 @@ private ApiCall prepareCreateBookingRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -276,7 +278,8 @@ private ApiCall prepareSearchAvailabil .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -337,7 +340,8 @@ private ApiCall prepareBulkRetrieveB .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -381,7 +385,8 @@ private ApiCall prepareRet .server(Server.ENUM_DEFAULT.value()) .path("/v2/bookings/business-booking-profile") .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -445,7 +450,8 @@ private ApiCall prepareListLo .queryParam(param -> param.key("cursor") .value(cursor).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -498,7 +504,8 @@ private ApiCall prepareRet .templateParam(param -> param.key("location_id").value(locationId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -582,7 +589,8 @@ private ApiCall prepareList .queryParam(param -> param.key("location_id") .value(locationId).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -637,7 +645,8 @@ private ApiCall pre .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -688,7 +697,8 @@ private ApiCall prepareR .templateParam(param -> param.key("team_member_id").value(teamMemberId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -745,7 +755,8 @@ private ApiCall prepareRetrieveBookingReq .templateParam(param -> param.key("booking_id").value(bookingId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -817,7 +828,8 @@ private ApiCall prepareUpdateBookingRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -889,7 +901,8 @@ private ApiCall prepareCancelBookingRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultCardsApi.java b/src/main/java/com/squareup/square/api/DefaultCardsApi.java index 3dca279f..5a2c0017 100644 --- a/src/main/java/com/squareup/square/api/DefaultCardsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultCardsApi.java @@ -118,7 +118,8 @@ private ApiCall prepareListCardsRequest( .queryParam(param -> param.key("sort_order") .value(sortOrder).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -173,7 +174,8 @@ private ApiCall prepareCreateCardRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -224,7 +226,8 @@ private ApiCall prepareRetrieveCardRequest( .templateParam(param -> param.key("card_id").value(cardId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -277,7 +280,8 @@ private ApiCall prepareDisableCardRequest( .templateParam(param -> param.key("card_id").value(cardId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultCashDrawersApi.java b/src/main/java/com/squareup/square/api/DefaultCashDrawersApi.java index 7534da68..b27bbbb8 100644 --- a/src/main/java/com/squareup/square/api/DefaultCashDrawersApi.java +++ b/src/main/java/com/squareup/square/api/DefaultCashDrawersApi.java @@ -114,7 +114,8 @@ private ApiCall prepareListCashDrawe .queryParam(param -> param.key("cursor") .value(cursor).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -178,7 +179,8 @@ private ApiCall prepareRetrieveCa .templateParam(param -> param.key("shift_id").value(shiftId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -256,7 +258,8 @@ private ApiCall prepareListCash .templateParam(param -> param.key("shift_id").value(shiftId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultCatalogApi.java b/src/main/java/com/squareup/square/api/DefaultCatalogApi.java index de716bdb..e62b7518 100644 --- a/src/main/java/com/squareup/square/api/DefaultCatalogApi.java +++ b/src/main/java/com/squareup/square/api/DefaultCatalogApi.java @@ -111,7 +111,8 @@ private ApiCall prepareBatchDel .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -174,7 +175,8 @@ private ApiCall prepareBatchR .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -247,7 +249,8 @@ private ApiCall prepareBatchUps .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -319,7 +322,8 @@ private ApiCall prepareCreateCatalogIm .multiPartRequestType(MutliPartRequestType.MULTI_PART_FILE) .multipartHeaders("Content-Type", "image/jpeg")) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -398,7 +402,8 @@ private ApiCall prepareUpdateCatalogIm .templateParam(param -> param.key("image_id").value(imageId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -444,7 +449,8 @@ private ApiCall prepareCatalogInfoRequest() t .server(Server.ENUM_DEFAULT.value()) .path("/v2/catalog/info") .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -553,7 +559,8 @@ private ApiCall prepareListCatalogRequest( .queryParam(param -> param.key("catalog_version") .value(catalogVersion).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -614,7 +621,8 @@ private ApiCall prepareUpsertCatalogO .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -685,7 +693,8 @@ private ApiCall prepareDeleteCatalogO .templateParam(param -> param.key("object_id").value(objectId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -811,7 +820,8 @@ private ApiCall prepareRetrieveCata .templateParam(param -> param.key("object_id").value(objectId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -886,7 +896,8 @@ private ApiCall prepareSearchCatalog .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -961,7 +972,8 @@ private ApiCall prepareSearchCatalogIt .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1018,7 +1030,8 @@ private ApiCall prepareUpdateItem .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1075,7 +1088,8 @@ private ApiCall prepareUpdateItemTaxesReq .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultCheckoutApi.java b/src/main/java/com/squareup/square/api/DefaultCheckoutApi.java index 6f793724..93b6a5b5 100644 --- a/src/main/java/com/squareup/square/api/DefaultCheckoutApi.java +++ b/src/main/java/com/squareup/square/api/DefaultCheckoutApi.java @@ -107,7 +107,8 @@ private ApiCall prepareCreateCheckoutReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -160,7 +161,8 @@ private ApiCall prepareRetrieveL .templateParam(param -> param.key("location_id").value(locationId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -224,7 +226,8 @@ private ApiCall prepareUpdateLocat .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -268,7 +271,8 @@ private ApiCall prepareRetrieveM .server(Server.ENUM_DEFAULT.value()) .path("/v2/online-checkout/merchant-settings") .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -323,7 +327,8 @@ private ApiCall prepareUpdateMerch .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -341,7 +346,7 @@ private ApiCall prepareUpdateMerch * endpoint. Provide this cursor to retrieve the next set of results for the original * query. If a cursor is not provided, the endpoint returns the first page of the * results. For more information, see - * [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). + * [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). * @param limit Optional parameter: A limit on the number of results to return per page. The * limit is advisory and the implementation might return more or less results. If the * supplied limit is negative, zero, or greater than the maximum limit of 1000, it is @@ -362,7 +367,7 @@ public ListPaymentLinksResponse listPaymentLinks( * endpoint. Provide this cursor to retrieve the next set of results for the original * query. If a cursor is not provided, the endpoint returns the first page of the * results. For more information, see - * [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). + * [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). * @param limit Optional parameter: A limit on the number of results to return per page. The * limit is advisory and the implementation might return more or less results. If the * supplied limit is negative, zero, or greater than the maximum limit of 1000, it is @@ -395,7 +400,8 @@ private ApiCall prepareListPaymentLinksR .queryParam(param -> param.key("limit") .value(limit).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -452,7 +458,8 @@ private ApiCall prepareCreatePaymentLin .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -503,7 +510,8 @@ private ApiCall prepareDeletePaymentLin .templateParam(param -> param.key("id").value(id) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -554,7 +562,8 @@ private ApiCall prepareRetrievePaymen .templateParam(param -> param.key("id").value(id) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -620,7 +629,8 @@ private ApiCall prepareUpdatePaymentLin .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultCustomerCustomAttributesApi.java b/src/main/java/com/squareup/square/api/DefaultCustomerCustomAttributesApi.java index 5d0bba4a..a92bad1d 100644 --- a/src/main/java/com/squareup/square/api/DefaultCustomerCustomAttributesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultCustomerCustomAttributesApi.java @@ -110,7 +110,8 @@ private ApiCall pr .queryParam(param -> param.key("cursor") .value(cursor).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -183,7 +184,8 @@ private ApiCall p .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -240,7 +242,8 @@ private ApiCall p .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -318,7 +321,8 @@ private ApiCall .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -388,7 +392,8 @@ private ApiCall p .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -465,7 +470,8 @@ private ApiCall prepar .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -571,7 +577,8 @@ private ApiCall prepareListC .templateParam(param -> param.key("customer_id").value(customerId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -641,7 +648,8 @@ private ApiCall prepareDele .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -747,7 +755,8 @@ private ApiCall prepareRe .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -838,7 +847,8 @@ private ApiCall prepareUpse .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultCustomerGroupsApi.java b/src/main/java/com/squareup/square/api/DefaultCustomerGroupsApi.java index 67a45eb6..0f5446f7 100644 --- a/src/main/java/com/squareup/square/api/DefaultCustomerGroupsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultCustomerGroupsApi.java @@ -93,7 +93,8 @@ private ApiCall prepareListCustomerGro .queryParam(param -> param.key("limit") .value(limit).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -150,7 +151,8 @@ private ApiCall prepareCreateCustomer .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -201,7 +203,8 @@ private ApiCall prepareDeleteCustomer .templateParam(param -> param.key("group_id").value(groupId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -252,7 +255,8 @@ private ApiCall prepareRetrieveCust .templateParam(param -> param.key("group_id").value(groupId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -314,7 +318,8 @@ private ApiCall prepareUpdateCustomer .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultCustomerSegmentsApi.java b/src/main/java/com/squareup/square/api/DefaultCustomerSegmentsApi.java index 427158e4..5ff561b9 100644 --- a/src/main/java/com/squareup/square/api/DefaultCustomerSegmentsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultCustomerSegmentsApi.java @@ -89,7 +89,8 @@ private ApiCall prepareListCustomerS .queryParam(param -> param.key("limit") .value(limit).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -140,7 +141,8 @@ private ApiCall prepareRetrieveCu .templateParam(param -> param.key("segment_id").value(segmentId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultCustomersApi.java b/src/main/java/com/squareup/square/api/DefaultCustomersApi.java index d955e473..6ccec8d6 100644 --- a/src/main/java/com/squareup/square/api/DefaultCustomersApi.java +++ b/src/main/java/com/squareup/square/api/DefaultCustomersApi.java @@ -8,6 +8,14 @@ import com.squareup.square.http.client.HttpContext; import com.squareup.square.http.request.HttpMethod; import com.squareup.square.models.AddGroupToCustomerResponse; +import com.squareup.square.models.BulkCreateCustomersRequest; +import com.squareup.square.models.BulkCreateCustomersResponse; +import com.squareup.square.models.BulkDeleteCustomersRequest; +import com.squareup.square.models.BulkDeleteCustomersResponse; +import com.squareup.square.models.BulkRetrieveCustomersRequest; +import com.squareup.square.models.BulkRetrieveCustomersResponse; +import com.squareup.square.models.BulkUpdateCustomersRequest; +import com.squareup.square.models.BulkUpdateCustomersResponse; import com.squareup.square.models.CreateCustomerCardRequest; import com.squareup.square.models.CreateCustomerCardResponse; import com.squareup.square.models.CreateCustomerRequest; @@ -135,7 +143,8 @@ private ApiCall prepareListCustomersRequest .queryParam(param -> param.key("count") .value((count != null) ? count : false).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -194,7 +203,8 @@ private ApiCall prepareCreateCustomerReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -206,6 +216,244 @@ private ApiCall prepareCreateCustomerReque .build(); } + /** + * Creates multiple [customer profiles]($m/Customer) for a business. This endpoint takes a map + * of individual create requests and returns a map of responses. You must provide at least one + * of the following values in each create request: - `given_name` - `family_name` - + * `company_name` - `email_address` - `phone_number`. + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkCreateCustomersResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public BulkCreateCustomersResponse bulkCreateCustomers( + final BulkCreateCustomersRequest body) throws ApiException, IOException { + return prepareBulkCreateCustomersRequest(body).execute(); + } + + /** + * Creates multiple [customer profiles]($m/Customer) for a business. This endpoint takes a map + * of individual create requests and returns a map of responses. You must provide at least one + * of the following values in each create request: - `given_name` - `family_name` - + * `company_name` - `email_address` - `phone_number`. + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkCreateCustomersResponse response from the API call + */ + public CompletableFuture bulkCreateCustomersAsync( + final BulkCreateCustomersRequest body) { + try { + return prepareBulkCreateCustomersRequest(body).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for bulkCreateCustomers. + */ + private ApiCall prepareBulkCreateCustomersRequest( + final BulkCreateCustomersRequest body) throws JsonProcessingException, IOException { + return new ApiCall.Builder() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v2/customers/bulk-create") + .bodyParam(param -> param.value(body)) + .bodySerializer(() -> ApiHelper.serialize(body)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("global")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .deserializer( + response -> ApiHelper.deserialize(response, BulkCreateCustomersResponse.class)) + .nullify404(false) + .contextInitializer((context, result) -> + result.toBuilder().httpContext((HttpContext)context).build()) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Deletes multiple customer profiles. The endpoint takes a list of customer IDs and returns a + * map of responses. + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkDeleteCustomersResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public BulkDeleteCustomersResponse bulkDeleteCustomers( + final BulkDeleteCustomersRequest body) throws ApiException, IOException { + return prepareBulkDeleteCustomersRequest(body).execute(); + } + + /** + * Deletes multiple customer profiles. The endpoint takes a list of customer IDs and returns a + * map of responses. + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkDeleteCustomersResponse response from the API call + */ + public CompletableFuture bulkDeleteCustomersAsync( + final BulkDeleteCustomersRequest body) { + try { + return prepareBulkDeleteCustomersRequest(body).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for bulkDeleteCustomers. + */ + private ApiCall prepareBulkDeleteCustomersRequest( + final BulkDeleteCustomersRequest body) throws JsonProcessingException, IOException { + return new ApiCall.Builder() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v2/customers/bulk-delete") + .bodyParam(param -> param.value(body)) + .bodySerializer(() -> ApiHelper.serialize(body)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("global")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .deserializer( + response -> ApiHelper.deserialize(response, BulkDeleteCustomersResponse.class)) + .nullify404(false) + .contextInitializer((context, result) -> + result.toBuilder().httpContext((HttpContext)context).build()) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Retrieves multiple customer profiles. This endpoint takes a list of customer IDs and returns + * a map of responses. + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkRetrieveCustomersResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public BulkRetrieveCustomersResponse bulkRetrieveCustomers( + final BulkRetrieveCustomersRequest body) throws ApiException, IOException { + return prepareBulkRetrieveCustomersRequest(body).execute(); + } + + /** + * Retrieves multiple customer profiles. This endpoint takes a list of customer IDs and returns + * a map of responses. + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkRetrieveCustomersResponse response from the API call + */ + public CompletableFuture bulkRetrieveCustomersAsync( + final BulkRetrieveCustomersRequest body) { + try { + return prepareBulkRetrieveCustomersRequest(body).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for bulkRetrieveCustomers. + */ + private ApiCall prepareBulkRetrieveCustomersRequest( + final BulkRetrieveCustomersRequest body) throws JsonProcessingException, IOException { + return new ApiCall.Builder() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v2/customers/bulk-retrieve") + .bodyParam(param -> param.value(body)) + .bodySerializer(() -> ApiHelper.serialize(body)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("global")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .deserializer( + response -> ApiHelper.deserialize(response, BulkRetrieveCustomersResponse.class)) + .nullify404(false) + .contextInitializer((context, result) -> + result.toBuilder().httpContext((HttpContext)context).build()) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Updates multiple customer profiles. This endpoint takes a map of individual update requests + * and returns a map of responses. You cannot use this endpoint to change cards on file. To make + * changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkUpdateCustomersResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public BulkUpdateCustomersResponse bulkUpdateCustomers( + final BulkUpdateCustomersRequest body) throws ApiException, IOException { + return prepareBulkUpdateCustomersRequest(body).execute(); + } + + /** + * Updates multiple customer profiles. This endpoint takes a map of individual update requests + * and returns a map of responses. You cannot use this endpoint to change cards on file. To make + * changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). + * @param body Required parameter: An object containing the fields to POST for the request. + * See the corresponding object definition for field details. + * @return Returns the BulkUpdateCustomersResponse response from the API call + */ + public CompletableFuture bulkUpdateCustomersAsync( + final BulkUpdateCustomersRequest body) { + try { + return prepareBulkUpdateCustomersRequest(body).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for bulkUpdateCustomers. + */ + private ApiCall prepareBulkUpdateCustomersRequest( + final BulkUpdateCustomersRequest body) throws JsonProcessingException, IOException { + return new ApiCall.Builder() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v2/customers/bulk-update") + .bodyParam(param -> param.value(body)) + .bodySerializer(() -> ApiHelper.serialize(body)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("global")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .deserializer( + response -> ApiHelper.deserialize(response, BulkUpdateCustomersResponse.class)) + .nullify404(false) + .contextInitializer((context, result) -> + result.toBuilder().httpContext((HttpContext)context).build()) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + /** * Searches the customer profiles associated with a Square account using one or more supported * query filters. Calling `SearchCustomers` without any explicit query filter returns all @@ -261,7 +509,8 @@ private ApiCall prepareSearchCustomersReq .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -275,11 +524,8 @@ private ApiCall prepareSearchCustomersReq /** * Deletes a customer profile from a business. This operation also unlinks any associated cards - * on file. As a best practice, include the `version` field in the request to enable [optimistic - * concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) - * control. If included, the value must be set to the current version of the customer profile. - * To delete a customer profile that was created by merging existing profiles, you must use the - * ID of the newly created profile. + * on file. To delete a customer profile that was created by merging existing profiles, you must + * use the ID of the newly created profile. * @param customerId Required parameter: The ID of the customer to delete. * @param version Optional parameter: The current version of the customer profile. As a best * practice, you should include this parameter to enable [optimistic @@ -298,11 +544,8 @@ public DeleteCustomerResponse deleteCustomer( /** * Deletes a customer profile from a business. This operation also unlinks any associated cards - * on file. As a best practice, include the `version` field in the request to enable [optimistic - * concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) - * control. If included, the value must be set to the current version of the customer profile. - * To delete a customer profile that was created by merging existing profiles, you must use the - * ID of the newly created profile. + * on file. To delete a customer profile that was created by merging existing profiles, you must + * use the ID of the newly created profile. * @param customerId Required parameter: The ID of the customer to delete. * @param version Optional parameter: The current version of the customer profile. As a best * practice, you should include this parameter to enable [optimistic @@ -337,7 +580,8 @@ private ApiCall prepareDeleteCustomerReque .templateParam(param -> param.key("customer_id").value(customerId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -388,7 +632,8 @@ private ApiCall prepareRetrieveCustomerR .templateParam(param -> param.key("customer_id").value(customerId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -403,13 +648,10 @@ private ApiCall prepareRetrieveCustomerR /** * Updates a customer profile. This endpoint supports sparse updates, so only new or changed * fields are required in the request. To add or update a field, specify the new value. To - * remove a field, specify `null` (recommended) or specify an empty string (string fields only). - * As a best practice, include the `version` field in the request to enable [optimistic - * concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) - * control. If included, the value must be set to the current version of the customer profile. - * To update a customer profile that was created by merging existing profiles, you must use the - * ID of the newly created profile. You cannot use this endpoint to change cards on file. To - * make changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). + * remove a field, specify `null`. To update a customer profile that was created by merging + * existing profiles, you must use the ID of the newly created profile. You cannot use this + * endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) or [Gift + * Cards API]($e/GiftCards). * @param customerId Required parameter: The ID of the customer to update. * @param body Required parameter: An object containing the fields to POST for the request. * See the corresponding object definition for field details. @@ -426,13 +668,10 @@ public UpdateCustomerResponse updateCustomer( /** * Updates a customer profile. This endpoint supports sparse updates, so only new or changed * fields are required in the request. To add or update a field, specify the new value. To - * remove a field, specify `null` (recommended) or specify an empty string (string fields only). - * As a best practice, include the `version` field in the request to enable [optimistic - * concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) - * control. If included, the value must be set to the current version of the customer profile. - * To update a customer profile that was created by merging existing profiles, you must use the - * ID of the newly created profile. You cannot use this endpoint to change cards on file. To - * make changes, use the [Cards API]($e/Cards) or [Gift Cards API]($e/GiftCards). + * remove a field, specify `null`. To update a customer profile that was created by merging + * existing profiles, you must use the ID of the newly created profile. You cannot use this + * endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) or [Gift + * Cards API]($e/GiftCards). * @param customerId Required parameter: The ID of the customer to update. * @param body Required parameter: An object containing the fields to POST for the request. * See the corresponding object definition for field details. @@ -466,7 +705,8 @@ private ApiCall prepareUpdateCustomerReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -540,7 +780,8 @@ private ApiCall prepareCreateCustomerC .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -606,7 +847,8 @@ private ApiCall prepareDeleteCustomerC .templateParam(param -> param.key("card_id").value(cardId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -668,7 +910,8 @@ private ApiCall prepareRemoveGrou .templateParam(param -> param.key("group_id").value(groupId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -728,7 +971,8 @@ private ApiCall prepareAddGroupToCusto .templateParam(param -> param.key("group_id").value(groupId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultDevicesApi.java b/src/main/java/com/squareup/square/api/DefaultDevicesApi.java index b436f4de..2e1c6542 100644 --- a/src/main/java/com/squareup/square/api/DefaultDevicesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultDevicesApi.java @@ -106,7 +106,8 @@ private ApiCall prepareListDevicesRequest( .queryParam(param -> param.key("location_id") .value(locationId).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -192,7 +193,8 @@ private ApiCall prepareListDeviceCodesReq .queryParam(param -> param.key("status") .value(status).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -249,7 +251,8 @@ private ApiCall prepareCreateDeviceCodeR .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -300,7 +303,8 @@ private ApiCall prepareGetDeviceCodeRequest .templateParam(param -> param.key("id").value(id) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -351,7 +355,8 @@ private ApiCall prepareGetDeviceRequest( .templateParam(param -> param.key("device_id").value(deviceId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultDisputesApi.java b/src/main/java/com/squareup/square/api/DefaultDisputesApi.java index aec28b23..f1c0e74b 100644 --- a/src/main/java/com/squareup/square/api/DefaultDisputesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultDisputesApi.java @@ -104,7 +104,8 @@ private ApiCall prepareListDisputesRequest( .queryParam(param -> param.key("location_id") .value(locationId).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -155,7 +156,8 @@ private ApiCall prepareRetrieveDisputeReq .templateParam(param -> param.key("dispute_id").value(disputeId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -212,7 +214,8 @@ private ApiCall prepareAcceptDisputeRequest .templateParam(param -> param.key("dispute_id").value(disputeId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -276,7 +279,8 @@ private ApiCall prepareListDisputeEvi .templateParam(param -> param.key("dispute_id").value(disputeId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -353,7 +357,8 @@ private ApiCall prepareCreateDi .templateParam(param -> param.key("dispute_id").value(disputeId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -417,7 +422,8 @@ private ApiCall prepareCreateDi .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -479,7 +485,8 @@ private ApiCall prepareDeleteDisput .templateParam(param -> param.key("evidence_id").value(evidenceId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -543,7 +550,8 @@ private ApiCall prepareRetrieveDi .templateParam(param -> param.key("evidence_id").value(evidenceId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -606,7 +614,8 @@ private ApiCall prepareSubmitEvidenceReque .templateParam(param -> param.key("dispute_id").value(disputeId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultEmployeesApi.java b/src/main/java/com/squareup/square/api/DefaultEmployeesApi.java index 16dcac97..8b4e5180 100644 --- a/src/main/java/com/squareup/square/api/DefaultEmployeesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultEmployeesApi.java @@ -93,7 +93,8 @@ private ApiCall prepareListEmployeesRequest .queryParam(param -> param.key("cursor") .value(cursor).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -148,7 +149,8 @@ private ApiCall prepareRetrieveEmployeeR .templateParam(param -> param.key("id").value(id) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultGiftCardActivitiesApi.java b/src/main/java/com/squareup/square/api/DefaultGiftCardActivitiesApi.java index ad9ff99a..768abad7 100644 --- a/src/main/java/com/squareup/square/api/DefaultGiftCardActivitiesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultGiftCardActivitiesApi.java @@ -161,7 +161,8 @@ private ApiCall prepareListGiftCar .queryParam(param -> param.key("sort_order") .value(sortOrder).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -220,7 +221,8 @@ private ApiCall prepareCreateGiftC .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultGiftCardsApi.java b/src/main/java/com/squareup/square/api/DefaultGiftCardsApi.java index 2305ce0d..0a4d2c07 100644 --- a/src/main/java/com/squareup/square/api/DefaultGiftCardsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultGiftCardsApi.java @@ -131,7 +131,8 @@ private ApiCall prepareListGiftCardsRequest .queryParam(param -> param.key("customer_id") .value(customerId).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -192,7 +193,8 @@ private ApiCall prepareCreateGiftCardReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -247,7 +249,8 @@ private ApiCall prepareRetrieveGi .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -302,7 +305,8 @@ private ApiCall prepareRetrieve .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -364,7 +368,8 @@ private ApiCall prepareLinkCustome .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -426,7 +431,8 @@ private ApiCall prepareUnlinkC .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -477,7 +483,8 @@ private ApiCall prepareRetrieveGiftCardR .templateParam(param -> param.key("id").value(id) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultInventoryApi.java b/src/main/java/com/squareup/square/api/DefaultInventoryApi.java index 5c689b3b..fc639eca 100644 --- a/src/main/java/com/squareup/square/api/DefaultInventoryApi.java +++ b/src/main/java/com/squareup/square/api/DefaultInventoryApi.java @@ -88,7 +88,8 @@ private ApiCall prepareDeprec .templateParam(param -> param.key("adjustment_id").value(adjustmentId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -143,7 +144,8 @@ private ApiCall prepareRetrie .templateParam(param -> param.key("adjustment_id").value(adjustmentId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -206,7 +208,8 @@ private ApiCall prepareDeprecatedBat .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -271,7 +274,8 @@ private ApiCall prepareDepr .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -336,7 +340,8 @@ private ApiCall prepareDepre .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -395,7 +400,8 @@ private ApiCall prepareBatchChangeIn .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -456,7 +462,8 @@ private ApiCall prepareBatc .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -521,7 +528,8 @@ private ApiCall prepareBatch .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -584,7 +592,8 @@ private ApiCall prepareDep .templateParam(param -> param.key("physical_count_id").value(physicalCountId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -639,7 +648,8 @@ private ApiCall prepareRet .templateParam(param -> param.key("physical_count_id").value(physicalCountId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -692,7 +702,8 @@ private ApiCall prepareRetrieve .templateParam(param -> param.key("transfer_id").value(transferId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -774,7 +785,8 @@ private ApiCall prepareRetrieveInv .templateParam(param -> param.key("catalog_object_id").value(catalogObjectId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -875,7 +887,8 @@ private ApiCall prepareRetrieveI .templateParam(param -> param.key("catalog_object_id").value(catalogObjectId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultInvoicesApi.java b/src/main/java/com/squareup/square/api/DefaultInvoicesApi.java index efe9db4e..cfc3bf3f 100644 --- a/src/main/java/com/squareup/square/api/DefaultInvoicesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultInvoicesApi.java @@ -109,7 +109,8 @@ private ApiCall prepareListInvoicesRequest( .queryParam(param -> param.key("limit") .value(limit).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -170,7 +171,8 @@ private ApiCall prepareCreateInvoiceRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -233,7 +235,8 @@ private ApiCall prepareSearchInvoicesReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -301,7 +304,8 @@ private ApiCall prepareDeleteInvoiceRequest .templateParam(param -> param.key("invoice_id").value(invoiceId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -352,7 +356,8 @@ private ApiCall prepareGetInvoiceRequest( .templateParam(param -> param.key("invoice_id").value(invoiceId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -424,7 +429,8 @@ private ApiCall prepareUpdateInvoiceRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -507,7 +513,8 @@ private ApiCall prepareCreateInvo .templateParam(param -> param.key("invoice_id").value(invoiceId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -571,7 +578,8 @@ private ApiCall prepareDeleteInvo .templateParam(param -> param.key("attachment_id").value(attachmentId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -637,7 +645,8 @@ private ApiCall prepareCancelInvoiceRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -655,8 +664,10 @@ private ApiCall prepareCancelInvoiceRequest * address, charges the customer's card on file, or does nothing. Square also makes the invoice * available on a Square-hosted invoice page. The invoice `status` also changes from `DRAFT` to * a status based on the invoice configuration. For example, the status changes to `UNPAID` if - * Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion - * of the invoice amount. + * Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion + * of the invoice amount. In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` + * permissions, `CUSTOMERS_READ` and `PAYMENTS_WRITE` are required when publishing invoices + * configured for card-on-file payments. * @param invoiceId Required parameter: The ID of the invoice to publish. * @param body Required parameter: An object containing the fields to POST for the request. * See the corresponding object definition for field details. @@ -676,8 +687,10 @@ public PublishInvoiceResponse publishInvoice( * address, charges the customer's card on file, or does nothing. Square also makes the invoice * available on a Square-hosted invoice page. The invoice `status` also changes from `DRAFT` to * a status based on the invoice configuration. For example, the status changes to `UNPAID` if - * Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion - * of the invoice amount. + * Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion + * of the invoice amount. In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` + * permissions, `CUSTOMERS_READ` and `PAYMENTS_WRITE` are required when publishing invoices + * configured for card-on-file payments. * @param invoiceId Required parameter: The ID of the invoice to publish. * @param body Required parameter: An object containing the fields to POST for the request. * See the corresponding object definition for field details. @@ -711,7 +724,8 @@ private ApiCall preparePublishInvoiceReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultLaborApi.java b/src/main/java/com/squareup/square/api/DefaultLaborApi.java index 2ec0cfec..08f3ef5c 100644 --- a/src/main/java/com/squareup/square/api/DefaultLaborApi.java +++ b/src/main/java/com/squareup/square/api/DefaultLaborApi.java @@ -107,7 +107,8 @@ private ApiCall prepareListBreakTypesReque .queryParam(param -> param.key("cursor") .value(cursor).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -170,7 +171,8 @@ private ApiCall prepareCreateBreakTypeReq .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -223,7 +225,8 @@ private ApiCall prepareDeleteBreakTypeReq .templateParam(param -> param.key("id").value(id) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -274,7 +277,8 @@ private ApiCall prepareGetBreakTypeRequest( .templateParam(param -> param.key("id").value(id) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -336,7 +340,8 @@ private ApiCall prepareUpdateBreakTypeReq .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -413,7 +418,8 @@ private ApiCall prepareListEmployeeWage .queryParam(param -> param.key("cursor") .value(cursor).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -470,7 +476,8 @@ private ApiCall prepareGetEmployeeWageReq .templateParam(param -> param.key("id").value(id) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -539,7 +546,8 @@ private ApiCall prepareCreateShiftRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -600,7 +608,8 @@ private ApiCall prepareSearchShiftsRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -651,7 +660,8 @@ private ApiCall prepareDeleteShiftRequest( .templateParam(param -> param.key("id").value(id) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -702,7 +712,8 @@ private ApiCall prepareGetShiftRequest( .templateParam(param -> param.key("id").value(id) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -770,7 +781,8 @@ private ApiCall prepareUpdateShiftRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -841,7 +853,8 @@ private ApiCall prepareListTeamMember .queryParam(param -> param.key("cursor") .value(cursor).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -892,7 +905,8 @@ private ApiCall prepareGetTeamMemberWag .templateParam(param -> param.key("id").value(id) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -954,7 +968,8 @@ private ApiCall prepareListWorkweekCo .queryParam(param -> param.key("cursor") .value(cursor).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1016,7 +1031,8 @@ private ApiCall prepareUpdateWorkwee .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultLocationCustomAttributesApi.java b/src/main/java/com/squareup/square/api/DefaultLocationCustomAttributesApi.java index b8c7d1b1..ce0ab967 100644 --- a/src/main/java/com/squareup/square/api/DefaultLocationCustomAttributesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultLocationCustomAttributesApi.java @@ -121,7 +121,8 @@ private ApiCall pr .queryParam(param -> param.key("cursor") .value(cursor).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -188,7 +189,8 @@ private ApiCall p .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -245,7 +247,8 @@ private ApiCall p .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -321,7 +324,8 @@ private ApiCall .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -389,7 +393,8 @@ private ApiCall p .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -448,7 +453,8 @@ private ApiCall prepar .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -523,7 +529,8 @@ private ApiCall prepar .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -636,7 +643,8 @@ private ApiCall prepareListL .templateParam(param -> param.key("location_id").value(locationId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -702,7 +710,8 @@ private ApiCall prepareDele .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -802,7 +811,8 @@ private ApiCall prepareRe .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -887,7 +897,8 @@ private ApiCall prepareUpse .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultLocationsApi.java b/src/main/java/com/squareup/square/api/DefaultLocationsApi.java index 83a88cf8..c6a011c7 100644 --- a/src/main/java/com/squareup/square/api/DefaultLocationsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultLocationsApi.java @@ -35,7 +35,7 @@ public DefaultLocationsApi(GlobalConfiguration globalConfig) { /** * Provides details about all of the seller's * [locations](https://developer.squareup.com/docs/locations-api), including those with an - * inactive status. + * inactive status. Locations are listed alphabetically by `name`. * @return Returns the ListLocationsResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. @@ -47,7 +47,7 @@ public ListLocationsResponse listLocations() throws ApiException, IOException { /** * Provides details about all of the seller's * [locations](https://developer.squareup.com/docs/locations-api), including those with an - * inactive status. + * inactive status. Locations are listed alphabetically by `name`. * @return Returns the ListLocationsResponse response from the API call */ public CompletableFuture listLocationsAsync() { @@ -68,7 +68,8 @@ private ApiCall prepareListLocationsRequest .server(Server.ENUM_DEFAULT.value()) .path("/v2/locations") .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -133,7 +134,8 @@ private ApiCall prepareCreateLocationReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -190,7 +192,8 @@ private ApiCall prepareRetrieveLocationR .templateParam(param -> param.key("location_id").value(locationId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -252,7 +255,8 @@ private ApiCall prepareUpdateLocationReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultLoyaltyApi.java b/src/main/java/com/squareup/square/api/DefaultLoyaltyApi.java index 0ea10f82..eb11fa57 100644 --- a/src/main/java/com/squareup/square/api/DefaultLoyaltyApi.java +++ b/src/main/java/com/squareup/square/api/DefaultLoyaltyApi.java @@ -99,7 +99,8 @@ private ApiCall prepareCreateLoyalty .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -160,7 +161,8 @@ private ApiCall prepareSearchLoyalt .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -213,7 +215,8 @@ private ApiCall prepareRetrieveLoy .templateParam(param -> param.key("account_id").value(accountId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -303,7 +306,8 @@ private ApiCall prepareAccumulate .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -373,7 +377,8 @@ private ApiCall prepareAdjustLoyaltyP .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -436,7 +441,8 @@ private ApiCall prepareSearchLoyaltyE .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -498,7 +504,8 @@ private ApiCall prepareListLoyaltyPro .server(Server.ENUM_DEFAULT.value()) .path("/v2/loyalty/programs") .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -561,7 +568,8 @@ private ApiCall prepareRetrieveLoy .templateParam(param -> param.key("program_id").value(programId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -651,7 +659,8 @@ private ApiCall prepareCalculateLo .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -747,7 +756,8 @@ private ApiCall prepareListLoyaltyP .templateParam(param -> param.key("program_id").value(programId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -823,7 +833,8 @@ private ApiCall prepareCreateLoyal .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -889,7 +900,8 @@ private ApiCall prepareRetrieveL .templateParam(param -> param.key("program_id").value(programId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -961,7 +973,8 @@ private ApiCall prepareCancelLoyal .templateParam(param -> param.key("program_id").value(programId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1024,7 +1037,8 @@ private ApiCall prepareCreateLoyaltyR .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1087,7 +1101,8 @@ private ApiCall prepareSearchLoyalty .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1148,7 +1163,8 @@ private ApiCall prepareDeleteLoyaltyR .templateParam(param -> param.key("reward_id").value(rewardId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1201,7 +1217,8 @@ private ApiCall prepareRetrieveLoya .templateParam(param -> param.key("reward_id").value(rewardId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1273,7 +1290,8 @@ private ApiCall prepareRedeemLoyaltyR .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultMerchantCustomAttributesApi.java b/src/main/java/com/squareup/square/api/DefaultMerchantCustomAttributesApi.java index 8d3ab6c7..8f4b6af9 100644 --- a/src/main/java/com/squareup/square/api/DefaultMerchantCustomAttributesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultMerchantCustomAttributesApi.java @@ -121,7 +121,8 @@ private ApiCall pr .queryParam(param -> param.key("cursor") .value(cursor).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -190,7 +191,8 @@ private ApiCall p .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -247,7 +249,8 @@ private ApiCall p .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -323,7 +326,8 @@ private ApiCall .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -391,7 +395,8 @@ private ApiCall p .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -450,7 +455,8 @@ private ApiCall prepar .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -525,7 +531,8 @@ private ApiCall prepar .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -638,7 +645,8 @@ private ApiCall prepareListM .templateParam(param -> param.key("merchant_id").value(merchantId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -704,7 +712,8 @@ private ApiCall prepareDele .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -804,7 +813,8 @@ private ApiCall prepareRe .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -889,7 +899,8 @@ private ApiCall prepareUpse .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultMerchantsApi.java b/src/main/java/com/squareup/square/api/DefaultMerchantsApi.java index e17d6431..3e535852 100644 --- a/src/main/java/com/squareup/square/api/DefaultMerchantsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultMerchantsApi.java @@ -78,7 +78,8 @@ private ApiCall prepareListMerchantsRequest .queryParam(param -> param.key("cursor") .value(cursor).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -133,7 +134,8 @@ private ApiCall prepareRetrieveMerchantR .templateParam(param -> param.key("merchant_id").value(merchantId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultMobileAuthorizationApi.java b/src/main/java/com/squareup/square/api/DefaultMobileAuthorizationApi.java index e8499a9a..b0fbf856 100644 --- a/src/main/java/com/squareup/square/api/DefaultMobileAuthorizationApi.java +++ b/src/main/java/com/squareup/square/api/DefaultMobileAuthorizationApi.java @@ -81,7 +81,8 @@ private ApiCall prepareCrea .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultOrderCustomAttributesApi.java b/src/main/java/com/squareup/square/api/DefaultOrderCustomAttributesApi.java index 41521caf..3152c46f 100644 --- a/src/main/java/com/squareup/square/api/DefaultOrderCustomAttributesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultOrderCustomAttributesApi.java @@ -123,7 +123,8 @@ private ApiCall prepa .queryParam(param -> param.key("limit") .value(limit).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -182,7 +183,8 @@ private ApiCall prep .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -235,7 +237,8 @@ private ApiCall prep .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -307,7 +310,8 @@ private ApiCall pr .templateParam(param -> param.key("key").value(key) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -373,7 +377,8 @@ private ApiCall prep .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -450,7 +455,8 @@ private ApiCall prepareBu .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -527,7 +533,8 @@ private ApiCall prepareBu .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -640,7 +647,8 @@ private ApiCall prepareListOrde .templateParam(param -> param.key("order_id").value(orderId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -706,7 +714,8 @@ private ApiCall prepareDeleteO .templateParam(param -> param.key("custom_attribute_key").value(customAttributeKey) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -806,7 +815,8 @@ private ApiCall prepareRetri .templateParam(param -> param.key("custom_attribute_key").value(customAttributeKey) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -893,7 +903,8 @@ private ApiCall prepareUpsertO .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultOrdersApi.java b/src/main/java/com/squareup/square/api/DefaultOrdersApi.java index b2dbb23a..658d20d5 100644 --- a/src/main/java/com/squareup/square/api/DefaultOrdersApi.java +++ b/src/main/java/com/squareup/square/api/DefaultOrdersApi.java @@ -90,7 +90,8 @@ private ApiCall prepareCreateOrderRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -147,7 +148,8 @@ private ApiCall prepareBatchRetrieveO .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -202,7 +204,8 @@ private ApiCall prepareCalculateOrderReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -261,7 +264,8 @@ private ApiCall prepareCloneOrderRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -334,7 +338,8 @@ private ApiCall prepareSearchOrdersRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -385,7 +390,8 @@ private ApiCall prepareRetrieveOrderRequest .templateParam(param -> param.key("order_id").value(orderId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -465,7 +471,8 @@ private ApiCall prepareUpdateOrderRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -543,7 +550,8 @@ private ApiCall preparePayOrderRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultPaymentsApi.java b/src/main/java/com/squareup/square/api/DefaultPaymentsApi.java index aacd64f3..cef0bd71 100644 --- a/src/main/java/com/squareup/square/api/DefaultPaymentsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultPaymentsApi.java @@ -166,7 +166,8 @@ private ApiCall prepareListPaymentsRequest( .queryParam(param -> param.key("limit") .value(limit).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -227,7 +228,8 @@ private ApiCall prepareCreatePaymentRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -296,7 +298,8 @@ private ApiCall prepareCanc .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -347,7 +350,8 @@ private ApiCall prepareGetPaymentRequest( .templateParam(param -> param.key("payment_id").value(paymentId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -411,7 +415,8 @@ private ApiCall prepareUpdatePaymentRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -464,7 +469,8 @@ private ApiCall prepareCancelPaymentRequest .templateParam(param -> param.key("payment_id").value(paymentId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -528,7 +534,8 @@ private ApiCall prepareCompletePaymentReq .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultPayoutsApi.java b/src/main/java/com/squareup/square/api/DefaultPayoutsApi.java index 96d17bd6..8ac6bd45 100644 --- a/src/main/java/com/squareup/square/api/DefaultPayoutsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultPayoutsApi.java @@ -143,7 +143,8 @@ private ApiCall prepareListPayoutsRequest( .queryParam(param -> param.key("limit") .value(limit).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -196,7 +197,8 @@ private ApiCall prepareGetPayoutRequest( .templateParam(param -> param.key("payout_id").value(payoutId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -288,7 +290,8 @@ private ApiCall prepareListPayoutEntrie .templateParam(param -> param.key("payout_id").value(payoutId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultRefundsApi.java b/src/main/java/com/squareup/square/api/DefaultRefundsApi.java index 7ad5ccb8..656b6419 100644 --- a/src/main/java/com/squareup/square/api/DefaultRefundsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultRefundsApi.java @@ -166,7 +166,8 @@ private ApiCall prepareListPaymentRefu .queryParam(param -> param.key("limit") .value(limit).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -227,7 +228,8 @@ private ApiCall prepareRefundPaymentRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -278,7 +280,8 @@ private ApiCall prepareGetPaymentRefundR .templateParam(param -> param.key("refund_id").value(refundId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultSitesApi.java b/src/main/java/com/squareup/square/api/DefaultSitesApi.java index d8042611..f54ea910 100644 --- a/src/main/java/com/squareup/square/api/DefaultSitesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultSitesApi.java @@ -64,7 +64,8 @@ private ApiCall prepareListSitesRequest() throw .server(Server.ENUM_DEFAULT.value()) .path("/v2/sites") .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultSnippetsApi.java b/src/main/java/com/squareup/square/api/DefaultSnippetsApi.java index 173c42fb..d4ddec02 100644 --- a/src/main/java/com/squareup/square/api/DefaultSnippetsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultSnippetsApi.java @@ -77,7 +77,8 @@ private ApiCall prepareDeleteSnippetRequest .templateParam(param -> param.key("site_id").value(siteId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -138,7 +139,8 @@ private ApiCall prepareRetrieveSnippetReq .templateParam(param -> param.key("site_id").value(siteId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -214,7 +216,8 @@ private ApiCall prepareUpsertSnippetRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultSubscriptionsApi.java b/src/main/java/com/squareup/square/api/DefaultSubscriptionsApi.java index f821f37b..74202ea4 100644 --- a/src/main/java/com/squareup/square/api/DefaultSubscriptionsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultSubscriptionsApi.java @@ -99,7 +99,8 @@ private ApiCall prepareCreateSubscript .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -158,7 +159,8 @@ private ApiCall prepareBulkSwapPlanRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -225,7 +227,8 @@ private ApiCall prepareSearchSubscrip .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -287,7 +290,8 @@ private ApiCall prepareRetrieveSubsc .templateParam(param -> param.key("subscription_id").value(subscriptionId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -351,7 +355,8 @@ private ApiCall prepareUpdateSubscript .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -411,7 +416,8 @@ private ApiCall prepareDeleteSub .templateParam(param -> param.key("action_id").value(actionId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -479,7 +485,8 @@ private ApiCall prepareChangeBill .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -534,7 +541,8 @@ private ApiCall prepareCancelSubscript .templateParam(param -> param.key("subscription_id").value(subscriptionId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -613,7 +621,8 @@ private ApiCall prepareListSubscri .templateParam(param -> param.key("subscription_id").value(subscriptionId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -675,7 +684,8 @@ private ApiCall preparePauseSubscriptio .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -737,7 +747,8 @@ private ApiCall prepareResumeSubscript .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -805,7 +816,8 @@ private ApiCall prepareSwapPlanRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultTeamApi.java b/src/main/java/com/squareup/square/api/DefaultTeamApi.java index 0221b25d..9601a543 100644 --- a/src/main/java/com/squareup/square/api/DefaultTeamApi.java +++ b/src/main/java/com/squareup/square/api/DefaultTeamApi.java @@ -89,7 +89,8 @@ private ApiCall prepareCreateTeamMemberR .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -154,7 +155,8 @@ private ApiCall prepareBulkCreateTe .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -219,7 +221,8 @@ private ApiCall prepareBulkUpdateTe .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -276,7 +279,8 @@ private ApiCall prepareSearchTeamMember .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -331,7 +335,8 @@ private ApiCall prepareRetrieveTeamMem .templateParam(param -> param.key("team_member_id").value(teamMemberId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -397,7 +402,8 @@ private ApiCall prepareUpdateTeamMemberR .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -454,7 +460,8 @@ private ApiCall prepareRetrieveWageSe .templateParam(param -> param.key("team_member_id").value(teamMemberId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -526,7 +533,8 @@ private ApiCall prepareUpdateWageSettin .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultTerminalApi.java b/src/main/java/com/squareup/square/api/DefaultTerminalApi.java index a36c1f55..574323a4 100644 --- a/src/main/java/com/squareup/square/api/DefaultTerminalApi.java +++ b/src/main/java/com/squareup/square/api/DefaultTerminalApi.java @@ -90,7 +90,8 @@ private ApiCall prepareCreateTermina .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -147,7 +148,8 @@ private ApiCall prepareSearchTermin .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -200,7 +202,8 @@ private ApiCall prepareGetTerminalActio .templateParam(param -> param.key("action_id").value(actionId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -251,7 +254,8 @@ private ApiCall prepareCancelTermina .templateParam(param -> param.key("action_id").value(actionId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -310,7 +314,8 @@ private ApiCall prepareDismissTermi .templateParam(param -> param.key("action_id").value(actionId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -367,7 +372,8 @@ private ApiCall prepareCreateTermi .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -426,7 +432,8 @@ private ApiCall prepareSearchTerm .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -479,7 +486,8 @@ private ApiCall prepareGetTerminalChe .templateParam(param -> param.key("checkout_id").value(checkoutId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -530,7 +538,8 @@ private ApiCall prepareCancelTermi .templateParam(param -> param.key("checkout_id").value(checkoutId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -583,7 +592,8 @@ private ApiCall prepareDismissTer .templateParam(param -> param.key("checkout_id").value(checkoutId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -644,7 +654,8 @@ private ApiCall prepareCreateTermina .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -701,7 +712,8 @@ private ApiCall prepareSearchTermin .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -754,7 +766,8 @@ private ApiCall prepareGetTerminalRefun .templateParam(param -> param.key("terminal_refund_id").value(terminalRefundId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -807,7 +820,8 @@ private ApiCall prepareCancelTermina .templateParam(param -> param.key("terminal_refund_id").value(terminalRefundId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -860,7 +874,8 @@ private ApiCall prepareDismissTermi .templateParam(param -> param.key("terminal_refund_id").value(terminalRefundId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultTransactionsApi.java b/src/main/java/com/squareup/square/api/DefaultTransactionsApi.java index cb6f90cf..5e15515d 100644 --- a/src/main/java/com/squareup/square/api/DefaultTransactionsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultTransactionsApi.java @@ -132,7 +132,8 @@ private ApiCall prepareListTransactionsR .templateParam(param -> param.key("location_id").value(locationId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -196,7 +197,8 @@ private ApiCall prepareRetrieveTransa .templateParam(param -> param.key("transaction_id").value(transactionId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -266,7 +268,8 @@ private ApiCall prepareCaptureTransact .templateParam(param -> param.key("transaction_id").value(transactionId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -336,7 +339,8 @@ private ApiCall prepareVoidTransactionReq .templateParam(param -> param.key("transaction_id").value(transactionId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultV1TransactionsApi.java b/src/main/java/com/squareup/square/api/DefaultV1TransactionsApi.java index 584041e9..45158cff 100644 --- a/src/main/java/com/squareup/square/api/DefaultV1TransactionsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultV1TransactionsApi.java @@ -7,11 +7,7 @@ import com.squareup.square.exceptions.ApiException; import com.squareup.square.http.client.HttpContext; import com.squareup.square.http.request.HttpMethod; -import com.squareup.square.models.V1CreateRefundRequest; import com.squareup.square.models.V1Order; -import com.squareup.square.models.V1Payment; -import com.squareup.square.models.V1Refund; -import com.squareup.square.models.V1Settlement; import com.squareup.square.models.V1UpdateOrderRequest; import io.apimatic.core.ApiCall; import io.apimatic.core.GlobalConfiguration; @@ -105,7 +101,8 @@ private ApiCall, ApiException> prepareV1ListOrdersRequest( .templateParam(param -> param.key("location_id").value(locationId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -179,7 +176,8 @@ private ApiCall prepareV1RetrieveOrderRequest( .templateParam(param -> param.key("order_id").value(orderId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -258,7 +256,8 @@ private ApiCall prepareV1UpdateOrderRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -269,628 +268,4 @@ private ApiCall prepareV1UpdateOrderRequest( .globalErrorCase(GLOBAL_ERROR_CASES)) .build(); } - - /** - * Provides summary information for all payments taken for a given Square account during a date - * range. Date ranges cannot exceed 1 year in length. See Date ranges for details of inclusive - * and exclusive dates. *Note**: Details for payments processed with Square Point of Sale while - * in offline mode may not be transmitted to Square for up to 72 hours. Offline payments have a - * `created_at` value that reflects the time the payment was originally processed, not the time - * it was subsequently transmitted to Square. Consequently, the ListPayments endpoint might list - * an offline payment chronologically between online payments that were seen in a previous - * request. - * @deprecated - * - * @param locationId Required parameter: The ID of the location to list payments for. If you - * specify me, this endpoint returns payments aggregated from all of the business's - * locations. - * @param order Optional parameter: The order in which payments are listed in the response. - * @param beginTime 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. - * @param endTime 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. - * @param limit Optional parameter: The maximum number of payments to return in a single - * response. This value cannot exceed 200. - * @param batchToken Optional parameter: A pagination cursor to retrieve the next set of - * results for your original query to the endpoint. - * @param includePartial Optional parameter: Indicates whether or not to include partial - * payments in the response. Partial payments will have the tenders collected so far, - * but the itemizations will be empty until the payment is completed. - * @return Returns the List of V1Payment response from the API call - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - @Deprecated - public List v1ListPayments( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String batchToken, - final Boolean includePartial) throws ApiException, IOException { - return prepareV1ListPaymentsRequest(locationId, order, beginTime, endTime, limit, - batchToken, includePartial).execute(); - } - - /** - * Provides summary information for all payments taken for a given Square account during a date - * range. Date ranges cannot exceed 1 year in length. See Date ranges for details of inclusive - * and exclusive dates. *Note**: Details for payments processed with Square Point of Sale while - * in offline mode may not be transmitted to Square for up to 72 hours. Offline payments have a - * `created_at` value that reflects the time the payment was originally processed, not the time - * it was subsequently transmitted to Square. Consequently, the ListPayments endpoint might list - * an offline payment chronologically between online payments that were seen in a previous - * request. - * @deprecated - * - * @param locationId Required parameter: The ID of the location to list payments for. If you - * specify me, this endpoint returns payments aggregated from all of the business's - * locations. - * @param order Optional parameter: The order in which payments are listed in the response. - * @param beginTime 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. - * @param endTime 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. - * @param limit Optional parameter: The maximum number of payments to return in a single - * response. This value cannot exceed 200. - * @param batchToken Optional parameter: A pagination cursor to retrieve the next set of - * results for your original query to the endpoint. - * @param includePartial Optional parameter: Indicates whether or not to include partial - * payments in the response. Partial payments will have the tenders collected so far, - * but the itemizations will be empty until the payment is completed. - * @return Returns the List of V1Payment response from the API call - */ - @Deprecated - public CompletableFuture> v1ListPaymentsAsync( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String batchToken, - final Boolean includePartial) { - try { - return prepareV1ListPaymentsRequest(locationId, order, beginTime, endTime, limit, batchToken, - includePartial).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); - } - } - - /** - * Builds the ApiCall object for v1ListPayments. - */ - private ApiCall, ApiException> prepareV1ListPaymentsRequest( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String batchToken, - final Boolean includePartial) throws IOException { - return new ApiCall.Builder, ApiException>() - .globalConfig(getGlobalConfiguration()) - .requestBuilder(requestBuilder -> requestBuilder - .server(Server.ENUM_DEFAULT.value()) - .path("/v1/{location_id}/payments") - .queryParam(param -> param.key("order") - .value(order).isRequired(false)) - .queryParam(param -> param.key("begin_time") - .value(beginTime).isRequired(false)) - .queryParam(param -> param.key("end_time") - .value(endTime).isRequired(false)) - .queryParam(param -> param.key("limit") - .value(limit).isRequired(false)) - .queryParam(param -> param.key("batch_token") - .value(batchToken).isRequired(false)) - .queryParam(param -> param.key("include_partial") - .value((includePartial != null) ? includePartial : false).isRequired(false)) - .templateParam(param -> param.key("location_id").value(locationId) - .shouldEncode(true)) - .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) - .httpMethod(HttpMethod.GET)) - .responseHandler(responseHandler -> responseHandler - .deserializer( - response -> ApiHelper.deserializeArray(response, - V1Payment[].class)) - .nullify404(false) - .contextInitializer((context, result) -> { - for (int i = 0; i < result.size(); i++) { - result.set(i, result.get(i).toBuilder() - .httpContext((HttpContext)context).build()); - } - return result; - }) - .globalErrorCase(GLOBAL_ERROR_CASES)) - .build(); - } - - /** - * Provides comprehensive information for a single payment. - * @deprecated - * - * @param locationId Required parameter: The ID of the payment's associated location. - * @param paymentId 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. - * @return Returns the V1Payment response from the API call - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - @Deprecated - public V1Payment v1RetrievePayment( - final String locationId, - final String paymentId) throws ApiException, IOException { - return prepareV1RetrievePaymentRequest(locationId, paymentId).execute(); - } - - /** - * Provides comprehensive information for a single payment. - * @deprecated - * - * @param locationId Required parameter: The ID of the payment's associated location. - * @param paymentId 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. - * @return Returns the V1Payment response from the API call - */ - @Deprecated - public CompletableFuture v1RetrievePaymentAsync( - final String locationId, - final String paymentId) { - try { - return prepareV1RetrievePaymentRequest(locationId, paymentId).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); - } - } - - /** - * Builds the ApiCall object for v1RetrievePayment. - */ - private ApiCall prepareV1RetrievePaymentRequest( - final String locationId, - final String paymentId) throws IOException { - return new ApiCall.Builder() - .globalConfig(getGlobalConfiguration()) - .requestBuilder(requestBuilder -> requestBuilder - .server(Server.ENUM_DEFAULT.value()) - .path("/v1/{location_id}/payments/{payment_id}") - .templateParam(param -> param.key("location_id").value(locationId) - .shouldEncode(true)) - .templateParam(param -> param.key("payment_id").value(paymentId) - .shouldEncode(true)) - .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) - .httpMethod(HttpMethod.GET)) - .responseHandler(responseHandler -> responseHandler - .deserializer( - response -> ApiHelper.deserialize(response, V1Payment.class)) - .nullify404(false) - .contextInitializer((context, result) -> - result.toBuilder().httpContext((HttpContext)context).build()) - .globalErrorCase(GLOBAL_ERROR_CASES)) - .build(); - } - - /** - * 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. - * @deprecated - * - * @param locationId Required parameter: The ID of the location to list refunds for. - * @param order Optional parameter: The order in which payments are listed in the response. - * @param beginTime 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. - * @param endTime 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. - * @param limit Optional parameter: The approximate number of refunds to return in a single - * response. Default: 100. Max: 200. Response may contain more results than the - * prescribed limit when refunds are made simultaneously to multiple tenders in a - * payment or when refunds are generated in an exchange to account for the value of - * returned goods. - * @param batchToken Optional parameter: A pagination cursor to retrieve the next set of - * results for your original query to the endpoint. - * @return Returns the List of V1Refund response from the API call - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - @Deprecated - public List v1ListRefunds( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String batchToken) throws ApiException, IOException { - return prepareV1ListRefundsRequest(locationId, order, beginTime, endTime, limit, - batchToken).execute(); - } - - /** - * 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. - * @deprecated - * - * @param locationId Required parameter: The ID of the location to list refunds for. - * @param order Optional parameter: The order in which payments are listed in the response. - * @param beginTime 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. - * @param endTime 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. - * @param limit Optional parameter: The approximate number of refunds to return in a single - * response. Default: 100. Max: 200. Response may contain more results than the - * prescribed limit when refunds are made simultaneously to multiple tenders in a - * payment or when refunds are generated in an exchange to account for the value of - * returned goods. - * @param batchToken Optional parameter: A pagination cursor to retrieve the next set of - * results for your original query to the endpoint. - * @return Returns the List of V1Refund response from the API call - */ - @Deprecated - public CompletableFuture> v1ListRefundsAsync( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String batchToken) { - try { - return prepareV1ListRefundsRequest(locationId, order, beginTime, endTime, limit, - batchToken).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); - } - } - - /** - * Builds the ApiCall object for v1ListRefunds. - */ - private ApiCall, ApiException> prepareV1ListRefundsRequest( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String batchToken) throws IOException { - return new ApiCall.Builder, ApiException>() - .globalConfig(getGlobalConfiguration()) - .requestBuilder(requestBuilder -> requestBuilder - .server(Server.ENUM_DEFAULT.value()) - .path("/v1/{location_id}/refunds") - .queryParam(param -> param.key("order") - .value(order).isRequired(false)) - .queryParam(param -> param.key("begin_time") - .value(beginTime).isRequired(false)) - .queryParam(param -> param.key("end_time") - .value(endTime).isRequired(false)) - .queryParam(param -> param.key("limit") - .value(limit).isRequired(false)) - .queryParam(param -> param.key("batch_token") - .value(batchToken).isRequired(false)) - .templateParam(param -> param.key("location_id").value(locationId) - .shouldEncode(true)) - .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) - .httpMethod(HttpMethod.GET)) - .responseHandler(responseHandler -> responseHandler - .deserializer( - response -> ApiHelper.deserializeArray(response, - V1Refund[].class)) - .nullify404(false) - .contextInitializer((context, result) -> { - for (int i = 0; i < result.size(); i++) { - result.set(i, result.get(i).toBuilder() - .httpContext((HttpContext)context).build()); - } - return result; - }) - .globalErrorCase(GLOBAL_ERROR_CASES)) - .build(); - } - - /** - * Issues a refund for a previously processed payment. You must issue a refund within 60 days of - * the associated payment. You cannot issue a partial refund for a split tender payment. You - * must instead issue a full or partial refund for a particular tender, by providing the - * applicable tender id to the V1CreateRefund endpoint. Issuing a full refund for a split tender - * payment refunds all tenders associated with the payment. Issuing a refund for a card payment - * is not reversible. For development purposes, you can create fake cash payments in Square - * Point of Sale and refund them. - * @deprecated - * - * @param locationId Required parameter: The ID of the original payment's associated location. - * @param body Required parameter: An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * @return Returns the V1Refund response from the API call - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - @Deprecated - public V1Refund v1CreateRefund( - final String locationId, - final V1CreateRefundRequest body) throws ApiException, IOException { - return prepareV1CreateRefundRequest(locationId, body).execute(); - } - - /** - * Issues a refund for a previously processed payment. You must issue a refund within 60 days of - * the associated payment. You cannot issue a partial refund for a split tender payment. You - * must instead issue a full or partial refund for a particular tender, by providing the - * applicable tender id to the V1CreateRefund endpoint. Issuing a full refund for a split tender - * payment refunds all tenders associated with the payment. Issuing a refund for a card payment - * is not reversible. For development purposes, you can create fake cash payments in Square - * Point of Sale and refund them. - * @deprecated - * - * @param locationId Required parameter: The ID of the original payment's associated location. - * @param body Required parameter: An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * @return Returns the V1Refund response from the API call - */ - @Deprecated - public CompletableFuture v1CreateRefundAsync( - final String locationId, - final V1CreateRefundRequest body) { - try { - return prepareV1CreateRefundRequest(locationId, body).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); - } - } - - /** - * Builds the ApiCall object for v1CreateRefund. - */ - private ApiCall prepareV1CreateRefundRequest( - final String locationId, - final V1CreateRefundRequest body) throws JsonProcessingException, IOException { - return new ApiCall.Builder() - .globalConfig(getGlobalConfiguration()) - .requestBuilder(requestBuilder -> requestBuilder - .server(Server.ENUM_DEFAULT.value()) - .path("/v1/{location_id}/refunds") - .bodyParam(param -> param.value(body)) - .bodySerializer(() -> ApiHelper.serialize(body)) - .templateParam(param -> param.key("location_id").value(locationId) - .shouldEncode(true)) - .headerParam(param -> param.key("Content-Type") - .value("application/json").isRequired(false)) - .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) - .httpMethod(HttpMethod.POST)) - .responseHandler(responseHandler -> responseHandler - .deserializer( - response -> ApiHelper.deserialize(response, V1Refund.class)) - .nullify404(false) - .contextInitializer((context, result) -> - result.toBuilder().httpContext((HttpContext)context).build()) - .globalErrorCase(GLOBAL_ERROR_CASES)) - .build(); - } - - /** - * Provides summary information for all deposits and withdrawals initiated by Square to a linked - * bank account during a date range. Date ranges cannot exceed one year in length. *Note**: the - * ListSettlements endpoint does not provide entry information. - * @deprecated - * - * @param locationId 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. - * @param order Optional parameter: The order in which settlements are listed in the response. - * @param beginTime 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. - * @param endTime 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. - * @param limit Optional parameter: The maximum number of settlements to return in a single - * response. This value cannot exceed 200. - * @param status Optional parameter: Provide this parameter to retrieve only settlements with - * a particular status (SENT or FAILED). - * @param batchToken Optional parameter: A pagination cursor to retrieve the next set of - * results for your original query to the endpoint. - * @return Returns the List of V1Settlement response from the API call - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - @Deprecated - public List v1ListSettlements( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String status, - final String batchToken) throws ApiException, IOException { - return prepareV1ListSettlementsRequest(locationId, order, beginTime, endTime, limit, status, - batchToken).execute(); - } - - /** - * Provides summary information for all deposits and withdrawals initiated by Square to a linked - * bank account during a date range. Date ranges cannot exceed one year in length. *Note**: the - * ListSettlements endpoint does not provide entry information. - * @deprecated - * - * @param locationId 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. - * @param order Optional parameter: The order in which settlements are listed in the response. - * @param beginTime 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. - * @param endTime 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. - * @param limit Optional parameter: The maximum number of settlements to return in a single - * response. This value cannot exceed 200. - * @param status Optional parameter: Provide this parameter to retrieve only settlements with - * a particular status (SENT or FAILED). - * @param batchToken Optional parameter: A pagination cursor to retrieve the next set of - * results for your original query to the endpoint. - * @return Returns the List of V1Settlement response from the API call - */ - @Deprecated - public CompletableFuture> v1ListSettlementsAsync( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String status, - final String batchToken) { - try { - return prepareV1ListSettlementsRequest(locationId, order, beginTime, endTime, limit, status, - batchToken).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); - } - } - - /** - * Builds the ApiCall object for v1ListSettlements. - */ - private ApiCall, ApiException> prepareV1ListSettlementsRequest( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String status, - final String batchToken) throws IOException { - return new ApiCall.Builder, ApiException>() - .globalConfig(getGlobalConfiguration()) - .requestBuilder(requestBuilder -> requestBuilder - .server(Server.ENUM_DEFAULT.value()) - .path("/v1/{location_id}/settlements") - .queryParam(param -> param.key("order") - .value(order).isRequired(false)) - .queryParam(param -> param.key("begin_time") - .value(beginTime).isRequired(false)) - .queryParam(param -> param.key("end_time") - .value(endTime).isRequired(false)) - .queryParam(param -> param.key("limit") - .value(limit).isRequired(false)) - .queryParam(param -> param.key("status") - .value(status).isRequired(false)) - .queryParam(param -> param.key("batch_token") - .value(batchToken).isRequired(false)) - .templateParam(param -> param.key("location_id").value(locationId) - .shouldEncode(true)) - .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) - .httpMethod(HttpMethod.GET)) - .responseHandler(responseHandler -> responseHandler - .deserializer( - response -> ApiHelper.deserializeArray(response, - V1Settlement[].class)) - .nullify404(false) - .contextInitializer((context, result) -> { - for (int i = 0; i < result.size(); i++) { - result.set(i, result.get(i).toBuilder() - .httpContext((HttpContext)context).build()); - } - return result; - }) - .globalErrorCase(GLOBAL_ERROR_CASES)) - .build(); - } - - /** - * Provides comprehensive information for a single settlement. The returned `Settlement` objects - * include an `entries` field that lists the transactions that contribute to the settlement - * total. Most settlement entries correspond to a payment payout, but settlement entries are - * also generated for less common events, like refunds, manual adjustments, or chargeback holds. - * Square initiates its regular deposits as indicated in the [Deposit Options with - * Square](https://squareup.com/help/us/en/article/3807) help article. Details for a regular - * deposit are usually not available from Connect API endpoints before 10 p.m. PST the same day. - * Square does not know when an initiated settlement **completes**, only whether it has failed. - * A completed settlement is typically reflected in a bank account within 3 business days, but - * in exceptional cases it may take longer. - * @deprecated - * - * @param locationId Required parameter: The ID of the settlements's associated location. - * @param settlementId Required parameter: The settlement's Square-issued ID. You obtain this - * value from Settlement objects returned by the List Settlements endpoint. - * @return Returns the V1Settlement response from the API call - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - @Deprecated - public V1Settlement v1RetrieveSettlement( - final String locationId, - final String settlementId) throws ApiException, IOException { - return prepareV1RetrieveSettlementRequest(locationId, settlementId).execute(); - } - - /** - * Provides comprehensive information for a single settlement. The returned `Settlement` objects - * include an `entries` field that lists the transactions that contribute to the settlement - * total. Most settlement entries correspond to a payment payout, but settlement entries are - * also generated for less common events, like refunds, manual adjustments, or chargeback holds. - * Square initiates its regular deposits as indicated in the [Deposit Options with - * Square](https://squareup.com/help/us/en/article/3807) help article. Details for a regular - * deposit are usually not available from Connect API endpoints before 10 p.m. PST the same day. - * Square does not know when an initiated settlement **completes**, only whether it has failed. - * A completed settlement is typically reflected in a bank account within 3 business days, but - * in exceptional cases it may take longer. - * @deprecated - * - * @param locationId Required parameter: The ID of the settlements's associated location. - * @param settlementId Required parameter: The settlement's Square-issued ID. You obtain this - * value from Settlement objects returned by the List Settlements endpoint. - * @return Returns the V1Settlement response from the API call - */ - @Deprecated - public CompletableFuture v1RetrieveSettlementAsync( - final String locationId, - final String settlementId) { - try { - return prepareV1RetrieveSettlementRequest(locationId, settlementId).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); - } - } - - /** - * Builds the ApiCall object for v1RetrieveSettlement. - */ - private ApiCall prepareV1RetrieveSettlementRequest( - final String locationId, - final String settlementId) throws IOException { - return new ApiCall.Builder() - .globalConfig(getGlobalConfiguration()) - .requestBuilder(requestBuilder -> requestBuilder - .server(Server.ENUM_DEFAULT.value()) - .path("/v1/{location_id}/settlements/{settlement_id}") - .templateParam(param -> param.key("location_id").value(locationId) - .shouldEncode(true)) - .templateParam(param -> param.key("settlement_id").value(settlementId) - .shouldEncode(true)) - .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) - .httpMethod(HttpMethod.GET)) - .responseHandler(responseHandler -> responseHandler - .deserializer( - response -> ApiHelper.deserialize(response, V1Settlement.class)) - .nullify404(false) - .contextInitializer((context, result) -> - result.toBuilder().httpContext((HttpContext)context).build()) - .globalErrorCase(GLOBAL_ERROR_CASES)) - .build(); - } } \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/DefaultVendorsApi.java b/src/main/java/com/squareup/square/api/DefaultVendorsApi.java index 36d2c50e..873a4fab 100644 --- a/src/main/java/com/squareup/square/api/DefaultVendorsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultVendorsApi.java @@ -82,7 +82,8 @@ private ApiCall prepareBulkCreateVendor .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -137,7 +138,8 @@ private ApiCall prepareBulkRetrieveVe .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -192,7 +194,8 @@ private ApiCall prepareBulkUpdateVendor .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -247,7 +250,8 @@ private ApiCall prepareCreateVendorRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -304,7 +308,8 @@ private ApiCall prepareSearchVendorsRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -355,7 +360,8 @@ private ApiCall prepareRetrieveVendorReque .templateParam(param -> param.key("vendor_id").value(vendorId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -417,7 +423,8 @@ private ApiCall prepareUpdateVendorRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultWebhookSubscriptionsApi.java b/src/main/java/com/squareup/square/api/DefaultWebhookSubscriptionsApi.java index 9835dcbd..7f1d1733 100644 --- a/src/main/java/com/squareup/square/api/DefaultWebhookSubscriptionsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultWebhookSubscriptionsApi.java @@ -79,7 +79,8 @@ private ApiCall prepareListWebhookE .queryParam(param -> param.key("api_version") .value(apiVersion).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -171,7 +172,8 @@ private ApiCall prepareListWebho .queryParam(param -> param.key("limit") .value(limit).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -226,7 +228,8 @@ private ApiCall prepareCreateWe .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -279,7 +282,8 @@ private ApiCall prepareDeleteWe .templateParam(param -> param.key("subscription_id").value(subscriptionId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -332,7 +336,8 @@ private ApiCall prepareRetrie .templateParam(param -> param.key("subscription_id").value(subscriptionId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -396,7 +401,8 @@ private ApiCall prepareUpdateWe .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -460,7 +466,8 @@ private ApiCall pre .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -524,7 +531,8 @@ private ApiCall prepareTestWebhoo .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseApi.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/InvoicesApi.java b/src/main/java/com/squareup/square/api/InvoicesApi.java index d280f699..54d2f065 100644 --- a/src/main/java/com/squareup/square/api/InvoicesApi.java +++ b/src/main/java/com/squareup/square/api/InvoicesApi.java @@ -303,8 +303,10 @@ CompletableFuture cancelInvoiceAsync( * address, charges the customer's card on file, or does nothing. Square also makes the invoice * available on a Square-hosted invoice page. The invoice `status` also changes from `DRAFT` to * a status based on the invoice configuration. For example, the status changes to `UNPAID` if - * Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion - * of the invoice amount. + * Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion + * of the invoice amount. In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` + * permissions, `CUSTOMERS_READ` and `PAYMENTS_WRITE` are required when publishing invoices + * configured for card-on-file payments. * @param invoiceId Required parameter: The ID of the invoice to publish. * @param body Required parameter: An object containing the fields to POST for the request. * See the corresponding object definition for field details. @@ -322,8 +324,10 @@ PublishInvoiceResponse publishInvoice( * address, charges the customer's card on file, or does nothing. Square also makes the invoice * available on a Square-hosted invoice page. The invoice `status` also changes from `DRAFT` to * a status based on the invoice configuration. For example, the status changes to `UNPAID` if - * Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion - * of the invoice amount. + * Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion + * of the invoice amount. In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` + * permissions, `CUSTOMERS_READ` and `PAYMENTS_WRITE` are required when publishing invoices + * configured for card-on-file payments. * @param invoiceId Required parameter: The ID of the invoice to publish. * @param body Required parameter: An object containing the fields to POST for the request. * See the corresponding object definition for field details. diff --git a/src/main/java/com/squareup/square/api/LocationsApi.java b/src/main/java/com/squareup/square/api/LocationsApi.java index b1976572..cd8582f6 100644 --- a/src/main/java/com/squareup/square/api/LocationsApi.java +++ b/src/main/java/com/squareup/square/api/LocationsApi.java @@ -19,7 +19,7 @@ public interface LocationsApi { /** * Provides details about all of the seller's * [locations](https://developer.squareup.com/docs/locations-api), including those with an - * inactive status. + * inactive status. Locations are listed alphabetically by `name`. * @return Returns the ListLocationsResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. @@ -29,7 +29,7 @@ public interface LocationsApi { /** * Provides details about all of the seller's * [locations](https://developer.squareup.com/docs/locations-api), including those with an - * inactive status. + * inactive status. Locations are listed alphabetically by `name`. * @return Returns the ListLocationsResponse response from the API call */ CompletableFuture listLocationsAsync(); diff --git a/src/main/java/com/squareup/square/api/V1TransactionsApi.java b/src/main/java/com/squareup/square/api/V1TransactionsApi.java index 30fa0ecf..d9dc6d45 100644 --- a/src/main/java/com/squareup/square/api/V1TransactionsApi.java +++ b/src/main/java/com/squareup/square/api/V1TransactionsApi.java @@ -2,11 +2,7 @@ package com.squareup.square.api; import com.squareup.square.exceptions.ApiException; -import com.squareup.square.models.V1CreateRefundRequest; import com.squareup.square.models.V1Order; -import com.squareup.square.models.V1Payment; -import com.squareup.square.models.V1Refund; -import com.squareup.square.models.V1Settlement; import com.squareup.square.models.V1UpdateOrderRequest; import java.io.IOException; import java.util.List; @@ -126,338 +122,4 @@ CompletableFuture v1UpdateOrderAsync( final String orderId, final V1UpdateOrderRequest body); - /** - * Provides summary information for all payments taken for a given Square account during a date - * range. Date ranges cannot exceed 1 year in length. See Date ranges for details of inclusive - * and exclusive dates. *Note**: Details for payments processed with Square Point of Sale while - * in offline mode may not be transmitted to Square for up to 72 hours. Offline payments have a - * `created_at` value that reflects the time the payment was originally processed, not the time - * it was subsequently transmitted to Square. Consequently, the ListPayments endpoint might list - * an offline payment chronologically between online payments that were seen in a previous - * request. - * @deprecated - * - * @param locationId Required parameter: The ID of the location to list payments for. If you - * specify me, this endpoint returns payments aggregated from all of the business's - * locations. - * @param order Optional parameter: The order in which payments are listed in the response. - * @param beginTime 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. - * @param endTime 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. - * @param limit Optional parameter: The maximum number of payments to return in a single - * response. This value cannot exceed 200. - * @param batchToken Optional parameter: A pagination cursor to retrieve the next set of - * results for your original query to the endpoint. - * @param includePartial Optional parameter: Indicates whether or not to include partial - * payments in the response. Partial payments will have the tenders collected so far, - * but the itemizations will be empty until the payment is completed. - * @return Returns the List of V1Payment response from the API call - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - @Deprecated List v1ListPayments( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String batchToken, - final Boolean includePartial) throws ApiException, IOException; - - /** - * Provides summary information for all payments taken for a given Square account during a date - * range. Date ranges cannot exceed 1 year in length. See Date ranges for details of inclusive - * and exclusive dates. *Note**: Details for payments processed with Square Point of Sale while - * in offline mode may not be transmitted to Square for up to 72 hours. Offline payments have a - * `created_at` value that reflects the time the payment was originally processed, not the time - * it was subsequently transmitted to Square. Consequently, the ListPayments endpoint might list - * an offline payment chronologically between online payments that were seen in a previous - * request. - * @deprecated - * - * @param locationId Required parameter: The ID of the location to list payments for. If you - * specify me, this endpoint returns payments aggregated from all of the business's - * locations. - * @param order Optional parameter: The order in which payments are listed in the response. - * @param beginTime 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. - * @param endTime 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. - * @param limit Optional parameter: The maximum number of payments to return in a single - * response. This value cannot exceed 200. - * @param batchToken Optional parameter: A pagination cursor to retrieve the next set of - * results for your original query to the endpoint. - * @param includePartial Optional parameter: Indicates whether or not to include partial - * payments in the response. Partial payments will have the tenders collected so far, - * but the itemizations will be empty until the payment is completed. - * @return Returns the List of V1Payment response from the API call - */ - @Deprecated - CompletableFuture> v1ListPaymentsAsync( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String batchToken, - final Boolean includePartial); - - /** - * Provides comprehensive information for a single payment. - * @deprecated - * - * @param locationId Required parameter: The ID of the payment's associated location. - * @param paymentId 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. - * @return Returns the V1Payment response from the API call - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - @Deprecated V1Payment v1RetrievePayment( - final String locationId, - final String paymentId) throws ApiException, IOException; - - /** - * Provides comprehensive information for a single payment. - * @deprecated - * - * @param locationId Required parameter: The ID of the payment's associated location. - * @param paymentId 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. - * @return Returns the V1Payment response from the API call - */ - @Deprecated - CompletableFuture v1RetrievePaymentAsync( - final String locationId, - final String paymentId); - - /** - * 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. - * @deprecated - * - * @param locationId Required parameter: The ID of the location to list refunds for. - * @param order Optional parameter: The order in which payments are listed in the response. - * @param beginTime 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. - * @param endTime 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. - * @param limit Optional parameter: The approximate number of refunds to return in a single - * response. Default: 100. Max: 200. Response may contain more results than the - * prescribed limit when refunds are made simultaneously to multiple tenders in a - * payment or when refunds are generated in an exchange to account for the value of - * returned goods. - * @param batchToken Optional parameter: A pagination cursor to retrieve the next set of - * results for your original query to the endpoint. - * @return Returns the List of V1Refund response from the API call - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - @Deprecated List v1ListRefunds( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String batchToken) throws ApiException, IOException; - - /** - * 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. - * @deprecated - * - * @param locationId Required parameter: The ID of the location to list refunds for. - * @param order Optional parameter: The order in which payments are listed in the response. - * @param beginTime 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. - * @param endTime 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. - * @param limit Optional parameter: The approximate number of refunds to return in a single - * response. Default: 100. Max: 200. Response may contain more results than the - * prescribed limit when refunds are made simultaneously to multiple tenders in a - * payment or when refunds are generated in an exchange to account for the value of - * returned goods. - * @param batchToken Optional parameter: A pagination cursor to retrieve the next set of - * results for your original query to the endpoint. - * @return Returns the List of V1Refund response from the API call - */ - @Deprecated - CompletableFuture> v1ListRefundsAsync( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String batchToken); - - /** - * Issues a refund for a previously processed payment. You must issue a refund within 60 days of - * the associated payment. You cannot issue a partial refund for a split tender payment. You - * must instead issue a full or partial refund for a particular tender, by providing the - * applicable tender id to the V1CreateRefund endpoint. Issuing a full refund for a split tender - * payment refunds all tenders associated with the payment. Issuing a refund for a card payment - * is not reversible. For development purposes, you can create fake cash payments in Square - * Point of Sale and refund them. - * @deprecated - * - * @param locationId Required parameter: The ID of the original payment's associated location. - * @param body Required parameter: An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * @return Returns the V1Refund response from the API call - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - @Deprecated V1Refund v1CreateRefund( - final String locationId, - final V1CreateRefundRequest body) throws ApiException, IOException; - - /** - * Issues a refund for a previously processed payment. You must issue a refund within 60 days of - * the associated payment. You cannot issue a partial refund for a split tender payment. You - * must instead issue a full or partial refund for a particular tender, by providing the - * applicable tender id to the V1CreateRefund endpoint. Issuing a full refund for a split tender - * payment refunds all tenders associated with the payment. Issuing a refund for a card payment - * is not reversible. For development purposes, you can create fake cash payments in Square - * Point of Sale and refund them. - * @deprecated - * - * @param locationId Required parameter: The ID of the original payment's associated location. - * @param body Required parameter: An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * @return Returns the V1Refund response from the API call - */ - @Deprecated - CompletableFuture v1CreateRefundAsync( - final String locationId, - final V1CreateRefundRequest body); - - /** - * Provides summary information for all deposits and withdrawals initiated by Square to a linked - * bank account during a date range. Date ranges cannot exceed one year in length. *Note**: the - * ListSettlements endpoint does not provide entry information. - * @deprecated - * - * @param locationId 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. - * @param order Optional parameter: The order in which settlements are listed in the response. - * @param beginTime 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. - * @param endTime 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. - * @param limit Optional parameter: The maximum number of settlements to return in a single - * response. This value cannot exceed 200. - * @param status Optional parameter: Provide this parameter to retrieve only settlements with - * a particular status (SENT or FAILED). - * @param batchToken Optional parameter: A pagination cursor to retrieve the next set of - * results for your original query to the endpoint. - * @return Returns the List of V1Settlement response from the API call - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - @Deprecated List v1ListSettlements( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String status, - final String batchToken) throws ApiException, IOException; - - /** - * Provides summary information for all deposits and withdrawals initiated by Square to a linked - * bank account during a date range. Date ranges cannot exceed one year in length. *Note**: the - * ListSettlements endpoint does not provide entry information. - * @deprecated - * - * @param locationId 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. - * @param order Optional parameter: The order in which settlements are listed in the response. - * @param beginTime 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. - * @param endTime 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. - * @param limit Optional parameter: The maximum number of settlements to return in a single - * response. This value cannot exceed 200. - * @param status Optional parameter: Provide this parameter to retrieve only settlements with - * a particular status (SENT or FAILED). - * @param batchToken Optional parameter: A pagination cursor to retrieve the next set of - * results for your original query to the endpoint. - * @return Returns the List of V1Settlement response from the API call - */ - @Deprecated - CompletableFuture> v1ListSettlementsAsync( - final String locationId, - final String order, - final String beginTime, - final String endTime, - final Integer limit, - final String status, - final String batchToken); - - /** - * Provides comprehensive information for a single settlement. The returned `Settlement` objects - * include an `entries` field that lists the transactions that contribute to the settlement - * total. Most settlement entries correspond to a payment payout, but settlement entries are - * also generated for less common events, like refunds, manual adjustments, or chargeback holds. - * Square initiates its regular deposits as indicated in the [Deposit Options with - * Square](https://squareup.com/help/us/en/article/3807) help article. Details for a regular - * deposit are usually not available from Connect API endpoints before 10 p.m. PST the same day. - * Square does not know when an initiated settlement **completes**, only whether it has failed. - * A completed settlement is typically reflected in a bank account within 3 business days, but - * in exceptional cases it may take longer. - * @deprecated - * - * @param locationId Required parameter: The ID of the settlements's associated location. - * @param settlementId Required parameter: The settlement's Square-issued ID. You obtain this - * value from Settlement objects returned by the List Settlements endpoint. - * @return Returns the V1Settlement response from the API call - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - @Deprecated V1Settlement v1RetrieveSettlement( - final String locationId, - final String settlementId) throws ApiException, IOException; - - /** - * Provides comprehensive information for a single settlement. The returned `Settlement` objects - * include an `entries` field that lists the transactions that contribute to the settlement - * total. Most settlement entries correspond to a payment payout, but settlement entries are - * also generated for less common events, like refunds, manual adjustments, or chargeback holds. - * Square initiates its regular deposits as indicated in the [Deposit Options with - * Square](https://squareup.com/help/us/en/article/3807) help article. Details for a regular - * deposit are usually not available from Connect API endpoints before 10 p.m. PST the same day. - * Square does not know when an initiated settlement **completes**, only whether it has failed. - * A completed settlement is typically reflected in a bank account within 3 business days, but - * in exceptional cases it may take longer. - * @deprecated - * - * @param locationId Required parameter: The ID of the settlements's associated location. - * @param settlementId Required parameter: The settlement's Square-issued ID. You obtain this - * value from Settlement objects returned by the List Settlements endpoint. - * @return Returns the V1Settlement response from the API call - */ - @Deprecated - CompletableFuture v1RetrieveSettlementAsync( - final String locationId, - final String settlementId); - } \ No newline at end of file diff --git a/src/main/java/com/squareup/square/authentication/BearerAuthManager.java b/src/main/java/com/squareup/square/authentication/BearerAuthManager.java new file mode 100644 index 00000000..e8faf1fc --- /dev/null +++ b/src/main/java/com/squareup/square/authentication/BearerAuthManager.java @@ -0,0 +1,80 @@ + +package com.squareup.square.authentication; + +import com.squareup.square.BearerAuthCredentials; +import io.apimatic.core.authentication.HeaderAuth; +import java.util.Collections; + +/** + * Utility class for authorization and token management. + */ +public class BearerAuthManager extends HeaderAuth implements BearerAuthCredentials { + + /** + * Private instance of the auth model containing the auth credentials. + */ + private BearerAuthModel authModel; + + /** + * Constructor. + * @param authModel The instance of auth credentials. + */ + public BearerAuthManager(BearerAuthModel authModel) { + super(Collections.singletonMap("Authorization", + applyBearerPrefix(authModel.getAccessToken()))); + this.authModel = authModel; + } + + /** + * applies bearer prefix to the access token. + * @param accessToken The actual access token. + * @return The access token with 'Bearer' as prefix. + */ + private static String applyBearerPrefix(String accessToken) { + if (accessToken == null || accessToken == "") { + return null; + } + + return "Bearer " + accessToken; + } + + /** + * String value for accessToken. + * @return accessToken + */ + public String getAccessToken() { + return authModel.getAccessToken(); + } + + /** + * Checks if provided credentials matched with existing ones. + * @param accessToken String value for credentials. + * @return true if credentials matched. + */ + public boolean equals(String accessToken) { + return accessToken.equals(getAccessToken()); + } + + /** + * Converts this BearerAuthManager into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BearerAuthManager [" + "accessToken=" + getAccessToken() + "]"; + } + /** + * Returns the error message if the auth credentials are not valid. + * @return the auth specific error message. + */ + @Override + public String getErrorMessage() { + String errorMessage = super.getErrorMessage(); + if (errorMessage == null) { + return null; + } + + return "BearerAuth - " + errorMessage; + } + +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/authentication/BearerAuthModel.java b/src/main/java/com/squareup/square/authentication/BearerAuthModel.java new file mode 100644 index 00000000..a11e84fa --- /dev/null +++ b/src/main/java/com/squareup/square/authentication/BearerAuthModel.java @@ -0,0 +1,74 @@ + +package com.squareup.square.authentication; + +/** + * A data class for OAuth 2 Bearer token credentials. + */ +public class BearerAuthModel { + private String accessToken; + + /** + * A Constructor for BearerAuthModel. + */ + private BearerAuthModel(String accessToken) { + this.accessToken = accessToken; + } + + /** + * Getter for accessToken. + * @return accessToken The value of AccessToken. + */ + public String getAccessToken() { + return this.accessToken; + } + + /** + * Builds a new {@link BearerAuthModel.Builder} object. + * Creates the instance with the state of the current auth model. + * @return a new {@link BearerAuthModel.Builder} object. + */ + public Builder toBuilder() { + return new Builder(getAccessToken()); + } + + /** + * A Builder class for OAuth 2 Bearer token credentials. + */ + public static class Builder { + private String accessToken; + + /** + * The constructor with required auth credentials. + * @param accessToken The value of AccessToken. + */ + public Builder(String accessToken) { + if (accessToken == null) { + throw new NullPointerException("AccessToken cannot be null."); + } + + this.accessToken = accessToken; + } + + /** + * Setter for accessToken. + * @param accessToken The value of AccessToken. + * @return Builder The current instance of Builder. + */ + public Builder accessToken(String accessToken) { + if (accessToken == null) { + throw new NullPointerException("AccessToken cannot be null."); + } + + this.accessToken = accessToken; + return this; + } + + /** + * Builds the instance of BearerAuthModel using the provided credentials. + * @return The instance of BearerAuthModel. + */ + public BearerAuthModel build() { + return new BearerAuthModel(accessToken); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/squareup/square/models/BulkCreateCustomerData.java b/src/main/java/com/squareup/square/models/BulkCreateCustomerData.java new file mode 100644 index 00000000..ecdeff23 --- /dev/null +++ b/src/main/java/com/squareup/square/models/BulkCreateCustomerData.java @@ -0,0 +1,621 @@ + +package com.squareup.square.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.apimatic.core.types.OptionalNullable; +import java.util.Objects; + +/** + * This is a model class for BulkCreateCustomerData type. + */ +public class BulkCreateCustomerData { + private final OptionalNullable givenName; + private final OptionalNullable familyName; + private final OptionalNullable companyName; + private final OptionalNullable nickname; + private final OptionalNullable emailAddress; + private final Address address; + private final OptionalNullable phoneNumber; + private final OptionalNullable referenceId; + private final OptionalNullable note; + private final OptionalNullable birthday; + private final CustomerTaxIds taxIds; + + /** + * Initialization constructor. + * @param givenName String value for givenName. + * @param familyName String value for familyName. + * @param companyName String value for companyName. + * @param nickname String value for nickname. + * @param emailAddress String value for emailAddress. + * @param address Address value for address. + * @param phoneNumber String value for phoneNumber. + * @param referenceId String value for referenceId. + * @param note String value for note. + * @param birthday String value for birthday. + * @param taxIds CustomerTaxIds value for taxIds. + */ + @JsonCreator + public BulkCreateCustomerData( + @JsonProperty("given_name") String givenName, + @JsonProperty("family_name") String familyName, + @JsonProperty("company_name") String companyName, + @JsonProperty("nickname") String nickname, + @JsonProperty("email_address") String emailAddress, + @JsonProperty("address") Address address, + @JsonProperty("phone_number") String phoneNumber, + @JsonProperty("reference_id") String referenceId, + @JsonProperty("note") String note, + @JsonProperty("birthday") String birthday, + @JsonProperty("tax_ids") CustomerTaxIds taxIds) { + this.givenName = OptionalNullable.of(givenName); + this.familyName = OptionalNullable.of(familyName); + this.companyName = OptionalNullable.of(companyName); + this.nickname = OptionalNullable.of(nickname); + this.emailAddress = OptionalNullable.of(emailAddress); + this.address = address; + this.phoneNumber = OptionalNullable.of(phoneNumber); + this.referenceId = OptionalNullable.of(referenceId); + this.note = OptionalNullable.of(note); + this.birthday = OptionalNullable.of(birthday); + this.taxIds = taxIds; + } + + /** + * Initialization constructor. + * @param givenName String value for givenName. + * @param familyName String value for familyName. + * @param companyName String value for companyName. + * @param nickname String value for nickname. + * @param emailAddress String value for emailAddress. + * @param address Address value for address. + * @param phoneNumber String value for phoneNumber. + * @param referenceId String value for referenceId. + * @param note String value for note. + * @param birthday String value for birthday. + * @param taxIds CustomerTaxIds value for taxIds. + */ + + protected BulkCreateCustomerData(OptionalNullable givenName, + OptionalNullable familyName, OptionalNullable companyName, + OptionalNullable nickname, OptionalNullable emailAddress, + Address address, OptionalNullable phoneNumber, + OptionalNullable referenceId, OptionalNullable note, + OptionalNullable birthday, CustomerTaxIds taxIds) { + this.givenName = givenName; + this.familyName = familyName; + this.companyName = companyName; + this.nickname = nickname; + this.emailAddress = emailAddress; + this.address = address; + this.phoneNumber = phoneNumber; + this.referenceId = referenceId; + this.note = note; + this.birthday = birthday; + this.taxIds = taxIds; + } + + /** + * Internal Getter for GivenName. + * The given name (that is, the first name) associated with the customer profile. + * @return Returns the Internal String + */ + @JsonGetter("given_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetGivenName() { + return this.givenName; + } + + /** + * Getter for GivenName. + * The given name (that is, the first name) associated with the customer profile. + * @return Returns the String + */ + @JsonIgnore + public String getGivenName() { + return OptionalNullable.getFrom(givenName); + } + + /** + * Internal Getter for FamilyName. + * The family name (that is, the last name) associated with the customer profile. + * @return Returns the Internal String + */ + @JsonGetter("family_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetFamilyName() { + return this.familyName; + } + + /** + * Getter for FamilyName. + * The family name (that is, the last name) associated with the customer profile. + * @return Returns the String + */ + @JsonIgnore + public String getFamilyName() { + return OptionalNullable.getFrom(familyName); + } + + /** + * Internal Getter for CompanyName. + * A business name associated with the customer profile. + * @return Returns the Internal String + */ + @JsonGetter("company_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetCompanyName() { + return this.companyName; + } + + /** + * Getter for CompanyName. + * A business name associated with the customer profile. + * @return Returns the String + */ + @JsonIgnore + public String getCompanyName() { + return OptionalNullable.getFrom(companyName); + } + + /** + * Internal Getter for Nickname. + * A nickname for the customer profile. + * @return Returns the Internal String + */ + @JsonGetter("nickname") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetNickname() { + return this.nickname; + } + + /** + * Getter for Nickname. + * A nickname for the customer profile. + * @return Returns the String + */ + @JsonIgnore + public String getNickname() { + return OptionalNullable.getFrom(nickname); + } + + /** + * Internal Getter for EmailAddress. + * The email address associated with the customer profile. + * @return Returns the Internal String + */ + @JsonGetter("email_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetEmailAddress() { + return this.emailAddress; + } + + /** + * Getter for EmailAddress. + * The email address associated with the customer profile. + * @return Returns the String + */ + @JsonIgnore + public String getEmailAddress() { + return OptionalNullable.getFrom(emailAddress); + } + + /** + * Getter for Address. + * Represents a postal address in a country. For more information, see [Working with + * Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + * @return Returns the Address + */ + @JsonGetter("address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Address getAddress() { + return address; + } + + /** + * Internal Getter for PhoneNumber. + * The phone number associated with the customer profile. The phone number must be valid and can + * contain 9–16 digits, with an optional `+` prefix and country code. For more information, see + * [Customer phone + * numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + * @return Returns the Internal String + */ + @JsonGetter("phone_number") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetPhoneNumber() { + return this.phoneNumber; + } + + /** + * Getter for PhoneNumber. + * The phone number associated with the customer profile. The phone number must be valid and can + * contain 9–16 digits, with an optional `+` prefix and country code. For more information, see + * [Customer phone + * numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + * @return Returns the String + */ + @JsonIgnore + public String getPhoneNumber() { + return OptionalNullable.getFrom(phoneNumber); + } + + /** + * Internal Getter for ReferenceId. + * An optional second ID used to associate the customer profile with an entity in another + * system. + * @return Returns the Internal String + */ + @JsonGetter("reference_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetReferenceId() { + return this.referenceId; + } + + /** + * Getter for ReferenceId. + * An optional second ID used to associate the customer profile with an entity in another + * system. + * @return Returns the String + */ + @JsonIgnore + public String getReferenceId() { + return OptionalNullable.getFrom(referenceId); + } + + /** + * Internal Getter for Note. + * A custom note associated with the customer profile. + * @return Returns the Internal String + */ + @JsonGetter("note") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetNote() { + return this.note; + } + + /** + * Getter for Note. + * A custom note associated with the customer profile. + * @return Returns the String + */ + @JsonIgnore + public String getNote() { + return OptionalNullable.getFrom(note); + } + + /** + * Internal Getter for Birthday. + * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For + * example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays + * are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or `0000` if a + * birth year is not specified. + * @return Returns the Internal String + */ + @JsonGetter("birthday") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetBirthday() { + return this.birthday; + } + + /** + * Getter for Birthday. + * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For + * example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays + * are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or `0000` if a + * birth year is not specified. + * @return Returns the String + */ + @JsonIgnore + public String getBirthday() { + return OptionalNullable.getFrom(birthday); + } + + /** + * Getter for TaxIds. + * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding + * `tax_ids` field is available only for customers of sellers in EU countries or the United + * Kingdom. For more information, see [Customer tax + * IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + * @return Returns the CustomerTaxIds + */ + @JsonGetter("tax_ids") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CustomerTaxIds getTaxIds() { + return taxIds; + } + + @Override + public int hashCode() { + return Objects.hash(givenName, familyName, companyName, nickname, emailAddress, address, + phoneNumber, referenceId, note, birthday, taxIds); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof BulkCreateCustomerData)) { + return false; + } + BulkCreateCustomerData other = (BulkCreateCustomerData) obj; + return Objects.equals(givenName, other.givenName) + && Objects.equals(familyName, other.familyName) + && Objects.equals(companyName, other.companyName) + && Objects.equals(nickname, other.nickname) + && Objects.equals(emailAddress, other.emailAddress) + && Objects.equals(address, other.address) + && Objects.equals(phoneNumber, other.phoneNumber) + && Objects.equals(referenceId, other.referenceId) + && Objects.equals(note, other.note) + && Objects.equals(birthday, other.birthday) + && Objects.equals(taxIds, other.taxIds); + } + + /** + * Converts this BulkCreateCustomerData into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BulkCreateCustomerData [" + "givenName=" + givenName + ", familyName=" + familyName + + ", companyName=" + companyName + ", nickname=" + nickname + ", emailAddress=" + + emailAddress + ", address=" + address + ", phoneNumber=" + phoneNumber + + ", referenceId=" + referenceId + ", note=" + note + ", birthday=" + birthday + + ", taxIds=" + taxIds + "]"; + } + + /** + * Builds a new {@link BulkCreateCustomerData.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BulkCreateCustomerData.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .address(getAddress()) + .taxIds(getTaxIds()); + builder.givenName = internalGetGivenName(); + builder.familyName = internalGetFamilyName(); + builder.companyName = internalGetCompanyName(); + builder.nickname = internalGetNickname(); + builder.emailAddress = internalGetEmailAddress(); + builder.phoneNumber = internalGetPhoneNumber(); + builder.referenceId = internalGetReferenceId(); + builder.note = internalGetNote(); + builder.birthday = internalGetBirthday(); + return builder; + } + + /** + * Class to build instances of {@link BulkCreateCustomerData}. + */ + public static class Builder { + private OptionalNullable givenName; + private OptionalNullable familyName; + private OptionalNullable companyName; + private OptionalNullable nickname; + private OptionalNullable emailAddress; + private Address address; + private OptionalNullable phoneNumber; + private OptionalNullable referenceId; + private OptionalNullable note; + private OptionalNullable birthday; + private CustomerTaxIds taxIds; + + + + /** + * Setter for givenName. + * @param givenName String value for givenName. + * @return Builder + */ + public Builder givenName(String givenName) { + this.givenName = OptionalNullable.of(givenName); + return this; + } + + /** + * UnSetter for givenName. + * @return Builder + */ + public Builder unsetGivenName() { + givenName = null; + return this; + } + + /** + * Setter for familyName. + * @param familyName String value for familyName. + * @return Builder + */ + public Builder familyName(String familyName) { + this.familyName = OptionalNullable.of(familyName); + return this; + } + + /** + * UnSetter for familyName. + * @return Builder + */ + public Builder unsetFamilyName() { + familyName = null; + return this; + } + + /** + * Setter for companyName. + * @param companyName String value for companyName. + * @return Builder + */ + public Builder companyName(String companyName) { + this.companyName = OptionalNullable.of(companyName); + return this; + } + + /** + * UnSetter for companyName. + * @return Builder + */ + public Builder unsetCompanyName() { + companyName = null; + return this; + } + + /** + * Setter for nickname. + * @param nickname String value for nickname. + * @return Builder + */ + public Builder nickname(String nickname) { + this.nickname = OptionalNullable.of(nickname); + return this; + } + + /** + * UnSetter for nickname. + * @return Builder + */ + public Builder unsetNickname() { + nickname = null; + return this; + } + + /** + * Setter for emailAddress. + * @param emailAddress String value for emailAddress. + * @return Builder + */ + public Builder emailAddress(String emailAddress) { + this.emailAddress = OptionalNullable.of(emailAddress); + return this; + } + + /** + * UnSetter for emailAddress. + * @return Builder + */ + public Builder unsetEmailAddress() { + emailAddress = null; + return this; + } + + /** + * Setter for address. + * @param address Address value for address. + * @return Builder + */ + public Builder address(Address address) { + this.address = address; + return this; + } + + /** + * Setter for phoneNumber. + * @param phoneNumber String value for phoneNumber. + * @return Builder + */ + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = OptionalNullable.of(phoneNumber); + return this; + } + + /** + * UnSetter for phoneNumber. + * @return Builder + */ + public Builder unsetPhoneNumber() { + phoneNumber = null; + return this; + } + + /** + * Setter for referenceId. + * @param referenceId String value for referenceId. + * @return Builder + */ + public Builder referenceId(String referenceId) { + this.referenceId = OptionalNullable.of(referenceId); + return this; + } + + /** + * UnSetter for referenceId. + * @return Builder + */ + public Builder unsetReferenceId() { + referenceId = null; + return this; + } + + /** + * Setter for note. + * @param note String value for note. + * @return Builder + */ + public Builder note(String note) { + this.note = OptionalNullable.of(note); + return this; + } + + /** + * UnSetter for note. + * @return Builder + */ + public Builder unsetNote() { + note = null; + return this; + } + + /** + * Setter for birthday. + * @param birthday String value for birthday. + * @return Builder + */ + public Builder birthday(String birthday) { + this.birthday = OptionalNullable.of(birthday); + return this; + } + + /** + * UnSetter for birthday. + * @return Builder + */ + public Builder unsetBirthday() { + birthday = null; + return this; + } + + /** + * Setter for taxIds. + * @param taxIds CustomerTaxIds value for taxIds. + * @return Builder + */ + public Builder taxIds(CustomerTaxIds taxIds) { + this.taxIds = taxIds; + return this; + } + + /** + * Builds a new {@link BulkCreateCustomerData} object using the set fields. + * @return {@link BulkCreateCustomerData} + */ + public BulkCreateCustomerData build() { + return new BulkCreateCustomerData(givenName, familyName, companyName, nickname, + emailAddress, address, phoneNumber, referenceId, note, birthday, taxIds); + } + } +} diff --git a/src/main/java/com/squareup/square/models/BulkCreateCustomersRequest.java b/src/main/java/com/squareup/square/models/BulkCreateCustomersRequest.java new file mode 100644 index 00000000..b260ca48 --- /dev/null +++ b/src/main/java/com/squareup/square/models/BulkCreateCustomersRequest.java @@ -0,0 +1,108 @@ + +package com.squareup.square.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.Objects; + +/** + * This is a model class for BulkCreateCustomersRequest type. + */ +public class BulkCreateCustomersRequest { + private final Map customers; + + /** + * Initialization constructor. + * @param customers Map of String, value for customers. + */ + @JsonCreator + public BulkCreateCustomersRequest( + @JsonProperty("customers") Map customers) { + this.customers = customers; + } + + /** + * Getter for Customers. + * A map of 1 to 100 individual create requests, represented by `idempotency key: { customer + * data }` key-value pairs. Each key is an [idempotency + * key](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) that + * uniquely identifies the create request. Each value contains the customer data used to create + * the customer profile. + * @return Returns the Map of String, BulkCreateCustomerData + */ + @JsonGetter("customers") + public Map getCustomers() { + return customers; + } + + @Override + public int hashCode() { + return Objects.hash(customers); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof BulkCreateCustomersRequest)) { + return false; + } + BulkCreateCustomersRequest other = (BulkCreateCustomersRequest) obj; + return Objects.equals(customers, other.customers); + } + + /** + * Converts this BulkCreateCustomersRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BulkCreateCustomersRequest [" + "customers=" + customers + "]"; + } + + /** + * Builds a new {@link BulkCreateCustomersRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BulkCreateCustomersRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(customers); + return builder; + } + + /** + * Class to build instances of {@link BulkCreateCustomersRequest}. + */ + public static class Builder { + private Map customers; + + /** + * Initialization constructor. + * @param customers Map of String, value for customers. + */ + public Builder(Map customers) { + this.customers = customers; + } + + /** + * Setter for customers. + * @param customers Map of String, value for customers. + * @return Builder + */ + public Builder customers(Map customers) { + this.customers = customers; + return this; + } + + /** + * Builds a new {@link BulkCreateCustomersRequest} object using the set fields. + * @return {@link BulkCreateCustomersRequest} + */ + public BulkCreateCustomersRequest build() { + return new BulkCreateCustomersRequest(customers); + } + } +} diff --git a/src/main/java/com/squareup/square/models/BulkCreateCustomersResponse.java b/src/main/java/com/squareup/square/models/BulkCreateCustomersResponse.java new file mode 100644 index 00000000..a422e3cb --- /dev/null +++ b/src/main/java/com/squareup/square/models/BulkCreateCustomersResponse.java @@ -0,0 +1,157 @@ + +package com.squareup.square.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.squareup.square.http.client.HttpContext; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * This is a model class for BulkCreateCustomersResponse type. + */ +public class BulkCreateCustomersResponse { + private HttpContext httpContext; + private final Map responses; + private final List errors; + + /** + * Initialization constructor. + * @param responses Map of String, value for responses. + * @param errors List of Error value for errors. + */ + @JsonCreator + public BulkCreateCustomersResponse( + @JsonProperty("responses") Map responses, + @JsonProperty("errors") List errors) { + this.responses = responses; + this.errors = errors; + } + + @JsonIgnore + public HttpContext getContext() { + return httpContext; + } + + /** + * Getter for Responses. + * A map of responses that correspond to individual create requests, represented by key-value + * pairs. Each key is the idempotency key that was provided for a create request and each value + * is the corresponding response. If the request succeeds, the value is the new customer + * profile. If the request fails, the value contains any errors that occurred during the + * request. + * @return Returns the Map of String, CreateCustomerResponse + */ + @JsonGetter("responses") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Map getResponses() { + return responses; + } + + /** + * Getter for Errors. + * Any top-level errors that prevented the bulk operation from running. + * @return Returns the List of Error + */ + @JsonGetter("errors") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getErrors() { + return errors; + } + + @Override + public int hashCode() { + return Objects.hash(responses, errors); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof BulkCreateCustomersResponse)) { + return false; + } + BulkCreateCustomersResponse other = (BulkCreateCustomersResponse) obj; + return Objects.equals(responses, other.responses) + && Objects.equals(errors, other.errors); + } + + /** + * Converts this BulkCreateCustomersResponse into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BulkCreateCustomersResponse [" + "responses=" + responses + ", errors=" + errors + + "]"; + } + + /** + * Builds a new {@link BulkCreateCustomersResponse.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BulkCreateCustomersResponse.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .responses(getResponses()) + .errors(getErrors()); + return builder; + } + + /** + * Class to build instances of {@link BulkCreateCustomersResponse}. + */ + public static class Builder { + private HttpContext httpContext; + private Map responses; + private List errors; + + + + /** + * Setter for httpContext. + * @param httpContext HttpContext value for httpContext. + * @return Builder + */ + public Builder httpContext(HttpContext httpContext) { + this.httpContext = httpContext; + return this; + } + + /** + * Setter for responses. + * @param responses Map of String, value for responses. + * @return Builder + */ + public Builder responses(Map responses) { + this.responses = responses; + return this; + } + + /** + * Setter for errors. + * @param errors List of Error value for errors. + * @return Builder + */ + public Builder errors(List errors) { + this.errors = errors; + return this; + } + + /** + * Builds a new {@link BulkCreateCustomersResponse} object using the set fields. + * @return {@link BulkCreateCustomersResponse} + */ + public BulkCreateCustomersResponse build() { + BulkCreateCustomersResponse model = + new BulkCreateCustomersResponse(responses, errors); + model.httpContext = httpContext; + return model; + } + } +} diff --git a/src/main/java/com/squareup/square/models/BulkDeleteCustomersRequest.java b/src/main/java/com/squareup/square/models/BulkDeleteCustomersRequest.java new file mode 100644 index 00000000..55067f2f --- /dev/null +++ b/src/main/java/com/squareup/square/models/BulkDeleteCustomersRequest.java @@ -0,0 +1,104 @@ + +package com.squareup.square.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +/** + * This is a model class for BulkDeleteCustomersRequest type. + */ +public class BulkDeleteCustomersRequest { + private final List customerIds; + + /** + * Initialization constructor. + * @param customerIds List of String value for customerIds. + */ + @JsonCreator + public BulkDeleteCustomersRequest( + @JsonProperty("customer_ids") List customerIds) { + this.customerIds = customerIds; + } + + /** + * Getter for CustomerIds. + * The IDs of the [customer profiles](entity:Customer) to delete. + * @return Returns the List of String + */ + @JsonGetter("customer_ids") + public List getCustomerIds() { + return customerIds; + } + + @Override + public int hashCode() { + return Objects.hash(customerIds); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof BulkDeleteCustomersRequest)) { + return false; + } + BulkDeleteCustomersRequest other = (BulkDeleteCustomersRequest) obj; + return Objects.equals(customerIds, other.customerIds); + } + + /** + * Converts this BulkDeleteCustomersRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BulkDeleteCustomersRequest [" + "customerIds=" + customerIds + "]"; + } + + /** + * Builds a new {@link BulkDeleteCustomersRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BulkDeleteCustomersRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(customerIds); + return builder; + } + + /** + * Class to build instances of {@link BulkDeleteCustomersRequest}. + */ + public static class Builder { + private List customerIds; + + /** + * Initialization constructor. + * @param customerIds List of String value for customerIds. + */ + public Builder(List customerIds) { + this.customerIds = customerIds; + } + + /** + * Setter for customerIds. + * @param customerIds List of String value for customerIds. + * @return Builder + */ + public Builder customerIds(List customerIds) { + this.customerIds = customerIds; + return this; + } + + /** + * Builds a new {@link BulkDeleteCustomersRequest} object using the set fields. + * @return {@link BulkDeleteCustomersRequest} + */ + public BulkDeleteCustomersRequest build() { + return new BulkDeleteCustomersRequest(customerIds); + } + } +} diff --git a/src/main/java/com/squareup/square/models/BulkDeleteCustomersResponse.java b/src/main/java/com/squareup/square/models/BulkDeleteCustomersResponse.java new file mode 100644 index 00000000..fae524e6 --- /dev/null +++ b/src/main/java/com/squareup/square/models/BulkDeleteCustomersResponse.java @@ -0,0 +1,156 @@ + +package com.squareup.square.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.squareup.square.http.client.HttpContext; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * This is a model class for BulkDeleteCustomersResponse type. + */ +public class BulkDeleteCustomersResponse { + private HttpContext httpContext; + private final Map responses; + private final List errors; + + /** + * Initialization constructor. + * @param responses Map of String, value for responses. + * @param errors List of Error value for errors. + */ + @JsonCreator + public BulkDeleteCustomersResponse( + @JsonProperty("responses") Map responses, + @JsonProperty("errors") List errors) { + this.responses = responses; + this.errors = errors; + } + + @JsonIgnore + public HttpContext getContext() { + return httpContext; + } + + /** + * Getter for Responses. + * A map of responses that correspond to individual delete requests, represented by key-value + * pairs. Each key is the customer ID that was specified for a delete request and each value is + * the corresponding response. If the request succeeds, the value is an empty object (`{ }`). If + * the request fails, the value contains any errors that occurred during the request. + * @return Returns the Map of String, DeleteCustomerResponse + */ + @JsonGetter("responses") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Map getResponses() { + return responses; + } + + /** + * Getter for Errors. + * Any top-level errors that prevented the bulk operation from running. + * @return Returns the List of Error + */ + @JsonGetter("errors") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getErrors() { + return errors; + } + + @Override + public int hashCode() { + return Objects.hash(responses, errors); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof BulkDeleteCustomersResponse)) { + return false; + } + BulkDeleteCustomersResponse other = (BulkDeleteCustomersResponse) obj; + return Objects.equals(responses, other.responses) + && Objects.equals(errors, other.errors); + } + + /** + * Converts this BulkDeleteCustomersResponse into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BulkDeleteCustomersResponse [" + "responses=" + responses + ", errors=" + errors + + "]"; + } + + /** + * Builds a new {@link BulkDeleteCustomersResponse.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BulkDeleteCustomersResponse.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .responses(getResponses()) + .errors(getErrors()); + return builder; + } + + /** + * Class to build instances of {@link BulkDeleteCustomersResponse}. + */ + public static class Builder { + private HttpContext httpContext; + private Map responses; + private List errors; + + + + /** + * Setter for httpContext. + * @param httpContext HttpContext value for httpContext. + * @return Builder + */ + public Builder httpContext(HttpContext httpContext) { + this.httpContext = httpContext; + return this; + } + + /** + * Setter for responses. + * @param responses Map of String, value for responses. + * @return Builder + */ + public Builder responses(Map responses) { + this.responses = responses; + return this; + } + + /** + * Setter for errors. + * @param errors List of Error value for errors. + * @return Builder + */ + public Builder errors(List errors) { + this.errors = errors; + return this; + } + + /** + * Builds a new {@link BulkDeleteCustomersResponse} object using the set fields. + * @return {@link BulkDeleteCustomersResponse} + */ + public BulkDeleteCustomersResponse build() { + BulkDeleteCustomersResponse model = + new BulkDeleteCustomersResponse(responses, errors); + model.httpContext = httpContext; + return model; + } + } +} diff --git a/src/main/java/com/squareup/square/models/BulkRetrieveCustomersRequest.java b/src/main/java/com/squareup/square/models/BulkRetrieveCustomersRequest.java new file mode 100644 index 00000000..86665181 --- /dev/null +++ b/src/main/java/com/squareup/square/models/BulkRetrieveCustomersRequest.java @@ -0,0 +1,104 @@ + +package com.squareup.square.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +/** + * This is a model class for BulkRetrieveCustomersRequest type. + */ +public class BulkRetrieveCustomersRequest { + private final List customerIds; + + /** + * Initialization constructor. + * @param customerIds List of String value for customerIds. + */ + @JsonCreator + public BulkRetrieveCustomersRequest( + @JsonProperty("customer_ids") List customerIds) { + this.customerIds = customerIds; + } + + /** + * Getter for CustomerIds. + * The IDs of the [customer profiles](entity:Customer) to retrieve. + * @return Returns the List of String + */ + @JsonGetter("customer_ids") + public List getCustomerIds() { + return customerIds; + } + + @Override + public int hashCode() { + return Objects.hash(customerIds); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof BulkRetrieveCustomersRequest)) { + return false; + } + BulkRetrieveCustomersRequest other = (BulkRetrieveCustomersRequest) obj; + return Objects.equals(customerIds, other.customerIds); + } + + /** + * Converts this BulkRetrieveCustomersRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BulkRetrieveCustomersRequest [" + "customerIds=" + customerIds + "]"; + } + + /** + * Builds a new {@link BulkRetrieveCustomersRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BulkRetrieveCustomersRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(customerIds); + return builder; + } + + /** + * Class to build instances of {@link BulkRetrieveCustomersRequest}. + */ + public static class Builder { + private List customerIds; + + /** + * Initialization constructor. + * @param customerIds List of String value for customerIds. + */ + public Builder(List customerIds) { + this.customerIds = customerIds; + } + + /** + * Setter for customerIds. + * @param customerIds List of String value for customerIds. + * @return Builder + */ + public Builder customerIds(List customerIds) { + this.customerIds = customerIds; + return this; + } + + /** + * Builds a new {@link BulkRetrieveCustomersRequest} object using the set fields. + * @return {@link BulkRetrieveCustomersRequest} + */ + public BulkRetrieveCustomersRequest build() { + return new BulkRetrieveCustomersRequest(customerIds); + } + } +} diff --git a/src/main/java/com/squareup/square/models/BulkRetrieveCustomersResponse.java b/src/main/java/com/squareup/square/models/BulkRetrieveCustomersResponse.java new file mode 100644 index 00000000..7abb03b8 --- /dev/null +++ b/src/main/java/com/squareup/square/models/BulkRetrieveCustomersResponse.java @@ -0,0 +1,157 @@ + +package com.squareup.square.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.squareup.square.http.client.HttpContext; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * This is a model class for BulkRetrieveCustomersResponse type. + */ +public class BulkRetrieveCustomersResponse { + private HttpContext httpContext; + private final Map responses; + private final List errors; + + /** + * Initialization constructor. + * @param responses Map of String, value for responses. + * @param errors List of Error value for errors. + */ + @JsonCreator + public BulkRetrieveCustomersResponse( + @JsonProperty("responses") Map responses, + @JsonProperty("errors") List errors) { + this.responses = responses; + this.errors = errors; + } + + @JsonIgnore + public HttpContext getContext() { + return httpContext; + } + + /** + * Getter for Responses. + * A map of responses that correspond to individual retrieve requests, represented by key-value + * pairs. Each key is the customer ID that was specified for a retrieve request and each value + * is the corresponding response. If the request succeeds, the value is the requested customer + * profile. If the request fails, the value contains any errors that occurred during the + * request. + * @return Returns the Map of String, RetrieveCustomerResponse + */ + @JsonGetter("responses") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Map getResponses() { + return responses; + } + + /** + * Getter for Errors. + * Any top-level errors that prevented the bulk operation from running. + * @return Returns the List of Error + */ + @JsonGetter("errors") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getErrors() { + return errors; + } + + @Override + public int hashCode() { + return Objects.hash(responses, errors); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof BulkRetrieveCustomersResponse)) { + return false; + } + BulkRetrieveCustomersResponse other = (BulkRetrieveCustomersResponse) obj; + return Objects.equals(responses, other.responses) + && Objects.equals(errors, other.errors); + } + + /** + * Converts this BulkRetrieveCustomersResponse into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BulkRetrieveCustomersResponse [" + "responses=" + responses + ", errors=" + errors + + "]"; + } + + /** + * Builds a new {@link BulkRetrieveCustomersResponse.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BulkRetrieveCustomersResponse.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .responses(getResponses()) + .errors(getErrors()); + return builder; + } + + /** + * Class to build instances of {@link BulkRetrieveCustomersResponse}. + */ + public static class Builder { + private HttpContext httpContext; + private Map responses; + private List errors; + + + + /** + * Setter for httpContext. + * @param httpContext HttpContext value for httpContext. + * @return Builder + */ + public Builder httpContext(HttpContext httpContext) { + this.httpContext = httpContext; + return this; + } + + /** + * Setter for responses. + * @param responses Map of String, value for responses. + * @return Builder + */ + public Builder responses(Map responses) { + this.responses = responses; + return this; + } + + /** + * Setter for errors. + * @param errors List of Error value for errors. + * @return Builder + */ + public Builder errors(List errors) { + this.errors = errors; + return this; + } + + /** + * Builds a new {@link BulkRetrieveCustomersResponse} object using the set fields. + * @return {@link BulkRetrieveCustomersResponse} + */ + public BulkRetrieveCustomersResponse build() { + BulkRetrieveCustomersResponse model = + new BulkRetrieveCustomersResponse(responses, errors); + model.httpContext = httpContext; + return model; + } + } +} diff --git a/src/main/java/com/squareup/square/models/BulkUpdateCustomerData.java b/src/main/java/com/squareup/square/models/BulkUpdateCustomerData.java new file mode 100644 index 00000000..e77d1feb --- /dev/null +++ b/src/main/java/com/squareup/square/models/BulkUpdateCustomerData.java @@ -0,0 +1,655 @@ + +package com.squareup.square.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.apimatic.core.types.OptionalNullable; +import java.util.Objects; + +/** + * This is a model class for BulkUpdateCustomerData type. + */ +public class BulkUpdateCustomerData { + private final OptionalNullable givenName; + private final OptionalNullable familyName; + private final OptionalNullable companyName; + private final OptionalNullable nickname; + private final OptionalNullable emailAddress; + private final Address address; + private final OptionalNullable phoneNumber; + private final OptionalNullable referenceId; + private final OptionalNullable note; + private final OptionalNullable birthday; + private final CustomerTaxIds taxIds; + private final Long version; + + /** + * Initialization constructor. + * @param givenName String value for givenName. + * @param familyName String value for familyName. + * @param companyName String value for companyName. + * @param nickname String value for nickname. + * @param emailAddress String value for emailAddress. + * @param address Address value for address. + * @param phoneNumber String value for phoneNumber. + * @param referenceId String value for referenceId. + * @param note String value for note. + * @param birthday String value for birthday. + * @param taxIds CustomerTaxIds value for taxIds. + * @param version Long value for version. + */ + @JsonCreator + public BulkUpdateCustomerData( + @JsonProperty("given_name") String givenName, + @JsonProperty("family_name") String familyName, + @JsonProperty("company_name") String companyName, + @JsonProperty("nickname") String nickname, + @JsonProperty("email_address") String emailAddress, + @JsonProperty("address") Address address, + @JsonProperty("phone_number") String phoneNumber, + @JsonProperty("reference_id") String referenceId, + @JsonProperty("note") String note, + @JsonProperty("birthday") String birthday, + @JsonProperty("tax_ids") CustomerTaxIds taxIds, + @JsonProperty("version") Long version) { + this.givenName = OptionalNullable.of(givenName); + this.familyName = OptionalNullable.of(familyName); + this.companyName = OptionalNullable.of(companyName); + this.nickname = OptionalNullable.of(nickname); + this.emailAddress = OptionalNullable.of(emailAddress); + this.address = address; + this.phoneNumber = OptionalNullable.of(phoneNumber); + this.referenceId = OptionalNullable.of(referenceId); + this.note = OptionalNullable.of(note); + this.birthday = OptionalNullable.of(birthday); + this.taxIds = taxIds; + this.version = version; + } + + /** + * Initialization constructor. + * @param givenName String value for givenName. + * @param familyName String value for familyName. + * @param companyName String value for companyName. + * @param nickname String value for nickname. + * @param emailAddress String value for emailAddress. + * @param address Address value for address. + * @param phoneNumber String value for phoneNumber. + * @param referenceId String value for referenceId. + * @param note String value for note. + * @param birthday String value for birthday. + * @param taxIds CustomerTaxIds value for taxIds. + * @param version Long value for version. + */ + + protected BulkUpdateCustomerData(OptionalNullable givenName, + OptionalNullable familyName, OptionalNullable companyName, + OptionalNullable nickname, OptionalNullable emailAddress, + Address address, OptionalNullable phoneNumber, + OptionalNullable referenceId, OptionalNullable note, + OptionalNullable birthday, CustomerTaxIds taxIds, Long version) { + this.givenName = givenName; + this.familyName = familyName; + this.companyName = companyName; + this.nickname = nickname; + this.emailAddress = emailAddress; + this.address = address; + this.phoneNumber = phoneNumber; + this.referenceId = referenceId; + this.note = note; + this.birthday = birthday; + this.taxIds = taxIds; + this.version = version; + } + + /** + * Internal Getter for GivenName. + * The given name (that is, the first name) associated with the customer profile. + * @return Returns the Internal String + */ + @JsonGetter("given_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetGivenName() { + return this.givenName; + } + + /** + * Getter for GivenName. + * The given name (that is, the first name) associated with the customer profile. + * @return Returns the String + */ + @JsonIgnore + public String getGivenName() { + return OptionalNullable.getFrom(givenName); + } + + /** + * Internal Getter for FamilyName. + * The family name (that is, the last name) associated with the customer profile. + * @return Returns the Internal String + */ + @JsonGetter("family_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetFamilyName() { + return this.familyName; + } + + /** + * Getter for FamilyName. + * The family name (that is, the last name) associated with the customer profile. + * @return Returns the String + */ + @JsonIgnore + public String getFamilyName() { + return OptionalNullable.getFrom(familyName); + } + + /** + * Internal Getter for CompanyName. + * A business name associated with the customer profile. + * @return Returns the Internal String + */ + @JsonGetter("company_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetCompanyName() { + return this.companyName; + } + + /** + * Getter for CompanyName. + * A business name associated with the customer profile. + * @return Returns the String + */ + @JsonIgnore + public String getCompanyName() { + return OptionalNullable.getFrom(companyName); + } + + /** + * Internal Getter for Nickname. + * A nickname for the customer profile. + * @return Returns the Internal String + */ + @JsonGetter("nickname") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetNickname() { + return this.nickname; + } + + /** + * Getter for Nickname. + * A nickname for the customer profile. + * @return Returns the String + */ + @JsonIgnore + public String getNickname() { + return OptionalNullable.getFrom(nickname); + } + + /** + * Internal Getter for EmailAddress. + * The email address associated with the customer profile. + * @return Returns the Internal String + */ + @JsonGetter("email_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetEmailAddress() { + return this.emailAddress; + } + + /** + * Getter for EmailAddress. + * The email address associated with the customer profile. + * @return Returns the String + */ + @JsonIgnore + public String getEmailAddress() { + return OptionalNullable.getFrom(emailAddress); + } + + /** + * Getter for Address. + * Represents a postal address in a country. For more information, see [Working with + * Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + * @return Returns the Address + */ + @JsonGetter("address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Address getAddress() { + return address; + } + + /** + * Internal Getter for PhoneNumber. + * The phone number associated with the customer profile. The phone number must be valid and can + * contain 9–16 digits, with an optional `+` prefix and country code. For more information, see + * [Customer phone + * numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + * @return Returns the Internal String + */ + @JsonGetter("phone_number") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetPhoneNumber() { + return this.phoneNumber; + } + + /** + * Getter for PhoneNumber. + * The phone number associated with the customer profile. The phone number must be valid and can + * contain 9–16 digits, with an optional `+` prefix and country code. For more information, see + * [Customer phone + * numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + * @return Returns the String + */ + @JsonIgnore + public String getPhoneNumber() { + return OptionalNullable.getFrom(phoneNumber); + } + + /** + * Internal Getter for ReferenceId. + * An optional second ID used to associate the customer profile with an entity in another + * system. + * @return Returns the Internal String + */ + @JsonGetter("reference_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetReferenceId() { + return this.referenceId; + } + + /** + * Getter for ReferenceId. + * An optional second ID used to associate the customer profile with an entity in another + * system. + * @return Returns the String + */ + @JsonIgnore + public String getReferenceId() { + return OptionalNullable.getFrom(referenceId); + } + + /** + * Internal Getter for Note. + * An custom note associates with the customer profile. + * @return Returns the Internal String + */ + @JsonGetter("note") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetNote() { + return this.note; + } + + /** + * Getter for Note. + * An custom note associates with the customer profile. + * @return Returns the String + */ + @JsonIgnore + public String getNote() { + return OptionalNullable.getFrom(note); + } + + /** + * Internal Getter for Birthday. + * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For + * example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays + * are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or `0000` if a + * birth year is not specified. + * @return Returns the Internal String + */ + @JsonGetter("birthday") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetBirthday() { + return this.birthday; + } + + /** + * Getter for Birthday. + * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For + * example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays + * are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or `0000` if a + * birth year is not specified. + * @return Returns the String + */ + @JsonIgnore + public String getBirthday() { + return OptionalNullable.getFrom(birthday); + } + + /** + * Getter for TaxIds. + * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding + * `tax_ids` field is available only for customers of sellers in EU countries or the United + * Kingdom. For more information, see [Customer tax + * IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + * @return Returns the CustomerTaxIds + */ + @JsonGetter("tax_ids") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CustomerTaxIds getTaxIds() { + return taxIds; + } + + /** + * Getter for Version. + * The current version of the customer profile. As a best practice, you should include this + * field to enable [optimistic + * concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + * control. + * @return Returns the Long + */ + @JsonGetter("version") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Long getVersion() { + return version; + } + + @Override + public int hashCode() { + return Objects.hash(givenName, familyName, companyName, nickname, emailAddress, address, + phoneNumber, referenceId, note, birthday, taxIds, version); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof BulkUpdateCustomerData)) { + return false; + } + BulkUpdateCustomerData other = (BulkUpdateCustomerData) obj; + return Objects.equals(givenName, other.givenName) + && Objects.equals(familyName, other.familyName) + && Objects.equals(companyName, other.companyName) + && Objects.equals(nickname, other.nickname) + && Objects.equals(emailAddress, other.emailAddress) + && Objects.equals(address, other.address) + && Objects.equals(phoneNumber, other.phoneNumber) + && Objects.equals(referenceId, other.referenceId) + && Objects.equals(note, other.note) + && Objects.equals(birthday, other.birthday) + && Objects.equals(taxIds, other.taxIds) + && Objects.equals(version, other.version); + } + + /** + * Converts this BulkUpdateCustomerData into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BulkUpdateCustomerData [" + "givenName=" + givenName + ", familyName=" + familyName + + ", companyName=" + companyName + ", nickname=" + nickname + ", emailAddress=" + + emailAddress + ", address=" + address + ", phoneNumber=" + phoneNumber + + ", referenceId=" + referenceId + ", note=" + note + ", birthday=" + birthday + + ", taxIds=" + taxIds + ", version=" + version + "]"; + } + + /** + * Builds a new {@link BulkUpdateCustomerData.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BulkUpdateCustomerData.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .address(getAddress()) + .taxIds(getTaxIds()) + .version(getVersion()); + builder.givenName = internalGetGivenName(); + builder.familyName = internalGetFamilyName(); + builder.companyName = internalGetCompanyName(); + builder.nickname = internalGetNickname(); + builder.emailAddress = internalGetEmailAddress(); + builder.phoneNumber = internalGetPhoneNumber(); + builder.referenceId = internalGetReferenceId(); + builder.note = internalGetNote(); + builder.birthday = internalGetBirthday(); + return builder; + } + + /** + * Class to build instances of {@link BulkUpdateCustomerData}. + */ + public static class Builder { + private OptionalNullable givenName; + private OptionalNullable familyName; + private OptionalNullable companyName; + private OptionalNullable nickname; + private OptionalNullable emailAddress; + private Address address; + private OptionalNullable phoneNumber; + private OptionalNullable referenceId; + private OptionalNullable note; + private OptionalNullable birthday; + private CustomerTaxIds taxIds; + private Long version; + + + + /** + * Setter for givenName. + * @param givenName String value for givenName. + * @return Builder + */ + public Builder givenName(String givenName) { + this.givenName = OptionalNullable.of(givenName); + return this; + } + + /** + * UnSetter for givenName. + * @return Builder + */ + public Builder unsetGivenName() { + givenName = null; + return this; + } + + /** + * Setter for familyName. + * @param familyName String value for familyName. + * @return Builder + */ + public Builder familyName(String familyName) { + this.familyName = OptionalNullable.of(familyName); + return this; + } + + /** + * UnSetter for familyName. + * @return Builder + */ + public Builder unsetFamilyName() { + familyName = null; + return this; + } + + /** + * Setter for companyName. + * @param companyName String value for companyName. + * @return Builder + */ + public Builder companyName(String companyName) { + this.companyName = OptionalNullable.of(companyName); + return this; + } + + /** + * UnSetter for companyName. + * @return Builder + */ + public Builder unsetCompanyName() { + companyName = null; + return this; + } + + /** + * Setter for nickname. + * @param nickname String value for nickname. + * @return Builder + */ + public Builder nickname(String nickname) { + this.nickname = OptionalNullable.of(nickname); + return this; + } + + /** + * UnSetter for nickname. + * @return Builder + */ + public Builder unsetNickname() { + nickname = null; + return this; + } + + /** + * Setter for emailAddress. + * @param emailAddress String value for emailAddress. + * @return Builder + */ + public Builder emailAddress(String emailAddress) { + this.emailAddress = OptionalNullable.of(emailAddress); + return this; + } + + /** + * UnSetter for emailAddress. + * @return Builder + */ + public Builder unsetEmailAddress() { + emailAddress = null; + return this; + } + + /** + * Setter for address. + * @param address Address value for address. + * @return Builder + */ + public Builder address(Address address) { + this.address = address; + return this; + } + + /** + * Setter for phoneNumber. + * @param phoneNumber String value for phoneNumber. + * @return Builder + */ + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = OptionalNullable.of(phoneNumber); + return this; + } + + /** + * UnSetter for phoneNumber. + * @return Builder + */ + public Builder unsetPhoneNumber() { + phoneNumber = null; + return this; + } + + /** + * Setter for referenceId. + * @param referenceId String value for referenceId. + * @return Builder + */ + public Builder referenceId(String referenceId) { + this.referenceId = OptionalNullable.of(referenceId); + return this; + } + + /** + * UnSetter for referenceId. + * @return Builder + */ + public Builder unsetReferenceId() { + referenceId = null; + return this; + } + + /** + * Setter for note. + * @param note String value for note. + * @return Builder + */ + public Builder note(String note) { + this.note = OptionalNullable.of(note); + return this; + } + + /** + * UnSetter for note. + * @return Builder + */ + public Builder unsetNote() { + note = null; + return this; + } + + /** + * Setter for birthday. + * @param birthday String value for birthday. + * @return Builder + */ + public Builder birthday(String birthday) { + this.birthday = OptionalNullable.of(birthday); + return this; + } + + /** + * UnSetter for birthday. + * @return Builder + */ + public Builder unsetBirthday() { + birthday = null; + return this; + } + + /** + * Setter for taxIds. + * @param taxIds CustomerTaxIds value for taxIds. + * @return Builder + */ + public Builder taxIds(CustomerTaxIds taxIds) { + this.taxIds = taxIds; + return this; + } + + /** + * Setter for version. + * @param version Long value for version. + * @return Builder + */ + public Builder version(Long version) { + this.version = version; + return this; + } + + /** + * Builds a new {@link BulkUpdateCustomerData} object using the set fields. + * @return {@link BulkUpdateCustomerData} + */ + public BulkUpdateCustomerData build() { + return new BulkUpdateCustomerData(givenName, familyName, companyName, nickname, + emailAddress, address, phoneNumber, referenceId, note, birthday, taxIds, + version); + } + } +} diff --git a/src/main/java/com/squareup/square/models/BulkUpdateCustomersRequest.java b/src/main/java/com/squareup/square/models/BulkUpdateCustomersRequest.java new file mode 100644 index 00000000..531072ba --- /dev/null +++ b/src/main/java/com/squareup/square/models/BulkUpdateCustomersRequest.java @@ -0,0 +1,109 @@ + +package com.squareup.square.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.Objects; + +/** + * This is a model class for BulkUpdateCustomersRequest type. + */ +public class BulkUpdateCustomersRequest { + private final Map customers; + + /** + * Initialization constructor. + * @param customers Map of String, value for customers. + */ + @JsonCreator + public BulkUpdateCustomersRequest( + @JsonProperty("customers") Map customers) { + this.customers = customers; + } + + /** + * Getter for Customers. + * A map of 1 to 100 individual update requests, represented by `customer ID: { customer data }` + * key-value pairs. Each key is the ID of the [customer profile](entity:Customer) to update. To + * update a customer profile that was created by merging existing profiles, provide the ID of + * the newly created profile. Each value contains the updated customer data. Only new or changed + * fields are required. To add or update a field, specify the new value. To remove a field, + * specify `null`. + * @return Returns the Map of String, BulkUpdateCustomerData + */ + @JsonGetter("customers") + public Map getCustomers() { + return customers; + } + + @Override + public int hashCode() { + return Objects.hash(customers); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof BulkUpdateCustomersRequest)) { + return false; + } + BulkUpdateCustomersRequest other = (BulkUpdateCustomersRequest) obj; + return Objects.equals(customers, other.customers); + } + + /** + * Converts this BulkUpdateCustomersRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BulkUpdateCustomersRequest [" + "customers=" + customers + "]"; + } + + /** + * Builds a new {@link BulkUpdateCustomersRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BulkUpdateCustomersRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(customers); + return builder; + } + + /** + * Class to build instances of {@link BulkUpdateCustomersRequest}. + */ + public static class Builder { + private Map customers; + + /** + * Initialization constructor. + * @param customers Map of String, value for customers. + */ + public Builder(Map customers) { + this.customers = customers; + } + + /** + * Setter for customers. + * @param customers Map of String, value for customers. + * @return Builder + */ + public Builder customers(Map customers) { + this.customers = customers; + return this; + } + + /** + * Builds a new {@link BulkUpdateCustomersRequest} object using the set fields. + * @return {@link BulkUpdateCustomersRequest} + */ + public BulkUpdateCustomersRequest build() { + return new BulkUpdateCustomersRequest(customers); + } + } +} diff --git a/src/main/java/com/squareup/square/models/BulkUpdateCustomersResponse.java b/src/main/java/com/squareup/square/models/BulkUpdateCustomersResponse.java new file mode 100644 index 00000000..1a2c56bd --- /dev/null +++ b/src/main/java/com/squareup/square/models/BulkUpdateCustomersResponse.java @@ -0,0 +1,157 @@ + +package com.squareup.square.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.squareup.square.http.client.HttpContext; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * This is a model class for BulkUpdateCustomersResponse type. + */ +public class BulkUpdateCustomersResponse { + private HttpContext httpContext; + private final Map responses; + private final List errors; + + /** + * Initialization constructor. + * @param responses Map of String, value for responses. + * @param errors List of Error value for errors. + */ + @JsonCreator + public BulkUpdateCustomersResponse( + @JsonProperty("responses") Map responses, + @JsonProperty("errors") List errors) { + this.responses = responses; + this.errors = errors; + } + + @JsonIgnore + public HttpContext getContext() { + return httpContext; + } + + /** + * Getter for Responses. + * A map of responses that correspond to individual update requests, represented by key-value + * pairs. Each key is the customer ID that was specified for an update request and each value is + * the corresponding response. If the request succeeds, the value is the updated customer + * profile. If the request fails, the value contains any errors that occurred during the + * request. + * @return Returns the Map of String, UpdateCustomerResponse + */ + @JsonGetter("responses") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Map getResponses() { + return responses; + } + + /** + * Getter for Errors. + * Any top-level errors that prevented the bulk operation from running. + * @return Returns the List of Error + */ + @JsonGetter("errors") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getErrors() { + return errors; + } + + @Override + public int hashCode() { + return Objects.hash(responses, errors); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof BulkUpdateCustomersResponse)) { + return false; + } + BulkUpdateCustomersResponse other = (BulkUpdateCustomersResponse) obj; + return Objects.equals(responses, other.responses) + && Objects.equals(errors, other.errors); + } + + /** + * Converts this BulkUpdateCustomersResponse into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BulkUpdateCustomersResponse [" + "responses=" + responses + ", errors=" + errors + + "]"; + } + + /** + * Builds a new {@link BulkUpdateCustomersResponse.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BulkUpdateCustomersResponse.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .responses(getResponses()) + .errors(getErrors()); + return builder; + } + + /** + * Class to build instances of {@link BulkUpdateCustomersResponse}. + */ + public static class Builder { + private HttpContext httpContext; + private Map responses; + private List errors; + + + + /** + * Setter for httpContext. + * @param httpContext HttpContext value for httpContext. + * @return Builder + */ + public Builder httpContext(HttpContext httpContext) { + this.httpContext = httpContext; + return this; + } + + /** + * Setter for responses. + * @param responses Map of String, value for responses. + * @return Builder + */ + public Builder responses(Map responses) { + this.responses = responses; + return this; + } + + /** + * Setter for errors. + * @param errors List of Error value for errors. + * @return Builder + */ + public Builder errors(List errors) { + this.errors = errors; + return this; + } + + /** + * Builds a new {@link BulkUpdateCustomersResponse} object using the set fields. + * @return {@link BulkUpdateCustomersResponse} + */ + public BulkUpdateCustomersResponse build() { + BulkUpdateCustomersResponse model = + new BulkUpdateCustomersResponse(responses, errors); + model.httpContext = httpContext; + return model; + } + } +} diff --git a/src/main/java/com/squareup/square/models/CatalogItemModifierListInfo.java b/src/main/java/com/squareup/square/models/CatalogItemModifierListInfo.java index 49160a0d..a94d13f8 100644 --- a/src/main/java/com/squareup/square/models/CatalogItemModifierListInfo.java +++ b/src/main/java/com/squareup/square/models/CatalogItemModifierListInfo.java @@ -20,6 +20,7 @@ public class CatalogItemModifierListInfo { private final OptionalNullable minSelectedModifiers; private final OptionalNullable maxSelectedModifiers; private final OptionalNullable enabled; + private final OptionalNullable ordinal; /** * Initialization constructor. @@ -28,6 +29,7 @@ public class CatalogItemModifierListInfo { * @param minSelectedModifiers Integer value for minSelectedModifiers. * @param maxSelectedModifiers Integer value for maxSelectedModifiers. * @param enabled Boolean value for enabled. + * @param ordinal Integer value for ordinal. */ @JsonCreator public CatalogItemModifierListInfo( @@ -35,12 +37,14 @@ public CatalogItemModifierListInfo( @JsonProperty("modifier_overrides") List modifierOverrides, @JsonProperty("min_selected_modifiers") Integer minSelectedModifiers, @JsonProperty("max_selected_modifiers") Integer maxSelectedModifiers, - @JsonProperty("enabled") Boolean enabled) { + @JsonProperty("enabled") Boolean enabled, + @JsonProperty("ordinal") Integer ordinal) { this.modifierListId = modifierListId; this.modifierOverrides = OptionalNullable.of(modifierOverrides); this.minSelectedModifiers = OptionalNullable.of(minSelectedModifiers); this.maxSelectedModifiers = OptionalNullable.of(maxSelectedModifiers); this.enabled = OptionalNullable.of(enabled); + this.ordinal = OptionalNullable.of(ordinal); } /** @@ -50,17 +54,20 @@ public CatalogItemModifierListInfo( * @param minSelectedModifiers Integer value for minSelectedModifiers. * @param maxSelectedModifiers Integer value for maxSelectedModifiers. * @param enabled Boolean value for enabled. + * @param ordinal Integer value for ordinal. */ protected CatalogItemModifierListInfo(String modifierListId, OptionalNullable> modifierOverrides, OptionalNullable minSelectedModifiers, - OptionalNullable maxSelectedModifiers, OptionalNullable enabled) { + OptionalNullable maxSelectedModifiers, OptionalNullable enabled, + OptionalNullable ordinal) { this.modifierListId = modifierListId; this.modifierOverrides = modifierOverrides; this.minSelectedModifiers = minSelectedModifiers; this.maxSelectedModifiers = maxSelectedModifiers; this.enabled = enabled; + this.ordinal = ordinal; } /** @@ -167,10 +174,34 @@ public Boolean getEnabled() { return OptionalNullable.getFrom(enabled); } + /** + * Internal Getter for Ordinal. + * The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` + * list applied to a `CatalogItem` instance. + * @return Returns the Internal Integer + */ + @JsonGetter("ordinal") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetOrdinal() { + return this.ordinal; + } + + /** + * Getter for Ordinal. + * The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` + * list applied to a `CatalogItem` instance. + * @return Returns the Integer + */ + @JsonIgnore + public Integer getOrdinal() { + return OptionalNullable.getFrom(ordinal); + } + @Override public int hashCode() { return Objects.hash(modifierListId, modifierOverrides, minSelectedModifiers, - maxSelectedModifiers, enabled); + maxSelectedModifiers, enabled, ordinal); } @Override @@ -186,7 +217,8 @@ public boolean equals(Object obj) { && Objects.equals(modifierOverrides, other.modifierOverrides) && Objects.equals(minSelectedModifiers, other.minSelectedModifiers) && Objects.equals(maxSelectedModifiers, other.maxSelectedModifiers) - && Objects.equals(enabled, other.enabled); + && Objects.equals(enabled, other.enabled) + && Objects.equals(ordinal, other.ordinal); } /** @@ -198,7 +230,7 @@ public String toString() { return "CatalogItemModifierListInfo [" + "modifierListId=" + modifierListId + ", modifierOverrides=" + modifierOverrides + ", minSelectedModifiers=" + minSelectedModifiers + ", maxSelectedModifiers=" + maxSelectedModifiers - + ", enabled=" + enabled + "]"; + + ", enabled=" + enabled + ", ordinal=" + ordinal + "]"; } /** @@ -212,6 +244,7 @@ public Builder toBuilder() { builder.minSelectedModifiers = internalGetMinSelectedModifiers(); builder.maxSelectedModifiers = internalGetMaxSelectedModifiers(); builder.enabled = internalGetEnabled(); + builder.ordinal = internalGetOrdinal(); return builder; } @@ -224,6 +257,7 @@ public static class Builder { private OptionalNullable minSelectedModifiers; private OptionalNullable maxSelectedModifiers; private OptionalNullable enabled; + private OptionalNullable ordinal; /** * Initialization constructor. @@ -319,13 +353,32 @@ public Builder unsetEnabled() { return this; } + /** + * Setter for ordinal. + * @param ordinal Integer value for ordinal. + * @return Builder + */ + public Builder ordinal(Integer ordinal) { + this.ordinal = OptionalNullable.of(ordinal); + return this; + } + + /** + * UnSetter for ordinal. + * @return Builder + */ + public Builder unsetOrdinal() { + ordinal = null; + return this; + } + /** * Builds a new {@link CatalogItemModifierListInfo} object using the set fields. * @return {@link CatalogItemModifierListInfo} */ public CatalogItemModifierListInfo build() { return new CatalogItemModifierListInfo(modifierListId, modifierOverrides, - minSelectedModifiers, maxSelectedModifiers, enabled); + minSelectedModifiers, maxSelectedModifiers, enabled, ordinal); } } } diff --git a/src/main/java/com/squareup/square/models/CatalogModifierList.java b/src/main/java/com/squareup/square/models/CatalogModifierList.java index 89c33e36..b5c55511 100644 --- a/src/main/java/com/squareup/square/models/CatalogModifierList.java +++ b/src/main/java/com/squareup/square/models/CatalogModifierList.java @@ -20,6 +20,10 @@ public class CatalogModifierList { private final String selectionType; private final OptionalNullable> modifiers; private final OptionalNullable> imageIds; + private final String modifierType; + private final OptionalNullable maxLength; + private final OptionalNullable textRequired; + private final OptionalNullable internalName; /** * Initialization constructor. @@ -28,6 +32,10 @@ public class CatalogModifierList { * @param selectionType String value for selectionType. * @param modifiers List of CatalogObject value for modifiers. * @param imageIds List of String value for imageIds. + * @param modifierType String value for modifierType. + * @param maxLength Integer value for maxLength. + * @param textRequired Boolean value for textRequired. + * @param internalName String value for internalName. */ @JsonCreator public CatalogModifierList( @@ -35,12 +43,20 @@ public CatalogModifierList( @JsonProperty("ordinal") Integer ordinal, @JsonProperty("selection_type") String selectionType, @JsonProperty("modifiers") List modifiers, - @JsonProperty("image_ids") List imageIds) { + @JsonProperty("image_ids") List imageIds, + @JsonProperty("modifier_type") String modifierType, + @JsonProperty("max_length") Integer maxLength, + @JsonProperty("text_required") Boolean textRequired, + @JsonProperty("internal_name") String internalName) { this.name = OptionalNullable.of(name); this.ordinal = OptionalNullable.of(ordinal); this.selectionType = selectionType; this.modifiers = OptionalNullable.of(modifiers); this.imageIds = OptionalNullable.of(imageIds); + this.modifierType = modifierType; + this.maxLength = OptionalNullable.of(maxLength); + this.textRequired = OptionalNullable.of(textRequired); + this.internalName = OptionalNullable.of(internalName); } /** @@ -50,21 +66,31 @@ public CatalogModifierList( * @param selectionType String value for selectionType. * @param modifiers List of CatalogObject value for modifiers. * @param imageIds List of String value for imageIds. + * @param modifierType String value for modifierType. + * @param maxLength Integer value for maxLength. + * @param textRequired Boolean value for textRequired. + * @param internalName String value for internalName. */ protected CatalogModifierList(OptionalNullable name, OptionalNullable ordinal, String selectionType, OptionalNullable> modifiers, - OptionalNullable> imageIds) { + OptionalNullable> imageIds, String modifierType, + OptionalNullable maxLength, OptionalNullable textRequired, + OptionalNullable internalName) { this.name = name; this.ordinal = ordinal; this.selectionType = selectionType; this.modifiers = modifiers; this.imageIds = imageIds; + this.modifierType = modifierType; + this.maxLength = maxLength; + this.textRequired = textRequired; + this.internalName = internalName; } /** * Internal Getter for Name. - * The name for the `CatalogModifierList` instance. This is a searchable attribute for use in + * The name of the `CatalogModifierList` instance. This is a searchable attribute for use in * applicable query filters, and its value length is of Unicode code points. * @return Returns the Internal String */ @@ -77,7 +103,7 @@ protected OptionalNullable internalGetName() { /** * Getter for Name. - * The name for the `CatalogModifierList` instance. This is a searchable attribute for use in + * The name of the `CatalogModifierList` instance. This is a searchable attribute for use in * applicable query filters, and its value length is of Unicode code points. * @return Returns the String */ @@ -88,7 +114,7 @@ public String getName() { /** * Internal Getter for Ordinal. - * Determines where this modifier list appears in a list of `CatalogModifierList` values. + * The position of this `CatalogModifierList` within a list of `CatalogModifierList` instances. * @return Returns the Internal Integer */ @JsonGetter("ordinal") @@ -100,7 +126,7 @@ protected OptionalNullable internalGetOrdinal() { /** * Getter for Ordinal. - * Determines where this modifier list appears in a list of `CatalogModifierList` values. + * The position of this `CatalogModifierList` within a list of `CatalogModifierList` instances. * @return Returns the Integer */ @JsonIgnore @@ -121,9 +147,11 @@ public String getSelectionType() { /** * Internal Getter for Modifiers. - * The options included in the `CatalogModifierList`. You must include at least one - * `CatalogModifier`. Each CatalogObject must have type `MODIFIER` and contain `CatalogModifier` - * data. + * A non-empty list of `CatalogModifier` objects to be included in the `CatalogModifierList`, + * for non text-based modifiers when the `modifier_type` attribute is `LIST`. Each element of + * this list is a `CatalogObject` instance of the `MODIFIER` type, containing the following + * attributes: ``` { "id": "{{catalog_modifier_id}}", "type": "MODIFIER", "modifier_data": {{a + * CatalogModifier instance>}} } ``` * @return Returns the Internal List of CatalogObject */ @JsonGetter("modifiers") @@ -135,9 +163,11 @@ protected OptionalNullable> internalGetModifiers() { /** * Getter for Modifiers. - * The options included in the `CatalogModifierList`. You must include at least one - * `CatalogModifier`. Each CatalogObject must have type `MODIFIER` and contain `CatalogModifier` - * data. + * A non-empty list of `CatalogModifier` objects to be included in the `CatalogModifierList`, + * for non text-based modifiers when the `modifier_type` attribute is `LIST`. Each element of + * this list is a `CatalogObject` instance of the `MODIFIER` type, containing the following + * attributes: ``` { "id": "{{catalog_modifier_id}}", "type": "MODIFIER", "modifier_data": {{a + * CatalogModifier instance>}} } ``` * @return Returns the List of CatalogObject */ @JsonIgnore @@ -148,7 +178,7 @@ public List getModifiers() { /** * Internal Getter for ImageIds. * The IDs of images associated with this `CatalogModifierList` instance. Currently these images - * are not displayed by Square, but are free to be displayed in 3rd party applications. + * are not displayed on Square products, but may be displayed in 3rd-party applications. * @return Returns the Internal List of String */ @JsonGetter("image_ids") @@ -161,7 +191,7 @@ protected OptionalNullable> internalGetImageIds() { /** * Getter for ImageIds. * The IDs of images associated with this `CatalogModifierList` instance. Currently these images - * are not displayed by Square, but are free to be displayed in 3rd party applications. + * are not displayed on Square products, but may be displayed in 3rd-party applications. * @return Returns the List of String */ @JsonIgnore @@ -169,9 +199,101 @@ public List getImageIds() { return OptionalNullable.getFrom(imageIds); } + /** + * Getter for ModifierType. + * Defines the type of `CatalogModifierList`. + * @return Returns the String + */ + @JsonGetter("modifier_type") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getModifierType() { + return modifierType; + } + + /** + * Internal Getter for MaxLength. + * The maximum length, in Unicode points, of the text string of the text-based modifier as + * represented by this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. + * @return Returns the Internal Integer + */ + @JsonGetter("max_length") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetMaxLength() { + return this.maxLength; + } + + /** + * Getter for MaxLength. + * The maximum length, in Unicode points, of the text string of the text-based modifier as + * represented by this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. + * @return Returns the Integer + */ + @JsonIgnore + public Integer getMaxLength() { + return OptionalNullable.getFrom(maxLength); + } + + /** + * Internal Getter for TextRequired. + * Whether the text string must be a non-empty string (`true`) or not (`false`) for a text-based + * modifier as represented by this `CatalogModifierList` object with the `modifier_type` set to + * `TEXT`. + * @return Returns the Internal Boolean + */ + @JsonGetter("text_required") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetTextRequired() { + return this.textRequired; + } + + /** + * Getter for TextRequired. + * Whether the text string must be a non-empty string (`true`) or not (`false`) for a text-based + * modifier as represented by this `CatalogModifierList` object with the `modifier_type` set to + * `TEXT`. + * @return Returns the Boolean + */ + @JsonIgnore + public Boolean getTextRequired() { + return OptionalNullable.getFrom(textRequired); + } + + /** + * Internal Getter for InternalName. + * A note for internal use by the business. For example, for a text-based modifier applied to a + * T-shirt item, if the buyer-supplied text of "Hello, Kitty!" is to be printed on the T-shirt, + * this `internal_name` attribute can be "Use italic face" as an instruction for the business to + * follow. For non text-based modifiers, this `internal_name` attribute can be used to include + * SKUs, internal codes, or supplemental descriptions for internal use. + * @return Returns the Internal String + */ + @JsonGetter("internal_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetInternalName() { + return this.internalName; + } + + /** + * Getter for InternalName. + * A note for internal use by the business. For example, for a text-based modifier applied to a + * T-shirt item, if the buyer-supplied text of "Hello, Kitty!" is to be printed on the T-shirt, + * this `internal_name` attribute can be "Use italic face" as an instruction for the business to + * follow. For non text-based modifiers, this `internal_name` attribute can be used to include + * SKUs, internal codes, or supplemental descriptions for internal use. + * @return Returns the String + */ + @JsonIgnore + public String getInternalName() { + return OptionalNullable.getFrom(internalName); + } + @Override public int hashCode() { - return Objects.hash(name, ordinal, selectionType, modifiers, imageIds); + return Objects.hash(name, ordinal, selectionType, modifiers, imageIds, modifierType, + maxLength, textRequired, internalName); } @Override @@ -187,7 +309,11 @@ public boolean equals(Object obj) { && Objects.equals(ordinal, other.ordinal) && Objects.equals(selectionType, other.selectionType) && Objects.equals(modifiers, other.modifiers) - && Objects.equals(imageIds, other.imageIds); + && Objects.equals(imageIds, other.imageIds) + && Objects.equals(modifierType, other.modifierType) + && Objects.equals(maxLength, other.maxLength) + && Objects.equals(textRequired, other.textRequired) + && Objects.equals(internalName, other.internalName); } /** @@ -198,7 +324,8 @@ public boolean equals(Object obj) { public String toString() { return "CatalogModifierList [" + "name=" + name + ", ordinal=" + ordinal + ", selectionType=" + selectionType + ", modifiers=" + modifiers + ", imageIds=" - + imageIds + "]"; + + imageIds + ", modifierType=" + modifierType + ", maxLength=" + maxLength + + ", textRequired=" + textRequired + ", internalName=" + internalName + "]"; } /** @@ -208,11 +335,15 @@ public String toString() { */ public Builder toBuilder() { Builder builder = new Builder() - .selectionType(getSelectionType()); + .selectionType(getSelectionType()) + .modifierType(getModifierType()); builder.name = internalGetName(); builder.ordinal = internalGetOrdinal(); builder.modifiers = internalGetModifiers(); builder.imageIds = internalGetImageIds(); + builder.maxLength = internalGetMaxLength(); + builder.textRequired = internalGetTextRequired(); + builder.internalName = internalGetInternalName(); return builder; } @@ -225,6 +356,10 @@ public static class Builder { private String selectionType; private OptionalNullable> modifiers; private OptionalNullable> imageIds; + private String modifierType; + private OptionalNullable maxLength; + private OptionalNullable textRequired; + private OptionalNullable internalName; @@ -314,12 +449,80 @@ public Builder unsetImageIds() { return this; } + /** + * Setter for modifierType. + * @param modifierType String value for modifierType. + * @return Builder + */ + public Builder modifierType(String modifierType) { + this.modifierType = modifierType; + return this; + } + + /** + * Setter for maxLength. + * @param maxLength Integer value for maxLength. + * @return Builder + */ + public Builder maxLength(Integer maxLength) { + this.maxLength = OptionalNullable.of(maxLength); + return this; + } + + /** + * UnSetter for maxLength. + * @return Builder + */ + public Builder unsetMaxLength() { + maxLength = null; + return this; + } + + /** + * Setter for textRequired. + * @param textRequired Boolean value for textRequired. + * @return Builder + */ + public Builder textRequired(Boolean textRequired) { + this.textRequired = OptionalNullable.of(textRequired); + return this; + } + + /** + * UnSetter for textRequired. + * @return Builder + */ + public Builder unsetTextRequired() { + textRequired = null; + return this; + } + + /** + * Setter for internalName. + * @param internalName String value for internalName. + * @return Builder + */ + public Builder internalName(String internalName) { + this.internalName = OptionalNullable.of(internalName); + return this; + } + + /** + * UnSetter for internalName. + * @return Builder + */ + public Builder unsetInternalName() { + internalName = null; + return this; + } + /** * Builds a new {@link CatalogModifierList} object using the set fields. * @return {@link CatalogModifierList} */ public CatalogModifierList build() { - return new CatalogModifierList(name, ordinal, selectionType, modifiers, imageIds); + return new CatalogModifierList(name, ordinal, selectionType, modifiers, imageIds, + modifierType, maxLength, textRequired, internalName); } } } diff --git a/src/main/java/com/squareup/square/models/CatalogObject.java b/src/main/java/com/squareup/square/models/CatalogObject.java index e7f7f5af..bdb4031a 100644 --- a/src/main/java/com/squareup/square/models/CatalogObject.java +++ b/src/main/java/com/squareup/square/models/CatalogObject.java @@ -525,10 +525,16 @@ public CatalogDiscount getDiscountData() { /** * Getter for ModifierListData. - * A list of modifiers applicable to items at the time of sale. For example, a "Condiments" - * modifier list applicable to a "Hot Dog" item may contain "Ketchup", "Mustard", and "Relish" - * modifiers. Use the `selection_type` field to specify whether or not multiple selections from - * the modifier list are allowed. + * For a text-based modifier, this encapsulates the modifier's text when its `modifier_type` is + * `TEXT`. For example, to sell T-shirts with custom prints, a text-based modifier can be used + * to capture the buyer-supplied text string to be selected for the T-shirt at the time of sale. + * For non text-based modifiers, this encapsulates a non-empty list of modifiers applicable to + * items at the time of sale. Each element of the modifier list is a `CatalogObject` instance of + * the `MODIFIER` type. For example, a "Condiments" modifier list applicable to a "Hot Dog" item + * may contain "Ketchup", "Mustard", and "Relish" modifiers. A non text-based modifier can be + * applied to the modified item once or multiple times, if the `selection_type` field is set to + * `SINGLE` or `MULTIPLE`, respectively. On the other hand, a text-based modifier can be applied + * to the item only once and the `selection_type` field is always set to `SINGLE`. * @return Returns the CatalogModifierList */ @JsonGetter("modifier_list_data") diff --git a/src/main/java/com/squareup/square/models/ListPaymentLinksRequest.java b/src/main/java/com/squareup/square/models/ListPaymentLinksRequest.java index cf638f3d..1ed22695 100644 --- a/src/main/java/com/squareup/square/models/ListPaymentLinksRequest.java +++ b/src/main/java/com/squareup/square/models/ListPaymentLinksRequest.java @@ -47,7 +47,7 @@ protected ListPaymentLinksRequest(OptionalNullable cursor, * A pagination cursor returned by a previous call to this endpoint. Provide this cursor to * retrieve the next set of results for the original query. If a cursor is not provided, the * endpoint returns the first page of the results. For more information, see - * [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). + * [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). * @return Returns the Internal String */ @JsonGetter("cursor") @@ -62,7 +62,7 @@ protected OptionalNullable internalGetCursor() { * A pagination cursor returned by a previous call to this endpoint. Provide this cursor to * retrieve the next set of results for the original query. If a cursor is not provided, the * endpoint returns the first page of the results. For more information, see - * [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). + * [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). * @return Returns the String */ @JsonIgnore diff --git a/src/main/java/com/squareup/square/models/ListPaymentLinksResponse.java b/src/main/java/com/squareup/square/models/ListPaymentLinksResponse.java index 69712895..77fb4f22 100644 --- a/src/main/java/com/squareup/square/models/ListPaymentLinksResponse.java +++ b/src/main/java/com/squareup/square/models/ListPaymentLinksResponse.java @@ -67,7 +67,7 @@ public List getPaymentLinks() { * When a response is truncated, it includes a cursor that you can use in a subsequent request * to retrieve the next set of gift cards. If a cursor is not present, this is the final * response. For more information, see - * [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). + * [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). * @return Returns the String */ @JsonGetter("cursor") diff --git a/src/main/java/com/squareup/square/models/OrderLineItemTax.java b/src/main/java/com/squareup/square/models/OrderLineItemTax.java index 7ed024fe..5b78e829 100644 --- a/src/main/java/com/squareup/square/models/OrderLineItemTax.java +++ b/src/main/java/com/squareup/square/models/OrderLineItemTax.java @@ -196,7 +196,8 @@ public String getType() { /** * Internal Getter for Percentage. * The percentage of the tax, as a string representation of a decimal number. For example, a - * value of `"7.25"` corresponds to a percentage of 7.25%. + * value of `"7.25"` corresponds to a percentage of 7.25%. Either `percentage` or `amount_money` + * should be set, but not both. * @return Returns the Internal String */ @JsonGetter("percentage") @@ -209,7 +210,8 @@ protected OptionalNullable internalGetPercentage() { /** * Getter for Percentage. * The percentage of the tax, as a string representation of a decimal number. For example, a - * value of `"7.25"` corresponds to a percentage of 7.25%. + * value of `"7.25"` corresponds to a percentage of 7.25%. Either `percentage` or `amount_money` + * should be set, but not both. * @return Returns the String */ @JsonIgnore diff --git a/src/main/java/com/squareup/square/models/PaymentBalanceActivityFeeDetail.java b/src/main/java/com/squareup/square/models/PaymentBalanceActivityFeeDetail.java index 97b150ec..708bda2d 100644 --- a/src/main/java/com/squareup/square/models/PaymentBalanceActivityFeeDetail.java +++ b/src/main/java/com/squareup/square/models/PaymentBalanceActivityFeeDetail.java @@ -37,7 +37,9 @@ protected PaymentBalanceActivityFeeDetail(OptionalNullable paymentId) { /** * Internal Getter for PaymentId. - * The ID of the payment associated with this activity. + * The ID of the payment associated with this activity This will only be populated when a + * principal LedgerEntryToken is also populated. If the fee is independent (there is no + * principal LedgerEntryToken) then this will likely not be populated. * @return Returns the Internal String */ @JsonGetter("payment_id") @@ -49,7 +51,9 @@ protected OptionalNullable internalGetPaymentId() { /** * Getter for PaymentId. - * The ID of the payment associated with this activity. + * The ID of the payment associated with this activity This will only be populated when a + * principal LedgerEntryToken is also populated. If the fee is independent (there is no + * principal LedgerEntryToken) then this will likely not be populated. * @return Returns the String */ @JsonIgnore diff --git a/src/main/java/com/squareup/square/models/PaymentRefund.java b/src/main/java/com/squareup/square/models/PaymentRefund.java index 1060ce57..7f9b8017 100644 --- a/src/main/java/com/squareup/square/models/PaymentRefund.java +++ b/src/main/java/com/squareup/square/models/PaymentRefund.java @@ -196,7 +196,7 @@ public Boolean getUnlinked() { /** * Internal Getter for DestinationType. * The destination type for this refund. Current values include `CARD`, `BANK_ACCOUNT`, - * `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`, and `EXTERNAL`. + * `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`, `EXTERNAL`, and `SQUARE_ACCOUNT`. * @return Returns the Internal String */ @JsonGetter("destination_type") @@ -209,7 +209,7 @@ protected OptionalNullable internalGetDestinationType() { /** * Getter for DestinationType. * The destination type for this refund. Current values include `CARD`, `BANK_ACCOUNT`, - * `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`, and `EXTERNAL`. + * `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`, `EXTERNAL`, and `SQUARE_ACCOUNT`. * @return Returns the String */ @JsonIgnore diff --git a/src/main/java/com/squareup/square/models/SearchOrdersResponse.java b/src/main/java/com/squareup/square/models/SearchOrdersResponse.java index 2985657c..91cbb1ed 100644 --- a/src/main/java/com/squareup/square/models/SearchOrdersResponse.java +++ b/src/main/java/com/squareup/square/models/SearchOrdersResponse.java @@ -72,7 +72,7 @@ public List getOrders() { * Getter for Cursor. * The pagination cursor to be used in a subsequent request. If unset, this is the final * response. For more information, see - * [Pagination](https://developer.squareup.com/docs/basics/build-basics/common-api-patterns/pagination). + * [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). * @return Returns the String */ @JsonGetter("cursor") diff --git a/src/main/java/com/squareup/square/models/V1CreateRefundRequest.java b/src/main/java/com/squareup/square/models/V1CreateRefundRequest.java deleted file mode 100644 index 1c8c01a7..00000000 --- a/src/main/java/com/squareup/square/models/V1CreateRefundRequest.java +++ /dev/null @@ -1,261 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.apimatic.core.types.OptionalNullable; -import java.util.Objects; - -/** - * This is a model class for V1CreateRefundRequest type. - */ -public class V1CreateRefundRequest { - private final String paymentId; - private final String type; - private final String reason; - private final V1Money refundedMoney; - private final OptionalNullable requestIdempotenceKey; - - /** - * Initialization constructor. - * @param paymentId String value for paymentId. - * @param type String value for type. - * @param reason String value for reason. - * @param refundedMoney V1Money value for refundedMoney. - * @param requestIdempotenceKey String value for requestIdempotenceKey. - */ - @JsonCreator - public V1CreateRefundRequest( - @JsonProperty("payment_id") String paymentId, - @JsonProperty("type") String type, - @JsonProperty("reason") String reason, - @JsonProperty("refunded_money") V1Money refundedMoney, - @JsonProperty("request_idempotence_key") String requestIdempotenceKey) { - this.paymentId = paymentId; - this.type = type; - this.reason = reason; - this.refundedMoney = refundedMoney; - this.requestIdempotenceKey = OptionalNullable.of(requestIdempotenceKey); - } - - /** - * Initialization constructor. - * @param paymentId String value for paymentId. - * @param type String value for type. - * @param reason String value for reason. - * @param refundedMoney V1Money value for refundedMoney. - * @param requestIdempotenceKey String value for requestIdempotenceKey. - */ - - protected V1CreateRefundRequest(String paymentId, String type, String reason, - V1Money refundedMoney, OptionalNullable requestIdempotenceKey) { - this.paymentId = paymentId; - this.type = type; - this.reason = reason; - this.refundedMoney = refundedMoney; - this.requestIdempotenceKey = requestIdempotenceKey; - } - - /** - * Getter for PaymentId. - * The ID of the payment to refund. If you are creating a `PARTIAL` refund for a split tender - * payment, instead provide the id of the particular tender you want to refund. - * @return Returns the String - */ - @JsonGetter("payment_id") - public String getPaymentId() { - return paymentId; - } - - /** - * Getter for Type. - * @return Returns the String - */ - @JsonGetter("type") - public String getType() { - return type; - } - - /** - * Getter for Reason. - * The reason for the refund. - * @return Returns the String - */ - @JsonGetter("reason") - public String getReason() { - return reason; - } - - /** - * Getter for RefundedMoney. - * @return Returns the V1Money - */ - @JsonGetter("refunded_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getRefundedMoney() { - return refundedMoney; - } - - /** - * Internal Getter for RequestIdempotenceKey. - * An optional key to ensure idempotence if you issue the same PARTIAL refund request more than - * once. - * @return Returns the Internal String - */ - @JsonGetter("request_idempotence_key") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetRequestIdempotenceKey() { - return this.requestIdempotenceKey; - } - - /** - * Getter for RequestIdempotenceKey. - * An optional key to ensure idempotence if you issue the same PARTIAL refund request more than - * once. - * @return Returns the String - */ - @JsonIgnore - public String getRequestIdempotenceKey() { - return OptionalNullable.getFrom(requestIdempotenceKey); - } - - @Override - public int hashCode() { - return Objects.hash(paymentId, type, reason, refundedMoney, requestIdempotenceKey); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1CreateRefundRequest)) { - return false; - } - V1CreateRefundRequest other = (V1CreateRefundRequest) obj; - return Objects.equals(paymentId, other.paymentId) - && Objects.equals(type, other.type) - && Objects.equals(reason, other.reason) - && Objects.equals(refundedMoney, other.refundedMoney) - && Objects.equals(requestIdempotenceKey, other.requestIdempotenceKey); - } - - /** - * Converts this V1CreateRefundRequest into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1CreateRefundRequest [" + "paymentId=" + paymentId + ", type=" + type + ", reason=" - + reason + ", refundedMoney=" + refundedMoney + ", requestIdempotenceKey=" - + requestIdempotenceKey + "]"; - } - - /** - * Builds a new {@link V1CreateRefundRequest.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1CreateRefundRequest.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder(paymentId, type, reason) - .refundedMoney(getRefundedMoney()); - builder.requestIdempotenceKey = internalGetRequestIdempotenceKey(); - return builder; - } - - /** - * Class to build instances of {@link V1CreateRefundRequest}. - */ - public static class Builder { - private String paymentId; - private String type; - private String reason; - private V1Money refundedMoney; - private OptionalNullable requestIdempotenceKey; - - /** - * Initialization constructor. - * @param paymentId String value for paymentId. - * @param type String value for type. - * @param reason String value for reason. - */ - public Builder(String paymentId, String type, String reason) { - this.paymentId = paymentId; - this.type = type; - this.reason = reason; - } - - /** - * Setter for paymentId. - * @param paymentId String value for paymentId. - * @return Builder - */ - public Builder paymentId(String paymentId) { - this.paymentId = paymentId; - return this; - } - - /** - * Setter for type. - * @param type String value for type. - * @return Builder - */ - public Builder type(String type) { - this.type = type; - return this; - } - - /** - * Setter for reason. - * @param reason String value for reason. - * @return Builder - */ - public Builder reason(String reason) { - this.reason = reason; - return this; - } - - /** - * Setter for refundedMoney. - * @param refundedMoney V1Money value for refundedMoney. - * @return Builder - */ - public Builder refundedMoney(V1Money refundedMoney) { - this.refundedMoney = refundedMoney; - return this; - } - - /** - * Setter for requestIdempotenceKey. - * @param requestIdempotenceKey String value for requestIdempotenceKey. - * @return Builder - */ - public Builder requestIdempotenceKey(String requestIdempotenceKey) { - this.requestIdempotenceKey = OptionalNullable.of(requestIdempotenceKey); - return this; - } - - /** - * UnSetter for requestIdempotenceKey. - * @return Builder - */ - public Builder unsetRequestIdempotenceKey() { - requestIdempotenceKey = null; - return this; - } - - /** - * Builds a new {@link V1CreateRefundRequest} object using the set fields. - * @return {@link V1CreateRefundRequest} - */ - public V1CreateRefundRequest build() { - return new V1CreateRefundRequest(paymentId, type, reason, refundedMoney, - requestIdempotenceKey); - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1ListPaymentsRequest.java b/src/main/java/com/squareup/square/models/V1ListPaymentsRequest.java deleted file mode 100644 index 37984358..00000000 --- a/src/main/java/com/squareup/square/models/V1ListPaymentsRequest.java +++ /dev/null @@ -1,381 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.apimatic.core.types.OptionalNullable; -import java.util.Objects; - -/** - * This is a model class for V1ListPaymentsRequest type. - */ -public class V1ListPaymentsRequest { - private final String order; - private final OptionalNullable beginTime; - private final OptionalNullable endTime; - private final OptionalNullable limit; - private final OptionalNullable batchToken; - private final OptionalNullable includePartial; - - /** - * Initialization constructor. - * @param order String value for order. - * @param beginTime String value for beginTime. - * @param endTime String value for endTime. - * @param limit Integer value for limit. - * @param batchToken String value for batchToken. - * @param includePartial Boolean value for includePartial. - */ - @JsonCreator - public V1ListPaymentsRequest( - @JsonProperty("order") String order, - @JsonProperty("begin_time") String beginTime, - @JsonProperty("end_time") String endTime, - @JsonProperty("limit") Integer limit, - @JsonProperty("batch_token") String batchToken, - @JsonProperty("include_partial") Boolean includePartial) { - this.order = order; - this.beginTime = OptionalNullable.of(beginTime); - this.endTime = OptionalNullable.of(endTime); - this.limit = OptionalNullable.of(limit); - this.batchToken = OptionalNullable.of(batchToken); - this.includePartial = OptionalNullable.of(includePartial); - } - - /** - * Initialization constructor. - * @param order String value for order. - * @param beginTime String value for beginTime. - * @param endTime String value for endTime. - * @param limit Integer value for limit. - * @param batchToken String value for batchToken. - * @param includePartial Boolean value for includePartial. - */ - - protected V1ListPaymentsRequest(String order, OptionalNullable beginTime, - OptionalNullable endTime, OptionalNullable limit, - OptionalNullable batchToken, OptionalNullable includePartial) { - this.order = order; - this.beginTime = beginTime; - this.endTime = endTime; - this.limit = limit; - this.batchToken = batchToken; - this.includePartial = includePartial; - } - - /** - * Getter for Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * @return Returns the String - */ - @JsonGetter("order") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getOrder() { - return order; - } - - /** - * Internal Getter for BeginTime. - * 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. - * @return Returns the Internal String - */ - @JsonGetter("begin_time") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetBeginTime() { - return this.beginTime; - } - - /** - * Getter for BeginTime. - * 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. - * @return Returns the String - */ - @JsonIgnore - public String getBeginTime() { - return OptionalNullable.getFrom(beginTime); - } - - /** - * Internal Getter for EndTime. - * 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. - * @return Returns the Internal String - */ - @JsonGetter("end_time") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetEndTime() { - return this.endTime; - } - - /** - * Getter for EndTime. - * 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. - * @return Returns the String - */ - @JsonIgnore - public String getEndTime() { - return OptionalNullable.getFrom(endTime); - } - - /** - * Internal Getter for Limit. - * The maximum number of payments to return in a single response. This value cannot exceed 200. - * @return Returns the Internal Integer - */ - @JsonGetter("limit") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetLimit() { - return this.limit; - } - - /** - * Getter for Limit. - * The maximum number of payments to return in a single response. This value cannot exceed 200. - * @return Returns the Integer - */ - @JsonIgnore - public Integer getLimit() { - return OptionalNullable.getFrom(limit); - } - - /** - * Internal Getter for BatchToken. - * A pagination cursor to retrieve the next set of results for your original query to the - * endpoint. - * @return Returns the Internal String - */ - @JsonGetter("batch_token") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetBatchToken() { - return this.batchToken; - } - - /** - * Getter for BatchToken. - * A pagination cursor to retrieve the next set of results for your original query to the - * endpoint. - * @return Returns the String - */ - @JsonIgnore - public String getBatchToken() { - return OptionalNullable.getFrom(batchToken); - } - - /** - * Internal Getter for IncludePartial. - * Indicates whether or not to include partial payments in the response. Partial payments will - * have the tenders collected so far, but the itemizations will be empty until the payment is - * completed. - * @return Returns the Internal Boolean - */ - @JsonGetter("include_partial") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetIncludePartial() { - return this.includePartial; - } - - /** - * Getter for IncludePartial. - * Indicates whether or not to include partial payments in the response. Partial payments will - * have the tenders collected so far, but the itemizations will be empty until the payment is - * completed. - * @return Returns the Boolean - */ - @JsonIgnore - public Boolean getIncludePartial() { - return OptionalNullable.getFrom(includePartial); - } - - @Override - public int hashCode() { - return Objects.hash(order, beginTime, endTime, limit, batchToken, includePartial); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1ListPaymentsRequest)) { - return false; - } - V1ListPaymentsRequest other = (V1ListPaymentsRequest) obj; - return Objects.equals(order, other.order) - && Objects.equals(beginTime, other.beginTime) - && Objects.equals(endTime, other.endTime) - && Objects.equals(limit, other.limit) - && Objects.equals(batchToken, other.batchToken) - && Objects.equals(includePartial, other.includePartial); - } - - /** - * Converts this V1ListPaymentsRequest into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1ListPaymentsRequest [" + "order=" + order + ", beginTime=" + beginTime - + ", endTime=" + endTime + ", limit=" + limit + ", batchToken=" + batchToken - + ", includePartial=" + includePartial + "]"; - } - - /** - * Builds a new {@link V1ListPaymentsRequest.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1ListPaymentsRequest.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .order(getOrder()); - builder.beginTime = internalGetBeginTime(); - builder.endTime = internalGetEndTime(); - builder.limit = internalGetLimit(); - builder.batchToken = internalGetBatchToken(); - builder.includePartial = internalGetIncludePartial(); - return builder; - } - - /** - * Class to build instances of {@link V1ListPaymentsRequest}. - */ - public static class Builder { - private String order; - private OptionalNullable beginTime; - private OptionalNullable endTime; - private OptionalNullable limit; - private OptionalNullable batchToken; - private OptionalNullable includePartial; - - - - /** - * Setter for order. - * @param order String value for order. - * @return Builder - */ - public Builder order(String order) { - this.order = order; - return this; - } - - /** - * Setter for beginTime. - * @param beginTime String value for beginTime. - * @return Builder - */ - public Builder beginTime(String beginTime) { - this.beginTime = OptionalNullable.of(beginTime); - return this; - } - - /** - * UnSetter for beginTime. - * @return Builder - */ - public Builder unsetBeginTime() { - beginTime = null; - return this; - } - - /** - * Setter for endTime. - * @param endTime String value for endTime. - * @return Builder - */ - public Builder endTime(String endTime) { - this.endTime = OptionalNullable.of(endTime); - return this; - } - - /** - * UnSetter for endTime. - * @return Builder - */ - public Builder unsetEndTime() { - endTime = null; - return this; - } - - /** - * Setter for limit. - * @param limit Integer value for limit. - * @return Builder - */ - public Builder limit(Integer limit) { - this.limit = OptionalNullable.of(limit); - return this; - } - - /** - * UnSetter for limit. - * @return Builder - */ - public Builder unsetLimit() { - limit = null; - return this; - } - - /** - * Setter for batchToken. - * @param batchToken String value for batchToken. - * @return Builder - */ - public Builder batchToken(String batchToken) { - this.batchToken = OptionalNullable.of(batchToken); - return this; - } - - /** - * UnSetter for batchToken. - * @return Builder - */ - public Builder unsetBatchToken() { - batchToken = null; - return this; - } - - /** - * Setter for includePartial. - * @param includePartial Boolean value for includePartial. - * @return Builder - */ - public Builder includePartial(Boolean includePartial) { - this.includePartial = OptionalNullable.of(includePartial); - return this; - } - - /** - * UnSetter for includePartial. - * @return Builder - */ - public Builder unsetIncludePartial() { - includePartial = null; - return this; - } - - /** - * Builds a new {@link V1ListPaymentsRequest} object using the set fields. - * @return {@link V1ListPaymentsRequest} - */ - public V1ListPaymentsRequest build() { - return new V1ListPaymentsRequest(order, beginTime, endTime, limit, batchToken, - includePartial); - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1ListPaymentsResponse.java b/src/main/java/com/squareup/square/models/V1ListPaymentsResponse.java deleted file mode 100644 index 567b8f7e..00000000 --- a/src/main/java/com/squareup/square/models/V1ListPaymentsResponse.java +++ /dev/null @@ -1,100 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Objects; - -/** - * This is a model class for V1ListPaymentsResponse type. - */ -public class V1ListPaymentsResponse { - private final List items; - - /** - * Initialization constructor. - * @param items List of V1Payment value for items. - */ - @JsonCreator - public V1ListPaymentsResponse( - @JsonProperty("items") List items) { - this.items = items; - } - - /** - * Getter for Items. - * @return Returns the List of V1Payment - */ - @JsonGetter("items") - @JsonInclude(JsonInclude.Include.NON_NULL) - public List getItems() { - return items; - } - - @Override - public int hashCode() { - return Objects.hash(items); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1ListPaymentsResponse)) { - return false; - } - V1ListPaymentsResponse other = (V1ListPaymentsResponse) obj; - return Objects.equals(items, other.items); - } - - /** - * Converts this V1ListPaymentsResponse into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1ListPaymentsResponse [" + "items=" + items + "]"; - } - - /** - * Builds a new {@link V1ListPaymentsResponse.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1ListPaymentsResponse.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .items(getItems()); - return builder; - } - - /** - * Class to build instances of {@link V1ListPaymentsResponse}. - */ - public static class Builder { - private List items; - - - - /** - * Setter for items. - * @param items List of V1Payment value for items. - * @return Builder - */ - public Builder items(List items) { - this.items = items; - return this; - } - - /** - * Builds a new {@link V1ListPaymentsResponse} object using the set fields. - * @return {@link V1ListPaymentsResponse} - */ - public V1ListPaymentsResponse build() { - return new V1ListPaymentsResponse(items); - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1ListRefundsRequest.java b/src/main/java/com/squareup/square/models/V1ListRefundsRequest.java deleted file mode 100644 index 3ae91802..00000000 --- a/src/main/java/com/squareup/square/models/V1ListRefundsRequest.java +++ /dev/null @@ -1,331 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.apimatic.core.types.OptionalNullable; -import java.util.Objects; - -/** - * This is a model class for V1ListRefundsRequest type. - */ -public class V1ListRefundsRequest { - private final String order; - private final OptionalNullable beginTime; - private final OptionalNullable endTime; - private final OptionalNullable limit; - private final OptionalNullable batchToken; - - /** - * Initialization constructor. - * @param order String value for order. - * @param beginTime String value for beginTime. - * @param endTime String value for endTime. - * @param limit Integer value for limit. - * @param batchToken String value for batchToken. - */ - @JsonCreator - public V1ListRefundsRequest( - @JsonProperty("order") String order, - @JsonProperty("begin_time") String beginTime, - @JsonProperty("end_time") String endTime, - @JsonProperty("limit") Integer limit, - @JsonProperty("batch_token") String batchToken) { - this.order = order; - this.beginTime = OptionalNullable.of(beginTime); - this.endTime = OptionalNullable.of(endTime); - this.limit = OptionalNullable.of(limit); - this.batchToken = OptionalNullable.of(batchToken); - } - - /** - * Initialization constructor. - * @param order String value for order. - * @param beginTime String value for beginTime. - * @param endTime String value for endTime. - * @param limit Integer value for limit. - * @param batchToken String value for batchToken. - */ - - protected V1ListRefundsRequest(String order, OptionalNullable beginTime, - OptionalNullable endTime, OptionalNullable limit, - OptionalNullable batchToken) { - this.order = order; - this.beginTime = beginTime; - this.endTime = endTime; - this.limit = limit; - this.batchToken = batchToken; - } - - /** - * Getter for Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * @return Returns the String - */ - @JsonGetter("order") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getOrder() { - return order; - } - - /** - * Internal Getter for BeginTime. - * 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. - * @return Returns the Internal String - */ - @JsonGetter("begin_time") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetBeginTime() { - return this.beginTime; - } - - /** - * Getter for BeginTime. - * 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. - * @return Returns the String - */ - @JsonIgnore - public String getBeginTime() { - return OptionalNullable.getFrom(beginTime); - } - - /** - * Internal Getter for EndTime. - * 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. - * @return Returns the Internal String - */ - @JsonGetter("end_time") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetEndTime() { - return this.endTime; - } - - /** - * Getter for EndTime. - * 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. - * @return Returns the String - */ - @JsonIgnore - public String getEndTime() { - return OptionalNullable.getFrom(endTime); - } - - /** - * Internal Getter for Limit. - * The approximate number of refunds to return in a single response. Default: 100. Max: 200. - * Response may contain more results than the prescribed limit when refunds are made - * simultaneously to multiple tenders in a payment or when refunds are generated in an exchange - * to account for the value of returned goods. - * @return Returns the Internal Integer - */ - @JsonGetter("limit") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetLimit() { - return this.limit; - } - - /** - * Getter for Limit. - * The approximate number of refunds to return in a single response. Default: 100. Max: 200. - * Response may contain more results than the prescribed limit when refunds are made - * simultaneously to multiple tenders in a payment or when refunds are generated in an exchange - * to account for the value of returned goods. - * @return Returns the Integer - */ - @JsonIgnore - public Integer getLimit() { - return OptionalNullable.getFrom(limit); - } - - /** - * Internal Getter for BatchToken. - * A pagination cursor to retrieve the next set of results for your original query to the - * endpoint. - * @return Returns the Internal String - */ - @JsonGetter("batch_token") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetBatchToken() { - return this.batchToken; - } - - /** - * Getter for BatchToken. - * A pagination cursor to retrieve the next set of results for your original query to the - * endpoint. - * @return Returns the String - */ - @JsonIgnore - public String getBatchToken() { - return OptionalNullable.getFrom(batchToken); - } - - @Override - public int hashCode() { - return Objects.hash(order, beginTime, endTime, limit, batchToken); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1ListRefundsRequest)) { - return false; - } - V1ListRefundsRequest other = (V1ListRefundsRequest) obj; - return Objects.equals(order, other.order) - && Objects.equals(beginTime, other.beginTime) - && Objects.equals(endTime, other.endTime) - && Objects.equals(limit, other.limit) - && Objects.equals(batchToken, other.batchToken); - } - - /** - * Converts this V1ListRefundsRequest into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1ListRefundsRequest [" + "order=" + order + ", beginTime=" + beginTime - + ", endTime=" + endTime + ", limit=" + limit + ", batchToken=" + batchToken + "]"; - } - - /** - * Builds a new {@link V1ListRefundsRequest.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1ListRefundsRequest.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .order(getOrder()); - builder.beginTime = internalGetBeginTime(); - builder.endTime = internalGetEndTime(); - builder.limit = internalGetLimit(); - builder.batchToken = internalGetBatchToken(); - return builder; - } - - /** - * Class to build instances of {@link V1ListRefundsRequest}. - */ - public static class Builder { - private String order; - private OptionalNullable beginTime; - private OptionalNullable endTime; - private OptionalNullable limit; - private OptionalNullable batchToken; - - - - /** - * Setter for order. - * @param order String value for order. - * @return Builder - */ - public Builder order(String order) { - this.order = order; - return this; - } - - /** - * Setter for beginTime. - * @param beginTime String value for beginTime. - * @return Builder - */ - public Builder beginTime(String beginTime) { - this.beginTime = OptionalNullable.of(beginTime); - return this; - } - - /** - * UnSetter for beginTime. - * @return Builder - */ - public Builder unsetBeginTime() { - beginTime = null; - return this; - } - - /** - * Setter for endTime. - * @param endTime String value for endTime. - * @return Builder - */ - public Builder endTime(String endTime) { - this.endTime = OptionalNullable.of(endTime); - return this; - } - - /** - * UnSetter for endTime. - * @return Builder - */ - public Builder unsetEndTime() { - endTime = null; - return this; - } - - /** - * Setter for limit. - * @param limit Integer value for limit. - * @return Builder - */ - public Builder limit(Integer limit) { - this.limit = OptionalNullable.of(limit); - return this; - } - - /** - * UnSetter for limit. - * @return Builder - */ - public Builder unsetLimit() { - limit = null; - return this; - } - - /** - * Setter for batchToken. - * @param batchToken String value for batchToken. - * @return Builder - */ - public Builder batchToken(String batchToken) { - this.batchToken = OptionalNullable.of(batchToken); - return this; - } - - /** - * UnSetter for batchToken. - * @return Builder - */ - public Builder unsetBatchToken() { - batchToken = null; - return this; - } - - /** - * Builds a new {@link V1ListRefundsRequest} object using the set fields. - * @return {@link V1ListRefundsRequest} - */ - public V1ListRefundsRequest build() { - return new V1ListRefundsRequest(order, beginTime, endTime, limit, batchToken); - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1ListRefundsResponse.java b/src/main/java/com/squareup/square/models/V1ListRefundsResponse.java deleted file mode 100644 index 49e5d1a2..00000000 --- a/src/main/java/com/squareup/square/models/V1ListRefundsResponse.java +++ /dev/null @@ -1,100 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Objects; - -/** - * This is a model class for V1ListRefundsResponse type. - */ -public class V1ListRefundsResponse { - private final List items; - - /** - * Initialization constructor. - * @param items List of V1Refund value for items. - */ - @JsonCreator - public V1ListRefundsResponse( - @JsonProperty("items") List items) { - this.items = items; - } - - /** - * Getter for Items. - * @return Returns the List of V1Refund - */ - @JsonGetter("items") - @JsonInclude(JsonInclude.Include.NON_NULL) - public List getItems() { - return items; - } - - @Override - public int hashCode() { - return Objects.hash(items); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1ListRefundsResponse)) { - return false; - } - V1ListRefundsResponse other = (V1ListRefundsResponse) obj; - return Objects.equals(items, other.items); - } - - /** - * Converts this V1ListRefundsResponse into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1ListRefundsResponse [" + "items=" + items + "]"; - } - - /** - * Builds a new {@link V1ListRefundsResponse.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1ListRefundsResponse.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .items(getItems()); - return builder; - } - - /** - * Class to build instances of {@link V1ListRefundsResponse}. - */ - public static class Builder { - private List items; - - - - /** - * Setter for items. - * @param items List of V1Refund value for items. - * @return Builder - */ - public Builder items(List items) { - this.items = items; - return this; - } - - /** - * Builds a new {@link V1ListRefundsResponse} object using the set fields. - * @return {@link V1ListRefundsResponse} - */ - public V1ListRefundsResponse build() { - return new V1ListRefundsResponse(items); - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1ListSettlementsRequest.java b/src/main/java/com/squareup/square/models/V1ListSettlementsRequest.java deleted file mode 100644 index 6dc1617e..00000000 --- a/src/main/java/com/squareup/square/models/V1ListSettlementsRequest.java +++ /dev/null @@ -1,358 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.apimatic.core.types.OptionalNullable; -import java.util.Objects; - -/** - * This is a model class for V1ListSettlementsRequest type. - */ -public class V1ListSettlementsRequest { - private final String order; - private final OptionalNullable beginTime; - private final OptionalNullable endTime; - private final OptionalNullable limit; - private final String status; - private final OptionalNullable batchToken; - - /** - * Initialization constructor. - * @param order String value for order. - * @param beginTime String value for beginTime. - * @param endTime String value for endTime. - * @param limit Integer value for limit. - * @param status String value for status. - * @param batchToken String value for batchToken. - */ - @JsonCreator - public V1ListSettlementsRequest( - @JsonProperty("order") String order, - @JsonProperty("begin_time") String beginTime, - @JsonProperty("end_time") String endTime, - @JsonProperty("limit") Integer limit, - @JsonProperty("status") String status, - @JsonProperty("batch_token") String batchToken) { - this.order = order; - this.beginTime = OptionalNullable.of(beginTime); - this.endTime = OptionalNullable.of(endTime); - this.limit = OptionalNullable.of(limit); - this.status = status; - this.batchToken = OptionalNullable.of(batchToken); - } - - /** - * Initialization constructor. - * @param order String value for order. - * @param beginTime String value for beginTime. - * @param endTime String value for endTime. - * @param limit Integer value for limit. - * @param status String value for status. - * @param batchToken String value for batchToken. - */ - - protected V1ListSettlementsRequest(String order, OptionalNullable beginTime, - OptionalNullable endTime, OptionalNullable limit, String status, - OptionalNullable batchToken) { - this.order = order; - this.beginTime = beginTime; - this.endTime = endTime; - this.limit = limit; - this.status = status; - this.batchToken = batchToken; - } - - /** - * Getter for Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * @return Returns the String - */ - @JsonGetter("order") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getOrder() { - return order; - } - - /** - * Internal Getter for BeginTime. - * 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. - * @return Returns the Internal String - */ - @JsonGetter("begin_time") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetBeginTime() { - return this.beginTime; - } - - /** - * Getter for BeginTime. - * 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. - * @return Returns the String - */ - @JsonIgnore - public String getBeginTime() { - return OptionalNullable.getFrom(beginTime); - } - - /** - * Internal Getter for EndTime. - * 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. - * @return Returns the Internal String - */ - @JsonGetter("end_time") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetEndTime() { - return this.endTime; - } - - /** - * Getter for EndTime. - * 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. - * @return Returns the String - */ - @JsonIgnore - public String getEndTime() { - return OptionalNullable.getFrom(endTime); - } - - /** - * Internal Getter for Limit. - * The maximum number of settlements to return in a single response. This value cannot exceed - * 200. - * @return Returns the Internal Integer - */ - @JsonGetter("limit") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetLimit() { - return this.limit; - } - - /** - * Getter for Limit. - * The maximum number of settlements to return in a single response. This value cannot exceed - * 200. - * @return Returns the Integer - */ - @JsonIgnore - public Integer getLimit() { - return OptionalNullable.getFrom(limit); - } - - /** - * Getter for Status. - * @return Returns the String - */ - @JsonGetter("status") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getStatus() { - return status; - } - - /** - * Internal Getter for BatchToken. - * A pagination cursor to retrieve the next set of results for your original query to the - * endpoint. - * @return Returns the Internal String - */ - @JsonGetter("batch_token") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetBatchToken() { - return this.batchToken; - } - - /** - * Getter for BatchToken. - * A pagination cursor to retrieve the next set of results for your original query to the - * endpoint. - * @return Returns the String - */ - @JsonIgnore - public String getBatchToken() { - return OptionalNullable.getFrom(batchToken); - } - - @Override - public int hashCode() { - return Objects.hash(order, beginTime, endTime, limit, status, batchToken); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1ListSettlementsRequest)) { - return false; - } - V1ListSettlementsRequest other = (V1ListSettlementsRequest) obj; - return Objects.equals(order, other.order) - && Objects.equals(beginTime, other.beginTime) - && Objects.equals(endTime, other.endTime) - && Objects.equals(limit, other.limit) - && Objects.equals(status, other.status) - && Objects.equals(batchToken, other.batchToken); - } - - /** - * Converts this V1ListSettlementsRequest into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1ListSettlementsRequest [" + "order=" + order + ", beginTime=" + beginTime - + ", endTime=" + endTime + ", limit=" + limit + ", status=" + status - + ", batchToken=" + batchToken + "]"; - } - - /** - * Builds a new {@link V1ListSettlementsRequest.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1ListSettlementsRequest.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .order(getOrder()) - .status(getStatus()); - builder.beginTime = internalGetBeginTime(); - builder.endTime = internalGetEndTime(); - builder.limit = internalGetLimit(); - builder.batchToken = internalGetBatchToken(); - return builder; - } - - /** - * Class to build instances of {@link V1ListSettlementsRequest}. - */ - public static class Builder { - private String order; - private OptionalNullable beginTime; - private OptionalNullable endTime; - private OptionalNullable limit; - private String status; - private OptionalNullable batchToken; - - - - /** - * Setter for order. - * @param order String value for order. - * @return Builder - */ - public Builder order(String order) { - this.order = order; - return this; - } - - /** - * Setter for beginTime. - * @param beginTime String value for beginTime. - * @return Builder - */ - public Builder beginTime(String beginTime) { - this.beginTime = OptionalNullable.of(beginTime); - return this; - } - - /** - * UnSetter for beginTime. - * @return Builder - */ - public Builder unsetBeginTime() { - beginTime = null; - return this; - } - - /** - * Setter for endTime. - * @param endTime String value for endTime. - * @return Builder - */ - public Builder endTime(String endTime) { - this.endTime = OptionalNullable.of(endTime); - return this; - } - - /** - * UnSetter for endTime. - * @return Builder - */ - public Builder unsetEndTime() { - endTime = null; - return this; - } - - /** - * Setter for limit. - * @param limit Integer value for limit. - * @return Builder - */ - public Builder limit(Integer limit) { - this.limit = OptionalNullable.of(limit); - return this; - } - - /** - * UnSetter for limit. - * @return Builder - */ - public Builder unsetLimit() { - limit = null; - return this; - } - - /** - * Setter for status. - * @param status String value for status. - * @return Builder - */ - public Builder status(String status) { - this.status = status; - return this; - } - - /** - * Setter for batchToken. - * @param batchToken String value for batchToken. - * @return Builder - */ - public Builder batchToken(String batchToken) { - this.batchToken = OptionalNullable.of(batchToken); - return this; - } - - /** - * UnSetter for batchToken. - * @return Builder - */ - public Builder unsetBatchToken() { - batchToken = null; - return this; - } - - /** - * Builds a new {@link V1ListSettlementsRequest} object using the set fields. - * @return {@link V1ListSettlementsRequest} - */ - public V1ListSettlementsRequest build() { - return new V1ListSettlementsRequest(order, beginTime, endTime, limit, status, - batchToken); - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1ListSettlementsResponse.java b/src/main/java/com/squareup/square/models/V1ListSettlementsResponse.java deleted file mode 100644 index 436a27af..00000000 --- a/src/main/java/com/squareup/square/models/V1ListSettlementsResponse.java +++ /dev/null @@ -1,100 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Objects; - -/** - * This is a model class for V1ListSettlementsResponse type. - */ -public class V1ListSettlementsResponse { - private final List items; - - /** - * Initialization constructor. - * @param items List of V1Settlement value for items. - */ - @JsonCreator - public V1ListSettlementsResponse( - @JsonProperty("items") List items) { - this.items = items; - } - - /** - * Getter for Items. - * @return Returns the List of V1Settlement - */ - @JsonGetter("items") - @JsonInclude(JsonInclude.Include.NON_NULL) - public List getItems() { - return items; - } - - @Override - public int hashCode() { - return Objects.hash(items); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1ListSettlementsResponse)) { - return false; - } - V1ListSettlementsResponse other = (V1ListSettlementsResponse) obj; - return Objects.equals(items, other.items); - } - - /** - * Converts this V1ListSettlementsResponse into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1ListSettlementsResponse [" + "items=" + items + "]"; - } - - /** - * Builds a new {@link V1ListSettlementsResponse.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1ListSettlementsResponse.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .items(getItems()); - return builder; - } - - /** - * Class to build instances of {@link V1ListSettlementsResponse}. - */ - public static class Builder { - private List items; - - - - /** - * Setter for items. - * @param items List of V1Settlement value for items. - * @return Builder - */ - public Builder items(List items) { - this.items = items; - return this; - } - - /** - * Builds a new {@link V1ListSettlementsResponse} object using the set fields. - * @return {@link V1ListSettlementsResponse} - */ - public V1ListSettlementsResponse build() { - return new V1ListSettlementsResponse(items); - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1Payment.java b/src/main/java/com/squareup/square/models/V1Payment.java deleted file mode 100644 index d029225b..00000000 --- a/src/main/java/com/squareup/square/models/V1Payment.java +++ /dev/null @@ -1,1171 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.squareup.square.http.client.HttpContext; -import io.apimatic.core.types.OptionalNullable; -import java.util.List; -import java.util.Objects; - -/** - * This is a model class for V1Payment type. - */ -public class V1Payment { - private HttpContext httpContext; - private final String id; - private final OptionalNullable merchantId; - private final String createdAt; - private final OptionalNullable creatorId; - private final V1Device device; - private final OptionalNullable paymentUrl; - private final OptionalNullable receiptUrl; - private final V1Money inclusiveTaxMoney; - private final V1Money additiveTaxMoney; - private final V1Money taxMoney; - private final V1Money tipMoney; - private final V1Money discountMoney; - private final V1Money totalCollectedMoney; - private final V1Money processingFeeMoney; - private final V1Money netTotalMoney; - private final V1Money refundedMoney; - private final V1Money swedishRoundingMoney; - private final V1Money grossSalesMoney; - private final V1Money netSalesMoney; - private final OptionalNullable> inclusiveTax; - private final OptionalNullable> additiveTax; - private final OptionalNullable> tender; - private final OptionalNullable> refunds; - private final OptionalNullable> itemizations; - private final V1Money surchargeMoney; - private final OptionalNullable> surcharges; - private final OptionalNullable isPartial; - - /** - * Initialization constructor. - * @param id String value for id. - * @param merchantId String value for merchantId. - * @param createdAt String value for createdAt. - * @param creatorId String value for creatorId. - * @param device V1Device value for device. - * @param paymentUrl String value for paymentUrl. - * @param receiptUrl String value for receiptUrl. - * @param inclusiveTaxMoney V1Money value for inclusiveTaxMoney. - * @param additiveTaxMoney V1Money value for additiveTaxMoney. - * @param taxMoney V1Money value for taxMoney. - * @param tipMoney V1Money value for tipMoney. - * @param discountMoney V1Money value for discountMoney. - * @param totalCollectedMoney V1Money value for totalCollectedMoney. - * @param processingFeeMoney V1Money value for processingFeeMoney. - * @param netTotalMoney V1Money value for netTotalMoney. - * @param refundedMoney V1Money value for refundedMoney. - * @param swedishRoundingMoney V1Money value for swedishRoundingMoney. - * @param grossSalesMoney V1Money value for grossSalesMoney. - * @param netSalesMoney V1Money value for netSalesMoney. - * @param inclusiveTax List of V1PaymentTax value for inclusiveTax. - * @param additiveTax List of V1PaymentTax value for additiveTax. - * @param tender List of V1Tender value for tender. - * @param refunds List of V1Refund value for refunds. - * @param itemizations List of V1PaymentItemization value for itemizations. - * @param surchargeMoney V1Money value for surchargeMoney. - * @param surcharges List of V1PaymentSurcharge value for surcharges. - * @param isPartial Boolean value for isPartial. - */ - @JsonCreator - public V1Payment( - @JsonProperty("id") String id, - @JsonProperty("merchant_id") String merchantId, - @JsonProperty("created_at") String createdAt, - @JsonProperty("creator_id") String creatorId, - @JsonProperty("device") V1Device device, - @JsonProperty("payment_url") String paymentUrl, - @JsonProperty("receipt_url") String receiptUrl, - @JsonProperty("inclusive_tax_money") V1Money inclusiveTaxMoney, - @JsonProperty("additive_tax_money") V1Money additiveTaxMoney, - @JsonProperty("tax_money") V1Money taxMoney, - @JsonProperty("tip_money") V1Money tipMoney, - @JsonProperty("discount_money") V1Money discountMoney, - @JsonProperty("total_collected_money") V1Money totalCollectedMoney, - @JsonProperty("processing_fee_money") V1Money processingFeeMoney, - @JsonProperty("net_total_money") V1Money netTotalMoney, - @JsonProperty("refunded_money") V1Money refundedMoney, - @JsonProperty("swedish_rounding_money") V1Money swedishRoundingMoney, - @JsonProperty("gross_sales_money") V1Money grossSalesMoney, - @JsonProperty("net_sales_money") V1Money netSalesMoney, - @JsonProperty("inclusive_tax") List inclusiveTax, - @JsonProperty("additive_tax") List additiveTax, - @JsonProperty("tender") List tender, - @JsonProperty("refunds") List refunds, - @JsonProperty("itemizations") List itemizations, - @JsonProperty("surcharge_money") V1Money surchargeMoney, - @JsonProperty("surcharges") List surcharges, - @JsonProperty("is_partial") Boolean isPartial) { - this.id = id; - this.merchantId = OptionalNullable.of(merchantId); - this.createdAt = createdAt; - this.creatorId = OptionalNullable.of(creatorId); - this.device = device; - this.paymentUrl = OptionalNullable.of(paymentUrl); - this.receiptUrl = OptionalNullable.of(receiptUrl); - this.inclusiveTaxMoney = inclusiveTaxMoney; - this.additiveTaxMoney = additiveTaxMoney; - this.taxMoney = taxMoney; - this.tipMoney = tipMoney; - this.discountMoney = discountMoney; - this.totalCollectedMoney = totalCollectedMoney; - this.processingFeeMoney = processingFeeMoney; - this.netTotalMoney = netTotalMoney; - this.refundedMoney = refundedMoney; - this.swedishRoundingMoney = swedishRoundingMoney; - this.grossSalesMoney = grossSalesMoney; - this.netSalesMoney = netSalesMoney; - this.inclusiveTax = OptionalNullable.of(inclusiveTax); - this.additiveTax = OptionalNullable.of(additiveTax); - this.tender = OptionalNullable.of(tender); - this.refunds = OptionalNullable.of(refunds); - this.itemizations = OptionalNullable.of(itemizations); - this.surchargeMoney = surchargeMoney; - this.surcharges = OptionalNullable.of(surcharges); - this.isPartial = OptionalNullable.of(isPartial); - } - - /** - * Initialization constructor. - * @param id String value for id. - * @param merchantId String value for merchantId. - * @param createdAt String value for createdAt. - * @param creatorId String value for creatorId. - * @param device V1Device value for device. - * @param paymentUrl String value for paymentUrl. - * @param receiptUrl String value for receiptUrl. - * @param inclusiveTaxMoney V1Money value for inclusiveTaxMoney. - * @param additiveTaxMoney V1Money value for additiveTaxMoney. - * @param taxMoney V1Money value for taxMoney. - * @param tipMoney V1Money value for tipMoney. - * @param discountMoney V1Money value for discountMoney. - * @param totalCollectedMoney V1Money value for totalCollectedMoney. - * @param processingFeeMoney V1Money value for processingFeeMoney. - * @param netTotalMoney V1Money value for netTotalMoney. - * @param refundedMoney V1Money value for refundedMoney. - * @param swedishRoundingMoney V1Money value for swedishRoundingMoney. - * @param grossSalesMoney V1Money value for grossSalesMoney. - * @param netSalesMoney V1Money value for netSalesMoney. - * @param inclusiveTax List of V1PaymentTax value for inclusiveTax. - * @param additiveTax List of V1PaymentTax value for additiveTax. - * @param tender List of V1Tender value for tender. - * @param refunds List of V1Refund value for refunds. - * @param itemizations List of V1PaymentItemization value for itemizations. - * @param surchargeMoney V1Money value for surchargeMoney. - * @param surcharges List of V1PaymentSurcharge value for surcharges. - * @param isPartial Boolean value for isPartial. - */ - - protected V1Payment(String id, OptionalNullable merchantId, String createdAt, - OptionalNullable creatorId, V1Device device, - OptionalNullable paymentUrl, OptionalNullable receiptUrl, - V1Money inclusiveTaxMoney, V1Money additiveTaxMoney, V1Money taxMoney, V1Money tipMoney, - V1Money discountMoney, V1Money totalCollectedMoney, V1Money processingFeeMoney, - V1Money netTotalMoney, V1Money refundedMoney, V1Money swedishRoundingMoney, - V1Money grossSalesMoney, V1Money netSalesMoney, - OptionalNullable> inclusiveTax, - OptionalNullable> additiveTax, - OptionalNullable> tender, OptionalNullable> refunds, - OptionalNullable> itemizations, V1Money surchargeMoney, - OptionalNullable> surcharges, - OptionalNullable isPartial) { - this.id = id; - this.merchantId = merchantId; - this.createdAt = createdAt; - this.creatorId = creatorId; - this.device = device; - this.paymentUrl = paymentUrl; - this.receiptUrl = receiptUrl; - this.inclusiveTaxMoney = inclusiveTaxMoney; - this.additiveTaxMoney = additiveTaxMoney; - this.taxMoney = taxMoney; - this.tipMoney = tipMoney; - this.discountMoney = discountMoney; - this.totalCollectedMoney = totalCollectedMoney; - this.processingFeeMoney = processingFeeMoney; - this.netTotalMoney = netTotalMoney; - this.refundedMoney = refundedMoney; - this.swedishRoundingMoney = swedishRoundingMoney; - this.grossSalesMoney = grossSalesMoney; - this.netSalesMoney = netSalesMoney; - this.inclusiveTax = inclusiveTax; - this.additiveTax = additiveTax; - this.tender = tender; - this.refunds = refunds; - this.itemizations = itemizations; - this.surchargeMoney = surchargeMoney; - this.surcharges = surcharges; - this.isPartial = isPartial; - } - - @JsonIgnore - public HttpContext getContext() { - return httpContext; - } - - /** - * Getter for Id. - * The payment's unique identifier. - * @return Returns the String - */ - @JsonGetter("id") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getId() { - return id; - } - - /** - * Internal Getter for MerchantId. - * The unique identifier of the merchant that took the payment. - * @return Returns the Internal String - */ - @JsonGetter("merchant_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetMerchantId() { - return this.merchantId; - } - - /** - * Getter for MerchantId. - * The unique identifier of the merchant that took the payment. - * @return Returns the String - */ - @JsonIgnore - public String getMerchantId() { - return OptionalNullable.getFrom(merchantId); - } - - /** - * Getter for CreatedAt. - * The time when the payment was created, in ISO 8601 format. Reflects the time of the first - * payment if the object represents an incomplete partial payment, and the time of the last or - * complete payment otherwise. - * @return Returns the String - */ - @JsonGetter("created_at") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getCreatedAt() { - return createdAt; - } - - /** - * Internal Getter for CreatorId. - * The unique identifier of the Square account that took the payment. - * @return Returns the Internal String - */ - @JsonGetter("creator_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetCreatorId() { - return this.creatorId; - } - - /** - * Getter for CreatorId. - * The unique identifier of the Square account that took the payment. - * @return Returns the String - */ - @JsonIgnore - public String getCreatorId() { - return OptionalNullable.getFrom(creatorId); - } - - /** - * Getter for Device. - * @return Returns the V1Device - */ - @JsonGetter("device") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Device getDevice() { - return device; - } - - /** - * Internal Getter for PaymentUrl. - * The URL of the payment's detail page in the merchant dashboard. The merchant must be signed - * in to the merchant dashboard to view this page. - * @return Returns the Internal String - */ - @JsonGetter("payment_url") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetPaymentUrl() { - return this.paymentUrl; - } - - /** - * Getter for PaymentUrl. - * The URL of the payment's detail page in the merchant dashboard. The merchant must be signed - * in to the merchant dashboard to view this page. - * @return Returns the String - */ - @JsonIgnore - public String getPaymentUrl() { - return OptionalNullable.getFrom(paymentUrl); - } - - /** - * Internal Getter for ReceiptUrl. - * The URL of the receipt for the payment. Note that for split tender payments, this URL - * corresponds to the receipt for the first tender listed in the payment's tender field. Each - * Tender object has its own receipt_url field you can use to get the other receipts associated - * with a split tender payment. - * @return Returns the Internal String - */ - @JsonGetter("receipt_url") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetReceiptUrl() { - return this.receiptUrl; - } - - /** - * Getter for ReceiptUrl. - * The URL of the receipt for the payment. Note that for split tender payments, this URL - * corresponds to the receipt for the first tender listed in the payment's tender field. Each - * Tender object has its own receipt_url field you can use to get the other receipts associated - * with a split tender payment. - * @return Returns the String - */ - @JsonIgnore - public String getReceiptUrl() { - return OptionalNullable.getFrom(receiptUrl); - } - - /** - * Getter for InclusiveTaxMoney. - * @return Returns the V1Money - */ - @JsonGetter("inclusive_tax_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getInclusiveTaxMoney() { - return inclusiveTaxMoney; - } - - /** - * Getter for AdditiveTaxMoney. - * @return Returns the V1Money - */ - @JsonGetter("additive_tax_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getAdditiveTaxMoney() { - return additiveTaxMoney; - } - - /** - * Getter for TaxMoney. - * @return Returns the V1Money - */ - @JsonGetter("tax_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getTaxMoney() { - return taxMoney; - } - - /** - * Getter for TipMoney. - * @return Returns the V1Money - */ - @JsonGetter("tip_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getTipMoney() { - return tipMoney; - } - - /** - * Getter for DiscountMoney. - * @return Returns the V1Money - */ - @JsonGetter("discount_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getDiscountMoney() { - return discountMoney; - } - - /** - * Getter for TotalCollectedMoney. - * @return Returns the V1Money - */ - @JsonGetter("total_collected_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getTotalCollectedMoney() { - return totalCollectedMoney; - } - - /** - * Getter for ProcessingFeeMoney. - * @return Returns the V1Money - */ - @JsonGetter("processing_fee_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getProcessingFeeMoney() { - return processingFeeMoney; - } - - /** - * Getter for NetTotalMoney. - * @return Returns the V1Money - */ - @JsonGetter("net_total_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getNetTotalMoney() { - return netTotalMoney; - } - - /** - * Getter for RefundedMoney. - * @return Returns the V1Money - */ - @JsonGetter("refunded_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getRefundedMoney() { - return refundedMoney; - } - - /** - * Getter for SwedishRoundingMoney. - * @return Returns the V1Money - */ - @JsonGetter("swedish_rounding_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getSwedishRoundingMoney() { - return swedishRoundingMoney; - } - - /** - * Getter for GrossSalesMoney. - * @return Returns the V1Money - */ - @JsonGetter("gross_sales_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getGrossSalesMoney() { - return grossSalesMoney; - } - - /** - * Getter for NetSalesMoney. - * @return Returns the V1Money - */ - @JsonGetter("net_sales_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getNetSalesMoney() { - return netSalesMoney; - } - - /** - * Internal Getter for InclusiveTax. - * All of the inclusive taxes associated with the payment. - * @return Returns the Internal List of V1PaymentTax - */ - @JsonGetter("inclusive_tax") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetInclusiveTax() { - return this.inclusiveTax; - } - - /** - * Getter for InclusiveTax. - * All of the inclusive taxes associated with the payment. - * @return Returns the List of V1PaymentTax - */ - @JsonIgnore - public List getInclusiveTax() { - return OptionalNullable.getFrom(inclusiveTax); - } - - /** - * Internal Getter for AdditiveTax. - * All of the additive taxes associated with the payment. - * @return Returns the Internal List of V1PaymentTax - */ - @JsonGetter("additive_tax") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetAdditiveTax() { - return this.additiveTax; - } - - /** - * Getter for AdditiveTax. - * All of the additive taxes associated with the payment. - * @return Returns the List of V1PaymentTax - */ - @JsonIgnore - public List getAdditiveTax() { - return OptionalNullable.getFrom(additiveTax); - } - - /** - * Internal Getter for Tender. - * All of the tenders associated with the payment. - * @return Returns the Internal List of V1Tender - */ - @JsonGetter("tender") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetTender() { - return this.tender; - } - - /** - * Getter for Tender. - * All of the tenders associated with the payment. - * @return Returns the List of V1Tender - */ - @JsonIgnore - public List getTender() { - return OptionalNullable.getFrom(tender); - } - - /** - * Internal Getter for Refunds. - * All of the refunds applied to the payment. Note that the value of all refunds on a payment - * can exceed the value of all tenders if a merchant chooses to refund money to a tender after - * previously accepting returned goods as part of an exchange. - * @return Returns the Internal List of V1Refund - */ - @JsonGetter("refunds") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetRefunds() { - return this.refunds; - } - - /** - * Getter for Refunds. - * All of the refunds applied to the payment. Note that the value of all refunds on a payment - * can exceed the value of all tenders if a merchant chooses to refund money to a tender after - * previously accepting returned goods as part of an exchange. - * @return Returns the List of V1Refund - */ - @JsonIgnore - public List getRefunds() { - return OptionalNullable.getFrom(refunds); - } - - /** - * Internal Getter for Itemizations. - * The items purchased in the payment. - * @return Returns the Internal List of V1PaymentItemization - */ - @JsonGetter("itemizations") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetItemizations() { - return this.itemizations; - } - - /** - * Getter for Itemizations. - * The items purchased in the payment. - * @return Returns the List of V1PaymentItemization - */ - @JsonIgnore - public List getItemizations() { - return OptionalNullable.getFrom(itemizations); - } - - /** - * Getter for SurchargeMoney. - * @return Returns the V1Money - */ - @JsonGetter("surcharge_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getSurchargeMoney() { - return surchargeMoney; - } - - /** - * Internal Getter for Surcharges. - * A list of all surcharges associated with the payment. - * @return Returns the Internal List of V1PaymentSurcharge - */ - @JsonGetter("surcharges") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetSurcharges() { - return this.surcharges; - } - - /** - * Getter for Surcharges. - * A list of all surcharges associated with the payment. - * @return Returns the List of V1PaymentSurcharge - */ - @JsonIgnore - public List getSurcharges() { - return OptionalNullable.getFrom(surcharges); - } - - /** - * Internal Getter for IsPartial. - * Indicates whether or not the payment is only partially paid for. If true, this payment will - * have the tenders collected so far, but the itemizations will be empty until the payment is - * completed. - * @return Returns the Internal Boolean - */ - @JsonGetter("is_partial") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetIsPartial() { - return this.isPartial; - } - - /** - * Getter for IsPartial. - * Indicates whether or not the payment is only partially paid for. If true, this payment will - * have the tenders collected so far, but the itemizations will be empty until the payment is - * completed. - * @return Returns the Boolean - */ - @JsonIgnore - public Boolean getIsPartial() { - return OptionalNullable.getFrom(isPartial); - } - - @Override - public int hashCode() { - return Objects.hash(id, merchantId, createdAt, creatorId, device, paymentUrl, receiptUrl, - inclusiveTaxMoney, additiveTaxMoney, taxMoney, tipMoney, discountMoney, - totalCollectedMoney, processingFeeMoney, netTotalMoney, refundedMoney, - swedishRoundingMoney, grossSalesMoney, netSalesMoney, inclusiveTax, additiveTax, - tender, refunds, itemizations, surchargeMoney, surcharges, isPartial); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1Payment)) { - return false; - } - V1Payment other = (V1Payment) obj; - return Objects.equals(id, other.id) - && Objects.equals(merchantId, other.merchantId) - && Objects.equals(createdAt, other.createdAt) - && Objects.equals(creatorId, other.creatorId) - && Objects.equals(device, other.device) - && Objects.equals(paymentUrl, other.paymentUrl) - && Objects.equals(receiptUrl, other.receiptUrl) - && Objects.equals(inclusiveTaxMoney, other.inclusiveTaxMoney) - && Objects.equals(additiveTaxMoney, other.additiveTaxMoney) - && Objects.equals(taxMoney, other.taxMoney) - && Objects.equals(tipMoney, other.tipMoney) - && Objects.equals(discountMoney, other.discountMoney) - && Objects.equals(totalCollectedMoney, other.totalCollectedMoney) - && Objects.equals(processingFeeMoney, other.processingFeeMoney) - && Objects.equals(netTotalMoney, other.netTotalMoney) - && Objects.equals(refundedMoney, other.refundedMoney) - && Objects.equals(swedishRoundingMoney, other.swedishRoundingMoney) - && Objects.equals(grossSalesMoney, other.grossSalesMoney) - && Objects.equals(netSalesMoney, other.netSalesMoney) - && Objects.equals(inclusiveTax, other.inclusiveTax) - && Objects.equals(additiveTax, other.additiveTax) - && Objects.equals(tender, other.tender) - && Objects.equals(refunds, other.refunds) - && Objects.equals(itemizations, other.itemizations) - && Objects.equals(surchargeMoney, other.surchargeMoney) - && Objects.equals(surcharges, other.surcharges) - && Objects.equals(isPartial, other.isPartial); - } - - /** - * Converts this V1Payment into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1Payment [" + "id=" + id + ", merchantId=" + merchantId + ", createdAt=" - + createdAt + ", creatorId=" + creatorId + ", device=" + device + ", paymentUrl=" - + paymentUrl + ", receiptUrl=" + receiptUrl + ", inclusiveTaxMoney=" - + inclusiveTaxMoney + ", additiveTaxMoney=" + additiveTaxMoney + ", taxMoney=" - + taxMoney + ", tipMoney=" + tipMoney + ", discountMoney=" + discountMoney - + ", totalCollectedMoney=" + totalCollectedMoney + ", processingFeeMoney=" - + processingFeeMoney + ", netTotalMoney=" + netTotalMoney + ", refundedMoney=" - + refundedMoney + ", swedishRoundingMoney=" + swedishRoundingMoney - + ", grossSalesMoney=" + grossSalesMoney + ", netSalesMoney=" + netSalesMoney - + ", inclusiveTax=" + inclusiveTax + ", additiveTax=" + additiveTax + ", tender=" - + tender + ", refunds=" + refunds + ", itemizations=" + itemizations - + ", surchargeMoney=" + surchargeMoney + ", surcharges=" + surcharges - + ", isPartial=" + isPartial + "]"; - } - - /** - * Builds a new {@link V1Payment.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1Payment.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .id(getId()) - .createdAt(getCreatedAt()) - .device(getDevice()) - .inclusiveTaxMoney(getInclusiveTaxMoney()) - .additiveTaxMoney(getAdditiveTaxMoney()) - .taxMoney(getTaxMoney()) - .tipMoney(getTipMoney()) - .discountMoney(getDiscountMoney()) - .totalCollectedMoney(getTotalCollectedMoney()) - .processingFeeMoney(getProcessingFeeMoney()) - .netTotalMoney(getNetTotalMoney()) - .refundedMoney(getRefundedMoney()) - .swedishRoundingMoney(getSwedishRoundingMoney()) - .grossSalesMoney(getGrossSalesMoney()) - .netSalesMoney(getNetSalesMoney()) - .surchargeMoney(getSurchargeMoney()); - builder.merchantId = internalGetMerchantId(); - builder.creatorId = internalGetCreatorId(); - builder.paymentUrl = internalGetPaymentUrl(); - builder.receiptUrl = internalGetReceiptUrl(); - builder.inclusiveTax = internalGetInclusiveTax(); - builder.additiveTax = internalGetAdditiveTax(); - builder.tender = internalGetTender(); - builder.refunds = internalGetRefunds(); - builder.itemizations = internalGetItemizations(); - builder.surcharges = internalGetSurcharges(); - builder.isPartial = internalGetIsPartial(); - return builder; - } - - /** - * Class to build instances of {@link V1Payment}. - */ - public static class Builder { - private HttpContext httpContext; - private String id; - private OptionalNullable merchantId; - private String createdAt; - private OptionalNullable creatorId; - private V1Device device; - private OptionalNullable paymentUrl; - private OptionalNullable receiptUrl; - private V1Money inclusiveTaxMoney; - private V1Money additiveTaxMoney; - private V1Money taxMoney; - private V1Money tipMoney; - private V1Money discountMoney; - private V1Money totalCollectedMoney; - private V1Money processingFeeMoney; - private V1Money netTotalMoney; - private V1Money refundedMoney; - private V1Money swedishRoundingMoney; - private V1Money grossSalesMoney; - private V1Money netSalesMoney; - private OptionalNullable> inclusiveTax; - private OptionalNullable> additiveTax; - private OptionalNullable> tender; - private OptionalNullable> refunds; - private OptionalNullable> itemizations; - private V1Money surchargeMoney; - private OptionalNullable> surcharges; - private OptionalNullable isPartial; - - - - /** - * Setter for httpContext. - * @param httpContext HttpContext value for httpContext. - * @return Builder - */ - public Builder httpContext(HttpContext httpContext) { - this.httpContext = httpContext; - return this; - } - - /** - * Setter for id. - * @param id String value for id. - * @return Builder - */ - public Builder id(String id) { - this.id = id; - return this; - } - - /** - * Setter for merchantId. - * @param merchantId String value for merchantId. - * @return Builder - */ - public Builder merchantId(String merchantId) { - this.merchantId = OptionalNullable.of(merchantId); - return this; - } - - /** - * UnSetter for merchantId. - * @return Builder - */ - public Builder unsetMerchantId() { - merchantId = null; - return this; - } - - /** - * Setter for createdAt. - * @param createdAt String value for createdAt. - * @return Builder - */ - public Builder createdAt(String createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Setter for creatorId. - * @param creatorId String value for creatorId. - * @return Builder - */ - public Builder creatorId(String creatorId) { - this.creatorId = OptionalNullable.of(creatorId); - return this; - } - - /** - * UnSetter for creatorId. - * @return Builder - */ - public Builder unsetCreatorId() { - creatorId = null; - return this; - } - - /** - * Setter for device. - * @param device V1Device value for device. - * @return Builder - */ - public Builder device(V1Device device) { - this.device = device; - return this; - } - - /** - * Setter for paymentUrl. - * @param paymentUrl String value for paymentUrl. - * @return Builder - */ - public Builder paymentUrl(String paymentUrl) { - this.paymentUrl = OptionalNullable.of(paymentUrl); - return this; - } - - /** - * UnSetter for paymentUrl. - * @return Builder - */ - public Builder unsetPaymentUrl() { - paymentUrl = null; - return this; - } - - /** - * Setter for receiptUrl. - * @param receiptUrl String value for receiptUrl. - * @return Builder - */ - public Builder receiptUrl(String receiptUrl) { - this.receiptUrl = OptionalNullable.of(receiptUrl); - return this; - } - - /** - * UnSetter for receiptUrl. - * @return Builder - */ - public Builder unsetReceiptUrl() { - receiptUrl = null; - return this; - } - - /** - * Setter for inclusiveTaxMoney. - * @param inclusiveTaxMoney V1Money value for inclusiveTaxMoney. - * @return Builder - */ - public Builder inclusiveTaxMoney(V1Money inclusiveTaxMoney) { - this.inclusiveTaxMoney = inclusiveTaxMoney; - return this; - } - - /** - * Setter for additiveTaxMoney. - * @param additiveTaxMoney V1Money value for additiveTaxMoney. - * @return Builder - */ - public Builder additiveTaxMoney(V1Money additiveTaxMoney) { - this.additiveTaxMoney = additiveTaxMoney; - return this; - } - - /** - * Setter for taxMoney. - * @param taxMoney V1Money value for taxMoney. - * @return Builder - */ - public Builder taxMoney(V1Money taxMoney) { - this.taxMoney = taxMoney; - return this; - } - - /** - * Setter for tipMoney. - * @param tipMoney V1Money value for tipMoney. - * @return Builder - */ - public Builder tipMoney(V1Money tipMoney) { - this.tipMoney = tipMoney; - return this; - } - - /** - * Setter for discountMoney. - * @param discountMoney V1Money value for discountMoney. - * @return Builder - */ - public Builder discountMoney(V1Money discountMoney) { - this.discountMoney = discountMoney; - return this; - } - - /** - * Setter for totalCollectedMoney. - * @param totalCollectedMoney V1Money value for totalCollectedMoney. - * @return Builder - */ - public Builder totalCollectedMoney(V1Money totalCollectedMoney) { - this.totalCollectedMoney = totalCollectedMoney; - return this; - } - - /** - * Setter for processingFeeMoney. - * @param processingFeeMoney V1Money value for processingFeeMoney. - * @return Builder - */ - public Builder processingFeeMoney(V1Money processingFeeMoney) { - this.processingFeeMoney = processingFeeMoney; - return this; - } - - /** - * Setter for netTotalMoney. - * @param netTotalMoney V1Money value for netTotalMoney. - * @return Builder - */ - public Builder netTotalMoney(V1Money netTotalMoney) { - this.netTotalMoney = netTotalMoney; - return this; - } - - /** - * Setter for refundedMoney. - * @param refundedMoney V1Money value for refundedMoney. - * @return Builder - */ - public Builder refundedMoney(V1Money refundedMoney) { - this.refundedMoney = refundedMoney; - return this; - } - - /** - * Setter for swedishRoundingMoney. - * @param swedishRoundingMoney V1Money value for swedishRoundingMoney. - * @return Builder - */ - public Builder swedishRoundingMoney(V1Money swedishRoundingMoney) { - this.swedishRoundingMoney = swedishRoundingMoney; - return this; - } - - /** - * Setter for grossSalesMoney. - * @param grossSalesMoney V1Money value for grossSalesMoney. - * @return Builder - */ - public Builder grossSalesMoney(V1Money grossSalesMoney) { - this.grossSalesMoney = grossSalesMoney; - return this; - } - - /** - * Setter for netSalesMoney. - * @param netSalesMoney V1Money value for netSalesMoney. - * @return Builder - */ - public Builder netSalesMoney(V1Money netSalesMoney) { - this.netSalesMoney = netSalesMoney; - return this; - } - - /** - * Setter for inclusiveTax. - * @param inclusiveTax List of V1PaymentTax value for inclusiveTax. - * @return Builder - */ - public Builder inclusiveTax(List inclusiveTax) { - this.inclusiveTax = OptionalNullable.of(inclusiveTax); - return this; - } - - /** - * UnSetter for inclusiveTax. - * @return Builder - */ - public Builder unsetInclusiveTax() { - inclusiveTax = null; - return this; - } - - /** - * Setter for additiveTax. - * @param additiveTax List of V1PaymentTax value for additiveTax. - * @return Builder - */ - public Builder additiveTax(List additiveTax) { - this.additiveTax = OptionalNullable.of(additiveTax); - return this; - } - - /** - * UnSetter for additiveTax. - * @return Builder - */ - public Builder unsetAdditiveTax() { - additiveTax = null; - return this; - } - - /** - * Setter for tender. - * @param tender List of V1Tender value for tender. - * @return Builder - */ - public Builder tender(List tender) { - this.tender = OptionalNullable.of(tender); - return this; - } - - /** - * UnSetter for tender. - * @return Builder - */ - public Builder unsetTender() { - tender = null; - return this; - } - - /** - * Setter for refunds. - * @param refunds List of V1Refund value for refunds. - * @return Builder - */ - public Builder refunds(List refunds) { - this.refunds = OptionalNullable.of(refunds); - return this; - } - - /** - * UnSetter for refunds. - * @return Builder - */ - public Builder unsetRefunds() { - refunds = null; - return this; - } - - /** - * Setter for itemizations. - * @param itemizations List of V1PaymentItemization value for itemizations. - * @return Builder - */ - public Builder itemizations(List itemizations) { - this.itemizations = OptionalNullable.of(itemizations); - return this; - } - - /** - * UnSetter for itemizations. - * @return Builder - */ - public Builder unsetItemizations() { - itemizations = null; - return this; - } - - /** - * Setter for surchargeMoney. - * @param surchargeMoney V1Money value for surchargeMoney. - * @return Builder - */ - public Builder surchargeMoney(V1Money surchargeMoney) { - this.surchargeMoney = surchargeMoney; - return this; - } - - /** - * Setter for surcharges. - * @param surcharges List of V1PaymentSurcharge value for surcharges. - * @return Builder - */ - public Builder surcharges(List surcharges) { - this.surcharges = OptionalNullable.of(surcharges); - return this; - } - - /** - * UnSetter for surcharges. - * @return Builder - */ - public Builder unsetSurcharges() { - surcharges = null; - return this; - } - - /** - * Setter for isPartial. - * @param isPartial Boolean value for isPartial. - * @return Builder - */ - public Builder isPartial(Boolean isPartial) { - this.isPartial = OptionalNullable.of(isPartial); - return this; - } - - /** - * UnSetter for isPartial. - * @return Builder - */ - public Builder unsetIsPartial() { - isPartial = null; - return this; - } - - /** - * Builds a new {@link V1Payment} object using the set fields. - * @return {@link V1Payment} - */ - public V1Payment build() { - V1Payment model = - new V1Payment(id, merchantId, createdAt, creatorId, device, paymentUrl, - receiptUrl, inclusiveTaxMoney, additiveTaxMoney, taxMoney, tipMoney, - discountMoney, totalCollectedMoney, processingFeeMoney, netTotalMoney, - refundedMoney, swedishRoundingMoney, grossSalesMoney, netSalesMoney, - inclusiveTax, additiveTax, tender, refunds, itemizations, - surchargeMoney, surcharges, isPartial); - model.httpContext = httpContext; - return model; - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1PaymentDiscount.java b/src/main/java/com/squareup/square/models/V1PaymentDiscount.java deleted file mode 100644 index ce532f30..00000000 --- a/src/main/java/com/squareup/square/models/V1PaymentDiscount.java +++ /dev/null @@ -1,215 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.apimatic.core.types.OptionalNullable; -import java.util.Objects; - -/** - * This is a model class for V1PaymentDiscount type. - */ -public class V1PaymentDiscount { - private final OptionalNullable name; - private final V1Money appliedMoney; - private final OptionalNullable discountId; - - /** - * Initialization constructor. - * @param name String value for name. - * @param appliedMoney V1Money value for appliedMoney. - * @param discountId String value for discountId. - */ - @JsonCreator - public V1PaymentDiscount( - @JsonProperty("name") String name, - @JsonProperty("applied_money") V1Money appliedMoney, - @JsonProperty("discount_id") String discountId) { - this.name = OptionalNullable.of(name); - this.appliedMoney = appliedMoney; - this.discountId = OptionalNullable.of(discountId); - } - - /** - * Initialization constructor. - * @param name String value for name. - * @param appliedMoney V1Money value for appliedMoney. - * @param discountId String value for discountId. - */ - - protected V1PaymentDiscount(OptionalNullable name, V1Money appliedMoney, - OptionalNullable discountId) { - this.name = name; - this.appliedMoney = appliedMoney; - this.discountId = discountId; - } - - /** - * Internal Getter for Name. - * The discount's name. - * @return Returns the Internal String - */ - @JsonGetter("name") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetName() { - return this.name; - } - - /** - * Getter for Name. - * The discount's name. - * @return Returns the String - */ - @JsonIgnore - public String getName() { - return OptionalNullable.getFrom(name); - } - - /** - * Getter for AppliedMoney. - * @return Returns the V1Money - */ - @JsonGetter("applied_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getAppliedMoney() { - return appliedMoney; - } - - /** - * Internal Getter for DiscountId. - * The ID of the applied discount, if available. Discounts applied in older versions of Square - * Register might not have an ID. - * @return Returns the Internal String - */ - @JsonGetter("discount_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetDiscountId() { - return this.discountId; - } - - /** - * Getter for DiscountId. - * The ID of the applied discount, if available. Discounts applied in older versions of Square - * Register might not have an ID. - * @return Returns the String - */ - @JsonIgnore - public String getDiscountId() { - return OptionalNullable.getFrom(discountId); - } - - @Override - public int hashCode() { - return Objects.hash(name, appliedMoney, discountId); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1PaymentDiscount)) { - return false; - } - V1PaymentDiscount other = (V1PaymentDiscount) obj; - return Objects.equals(name, other.name) - && Objects.equals(appliedMoney, other.appliedMoney) - && Objects.equals(discountId, other.discountId); - } - - /** - * Converts this V1PaymentDiscount into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1PaymentDiscount [" + "name=" + name + ", appliedMoney=" + appliedMoney - + ", discountId=" + discountId + "]"; - } - - /** - * Builds a new {@link V1PaymentDiscount.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1PaymentDiscount.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .appliedMoney(getAppliedMoney()); - builder.name = internalGetName(); - builder.discountId = internalGetDiscountId(); - return builder; - } - - /** - * Class to build instances of {@link V1PaymentDiscount}. - */ - public static class Builder { - private OptionalNullable name; - private V1Money appliedMoney; - private OptionalNullable discountId; - - - - /** - * Setter for name. - * @param name String value for name. - * @return Builder - */ - public Builder name(String name) { - this.name = OptionalNullable.of(name); - return this; - } - - /** - * UnSetter for name. - * @return Builder - */ - public Builder unsetName() { - name = null; - return this; - } - - /** - * Setter for appliedMoney. - * @param appliedMoney V1Money value for appliedMoney. - * @return Builder - */ - public Builder appliedMoney(V1Money appliedMoney) { - this.appliedMoney = appliedMoney; - return this; - } - - /** - * Setter for discountId. - * @param discountId String value for discountId. - * @return Builder - */ - public Builder discountId(String discountId) { - this.discountId = OptionalNullable.of(discountId); - return this; - } - - /** - * UnSetter for discountId. - * @return Builder - */ - public Builder unsetDiscountId() { - discountId = null; - return this; - } - - /** - * Builds a new {@link V1PaymentDiscount} object using the set fields. - * @return {@link V1PaymentDiscount} - */ - public V1PaymentDiscount build() { - return new V1PaymentDiscount(name, appliedMoney, discountId); - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1PaymentItemDetail.java b/src/main/java/com/squareup/square/models/V1PaymentItemDetail.java deleted file mode 100644 index 9710d69e..00000000 --- a/src/main/java/com/squareup/square/models/V1PaymentItemDetail.java +++ /dev/null @@ -1,285 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.apimatic.core.types.OptionalNullable; -import java.util.Objects; - -/** - * This is a model class for V1PaymentItemDetail type. - */ -public class V1PaymentItemDetail { - private final OptionalNullable categoryName; - private final OptionalNullable sku; - private final OptionalNullable itemId; - private final OptionalNullable itemVariationId; - - /** - * Initialization constructor. - * @param categoryName String value for categoryName. - * @param sku String value for sku. - * @param itemId String value for itemId. - * @param itemVariationId String value for itemVariationId. - */ - @JsonCreator - public V1PaymentItemDetail( - @JsonProperty("category_name") String categoryName, - @JsonProperty("sku") String sku, - @JsonProperty("item_id") String itemId, - @JsonProperty("item_variation_id") String itemVariationId) { - this.categoryName = OptionalNullable.of(categoryName); - this.sku = OptionalNullable.of(sku); - this.itemId = OptionalNullable.of(itemId); - this.itemVariationId = OptionalNullable.of(itemVariationId); - } - - /** - * Initialization constructor. - * @param categoryName String value for categoryName. - * @param sku String value for sku. - * @param itemId String value for itemId. - * @param itemVariationId String value for itemVariationId. - */ - - protected V1PaymentItemDetail(OptionalNullable categoryName, - OptionalNullable sku, OptionalNullable itemId, - OptionalNullable itemVariationId) { - this.categoryName = categoryName; - this.sku = sku; - this.itemId = itemId; - this.itemVariationId = itemVariationId; - } - - /** - * Internal Getter for CategoryName. - * The name of the item's merchant-defined category, if any. - * @return Returns the Internal String - */ - @JsonGetter("category_name") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetCategoryName() { - return this.categoryName; - } - - /** - * Getter for CategoryName. - * The name of the item's merchant-defined category, if any. - * @return Returns the String - */ - @JsonIgnore - public String getCategoryName() { - return OptionalNullable.getFrom(categoryName); - } - - /** - * Internal Getter for Sku. - * The item's merchant-defined SKU, if any. - * @return Returns the Internal String - */ - @JsonGetter("sku") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetSku() { - return this.sku; - } - - /** - * Getter for Sku. - * The item's merchant-defined SKU, if any. - * @return Returns the String - */ - @JsonIgnore - public String getSku() { - return OptionalNullable.getFrom(sku); - } - - /** - * Internal Getter for ItemId. - * The unique ID of the item purchased, if any. - * @return Returns the Internal String - */ - @JsonGetter("item_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetItemId() { - return this.itemId; - } - - /** - * Getter for ItemId. - * The unique ID of the item purchased, if any. - * @return Returns the String - */ - @JsonIgnore - public String getItemId() { - return OptionalNullable.getFrom(itemId); - } - - /** - * Internal Getter for ItemVariationId. - * The unique ID of the item variation purchased, if any. - * @return Returns the Internal String - */ - @JsonGetter("item_variation_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetItemVariationId() { - return this.itemVariationId; - } - - /** - * Getter for ItemVariationId. - * The unique ID of the item variation purchased, if any. - * @return Returns the String - */ - @JsonIgnore - public String getItemVariationId() { - return OptionalNullable.getFrom(itemVariationId); - } - - @Override - public int hashCode() { - return Objects.hash(categoryName, sku, itemId, itemVariationId); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1PaymentItemDetail)) { - return false; - } - V1PaymentItemDetail other = (V1PaymentItemDetail) obj; - return Objects.equals(categoryName, other.categoryName) - && Objects.equals(sku, other.sku) - && Objects.equals(itemId, other.itemId) - && Objects.equals(itemVariationId, other.itemVariationId); - } - - /** - * Converts this V1PaymentItemDetail into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1PaymentItemDetail [" + "categoryName=" + categoryName + ", sku=" + sku - + ", itemId=" + itemId + ", itemVariationId=" + itemVariationId + "]"; - } - - /** - * Builds a new {@link V1PaymentItemDetail.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1PaymentItemDetail.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder(); - builder.categoryName = internalGetCategoryName(); - builder.sku = internalGetSku(); - builder.itemId = internalGetItemId(); - builder.itemVariationId = internalGetItemVariationId(); - return builder; - } - - /** - * Class to build instances of {@link V1PaymentItemDetail}. - */ - public static class Builder { - private OptionalNullable categoryName; - private OptionalNullable sku; - private OptionalNullable itemId; - private OptionalNullable itemVariationId; - - - - /** - * Setter for categoryName. - * @param categoryName String value for categoryName. - * @return Builder - */ - public Builder categoryName(String categoryName) { - this.categoryName = OptionalNullable.of(categoryName); - return this; - } - - /** - * UnSetter for categoryName. - * @return Builder - */ - public Builder unsetCategoryName() { - categoryName = null; - return this; - } - - /** - * Setter for sku. - * @param sku String value for sku. - * @return Builder - */ - public Builder sku(String sku) { - this.sku = OptionalNullable.of(sku); - return this; - } - - /** - * UnSetter for sku. - * @return Builder - */ - public Builder unsetSku() { - sku = null; - return this; - } - - /** - * Setter for itemId. - * @param itemId String value for itemId. - * @return Builder - */ - public Builder itemId(String itemId) { - this.itemId = OptionalNullable.of(itemId); - return this; - } - - /** - * UnSetter for itemId. - * @return Builder - */ - public Builder unsetItemId() { - itemId = null; - return this; - } - - /** - * Setter for itemVariationId. - * @param itemVariationId String value for itemVariationId. - * @return Builder - */ - public Builder itemVariationId(String itemVariationId) { - this.itemVariationId = OptionalNullable.of(itemVariationId); - return this; - } - - /** - * UnSetter for itemVariationId. - * @return Builder - */ - public Builder unsetItemVariationId() { - itemVariationId = null; - return this; - } - - /** - * Builds a new {@link V1PaymentItemDetail} object using the set fields. - * @return {@link V1PaymentItemDetail} - */ - public V1PaymentItemDetail build() { - return new V1PaymentItemDetail(categoryName, sku, itemId, itemVariationId); - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1PaymentItemization.java b/src/main/java/com/squareup/square/models/V1PaymentItemization.java deleted file mode 100644 index f9d705b5..00000000 --- a/src/main/java/com/squareup/square/models/V1PaymentItemization.java +++ /dev/null @@ -1,653 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.apimatic.core.types.OptionalNullable; -import java.util.List; -import java.util.Objects; - -/** - * This is a model class for V1PaymentItemization type. - */ -public class V1PaymentItemization { - private final OptionalNullable name; - private final OptionalNullable quantity; - private final String itemizationType; - private final V1PaymentItemDetail itemDetail; - private final OptionalNullable notes; - private final OptionalNullable itemVariationName; - private final V1Money totalMoney; - private final V1Money singleQuantityMoney; - private final V1Money grossSalesMoney; - private final V1Money discountMoney; - private final V1Money netSalesMoney; - private final OptionalNullable> taxes; - private final OptionalNullable> discounts; - private final OptionalNullable> modifiers; - - /** - * Initialization constructor. - * @param name String value for name. - * @param quantity Double value for quantity. - * @param itemizationType String value for itemizationType. - * @param itemDetail V1PaymentItemDetail value for itemDetail. - * @param notes String value for notes. - * @param itemVariationName String value for itemVariationName. - * @param totalMoney V1Money value for totalMoney. - * @param singleQuantityMoney V1Money value for singleQuantityMoney. - * @param grossSalesMoney V1Money value for grossSalesMoney. - * @param discountMoney V1Money value for discountMoney. - * @param netSalesMoney V1Money value for netSalesMoney. - * @param taxes List of V1PaymentTax value for taxes. - * @param discounts List of V1PaymentDiscount value for discounts. - * @param modifiers List of V1PaymentModifier value for modifiers. - */ - @JsonCreator - public V1PaymentItemization( - @JsonProperty("name") String name, - @JsonProperty("quantity") Double quantity, - @JsonProperty("itemization_type") String itemizationType, - @JsonProperty("item_detail") V1PaymentItemDetail itemDetail, - @JsonProperty("notes") String notes, - @JsonProperty("item_variation_name") String itemVariationName, - @JsonProperty("total_money") V1Money totalMoney, - @JsonProperty("single_quantity_money") V1Money singleQuantityMoney, - @JsonProperty("gross_sales_money") V1Money grossSalesMoney, - @JsonProperty("discount_money") V1Money discountMoney, - @JsonProperty("net_sales_money") V1Money netSalesMoney, - @JsonProperty("taxes") List taxes, - @JsonProperty("discounts") List discounts, - @JsonProperty("modifiers") List modifiers) { - this.name = OptionalNullable.of(name); - this.quantity = OptionalNullable.of(quantity); - this.itemizationType = itemizationType; - this.itemDetail = itemDetail; - this.notes = OptionalNullable.of(notes); - this.itemVariationName = OptionalNullable.of(itemVariationName); - this.totalMoney = totalMoney; - this.singleQuantityMoney = singleQuantityMoney; - this.grossSalesMoney = grossSalesMoney; - this.discountMoney = discountMoney; - this.netSalesMoney = netSalesMoney; - this.taxes = OptionalNullable.of(taxes); - this.discounts = OptionalNullable.of(discounts); - this.modifiers = OptionalNullable.of(modifiers); - } - - /** - * Initialization constructor. - * @param name String value for name. - * @param quantity Double value for quantity. - * @param itemizationType String value for itemizationType. - * @param itemDetail V1PaymentItemDetail value for itemDetail. - * @param notes String value for notes. - * @param itemVariationName String value for itemVariationName. - * @param totalMoney V1Money value for totalMoney. - * @param singleQuantityMoney V1Money value for singleQuantityMoney. - * @param grossSalesMoney V1Money value for grossSalesMoney. - * @param discountMoney V1Money value for discountMoney. - * @param netSalesMoney V1Money value for netSalesMoney. - * @param taxes List of V1PaymentTax value for taxes. - * @param discounts List of V1PaymentDiscount value for discounts. - * @param modifiers List of V1PaymentModifier value for modifiers. - */ - - protected V1PaymentItemization(OptionalNullable name, OptionalNullable quantity, - String itemizationType, V1PaymentItemDetail itemDetail, OptionalNullable notes, - OptionalNullable itemVariationName, V1Money totalMoney, - V1Money singleQuantityMoney, V1Money grossSalesMoney, V1Money discountMoney, - V1Money netSalesMoney, OptionalNullable> taxes, - OptionalNullable> discounts, - OptionalNullable> modifiers) { - this.name = name; - this.quantity = quantity; - this.itemizationType = itemizationType; - this.itemDetail = itemDetail; - this.notes = notes; - this.itemVariationName = itemVariationName; - this.totalMoney = totalMoney; - this.singleQuantityMoney = singleQuantityMoney; - this.grossSalesMoney = grossSalesMoney; - this.discountMoney = discountMoney; - this.netSalesMoney = netSalesMoney; - this.taxes = taxes; - this.discounts = discounts; - this.modifiers = modifiers; - } - - /** - * Internal Getter for Name. - * The item's name. - * @return Returns the Internal String - */ - @JsonGetter("name") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetName() { - return this.name; - } - - /** - * Getter for Name. - * The item's name. - * @return Returns the String - */ - @JsonIgnore - public String getName() { - return OptionalNullable.getFrom(name); - } - - /** - * Internal Getter for Quantity. - * The quantity of the item purchased. This can be a decimal value. - * @return Returns the Internal Double - */ - @JsonGetter("quantity") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetQuantity() { - return this.quantity; - } - - /** - * Getter for Quantity. - * The quantity of the item purchased. This can be a decimal value. - * @return Returns the Double - */ - @JsonIgnore - public Double getQuantity() { - return OptionalNullable.getFrom(quantity); - } - - /** - * Getter for ItemizationType. - * @return Returns the String - */ - @JsonGetter("itemization_type") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getItemizationType() { - return itemizationType; - } - - /** - * Getter for ItemDetail. - * V1PaymentItemDetail - * @return Returns the V1PaymentItemDetail - */ - @JsonGetter("item_detail") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1PaymentItemDetail getItemDetail() { - return itemDetail; - } - - /** - * Internal Getter for Notes. - * Notes entered by the merchant about the item at the time of payment, if any. - * @return Returns the Internal String - */ - @JsonGetter("notes") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetNotes() { - return this.notes; - } - - /** - * Getter for Notes. - * Notes entered by the merchant about the item at the time of payment, if any. - * @return Returns the String - */ - @JsonIgnore - public String getNotes() { - return OptionalNullable.getFrom(notes); - } - - /** - * Internal Getter for ItemVariationName. - * The name of the item variation purchased, if any. - * @return Returns the Internal String - */ - @JsonGetter("item_variation_name") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetItemVariationName() { - return this.itemVariationName; - } - - /** - * Getter for ItemVariationName. - * The name of the item variation purchased, if any. - * @return Returns the String - */ - @JsonIgnore - public String getItemVariationName() { - return OptionalNullable.getFrom(itemVariationName); - } - - /** - * Getter for TotalMoney. - * @return Returns the V1Money - */ - @JsonGetter("total_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getTotalMoney() { - return totalMoney; - } - - /** - * Getter for SingleQuantityMoney. - * @return Returns the V1Money - */ - @JsonGetter("single_quantity_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getSingleQuantityMoney() { - return singleQuantityMoney; - } - - /** - * Getter for GrossSalesMoney. - * @return Returns the V1Money - */ - @JsonGetter("gross_sales_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getGrossSalesMoney() { - return grossSalesMoney; - } - - /** - * Getter for DiscountMoney. - * @return Returns the V1Money - */ - @JsonGetter("discount_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getDiscountMoney() { - return discountMoney; - } - - /** - * Getter for NetSalesMoney. - * @return Returns the V1Money - */ - @JsonGetter("net_sales_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getNetSalesMoney() { - return netSalesMoney; - } - - /** - * Internal Getter for Taxes. - * All taxes applied to this itemization. - * @return Returns the Internal List of V1PaymentTax - */ - @JsonGetter("taxes") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetTaxes() { - return this.taxes; - } - - /** - * Getter for Taxes. - * All taxes applied to this itemization. - * @return Returns the List of V1PaymentTax - */ - @JsonIgnore - public List getTaxes() { - return OptionalNullable.getFrom(taxes); - } - - /** - * Internal Getter for Discounts. - * All discounts applied to this itemization. - * @return Returns the Internal List of V1PaymentDiscount - */ - @JsonGetter("discounts") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetDiscounts() { - return this.discounts; - } - - /** - * Getter for Discounts. - * All discounts applied to this itemization. - * @return Returns the List of V1PaymentDiscount - */ - @JsonIgnore - public List getDiscounts() { - return OptionalNullable.getFrom(discounts); - } - - /** - * Internal Getter for Modifiers. - * All modifier options applied to this itemization. - * @return Returns the Internal List of V1PaymentModifier - */ - @JsonGetter("modifiers") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetModifiers() { - return this.modifiers; - } - - /** - * Getter for Modifiers. - * All modifier options applied to this itemization. - * @return Returns the List of V1PaymentModifier - */ - @JsonIgnore - public List getModifiers() { - return OptionalNullable.getFrom(modifiers); - } - - @Override - public int hashCode() { - return Objects.hash(name, quantity, itemizationType, itemDetail, notes, itemVariationName, - totalMoney, singleQuantityMoney, grossSalesMoney, discountMoney, netSalesMoney, - taxes, discounts, modifiers); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1PaymentItemization)) { - return false; - } - V1PaymentItemization other = (V1PaymentItemization) obj; - return Objects.equals(name, other.name) - && Objects.equals(quantity, other.quantity) - && Objects.equals(itemizationType, other.itemizationType) - && Objects.equals(itemDetail, other.itemDetail) - && Objects.equals(notes, other.notes) - && Objects.equals(itemVariationName, other.itemVariationName) - && Objects.equals(totalMoney, other.totalMoney) - && Objects.equals(singleQuantityMoney, other.singleQuantityMoney) - && Objects.equals(grossSalesMoney, other.grossSalesMoney) - && Objects.equals(discountMoney, other.discountMoney) - && Objects.equals(netSalesMoney, other.netSalesMoney) - && Objects.equals(taxes, other.taxes) - && Objects.equals(discounts, other.discounts) - && Objects.equals(modifiers, other.modifiers); - } - - /** - * Converts this V1PaymentItemization into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1PaymentItemization [" + "name=" + name + ", quantity=" + quantity - + ", itemizationType=" + itemizationType + ", itemDetail=" + itemDetail + ", notes=" - + notes + ", itemVariationName=" + itemVariationName + ", totalMoney=" + totalMoney - + ", singleQuantityMoney=" + singleQuantityMoney + ", grossSalesMoney=" - + grossSalesMoney + ", discountMoney=" + discountMoney + ", netSalesMoney=" - + netSalesMoney + ", taxes=" + taxes + ", discounts=" + discounts + ", modifiers=" - + modifiers + "]"; - } - - /** - * Builds a new {@link V1PaymentItemization.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1PaymentItemization.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .itemizationType(getItemizationType()) - .itemDetail(getItemDetail()) - .totalMoney(getTotalMoney()) - .singleQuantityMoney(getSingleQuantityMoney()) - .grossSalesMoney(getGrossSalesMoney()) - .discountMoney(getDiscountMoney()) - .netSalesMoney(getNetSalesMoney()); - builder.name = internalGetName(); - builder.quantity = internalGetQuantity(); - builder.notes = internalGetNotes(); - builder.itemVariationName = internalGetItemVariationName(); - builder.taxes = internalGetTaxes(); - builder.discounts = internalGetDiscounts(); - builder.modifiers = internalGetModifiers(); - return builder; - } - - /** - * Class to build instances of {@link V1PaymentItemization}. - */ - public static class Builder { - private OptionalNullable name; - private OptionalNullable quantity; - private String itemizationType; - private V1PaymentItemDetail itemDetail; - private OptionalNullable notes; - private OptionalNullable itemVariationName; - private V1Money totalMoney; - private V1Money singleQuantityMoney; - private V1Money grossSalesMoney; - private V1Money discountMoney; - private V1Money netSalesMoney; - private OptionalNullable> taxes; - private OptionalNullable> discounts; - private OptionalNullable> modifiers; - - - - /** - * Setter for name. - * @param name String value for name. - * @return Builder - */ - public Builder name(String name) { - this.name = OptionalNullable.of(name); - return this; - } - - /** - * UnSetter for name. - * @return Builder - */ - public Builder unsetName() { - name = null; - return this; - } - - /** - * Setter for quantity. - * @param quantity Double value for quantity. - * @return Builder - */ - public Builder quantity(Double quantity) { - this.quantity = OptionalNullable.of(quantity); - return this; - } - - /** - * UnSetter for quantity. - * @return Builder - */ - public Builder unsetQuantity() { - quantity = null; - return this; - } - - /** - * Setter for itemizationType. - * @param itemizationType String value for itemizationType. - * @return Builder - */ - public Builder itemizationType(String itemizationType) { - this.itemizationType = itemizationType; - return this; - } - - /** - * Setter for itemDetail. - * @param itemDetail V1PaymentItemDetail value for itemDetail. - * @return Builder - */ - public Builder itemDetail(V1PaymentItemDetail itemDetail) { - this.itemDetail = itemDetail; - return this; - } - - /** - * Setter for notes. - * @param notes String value for notes. - * @return Builder - */ - public Builder notes(String notes) { - this.notes = OptionalNullable.of(notes); - return this; - } - - /** - * UnSetter for notes. - * @return Builder - */ - public Builder unsetNotes() { - notes = null; - return this; - } - - /** - * Setter for itemVariationName. - * @param itemVariationName String value for itemVariationName. - * @return Builder - */ - public Builder itemVariationName(String itemVariationName) { - this.itemVariationName = OptionalNullable.of(itemVariationName); - return this; - } - - /** - * UnSetter for itemVariationName. - * @return Builder - */ - public Builder unsetItemVariationName() { - itemVariationName = null; - return this; - } - - /** - * Setter for totalMoney. - * @param totalMoney V1Money value for totalMoney. - * @return Builder - */ - public Builder totalMoney(V1Money totalMoney) { - this.totalMoney = totalMoney; - return this; - } - - /** - * Setter for singleQuantityMoney. - * @param singleQuantityMoney V1Money value for singleQuantityMoney. - * @return Builder - */ - public Builder singleQuantityMoney(V1Money singleQuantityMoney) { - this.singleQuantityMoney = singleQuantityMoney; - return this; - } - - /** - * Setter for grossSalesMoney. - * @param grossSalesMoney V1Money value for grossSalesMoney. - * @return Builder - */ - public Builder grossSalesMoney(V1Money grossSalesMoney) { - this.grossSalesMoney = grossSalesMoney; - return this; - } - - /** - * Setter for discountMoney. - * @param discountMoney V1Money value for discountMoney. - * @return Builder - */ - public Builder discountMoney(V1Money discountMoney) { - this.discountMoney = discountMoney; - return this; - } - - /** - * Setter for netSalesMoney. - * @param netSalesMoney V1Money value for netSalesMoney. - * @return Builder - */ - public Builder netSalesMoney(V1Money netSalesMoney) { - this.netSalesMoney = netSalesMoney; - return this; - } - - /** - * Setter for taxes. - * @param taxes List of V1PaymentTax value for taxes. - * @return Builder - */ - public Builder taxes(List taxes) { - this.taxes = OptionalNullable.of(taxes); - return this; - } - - /** - * UnSetter for taxes. - * @return Builder - */ - public Builder unsetTaxes() { - taxes = null; - return this; - } - - /** - * Setter for discounts. - * @param discounts List of V1PaymentDiscount value for discounts. - * @return Builder - */ - public Builder discounts(List discounts) { - this.discounts = OptionalNullable.of(discounts); - return this; - } - - /** - * UnSetter for discounts. - * @return Builder - */ - public Builder unsetDiscounts() { - discounts = null; - return this; - } - - /** - * Setter for modifiers. - * @param modifiers List of V1PaymentModifier value for modifiers. - * @return Builder - */ - public Builder modifiers(List modifiers) { - this.modifiers = OptionalNullable.of(modifiers); - return this; - } - - /** - * UnSetter for modifiers. - * @return Builder - */ - public Builder unsetModifiers() { - modifiers = null; - return this; - } - - /** - * Builds a new {@link V1PaymentItemization} object using the set fields. - * @return {@link V1PaymentItemization} - */ - public V1PaymentItemization build() { - return new V1PaymentItemization(name, quantity, itemizationType, itemDetail, notes, - itemVariationName, totalMoney, singleQuantityMoney, grossSalesMoney, - discountMoney, netSalesMoney, taxes, discounts, modifiers); - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1PaymentModifier.java b/src/main/java/com/squareup/square/models/V1PaymentModifier.java deleted file mode 100644 index 1600f709..00000000 --- a/src/main/java/com/squareup/square/models/V1PaymentModifier.java +++ /dev/null @@ -1,215 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.apimatic.core.types.OptionalNullable; -import java.util.Objects; - -/** - * This is a model class for V1PaymentModifier type. - */ -public class V1PaymentModifier { - private final OptionalNullable name; - private final V1Money appliedMoney; - private final OptionalNullable modifierOptionId; - - /** - * Initialization constructor. - * @param name String value for name. - * @param appliedMoney V1Money value for appliedMoney. - * @param modifierOptionId String value for modifierOptionId. - */ - @JsonCreator - public V1PaymentModifier( - @JsonProperty("name") String name, - @JsonProperty("applied_money") V1Money appliedMoney, - @JsonProperty("modifier_option_id") String modifierOptionId) { - this.name = OptionalNullable.of(name); - this.appliedMoney = appliedMoney; - this.modifierOptionId = OptionalNullable.of(modifierOptionId); - } - - /** - * Initialization constructor. - * @param name String value for name. - * @param appliedMoney V1Money value for appliedMoney. - * @param modifierOptionId String value for modifierOptionId. - */ - - protected V1PaymentModifier(OptionalNullable name, V1Money appliedMoney, - OptionalNullable modifierOptionId) { - this.name = name; - this.appliedMoney = appliedMoney; - this.modifierOptionId = modifierOptionId; - } - - /** - * Internal Getter for Name. - * The modifier option's name. - * @return Returns the Internal String - */ - @JsonGetter("name") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetName() { - return this.name; - } - - /** - * Getter for Name. - * The modifier option's name. - * @return Returns the String - */ - @JsonIgnore - public String getName() { - return OptionalNullable.getFrom(name); - } - - /** - * Getter for AppliedMoney. - * @return Returns the V1Money - */ - @JsonGetter("applied_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getAppliedMoney() { - return appliedMoney; - } - - /** - * Internal Getter for ModifierOptionId. - * The ID of the applied modifier option, if available. Modifier options applied in older - * versions of Square Register might not have an ID. - * @return Returns the Internal String - */ - @JsonGetter("modifier_option_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetModifierOptionId() { - return this.modifierOptionId; - } - - /** - * Getter for ModifierOptionId. - * The ID of the applied modifier option, if available. Modifier options applied in older - * versions of Square Register might not have an ID. - * @return Returns the String - */ - @JsonIgnore - public String getModifierOptionId() { - return OptionalNullable.getFrom(modifierOptionId); - } - - @Override - public int hashCode() { - return Objects.hash(name, appliedMoney, modifierOptionId); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1PaymentModifier)) { - return false; - } - V1PaymentModifier other = (V1PaymentModifier) obj; - return Objects.equals(name, other.name) - && Objects.equals(appliedMoney, other.appliedMoney) - && Objects.equals(modifierOptionId, other.modifierOptionId); - } - - /** - * Converts this V1PaymentModifier into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1PaymentModifier [" + "name=" + name + ", appliedMoney=" + appliedMoney - + ", modifierOptionId=" + modifierOptionId + "]"; - } - - /** - * Builds a new {@link V1PaymentModifier.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1PaymentModifier.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .appliedMoney(getAppliedMoney()); - builder.name = internalGetName(); - builder.modifierOptionId = internalGetModifierOptionId(); - return builder; - } - - /** - * Class to build instances of {@link V1PaymentModifier}. - */ - public static class Builder { - private OptionalNullable name; - private V1Money appliedMoney; - private OptionalNullable modifierOptionId; - - - - /** - * Setter for name. - * @param name String value for name. - * @return Builder - */ - public Builder name(String name) { - this.name = OptionalNullable.of(name); - return this; - } - - /** - * UnSetter for name. - * @return Builder - */ - public Builder unsetName() { - name = null; - return this; - } - - /** - * Setter for appliedMoney. - * @param appliedMoney V1Money value for appliedMoney. - * @return Builder - */ - public Builder appliedMoney(V1Money appliedMoney) { - this.appliedMoney = appliedMoney; - return this; - } - - /** - * Setter for modifierOptionId. - * @param modifierOptionId String value for modifierOptionId. - * @return Builder - */ - public Builder modifierOptionId(String modifierOptionId) { - this.modifierOptionId = OptionalNullable.of(modifierOptionId); - return this; - } - - /** - * UnSetter for modifierOptionId. - * @return Builder - */ - public Builder unsetModifierOptionId() { - modifierOptionId = null; - return this; - } - - /** - * Builds a new {@link V1PaymentModifier} object using the set fields. - * @return {@link V1PaymentModifier} - */ - public V1PaymentModifier build() { - return new V1PaymentModifier(name, appliedMoney, modifierOptionId); - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1PaymentSurcharge.java b/src/main/java/com/squareup/square/models/V1PaymentSurcharge.java deleted file mode 100644 index 91db1261..00000000 --- a/src/main/java/com/squareup/square/models/V1PaymentSurcharge.java +++ /dev/null @@ -1,432 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.apimatic.core.types.OptionalNullable; -import java.util.List; -import java.util.Objects; - -/** - * This is a model class for V1PaymentSurcharge type. - */ -public class V1PaymentSurcharge { - private final OptionalNullable name; - private final V1Money appliedMoney; - private final OptionalNullable rate; - private final V1Money amountMoney; - private final String type; - private final OptionalNullable taxable; - private final OptionalNullable> taxes; - private final OptionalNullable surchargeId; - - /** - * Initialization constructor. - * @param name String value for name. - * @param appliedMoney V1Money value for appliedMoney. - * @param rate String value for rate. - * @param amountMoney V1Money value for amountMoney. - * @param type String value for type. - * @param taxable Boolean value for taxable. - * @param taxes List of V1PaymentTax value for taxes. - * @param surchargeId String value for surchargeId. - */ - @JsonCreator - public V1PaymentSurcharge( - @JsonProperty("name") String name, - @JsonProperty("applied_money") V1Money appliedMoney, - @JsonProperty("rate") String rate, - @JsonProperty("amount_money") V1Money amountMoney, - @JsonProperty("type") String type, - @JsonProperty("taxable") Boolean taxable, - @JsonProperty("taxes") List taxes, - @JsonProperty("surcharge_id") String surchargeId) { - this.name = OptionalNullable.of(name); - this.appliedMoney = appliedMoney; - this.rate = OptionalNullable.of(rate); - this.amountMoney = amountMoney; - this.type = type; - this.taxable = OptionalNullable.of(taxable); - this.taxes = OptionalNullable.of(taxes); - this.surchargeId = OptionalNullable.of(surchargeId); - } - - /** - * Initialization constructor. - * @param name String value for name. - * @param appliedMoney V1Money value for appliedMoney. - * @param rate String value for rate. - * @param amountMoney V1Money value for amountMoney. - * @param type String value for type. - * @param taxable Boolean value for taxable. - * @param taxes List of V1PaymentTax value for taxes. - * @param surchargeId String value for surchargeId. - */ - - protected V1PaymentSurcharge(OptionalNullable name, V1Money appliedMoney, - OptionalNullable rate, V1Money amountMoney, String type, - OptionalNullable taxable, OptionalNullable> taxes, - OptionalNullable surchargeId) { - this.name = name; - this.appliedMoney = appliedMoney; - this.rate = rate; - this.amountMoney = amountMoney; - this.type = type; - this.taxable = taxable; - this.taxes = taxes; - this.surchargeId = surchargeId; - } - - /** - * Internal Getter for Name. - * The name of the surcharge. - * @return Returns the Internal String - */ - @JsonGetter("name") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetName() { - return this.name; - } - - /** - * Getter for Name. - * The name of the surcharge. - * @return Returns the String - */ - @JsonIgnore - public String getName() { - return OptionalNullable.getFrom(name); - } - - /** - * Getter for AppliedMoney. - * @return Returns the V1Money - */ - @JsonGetter("applied_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getAppliedMoney() { - return appliedMoney; - } - - /** - * Internal Getter for Rate. - * The amount of the surcharge as a percentage. The percentage is provided as a string - * representing the decimal equivalent of the percentage. For example, "0.7" corresponds to a 7% - * surcharge. Exactly one of rate or amount_money should be set. - * @return Returns the Internal String - */ - @JsonGetter("rate") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetRate() { - return this.rate; - } - - /** - * Getter for Rate. - * The amount of the surcharge as a percentage. The percentage is provided as a string - * representing the decimal equivalent of the percentage. For example, "0.7" corresponds to a 7% - * surcharge. Exactly one of rate or amount_money should be set. - * @return Returns the String - */ - @JsonIgnore - public String getRate() { - return OptionalNullable.getFrom(rate); - } - - /** - * Getter for AmountMoney. - * @return Returns the V1Money - */ - @JsonGetter("amount_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getAmountMoney() { - return amountMoney; - } - - /** - * Getter for Type. - * @return Returns the String - */ - @JsonGetter("type") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getType() { - return type; - } - - /** - * Internal Getter for Taxable. - * Indicates whether the surcharge is taxable. - * @return Returns the Internal Boolean - */ - @JsonGetter("taxable") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetTaxable() { - return this.taxable; - } - - /** - * Getter for Taxable. - * Indicates whether the surcharge is taxable. - * @return Returns the Boolean - */ - @JsonIgnore - public Boolean getTaxable() { - return OptionalNullable.getFrom(taxable); - } - - /** - * Internal Getter for Taxes. - * The list of taxes that should be applied to the surcharge. - * @return Returns the Internal List of V1PaymentTax - */ - @JsonGetter("taxes") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetTaxes() { - return this.taxes; - } - - /** - * Getter for Taxes. - * The list of taxes that should be applied to the surcharge. - * @return Returns the List of V1PaymentTax - */ - @JsonIgnore - public List getTaxes() { - return OptionalNullable.getFrom(taxes); - } - - /** - * Internal Getter for SurchargeId. - * A Square-issued unique identifier associated with the surcharge. - * @return Returns the Internal String - */ - @JsonGetter("surcharge_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetSurchargeId() { - return this.surchargeId; - } - - /** - * Getter for SurchargeId. - * A Square-issued unique identifier associated with the surcharge. - * @return Returns the String - */ - @JsonIgnore - public String getSurchargeId() { - return OptionalNullable.getFrom(surchargeId); - } - - @Override - public int hashCode() { - return Objects.hash(name, appliedMoney, rate, amountMoney, type, taxable, taxes, - surchargeId); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1PaymentSurcharge)) { - return false; - } - V1PaymentSurcharge other = (V1PaymentSurcharge) obj; - return Objects.equals(name, other.name) - && Objects.equals(appliedMoney, other.appliedMoney) - && Objects.equals(rate, other.rate) - && Objects.equals(amountMoney, other.amountMoney) - && Objects.equals(type, other.type) - && Objects.equals(taxable, other.taxable) - && Objects.equals(taxes, other.taxes) - && Objects.equals(surchargeId, other.surchargeId); - } - - /** - * Converts this V1PaymentSurcharge into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1PaymentSurcharge [" + "name=" + name + ", appliedMoney=" + appliedMoney - + ", rate=" + rate + ", amountMoney=" + amountMoney + ", type=" + type - + ", taxable=" + taxable + ", taxes=" + taxes + ", surchargeId=" + surchargeId - + "]"; - } - - /** - * Builds a new {@link V1PaymentSurcharge.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1PaymentSurcharge.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .appliedMoney(getAppliedMoney()) - .amountMoney(getAmountMoney()) - .type(getType()); - builder.name = internalGetName(); - builder.rate = internalGetRate(); - builder.taxable = internalGetTaxable(); - builder.taxes = internalGetTaxes(); - builder.surchargeId = internalGetSurchargeId(); - return builder; - } - - /** - * Class to build instances of {@link V1PaymentSurcharge}. - */ - public static class Builder { - private OptionalNullable name; - private V1Money appliedMoney; - private OptionalNullable rate; - private V1Money amountMoney; - private String type; - private OptionalNullable taxable; - private OptionalNullable> taxes; - private OptionalNullable surchargeId; - - - - /** - * Setter for name. - * @param name String value for name. - * @return Builder - */ - public Builder name(String name) { - this.name = OptionalNullable.of(name); - return this; - } - - /** - * UnSetter for name. - * @return Builder - */ - public Builder unsetName() { - name = null; - return this; - } - - /** - * Setter for appliedMoney. - * @param appliedMoney V1Money value for appliedMoney. - * @return Builder - */ - public Builder appliedMoney(V1Money appliedMoney) { - this.appliedMoney = appliedMoney; - return this; - } - - /** - * Setter for rate. - * @param rate String value for rate. - * @return Builder - */ - public Builder rate(String rate) { - this.rate = OptionalNullable.of(rate); - return this; - } - - /** - * UnSetter for rate. - * @return Builder - */ - public Builder unsetRate() { - rate = null; - return this; - } - - /** - * Setter for amountMoney. - * @param amountMoney V1Money value for amountMoney. - * @return Builder - */ - public Builder amountMoney(V1Money amountMoney) { - this.amountMoney = amountMoney; - return this; - } - - /** - * Setter for type. - * @param type String value for type. - * @return Builder - */ - public Builder type(String type) { - this.type = type; - return this; - } - - /** - * Setter for taxable. - * @param taxable Boolean value for taxable. - * @return Builder - */ - public Builder taxable(Boolean taxable) { - this.taxable = OptionalNullable.of(taxable); - return this; - } - - /** - * UnSetter for taxable. - * @return Builder - */ - public Builder unsetTaxable() { - taxable = null; - return this; - } - - /** - * Setter for taxes. - * @param taxes List of V1PaymentTax value for taxes. - * @return Builder - */ - public Builder taxes(List taxes) { - this.taxes = OptionalNullable.of(taxes); - return this; - } - - /** - * UnSetter for taxes. - * @return Builder - */ - public Builder unsetTaxes() { - taxes = null; - return this; - } - - /** - * Setter for surchargeId. - * @param surchargeId String value for surchargeId. - * @return Builder - */ - public Builder surchargeId(String surchargeId) { - this.surchargeId = OptionalNullable.of(surchargeId); - return this; - } - - /** - * UnSetter for surchargeId. - * @return Builder - */ - public Builder unsetSurchargeId() { - surchargeId = null; - return this; - } - - /** - * Builds a new {@link V1PaymentSurcharge} object using the set fields. - * @return {@link V1PaymentSurcharge} - */ - public V1PaymentSurcharge build() { - return new V1PaymentSurcharge(name, appliedMoney, rate, amountMoney, type, taxable, - taxes, surchargeId); - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1PaymentTax.java b/src/main/java/com/squareup/square/models/V1PaymentTax.java deleted file mode 100644 index 89441db2..00000000 --- a/src/main/java/com/squareup/square/models/V1PaymentTax.java +++ /dev/null @@ -1,349 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.apimatic.core.types.OptionalNullable; -import java.util.List; -import java.util.Objects; - -/** - * This is a model class for V1PaymentTax type. - */ -public class V1PaymentTax { - private final OptionalNullable> errors; - private final OptionalNullable name; - private final V1Money appliedMoney; - private final OptionalNullable rate; - private final String inclusionType; - private final OptionalNullable feeId; - - /** - * Initialization constructor. - * @param errors List of Error value for errors. - * @param name String value for name. - * @param appliedMoney V1Money value for appliedMoney. - * @param rate String value for rate. - * @param inclusionType String value for inclusionType. - * @param feeId String value for feeId. - */ - @JsonCreator - public V1PaymentTax( - @JsonProperty("errors") List errors, - @JsonProperty("name") String name, - @JsonProperty("applied_money") V1Money appliedMoney, - @JsonProperty("rate") String rate, - @JsonProperty("inclusion_type") String inclusionType, - @JsonProperty("fee_id") String feeId) { - this.errors = OptionalNullable.of(errors); - this.name = OptionalNullable.of(name); - this.appliedMoney = appliedMoney; - this.rate = OptionalNullable.of(rate); - this.inclusionType = inclusionType; - this.feeId = OptionalNullable.of(feeId); - } - - /** - * Initialization constructor. - * @param errors List of Error value for errors. - * @param name String value for name. - * @param appliedMoney V1Money value for appliedMoney. - * @param rate String value for rate. - * @param inclusionType String value for inclusionType. - * @param feeId String value for feeId. - */ - - protected V1PaymentTax(OptionalNullable> errors, OptionalNullable name, - V1Money appliedMoney, OptionalNullable rate, String inclusionType, - OptionalNullable feeId) { - this.errors = errors; - this.name = name; - this.appliedMoney = appliedMoney; - this.rate = rate; - this.inclusionType = inclusionType; - this.feeId = feeId; - } - - /** - * Internal Getter for Errors. - * Any errors that occurred during the request. - * @return Returns the Internal List of Error - */ - @JsonGetter("errors") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetErrors() { - return this.errors; - } - - /** - * Getter for Errors. - * Any errors that occurred during the request. - * @return Returns the List of Error - */ - @JsonIgnore - public List getErrors() { - return OptionalNullable.getFrom(errors); - } - - /** - * Internal Getter for Name. - * The merchant-defined name of the tax. - * @return Returns the Internal String - */ - @JsonGetter("name") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetName() { - return this.name; - } - - /** - * Getter for Name. - * The merchant-defined name of the tax. - * @return Returns the String - */ - @JsonIgnore - public String getName() { - return OptionalNullable.getFrom(name); - } - - /** - * Getter for AppliedMoney. - * @return Returns the V1Money - */ - @JsonGetter("applied_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getAppliedMoney() { - return appliedMoney; - } - - /** - * Internal Getter for Rate. - * The rate of the tax, as a string representation of a decimal number. A value of 0.07 - * corresponds to a rate of 7%. - * @return Returns the Internal String - */ - @JsonGetter("rate") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetRate() { - return this.rate; - } - - /** - * Getter for Rate. - * The rate of the tax, as a string representation of a decimal number. A value of 0.07 - * corresponds to a rate of 7%. - * @return Returns the String - */ - @JsonIgnore - public String getRate() { - return OptionalNullable.getFrom(rate); - } - - /** - * Getter for InclusionType. - * @return Returns the String - */ - @JsonGetter("inclusion_type") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getInclusionType() { - return inclusionType; - } - - /** - * Internal Getter for FeeId. - * The ID of the tax, if available. Taxes applied in older versions of Square Register might not - * have an ID. - * @return Returns the Internal String - */ - @JsonGetter("fee_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetFeeId() { - return this.feeId; - } - - /** - * Getter for FeeId. - * The ID of the tax, if available. Taxes applied in older versions of Square Register might not - * have an ID. - * @return Returns the String - */ - @JsonIgnore - public String getFeeId() { - return OptionalNullable.getFrom(feeId); - } - - @Override - public int hashCode() { - return Objects.hash(errors, name, appliedMoney, rate, inclusionType, feeId); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1PaymentTax)) { - return false; - } - V1PaymentTax other = (V1PaymentTax) obj; - return Objects.equals(errors, other.errors) - && Objects.equals(name, other.name) - && Objects.equals(appliedMoney, other.appliedMoney) - && Objects.equals(rate, other.rate) - && Objects.equals(inclusionType, other.inclusionType) - && Objects.equals(feeId, other.feeId); - } - - /** - * Converts this V1PaymentTax into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1PaymentTax [" + "errors=" + errors + ", name=" + name + ", appliedMoney=" - + appliedMoney + ", rate=" + rate + ", inclusionType=" + inclusionType + ", feeId=" - + feeId + "]"; - } - - /** - * Builds a new {@link V1PaymentTax.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1PaymentTax.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .appliedMoney(getAppliedMoney()) - .inclusionType(getInclusionType()); - builder.errors = internalGetErrors(); - builder.name = internalGetName(); - builder.rate = internalGetRate(); - builder.feeId = internalGetFeeId(); - return builder; - } - - /** - * Class to build instances of {@link V1PaymentTax}. - */ - public static class Builder { - private OptionalNullable> errors; - private OptionalNullable name; - private V1Money appliedMoney; - private OptionalNullable rate; - private String inclusionType; - private OptionalNullable feeId; - - - - /** - * Setter for errors. - * @param errors List of Error value for errors. - * @return Builder - */ - public Builder errors(List errors) { - this.errors = OptionalNullable.of(errors); - return this; - } - - /** - * UnSetter for errors. - * @return Builder - */ - public Builder unsetErrors() { - errors = null; - return this; - } - - /** - * Setter for name. - * @param name String value for name. - * @return Builder - */ - public Builder name(String name) { - this.name = OptionalNullable.of(name); - return this; - } - - /** - * UnSetter for name. - * @return Builder - */ - public Builder unsetName() { - name = null; - return this; - } - - /** - * Setter for appliedMoney. - * @param appliedMoney V1Money value for appliedMoney. - * @return Builder - */ - public Builder appliedMoney(V1Money appliedMoney) { - this.appliedMoney = appliedMoney; - return this; - } - - /** - * Setter for rate. - * @param rate String value for rate. - * @return Builder - */ - public Builder rate(String rate) { - this.rate = OptionalNullable.of(rate); - return this; - } - - /** - * UnSetter for rate. - * @return Builder - */ - public Builder unsetRate() { - rate = null; - return this; - } - - /** - * Setter for inclusionType. - * @param inclusionType String value for inclusionType. - * @return Builder - */ - public Builder inclusionType(String inclusionType) { - this.inclusionType = inclusionType; - return this; - } - - /** - * Setter for feeId. - * @param feeId String value for feeId. - * @return Builder - */ - public Builder feeId(String feeId) { - this.feeId = OptionalNullable.of(feeId); - return this; - } - - /** - * UnSetter for feeId. - * @return Builder - */ - public Builder unsetFeeId() { - feeId = null; - return this; - } - - /** - * Builds a new {@link V1PaymentTax} object using the set fields. - * @return {@link V1PaymentTax} - */ - public V1PaymentTax build() { - return new V1PaymentTax(errors, name, appliedMoney, rate, inclusionType, feeId); - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1Refund.java b/src/main/java/com/squareup/square/models/V1Refund.java deleted file mode 100644 index 3d397b9c..00000000 --- a/src/main/java/com/squareup/square/models/V1Refund.java +++ /dev/null @@ -1,828 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.squareup.square.http.client.HttpContext; -import io.apimatic.core.types.OptionalNullable; -import java.util.List; -import java.util.Objects; - -/** - * This is a model class for V1Refund type. - */ -public class V1Refund { - private HttpContext httpContext; - private final String type; - private final OptionalNullable reason; - private final V1Money refundedMoney; - private final V1Money refundedProcessingFeeMoney; - private final V1Money refundedTaxMoney; - private final V1Money refundedAdditiveTaxMoney; - private final OptionalNullable> refundedAdditiveTax; - private final V1Money refundedInclusiveTaxMoney; - private final OptionalNullable> refundedInclusiveTax; - private final V1Money refundedTipMoney; - private final V1Money refundedDiscountMoney; - private final V1Money refundedSurchargeMoney; - private final OptionalNullable> refundedSurcharges; - private final String createdAt; - private final OptionalNullable processedAt; - private final OptionalNullable paymentId; - private final OptionalNullable merchantId; - private final OptionalNullable isExchange; - - /** - * Initialization constructor. - * @param type String value for type. - * @param reason String value for reason. - * @param refundedMoney V1Money value for refundedMoney. - * @param refundedProcessingFeeMoney V1Money value for refundedProcessingFeeMoney. - * @param refundedTaxMoney V1Money value for refundedTaxMoney. - * @param refundedAdditiveTaxMoney V1Money value for refundedAdditiveTaxMoney. - * @param refundedAdditiveTax List of V1PaymentTax value for refundedAdditiveTax. - * @param refundedInclusiveTaxMoney V1Money value for refundedInclusiveTaxMoney. - * @param refundedInclusiveTax List of V1PaymentTax value for refundedInclusiveTax. - * @param refundedTipMoney V1Money value for refundedTipMoney. - * @param refundedDiscountMoney V1Money value for refundedDiscountMoney. - * @param refundedSurchargeMoney V1Money value for refundedSurchargeMoney. - * @param refundedSurcharges List of V1PaymentSurcharge value for refundedSurcharges. - * @param createdAt String value for createdAt. - * @param processedAt String value for processedAt. - * @param paymentId String value for paymentId. - * @param merchantId String value for merchantId. - * @param isExchange Boolean value for isExchange. - */ - @JsonCreator - public V1Refund( - @JsonProperty("type") String type, - @JsonProperty("reason") String reason, - @JsonProperty("refunded_money") V1Money refundedMoney, - @JsonProperty("refunded_processing_fee_money") V1Money refundedProcessingFeeMoney, - @JsonProperty("refunded_tax_money") V1Money refundedTaxMoney, - @JsonProperty("refunded_additive_tax_money") V1Money refundedAdditiveTaxMoney, - @JsonProperty("refunded_additive_tax") List refundedAdditiveTax, - @JsonProperty("refunded_inclusive_tax_money") V1Money refundedInclusiveTaxMoney, - @JsonProperty("refunded_inclusive_tax") List refundedInclusiveTax, - @JsonProperty("refunded_tip_money") V1Money refundedTipMoney, - @JsonProperty("refunded_discount_money") V1Money refundedDiscountMoney, - @JsonProperty("refunded_surcharge_money") V1Money refundedSurchargeMoney, - @JsonProperty("refunded_surcharges") List refundedSurcharges, - @JsonProperty("created_at") String createdAt, - @JsonProperty("processed_at") String processedAt, - @JsonProperty("payment_id") String paymentId, - @JsonProperty("merchant_id") String merchantId, - @JsonProperty("is_exchange") Boolean isExchange) { - this.type = type; - this.reason = OptionalNullable.of(reason); - this.refundedMoney = refundedMoney; - this.refundedProcessingFeeMoney = refundedProcessingFeeMoney; - this.refundedTaxMoney = refundedTaxMoney; - this.refundedAdditiveTaxMoney = refundedAdditiveTaxMoney; - this.refundedAdditiveTax = OptionalNullable.of(refundedAdditiveTax); - this.refundedInclusiveTaxMoney = refundedInclusiveTaxMoney; - this.refundedInclusiveTax = OptionalNullable.of(refundedInclusiveTax); - this.refundedTipMoney = refundedTipMoney; - this.refundedDiscountMoney = refundedDiscountMoney; - this.refundedSurchargeMoney = refundedSurchargeMoney; - this.refundedSurcharges = OptionalNullable.of(refundedSurcharges); - this.createdAt = createdAt; - this.processedAt = OptionalNullable.of(processedAt); - this.paymentId = OptionalNullable.of(paymentId); - this.merchantId = OptionalNullable.of(merchantId); - this.isExchange = OptionalNullable.of(isExchange); - } - - /** - * Initialization constructor. - * @param type String value for type. - * @param reason String value for reason. - * @param refundedMoney V1Money value for refundedMoney. - * @param refundedProcessingFeeMoney V1Money value for refundedProcessingFeeMoney. - * @param refundedTaxMoney V1Money value for refundedTaxMoney. - * @param refundedAdditiveTaxMoney V1Money value for refundedAdditiveTaxMoney. - * @param refundedAdditiveTax List of V1PaymentTax value for refundedAdditiveTax. - * @param refundedInclusiveTaxMoney V1Money value for refundedInclusiveTaxMoney. - * @param refundedInclusiveTax List of V1PaymentTax value for refundedInclusiveTax. - * @param refundedTipMoney V1Money value for refundedTipMoney. - * @param refundedDiscountMoney V1Money value for refundedDiscountMoney. - * @param refundedSurchargeMoney V1Money value for refundedSurchargeMoney. - * @param refundedSurcharges List of V1PaymentSurcharge value for refundedSurcharges. - * @param createdAt String value for createdAt. - * @param processedAt String value for processedAt. - * @param paymentId String value for paymentId. - * @param merchantId String value for merchantId. - * @param isExchange Boolean value for isExchange. - */ - - protected V1Refund(String type, OptionalNullable reason, V1Money refundedMoney, - V1Money refundedProcessingFeeMoney, V1Money refundedTaxMoney, - V1Money refundedAdditiveTaxMoney, - OptionalNullable> refundedAdditiveTax, - V1Money refundedInclusiveTaxMoney, - OptionalNullable> refundedInclusiveTax, V1Money refundedTipMoney, - V1Money refundedDiscountMoney, V1Money refundedSurchargeMoney, - OptionalNullable> refundedSurcharges, String createdAt, - OptionalNullable processedAt, OptionalNullable paymentId, - OptionalNullable merchantId, OptionalNullable isExchange) { - this.type = type; - this.reason = reason; - this.refundedMoney = refundedMoney; - this.refundedProcessingFeeMoney = refundedProcessingFeeMoney; - this.refundedTaxMoney = refundedTaxMoney; - this.refundedAdditiveTaxMoney = refundedAdditiveTaxMoney; - this.refundedAdditiveTax = refundedAdditiveTax; - this.refundedInclusiveTaxMoney = refundedInclusiveTaxMoney; - this.refundedInclusiveTax = refundedInclusiveTax; - this.refundedTipMoney = refundedTipMoney; - this.refundedDiscountMoney = refundedDiscountMoney; - this.refundedSurchargeMoney = refundedSurchargeMoney; - this.refundedSurcharges = refundedSurcharges; - this.createdAt = createdAt; - this.processedAt = processedAt; - this.paymentId = paymentId; - this.merchantId = merchantId; - this.isExchange = isExchange; - } - - @JsonIgnore - public HttpContext getContext() { - return httpContext; - } - - /** - * Getter for Type. - * @return Returns the String - */ - @JsonGetter("type") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getType() { - return type; - } - - /** - * Internal Getter for Reason. - * The merchant-specified reason for the refund. - * @return Returns the Internal String - */ - @JsonGetter("reason") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetReason() { - return this.reason; - } - - /** - * Getter for Reason. - * The merchant-specified reason for the refund. - * @return Returns the String - */ - @JsonIgnore - public String getReason() { - return OptionalNullable.getFrom(reason); - } - - /** - * Getter for RefundedMoney. - * @return Returns the V1Money - */ - @JsonGetter("refunded_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getRefundedMoney() { - return refundedMoney; - } - - /** - * Getter for RefundedProcessingFeeMoney. - * @return Returns the V1Money - */ - @JsonGetter("refunded_processing_fee_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getRefundedProcessingFeeMoney() { - return refundedProcessingFeeMoney; - } - - /** - * Getter for RefundedTaxMoney. - * @return Returns the V1Money - */ - @JsonGetter("refunded_tax_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getRefundedTaxMoney() { - return refundedTaxMoney; - } - - /** - * Getter for RefundedAdditiveTaxMoney. - * @return Returns the V1Money - */ - @JsonGetter("refunded_additive_tax_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getRefundedAdditiveTaxMoney() { - return refundedAdditiveTaxMoney; - } - - /** - * Internal Getter for RefundedAdditiveTax. - * All of the additive taxes associated with the refund. - * @return Returns the Internal List of V1PaymentTax - */ - @JsonGetter("refunded_additive_tax") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetRefundedAdditiveTax() { - return this.refundedAdditiveTax; - } - - /** - * Getter for RefundedAdditiveTax. - * All of the additive taxes associated with the refund. - * @return Returns the List of V1PaymentTax - */ - @JsonIgnore - public List getRefundedAdditiveTax() { - return OptionalNullable.getFrom(refundedAdditiveTax); - } - - /** - * Getter for RefundedInclusiveTaxMoney. - * @return Returns the V1Money - */ - @JsonGetter("refunded_inclusive_tax_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getRefundedInclusiveTaxMoney() { - return refundedInclusiveTaxMoney; - } - - /** - * Internal Getter for RefundedInclusiveTax. - * All of the inclusive taxes associated with the refund. - * @return Returns the Internal List of V1PaymentTax - */ - @JsonGetter("refunded_inclusive_tax") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetRefundedInclusiveTax() { - return this.refundedInclusiveTax; - } - - /** - * Getter for RefundedInclusiveTax. - * All of the inclusive taxes associated with the refund. - * @return Returns the List of V1PaymentTax - */ - @JsonIgnore - public List getRefundedInclusiveTax() { - return OptionalNullable.getFrom(refundedInclusiveTax); - } - - /** - * Getter for RefundedTipMoney. - * @return Returns the V1Money - */ - @JsonGetter("refunded_tip_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getRefundedTipMoney() { - return refundedTipMoney; - } - - /** - * Getter for RefundedDiscountMoney. - * @return Returns the V1Money - */ - @JsonGetter("refunded_discount_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getRefundedDiscountMoney() { - return refundedDiscountMoney; - } - - /** - * Getter for RefundedSurchargeMoney. - * @return Returns the V1Money - */ - @JsonGetter("refunded_surcharge_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getRefundedSurchargeMoney() { - return refundedSurchargeMoney; - } - - /** - * Internal Getter for RefundedSurcharges. - * A list of all surcharges associated with the refund. - * @return Returns the Internal List of V1PaymentSurcharge - */ - @JsonGetter("refunded_surcharges") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetRefundedSurcharges() { - return this.refundedSurcharges; - } - - /** - * Getter for RefundedSurcharges. - * A list of all surcharges associated with the refund. - * @return Returns the List of V1PaymentSurcharge - */ - @JsonIgnore - public List getRefundedSurcharges() { - return OptionalNullable.getFrom(refundedSurcharges); - } - - /** - * Getter for CreatedAt. - * The time when the merchant initiated the refund for Square to process, in ISO 8601 format. - * @return Returns the String - */ - @JsonGetter("created_at") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getCreatedAt() { - return createdAt; - } - - /** - * Internal Getter for ProcessedAt. - * The time when Square processed the refund on behalf of the merchant, in ISO 8601 format. - * @return Returns the Internal String - */ - @JsonGetter("processed_at") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetProcessedAt() { - return this.processedAt; - } - - /** - * Getter for ProcessedAt. - * The time when Square processed the refund on behalf of the merchant, in ISO 8601 format. - * @return Returns the String - */ - @JsonIgnore - public String getProcessedAt() { - return OptionalNullable.getFrom(processedAt); - } - - /** - * Internal Getter for PaymentId. - * A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the - * ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original - * tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the - * original payment ID even if the payment includes other tenders. - * @return Returns the Internal String - */ - @JsonGetter("payment_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetPaymentId() { - return this.paymentId; - } - - /** - * Getter for PaymentId. - * A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the - * ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original - * tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the - * original payment ID even if the payment includes other tenders. - * @return Returns the String - */ - @JsonIgnore - public String getPaymentId() { - return OptionalNullable.getFrom(paymentId); - } - - /** - * Internal Getter for MerchantId. - * @return Returns the Internal String - */ - @JsonGetter("merchant_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetMerchantId() { - return this.merchantId; - } - - /** - * Getter for MerchantId. - * @return Returns the String - */ - @JsonIgnore - public String getMerchantId() { - return OptionalNullable.getFrom(merchantId); - } - - /** - * Internal Getter for IsExchange. - * Indicates whether or not the refund is associated with an exchange. If is_exchange is true, - * the refund reflects the value of goods returned in the exchange not the total money refunded. - * @return Returns the Internal Boolean - */ - @JsonGetter("is_exchange") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetIsExchange() { - return this.isExchange; - } - - /** - * Getter for IsExchange. - * Indicates whether or not the refund is associated with an exchange. If is_exchange is true, - * the refund reflects the value of goods returned in the exchange not the total money refunded. - * @return Returns the Boolean - */ - @JsonIgnore - public Boolean getIsExchange() { - return OptionalNullable.getFrom(isExchange); - } - - @Override - public int hashCode() { - return Objects.hash(type, reason, refundedMoney, refundedProcessingFeeMoney, - refundedTaxMoney, refundedAdditiveTaxMoney, refundedAdditiveTax, - refundedInclusiveTaxMoney, refundedInclusiveTax, refundedTipMoney, - refundedDiscountMoney, refundedSurchargeMoney, refundedSurcharges, createdAt, - processedAt, paymentId, merchantId, isExchange); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1Refund)) { - return false; - } - V1Refund other = (V1Refund) obj; - return Objects.equals(type, other.type) - && Objects.equals(reason, other.reason) - && Objects.equals(refundedMoney, other.refundedMoney) - && Objects.equals(refundedProcessingFeeMoney, other.refundedProcessingFeeMoney) - && Objects.equals(refundedTaxMoney, other.refundedTaxMoney) - && Objects.equals(refundedAdditiveTaxMoney, other.refundedAdditiveTaxMoney) - && Objects.equals(refundedAdditiveTax, other.refundedAdditiveTax) - && Objects.equals(refundedInclusiveTaxMoney, other.refundedInclusiveTaxMoney) - && Objects.equals(refundedInclusiveTax, other.refundedInclusiveTax) - && Objects.equals(refundedTipMoney, other.refundedTipMoney) - && Objects.equals(refundedDiscountMoney, other.refundedDiscountMoney) - && Objects.equals(refundedSurchargeMoney, other.refundedSurchargeMoney) - && Objects.equals(refundedSurcharges, other.refundedSurcharges) - && Objects.equals(createdAt, other.createdAt) - && Objects.equals(processedAt, other.processedAt) - && Objects.equals(paymentId, other.paymentId) - && Objects.equals(merchantId, other.merchantId) - && Objects.equals(isExchange, other.isExchange); - } - - /** - * Converts this V1Refund into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1Refund [" + "type=" + type + ", reason=" + reason + ", refundedMoney=" - + refundedMoney + ", refundedProcessingFeeMoney=" + refundedProcessingFeeMoney - + ", refundedTaxMoney=" + refundedTaxMoney + ", refundedAdditiveTaxMoney=" - + refundedAdditiveTaxMoney + ", refundedAdditiveTax=" + refundedAdditiveTax - + ", refundedInclusiveTaxMoney=" + refundedInclusiveTaxMoney - + ", refundedInclusiveTax=" + refundedInclusiveTax + ", refundedTipMoney=" - + refundedTipMoney + ", refundedDiscountMoney=" + refundedDiscountMoney - + ", refundedSurchargeMoney=" + refundedSurchargeMoney + ", refundedSurcharges=" - + refundedSurcharges + ", createdAt=" + createdAt + ", processedAt=" + processedAt - + ", paymentId=" + paymentId + ", merchantId=" + merchantId + ", isExchange=" - + isExchange + "]"; - } - - /** - * Builds a new {@link V1Refund.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1Refund.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .type(getType()) - .refundedMoney(getRefundedMoney()) - .refundedProcessingFeeMoney(getRefundedProcessingFeeMoney()) - .refundedTaxMoney(getRefundedTaxMoney()) - .refundedAdditiveTaxMoney(getRefundedAdditiveTaxMoney()) - .refundedInclusiveTaxMoney(getRefundedInclusiveTaxMoney()) - .refundedTipMoney(getRefundedTipMoney()) - .refundedDiscountMoney(getRefundedDiscountMoney()) - .refundedSurchargeMoney(getRefundedSurchargeMoney()) - .createdAt(getCreatedAt()); - builder.reason = internalGetReason(); - builder.refundedAdditiveTax = internalGetRefundedAdditiveTax(); - builder.refundedInclusiveTax = internalGetRefundedInclusiveTax(); - builder.refundedSurcharges = internalGetRefundedSurcharges(); - builder.processedAt = internalGetProcessedAt(); - builder.paymentId = internalGetPaymentId(); - builder.merchantId = internalGetMerchantId(); - builder.isExchange = internalGetIsExchange(); - return builder; - } - - /** - * Class to build instances of {@link V1Refund}. - */ - public static class Builder { - private HttpContext httpContext; - private String type; - private OptionalNullable reason; - private V1Money refundedMoney; - private V1Money refundedProcessingFeeMoney; - private V1Money refundedTaxMoney; - private V1Money refundedAdditiveTaxMoney; - private OptionalNullable> refundedAdditiveTax; - private V1Money refundedInclusiveTaxMoney; - private OptionalNullable> refundedInclusiveTax; - private V1Money refundedTipMoney; - private V1Money refundedDiscountMoney; - private V1Money refundedSurchargeMoney; - private OptionalNullable> refundedSurcharges; - private String createdAt; - private OptionalNullable processedAt; - private OptionalNullable paymentId; - private OptionalNullable merchantId; - private OptionalNullable isExchange; - - - - /** - * Setter for httpContext. - * @param httpContext HttpContext value for httpContext. - * @return Builder - */ - public Builder httpContext(HttpContext httpContext) { - this.httpContext = httpContext; - return this; - } - - /** - * Setter for type. - * @param type String value for type. - * @return Builder - */ - public Builder type(String type) { - this.type = type; - return this; - } - - /** - * Setter for reason. - * @param reason String value for reason. - * @return Builder - */ - public Builder reason(String reason) { - this.reason = OptionalNullable.of(reason); - return this; - } - - /** - * UnSetter for reason. - * @return Builder - */ - public Builder unsetReason() { - reason = null; - return this; - } - - /** - * Setter for refundedMoney. - * @param refundedMoney V1Money value for refundedMoney. - * @return Builder - */ - public Builder refundedMoney(V1Money refundedMoney) { - this.refundedMoney = refundedMoney; - return this; - } - - /** - * Setter for refundedProcessingFeeMoney. - * @param refundedProcessingFeeMoney V1Money value for refundedProcessingFeeMoney. - * @return Builder - */ - public Builder refundedProcessingFeeMoney(V1Money refundedProcessingFeeMoney) { - this.refundedProcessingFeeMoney = refundedProcessingFeeMoney; - return this; - } - - /** - * Setter for refundedTaxMoney. - * @param refundedTaxMoney V1Money value for refundedTaxMoney. - * @return Builder - */ - public Builder refundedTaxMoney(V1Money refundedTaxMoney) { - this.refundedTaxMoney = refundedTaxMoney; - return this; - } - - /** - * Setter for refundedAdditiveTaxMoney. - * @param refundedAdditiveTaxMoney V1Money value for refundedAdditiveTaxMoney. - * @return Builder - */ - public Builder refundedAdditiveTaxMoney(V1Money refundedAdditiveTaxMoney) { - this.refundedAdditiveTaxMoney = refundedAdditiveTaxMoney; - return this; - } - - /** - * Setter for refundedAdditiveTax. - * @param refundedAdditiveTax List of V1PaymentTax value for refundedAdditiveTax. - * @return Builder - */ - public Builder refundedAdditiveTax(List refundedAdditiveTax) { - this.refundedAdditiveTax = OptionalNullable.of(refundedAdditiveTax); - return this; - } - - /** - * UnSetter for refundedAdditiveTax. - * @return Builder - */ - public Builder unsetRefundedAdditiveTax() { - refundedAdditiveTax = null; - return this; - } - - /** - * Setter for refundedInclusiveTaxMoney. - * @param refundedInclusiveTaxMoney V1Money value for refundedInclusiveTaxMoney. - * @return Builder - */ - public Builder refundedInclusiveTaxMoney(V1Money refundedInclusiveTaxMoney) { - this.refundedInclusiveTaxMoney = refundedInclusiveTaxMoney; - return this; - } - - /** - * Setter for refundedInclusiveTax. - * @param refundedInclusiveTax List of V1PaymentTax value for refundedInclusiveTax. - * @return Builder - */ - public Builder refundedInclusiveTax(List refundedInclusiveTax) { - this.refundedInclusiveTax = OptionalNullable.of(refundedInclusiveTax); - return this; - } - - /** - * UnSetter for refundedInclusiveTax. - * @return Builder - */ - public Builder unsetRefundedInclusiveTax() { - refundedInclusiveTax = null; - return this; - } - - /** - * Setter for refundedTipMoney. - * @param refundedTipMoney V1Money value for refundedTipMoney. - * @return Builder - */ - public Builder refundedTipMoney(V1Money refundedTipMoney) { - this.refundedTipMoney = refundedTipMoney; - return this; - } - - /** - * Setter for refundedDiscountMoney. - * @param refundedDiscountMoney V1Money value for refundedDiscountMoney. - * @return Builder - */ - public Builder refundedDiscountMoney(V1Money refundedDiscountMoney) { - this.refundedDiscountMoney = refundedDiscountMoney; - return this; - } - - /** - * Setter for refundedSurchargeMoney. - * @param refundedSurchargeMoney V1Money value for refundedSurchargeMoney. - * @return Builder - */ - public Builder refundedSurchargeMoney(V1Money refundedSurchargeMoney) { - this.refundedSurchargeMoney = refundedSurchargeMoney; - return this; - } - - /** - * Setter for refundedSurcharges. - * @param refundedSurcharges List of V1PaymentSurcharge value for refundedSurcharges. - * @return Builder - */ - public Builder refundedSurcharges(List refundedSurcharges) { - this.refundedSurcharges = OptionalNullable.of(refundedSurcharges); - return this; - } - - /** - * UnSetter for refundedSurcharges. - * @return Builder - */ - public Builder unsetRefundedSurcharges() { - refundedSurcharges = null; - return this; - } - - /** - * Setter for createdAt. - * @param createdAt String value for createdAt. - * @return Builder - */ - public Builder createdAt(String createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Setter for processedAt. - * @param processedAt String value for processedAt. - * @return Builder - */ - public Builder processedAt(String processedAt) { - this.processedAt = OptionalNullable.of(processedAt); - return this; - } - - /** - * UnSetter for processedAt. - * @return Builder - */ - public Builder unsetProcessedAt() { - processedAt = null; - return this; - } - - /** - * Setter for paymentId. - * @param paymentId String value for paymentId. - * @return Builder - */ - public Builder paymentId(String paymentId) { - this.paymentId = OptionalNullable.of(paymentId); - return this; - } - - /** - * UnSetter for paymentId. - * @return Builder - */ - public Builder unsetPaymentId() { - paymentId = null; - return this; - } - - /** - * Setter for merchantId. - * @param merchantId String value for merchantId. - * @return Builder - */ - public Builder merchantId(String merchantId) { - this.merchantId = OptionalNullable.of(merchantId); - return this; - } - - /** - * UnSetter for merchantId. - * @return Builder - */ - public Builder unsetMerchantId() { - merchantId = null; - return this; - } - - /** - * Setter for isExchange. - * @param isExchange Boolean value for isExchange. - * @return Builder - */ - public Builder isExchange(Boolean isExchange) { - this.isExchange = OptionalNullable.of(isExchange); - return this; - } - - /** - * UnSetter for isExchange. - * @return Builder - */ - public Builder unsetIsExchange() { - isExchange = null; - return this; - } - - /** - * Builds a new {@link V1Refund} object using the set fields. - * @return {@link V1Refund} - */ - public V1Refund build() { - V1Refund model = - new V1Refund(type, reason, refundedMoney, refundedProcessingFeeMoney, - refundedTaxMoney, refundedAdditiveTaxMoney, refundedAdditiveTax, - refundedInclusiveTaxMoney, refundedInclusiveTax, refundedTipMoney, - refundedDiscountMoney, refundedSurchargeMoney, refundedSurcharges, - createdAt, processedAt, paymentId, merchantId, isExchange); - model.httpContext = httpContext; - return model; - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1Settlement.java b/src/main/java/com/squareup/square/models/V1Settlement.java deleted file mode 100644 index ea013e61..00000000 --- a/src/main/java/com/squareup/square/models/V1Settlement.java +++ /dev/null @@ -1,346 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.squareup.square.http.client.HttpContext; -import io.apimatic.core.types.OptionalNullable; -import java.util.List; -import java.util.Objects; - -/** - * This is a model class for V1Settlement type. - */ -public class V1Settlement { - private HttpContext httpContext; - private final String id; - private final String status; - private final V1Money totalMoney; - private final OptionalNullable initiatedAt; - private final OptionalNullable bankAccountId; - private final OptionalNullable> entries; - - /** - * Initialization constructor. - * @param id String value for id. - * @param status String value for status. - * @param totalMoney V1Money value for totalMoney. - * @param initiatedAt String value for initiatedAt. - * @param bankAccountId String value for bankAccountId. - * @param entries List of V1SettlementEntry value for entries. - */ - @JsonCreator - public V1Settlement( - @JsonProperty("id") String id, - @JsonProperty("status") String status, - @JsonProperty("total_money") V1Money totalMoney, - @JsonProperty("initiated_at") String initiatedAt, - @JsonProperty("bank_account_id") String bankAccountId, - @JsonProperty("entries") List entries) { - this.id = id; - this.status = status; - this.totalMoney = totalMoney; - this.initiatedAt = OptionalNullable.of(initiatedAt); - this.bankAccountId = OptionalNullable.of(bankAccountId); - this.entries = OptionalNullable.of(entries); - } - - /** - * Initialization constructor. - * @param id String value for id. - * @param status String value for status. - * @param totalMoney V1Money value for totalMoney. - * @param initiatedAt String value for initiatedAt. - * @param bankAccountId String value for bankAccountId. - * @param entries List of V1SettlementEntry value for entries. - */ - - protected V1Settlement(String id, String status, V1Money totalMoney, - OptionalNullable initiatedAt, OptionalNullable bankAccountId, - OptionalNullable> entries) { - this.id = id; - this.status = status; - this.totalMoney = totalMoney; - this.initiatedAt = initiatedAt; - this.bankAccountId = bankAccountId; - this.entries = entries; - } - - @JsonIgnore - public HttpContext getContext() { - return httpContext; - } - - /** - * Getter for Id. - * The settlement's unique identifier. - * @return Returns the String - */ - @JsonGetter("id") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getId() { - return id; - } - - /** - * Getter for Status. - * @return Returns the String - */ - @JsonGetter("status") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getStatus() { - return status; - } - - /** - * Getter for TotalMoney. - * @return Returns the V1Money - */ - @JsonGetter("total_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getTotalMoney() { - return totalMoney; - } - - /** - * Internal Getter for InitiatedAt. - * The time when the settlement was submitted for deposit or withdrawal, in ISO 8601 format. - * @return Returns the Internal String - */ - @JsonGetter("initiated_at") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetInitiatedAt() { - return this.initiatedAt; - } - - /** - * Getter for InitiatedAt. - * The time when the settlement was submitted for deposit or withdrawal, in ISO 8601 format. - * @return Returns the String - */ - @JsonIgnore - public String getInitiatedAt() { - return OptionalNullable.getFrom(initiatedAt); - } - - /** - * Internal Getter for BankAccountId. - * The Square-issued unique identifier for the bank account associated with the settlement. - * @return Returns the Internal String - */ - @JsonGetter("bank_account_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetBankAccountId() { - return this.bankAccountId; - } - - /** - * Getter for BankAccountId. - * The Square-issued unique identifier for the bank account associated with the settlement. - * @return Returns the String - */ - @JsonIgnore - public String getBankAccountId() { - return OptionalNullable.getFrom(bankAccountId); - } - - /** - * Internal Getter for Entries. - * The entries included in this settlement. - * @return Returns the Internal List of V1SettlementEntry - */ - @JsonGetter("entries") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable> internalGetEntries() { - return this.entries; - } - - /** - * Getter for Entries. - * The entries included in this settlement. - * @return Returns the List of V1SettlementEntry - */ - @JsonIgnore - public List getEntries() { - return OptionalNullable.getFrom(entries); - } - - @Override - public int hashCode() { - return Objects.hash(id, status, totalMoney, initiatedAt, bankAccountId, entries); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1Settlement)) { - return false; - } - V1Settlement other = (V1Settlement) obj; - return Objects.equals(id, other.id) - && Objects.equals(status, other.status) - && Objects.equals(totalMoney, other.totalMoney) - && Objects.equals(initiatedAt, other.initiatedAt) - && Objects.equals(bankAccountId, other.bankAccountId) - && Objects.equals(entries, other.entries); - } - - /** - * Converts this V1Settlement into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1Settlement [" + "id=" + id + ", status=" + status + ", totalMoney=" + totalMoney - + ", initiatedAt=" + initiatedAt + ", bankAccountId=" + bankAccountId + ", entries=" - + entries + "]"; - } - - /** - * Builds a new {@link V1Settlement.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1Settlement.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .id(getId()) - .status(getStatus()) - .totalMoney(getTotalMoney()); - builder.initiatedAt = internalGetInitiatedAt(); - builder.bankAccountId = internalGetBankAccountId(); - builder.entries = internalGetEntries(); - return builder; - } - - /** - * Class to build instances of {@link V1Settlement}. - */ - public static class Builder { - private HttpContext httpContext; - private String id; - private String status; - private V1Money totalMoney; - private OptionalNullable initiatedAt; - private OptionalNullable bankAccountId; - private OptionalNullable> entries; - - - - /** - * Setter for httpContext. - * @param httpContext HttpContext value for httpContext. - * @return Builder - */ - public Builder httpContext(HttpContext httpContext) { - this.httpContext = httpContext; - return this; - } - - /** - * Setter for id. - * @param id String value for id. - * @return Builder - */ - public Builder id(String id) { - this.id = id; - return this; - } - - /** - * Setter for status. - * @param status String value for status. - * @return Builder - */ - public Builder status(String status) { - this.status = status; - return this; - } - - /** - * Setter for totalMoney. - * @param totalMoney V1Money value for totalMoney. - * @return Builder - */ - public Builder totalMoney(V1Money totalMoney) { - this.totalMoney = totalMoney; - return this; - } - - /** - * Setter for initiatedAt. - * @param initiatedAt String value for initiatedAt. - * @return Builder - */ - public Builder initiatedAt(String initiatedAt) { - this.initiatedAt = OptionalNullable.of(initiatedAt); - return this; - } - - /** - * UnSetter for initiatedAt. - * @return Builder - */ - public Builder unsetInitiatedAt() { - initiatedAt = null; - return this; - } - - /** - * Setter for bankAccountId. - * @param bankAccountId String value for bankAccountId. - * @return Builder - */ - public Builder bankAccountId(String bankAccountId) { - this.bankAccountId = OptionalNullable.of(bankAccountId); - return this; - } - - /** - * UnSetter for bankAccountId. - * @return Builder - */ - public Builder unsetBankAccountId() { - bankAccountId = null; - return this; - } - - /** - * Setter for entries. - * @param entries List of V1SettlementEntry value for entries. - * @return Builder - */ - public Builder entries(List entries) { - this.entries = OptionalNullable.of(entries); - return this; - } - - /** - * UnSetter for entries. - * @return Builder - */ - public Builder unsetEntries() { - entries = null; - return this; - } - - /** - * Builds a new {@link V1Settlement} object using the set fields. - * @return {@link V1Settlement} - */ - public V1Settlement build() { - V1Settlement model = - new V1Settlement(id, status, totalMoney, initiatedAt, bankAccountId, entries); - model.httpContext = httpContext; - return model; - } - } -} diff --git a/src/main/java/com/squareup/square/models/V1SettlementEntry.java b/src/main/java/com/squareup/square/models/V1SettlementEntry.java deleted file mode 100644 index 9e346f3f..00000000 --- a/src/main/java/com/squareup/square/models/V1SettlementEntry.java +++ /dev/null @@ -1,221 +0,0 @@ - -package com.squareup.square.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.apimatic.core.types.OptionalNullable; -import java.util.Objects; - -/** - * This is a model class for V1SettlementEntry type. - */ -public class V1SettlementEntry { - private final OptionalNullable paymentId; - private final String type; - private final V1Money amountMoney; - private final V1Money feeMoney; - - /** - * Initialization constructor. - * @param paymentId String value for paymentId. - * @param type String value for type. - * @param amountMoney V1Money value for amountMoney. - * @param feeMoney V1Money value for feeMoney. - */ - @JsonCreator - public V1SettlementEntry( - @JsonProperty("payment_id") String paymentId, - @JsonProperty("type") String type, - @JsonProperty("amount_money") V1Money amountMoney, - @JsonProperty("fee_money") V1Money feeMoney) { - this.paymentId = OptionalNullable.of(paymentId); - this.type = type; - this.amountMoney = amountMoney; - this.feeMoney = feeMoney; - } - - /** - * Initialization constructor. - * @param paymentId String value for paymentId. - * @param type String value for type. - * @param amountMoney V1Money value for amountMoney. - * @param feeMoney V1Money value for feeMoney. - */ - - protected V1SettlementEntry(OptionalNullable paymentId, String type, - V1Money amountMoney, V1Money feeMoney) { - this.paymentId = paymentId; - this.type = type; - this.amountMoney = amountMoney; - this.feeMoney = feeMoney; - } - - /** - * Internal Getter for PaymentId. - * The settlement's unique identifier. - * @return Returns the Internal String - */ - @JsonGetter("payment_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetPaymentId() { - return this.paymentId; - } - - /** - * Getter for PaymentId. - * The settlement's unique identifier. - * @return Returns the String - */ - @JsonIgnore - public String getPaymentId() { - return OptionalNullable.getFrom(paymentId); - } - - /** - * Getter for Type. - * @return Returns the String - */ - @JsonGetter("type") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getType() { - return type; - } - - /** - * Getter for AmountMoney. - * @return Returns the V1Money - */ - @JsonGetter("amount_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getAmountMoney() { - return amountMoney; - } - - /** - * Getter for FeeMoney. - * @return Returns the V1Money - */ - @JsonGetter("fee_money") - @JsonInclude(JsonInclude.Include.NON_NULL) - public V1Money getFeeMoney() { - return feeMoney; - } - - @Override - public int hashCode() { - return Objects.hash(paymentId, type, amountMoney, feeMoney); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof V1SettlementEntry)) { - return false; - } - V1SettlementEntry other = (V1SettlementEntry) obj; - return Objects.equals(paymentId, other.paymentId) - && Objects.equals(type, other.type) - && Objects.equals(amountMoney, other.amountMoney) - && Objects.equals(feeMoney, other.feeMoney); - } - - /** - * Converts this V1SettlementEntry into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "V1SettlementEntry [" + "paymentId=" + paymentId + ", type=" + type - + ", amountMoney=" + amountMoney + ", feeMoney=" + feeMoney + "]"; - } - - /** - * Builds a new {@link V1SettlementEntry.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link V1SettlementEntry.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .type(getType()) - .amountMoney(getAmountMoney()) - .feeMoney(getFeeMoney()); - builder.paymentId = internalGetPaymentId(); - return builder; - } - - /** - * Class to build instances of {@link V1SettlementEntry}. - */ - public static class Builder { - private OptionalNullable paymentId; - private String type; - private V1Money amountMoney; - private V1Money feeMoney; - - - - /** - * Setter for paymentId. - * @param paymentId String value for paymentId. - * @return Builder - */ - public Builder paymentId(String paymentId) { - this.paymentId = OptionalNullable.of(paymentId); - return this; - } - - /** - * UnSetter for paymentId. - * @return Builder - */ - public Builder unsetPaymentId() { - paymentId = null; - return this; - } - - /** - * Setter for type. - * @param type String value for type. - * @return Builder - */ - public Builder type(String type) { - this.type = type; - return this; - } - - /** - * Setter for amountMoney. - * @param amountMoney V1Money value for amountMoney. - * @return Builder - */ - public Builder amountMoney(V1Money amountMoney) { - this.amountMoney = amountMoney; - return this; - } - - /** - * Setter for feeMoney. - * @param feeMoney V1Money value for feeMoney. - * @return Builder - */ - public Builder feeMoney(V1Money feeMoney) { - this.feeMoney = feeMoney; - return this; - } - - /** - * Builds a new {@link V1SettlementEntry} object using the set fields. - * @return {@link V1SettlementEntry} - */ - public V1SettlementEntry build() { - return new V1SettlementEntry(paymentId, type, amountMoney, feeMoney); - } - } -} diff --git a/src/test/java/com/squareup/square/api/BaseApiTest.java b/src/test/java/com/squareup/square/api/BaseApiTest.java index 30630c30..fba9f556 100644 --- a/src/test/java/com/squareup/square/api/BaseApiTest.java +++ b/src/test/java/com/squareup/square/api/BaseApiTest.java @@ -3,6 +3,7 @@ import com.squareup.square.Environment; import com.squareup.square.SquareClient; +import com.squareup.square.authentication.BearerAuthModel; import com.squareup.square.testing.HttpCallbackCatcher; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -62,7 +63,9 @@ protected static SquareClient createConfigurationFromEnvironment() { final String accessToken = System.getenv("SQUARE_ACCESS_TOKEN"); if (accessToken != null) { - builder.accessToken(accessToken); + builder.bearerAuthCredentials(new BearerAuthModel + .Builder(accessToken) + .build()); } if (environment != null) { builder.environment(Environment.fromString(environment)); diff --git a/src/test/java/com/squareup/square/api/LocationsApiTest.java b/src/test/java/com/squareup/square/api/LocationsApiTest.java index 21654d03..a2e86c64 100644 --- a/src/test/java/com/squareup/square/api/LocationsApiTest.java +++ b/src/test/java/com/squareup/square/api/LocationsApiTest.java @@ -42,7 +42,7 @@ public static void tearDownClass() { /** * Provides details about all of the seller's * [locations](https://developer.squareup.com/docs/locations-api), including those with an - * inactive status. + * inactive status. Locations are listed alphabetically by `name`. * @throws Throwable exception if occurs. */ @Test