diff --git a/.fern/metadata.json b/.fern/metadata.json
index 1b6b24b5..97957d82 100644
--- a/.fern/metadata.json
+++ b/.fern/metadata.json
@@ -1,7 +1,7 @@
{
- "cliVersion": "3.38.0",
+ "cliVersion": "3.98.5",
"generatorName": "fernapi/fern-java-sdk",
- "generatorVersion": "3.27.6",
+ "generatorVersion": "3.42.8",
"generatorConfig": {
"base-api-exception-class-name": "SquareApiException",
"base-exception-class-name": "SquareException",
@@ -13,5 +13,5 @@
"enable-forward-compatible-enums": true,
"publish-to": "central"
},
- "sdkVersion": "46.0.0.20260122"
+ "sdkVersion": "46.1.0.20260122"
}
\ No newline at end of file
diff --git a/README.md b/README.md
index 2dd51f47..51154439 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,7 @@ Add the dependency in your `pom.xml` file:
com.squareup
square
- 46.0.0.20260122
+ 46.1.0.20260122
```
@@ -361,8 +361,8 @@ Gradle:
```groovy
dependencies {
- implementation 'com.squareup:square:46.0.0.20260122'
- implementation 'com.squareup:square-legacy:46.0.0.20260122'
+ implementation 'com.squareup:square:46.1.0.20260122'
+ implementation 'com.squareup:square-legacy:46.1.0.20260122'
}
```
@@ -372,12 +372,12 @@ Maven:
com.squareup
square
- 46.0.0.20260122
+ 46.1.0.20260122
com.squareup
square-legacy
- 46.0.0.20260122
+ 46.1.0.20260122
```
@@ -499,4 +499,4 @@ otherwise they would be overwritten upon the next generated release. Feel free t
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
an issue first to discuss with us!
-On the other hand, contributions to the README are always very welcome!
\ No newline at end of file
+On the other hand, contributions to the README are always very welcome!
diff --git a/build.gradle b/build.gradle
index 022d7ecd..7fb73bdf 100644
--- a/build.gradle
+++ b/build.gradle
@@ -15,9 +15,9 @@ repositories {
dependencies {
api 'com.squareup.okhttp3:okhttp:5.2.1'
- api 'com.fasterxml.jackson.core:jackson-databind:2.18.2'
- api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2'
- api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2'
+ api 'com.fasterxml.jackson.core:jackson-databind:2.18.6'
+ api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.6'
+ api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.6'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
@@ -47,7 +47,7 @@ java {
group = 'com.squareup'
-version = '46.0.0.20260122'
+version = '46.1.0.20260122'
jar {
dependsOn(":generatePomFileForMavenPublication")
@@ -78,7 +78,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.squareup'
artifactId = 'square'
- version = '46.0.0.20260122'
+ version = '46.1.0.20260122'
from components.java
pom {
name = 'square'
diff --git a/reference.md b/reference.md
index 47ec4ee3..9e8d4775 100644
--- a/reference.md
+++ b/reference.md
@@ -412,7 +412,7 @@ client.oAuth().authorize();
## V1Transactions
-client.v1Transactions.v1ListOrders(locationId) -> List<V1Order>
+client.v1Transactions.v1ListOrders(locationId) -> List<V1Order>
-
@@ -755,7 +755,7 @@ client.applePay().registerDomain(
## BankAccounts
-client.bankAccounts.list() -> SyncPagingIterable<BankAccount>
+client.bankAccounts.list() -> SyncPagingIterable<BankAccount>
-
@@ -1121,7 +1121,7 @@ client.bankAccounts().disableBankAccount(
## Bookings
-client.bookings.list() -> SyncPagingIterable<Booking>
+client.bookings.list() -> SyncPagingIterable<Booking>
-
@@ -1850,7 +1850,7 @@ client.bookings().cancel(
## Cards
-client.cards.list() -> SyncPagingIterable<Card>
+client.cards.list() -> SyncPagingIterable<Card>
-
@@ -2584,7 +2584,7 @@ client.catalog().info();
-client.catalog.list() -> SyncPagingIterable<CatalogObject>
+client.catalog.list() -> SyncPagingIterable<CatalogObject>
-
@@ -3275,7 +3275,7 @@ At least one of `taxes_to_enable` or `taxes_to_disable` must be specified.
## Channels
-client.channels.list() -> SyncPagingIterable<Channel>
+client.channels.list() -> SyncPagingIterable<Channel>
-
@@ -3494,7 +3494,7 @@ client.channels().get(
## Customers
-client.customers.list() -> SyncPagingIterable<Customer>
+client.customers.list() -> SyncPagingIterable<Customer>
-
@@ -4666,7 +4666,7 @@ As a best practice, you should include this parameter to enable [optimistic conc
## Devices
-client.devices.list() -> SyncPagingIterable<Device>
+client.devices.list() -> SyncPagingIterable<Device>
-
@@ -4821,7 +4821,7 @@ client.devices().get(
## Disputes
-client.disputes.list() -> SyncPagingIterable<Dispute>
+client.disputes.list() -> SyncPagingIterable<Dispute>
-
@@ -5242,7 +5242,7 @@ client.disputes().submitEvidence(
## Employees
-client.employees.list() -> SyncPagingIterable<Employee>
+client.employees.list() -> SyncPagingIterable<Employee>
-
@@ -5612,7 +5612,7 @@ client.events().listEventTypes(
## GiftCards
-client.giftCards.list() -> SyncPagingIterable<GiftCard>
+client.giftCards.list() -> SyncPagingIterable<GiftCard>
-
@@ -6593,7 +6593,7 @@ client.inventory().batchCreateChanges(
-client.inventory.batchGetChanges(request) -> SyncPagingIterable<InventoryChange>
+client.inventory.batchGetChanges(request) -> SyncPagingIterable<InventoryChange>
-
@@ -6680,7 +6680,7 @@ client.inventory().batchGetChanges(
-client.inventory.batchGetCounts(request) -> SyncPagingIterable<InventoryCount>
+client.inventory.batchGetCounts(request) -> SyncPagingIterable<InventoryCount>
-
@@ -6945,7 +6945,7 @@ client.inventory().getTransfer(
-client.inventory.get(catalogObjectId) -> SyncPagingIterable<InventoryCount>
+client.inventory.get(catalogObjectId) -> SyncPagingIterable<InventoryCount>
-
@@ -7033,7 +7033,7 @@ See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagin
-client.inventory.changes(catalogObjectId) -> SyncPagingIterable<InventoryChange>
+client.inventory.changes(catalogObjectId) -> SyncPagingIterable<InventoryChange>
-
@@ -7131,7 +7131,7 @@ See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagin
## Invoices
-client.invoices.list() -> SyncPagingIterable<Invoice>
+client.invoices.list() -> SyncPagingIterable<Invoice>
-
@@ -9829,7 +9829,7 @@ For more information, see [Pagination](https://developer.squareup.com/docs/build
## Merchants
-client.merchants.list() -> SyncPagingIterable<Merchant>
+client.merchants.list() -> SyncPagingIterable<Merchant>
-
@@ -11131,7 +11131,7 @@ The payment total must match the order total.
## Payments
-client.payments.list() -> SyncPagingIterable<Payment>
+client.payments.list() -> SyncPagingIterable<Payment>
-
@@ -12146,7 +12146,7 @@ the update fails and a response with a VERSION_MISMATCH error is returned.
## Payouts
-client.payouts.list() -> SyncPagingIterable<Payout>
+client.payouts.list() -> SyncPagingIterable<Payout>
-
@@ -12341,7 +12341,7 @@ client.payouts().get(
-client.payouts.listEntries(payoutId) -> SyncPagingIterable<PayoutEntry>
+client.payouts.listEntries(payoutId) -> SyncPagingIterable<PayoutEntry>
-
@@ -12440,7 +12440,7 @@ Default: `100`
## Refunds
-client.refunds.list() -> SyncPagingIterable<PaymentRefund>
+client.refunds.list() -> SyncPagingIterable<PaymentRefund>
-
@@ -14005,7 +14005,7 @@ client.subscriptions().cancel(
-client.subscriptions.listEvents(subscriptionId) -> SyncPagingIterable<SubscriptionEvent>
+client.subscriptions.listEvents(subscriptionId) -> SyncPagingIterable<SubscriptionEvent>
-
@@ -15621,7 +15621,7 @@ any valid string but must be unique for every CreateTransferOrder request.
-client.transferOrders.search(request) -> SyncPagingIterable<TransferOrder>
+client.transferOrders.search(request) -> SyncPagingIterable<TransferOrder>
-
@@ -16856,7 +16856,7 @@ client.vendors().update(
## Bookings CustomAttributeDefinitions
-client.bookings.customAttributeDefinitions.list() -> SyncPagingIterable<CustomAttributeDefinition>
+client.bookings.customAttributeDefinitions.list() -> SyncPagingIterable<CustomAttributeDefinition>
-
@@ -17436,7 +17436,7 @@ information needed to create or update a custom attribute.
-client.bookings.customAttributes.list(bookingId) -> SyncPagingIterable<CustomAttribute>
+client.bookings.customAttributes.list(bookingId) -> SyncPagingIterable<CustomAttribute>
-
@@ -17829,7 +17829,7 @@ definition owner, you must use the qualified key.
## Bookings LocationProfiles
-client.bookings.locationProfiles.list() -> SyncPagingIterable<LocationBookingProfile>
+client.bookings.locationProfiles.list() -> SyncPagingIterable<LocationBookingProfile>
-
@@ -17898,7 +17898,7 @@ client.bookings().locationProfiles().list(
## Bookings TeamMemberProfiles
-client.bookings.teamMemberProfiles.list() -> SyncPagingIterable<TeamMemberBookingProfile>
+client.bookings.teamMemberProfiles.list() -> SyncPagingIterable<TeamMemberBookingProfile>
-
@@ -18044,7 +18044,7 @@ client.bookings().teamMemberProfiles().get(
## CashDrawers Shifts
-client.cashDrawers.shifts.list() -> SyncPagingIterable<CashDrawerShiftSummary>
+client.cashDrawers.shifts.list() -> SyncPagingIterable<CashDrawerShiftSummary>
-
@@ -18224,7 +18224,7 @@ client.cashDrawers().shifts().get(
-client.cashDrawers.shifts.listEvents(shiftId) -> SyncPagingIterable<CashDrawerShiftEvent>
+client.cashDrawers.shifts.listEvents(shiftId) -> SyncPagingIterable<CashDrawerShiftEvent>
-
@@ -18710,7 +18710,7 @@ catalog item will delete its catalog item variations).
## Checkout PaymentLinks
-client.checkout.paymentLinks.list() -> SyncPagingIterable<PaymentLink>
+client.checkout.paymentLinks.list() -> SyncPagingIterable<PaymentLink>
-
@@ -19137,7 +19137,7 @@ client.checkout().paymentLinks().delete(
## Customers CustomAttributeDefinitions
-client.customers.customAttributeDefinitions.list() -> SyncPagingIterable<CustomAttributeDefinition>
+client.customers.customAttributeDefinitions.list() -> SyncPagingIterable<CustomAttributeDefinition>
-
@@ -19264,7 +19264,7 @@ client.customers().customAttributeDefinitions().create(
.key("favoritemovie")
.schema(
new HashMap() {{
- put("\\$ref", "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String");
+ put("$ref", "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String");
}}
)
.name("Favorite Movie")
@@ -19704,7 +19704,7 @@ information needed to create or update a custom attribute.
## Customers Groups
-client.customers.groups.list() -> SyncPagingIterable<CustomerGroup>
+client.customers.groups.list() -> SyncPagingIterable<CustomerGroup>
-
@@ -20190,7 +20190,7 @@ client.customers().groups().remove(
## Customers Segments
-client.customers.segments.list() -> SyncPagingIterable<CustomerSegment>
+client.customers.segments.list() -> SyncPagingIterable<CustomerSegment>
-
@@ -20524,7 +20524,7 @@ client.customers().cards().delete(
## Customers CustomAttributes
-client.customers.customAttributes.list(customerId) -> SyncPagingIterable<CustomAttribute>
+client.customers.customAttributes.list(customerId) -> SyncPagingIterable<CustomAttribute>
-
@@ -20926,7 +20926,7 @@ definition owner, you must use the qualified key.
## Devices Codes
-client.devices.codes.list() -> SyncPagingIterable<DeviceCode>
+client.devices.codes.list() -> SyncPagingIterable<DeviceCode>
-
@@ -21167,7 +21167,7 @@ client.devices().codes().get(
## Disputes Evidence
-client.disputes.evidence.list(disputeId) -> SyncPagingIterable<DisputeEvidence>
+client.disputes.evidence.list(disputeId) -> SyncPagingIterable<DisputeEvidence>
-
@@ -21379,7 +21379,7 @@ client.disputes().evidence().delete(
## GiftCards Activities
-client.giftCards.activities.list() -> SyncPagingIterable<GiftCardActivity>
+client.giftCards.activities.list() -> SyncPagingIterable<GiftCardActivity>
-
@@ -21620,7 +21620,7 @@ gift card, the `location_id` where the activity occurred, and the activity `type
## Labor BreakTypes
-client.labor.breakTypes.list() -> SyncPagingIterable<BreakType>
+client.labor.breakTypes.list() -> SyncPagingIterable<BreakType>
-
@@ -21990,7 +21990,7 @@ client.labor().breakTypes().delete(
## Labor EmployeeWages
-client.labor.employeeWages.list() -> SyncPagingIterable<EmployeeWage>
+client.labor.employeeWages.list() -> SyncPagingIterable<EmployeeWage>
-
@@ -22610,7 +22610,7 @@ client.labor().shifts().delete(
## Labor TeamMemberWages
-client.labor.teamMemberWages.list() -> SyncPagingIterable<TeamMemberWage>
+client.labor.teamMemberWages.list() -> SyncPagingIterable<TeamMemberWage>
-
@@ -22753,7 +22753,7 @@ client.labor().teamMemberWages().get(
## Labor WorkweekConfigs
-client.labor.workweekConfigs.list() -> SyncPagingIterable<WorkweekConfig>
+client.labor.workweekConfigs.list() -> SyncPagingIterable<WorkweekConfig>
-
@@ -22897,7 +22897,7 @@ client.labor().workweekConfigs().get(
## Locations CustomAttributeDefinitions
-client.locations.customAttributeDefinitions.list() -> SyncPagingIterable<CustomAttributeDefinition>
+client.locations.customAttributeDefinitions.list() -> SyncPagingIterable<CustomAttributeDefinition>
-
@@ -23027,7 +23027,7 @@ client.locations().customAttributeDefinitions().create(
.key("bestseller")
.schema(
new HashMap() {{
- put("\\$ref", "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String");
+ put("$ref", "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String");
}}
)
.name("Bestseller")
@@ -23511,7 +23511,7 @@ information needed to create or update a custom attribute.
-client.locations.customAttributes.list(locationId) -> SyncPagingIterable<CustomAttribute>
+client.locations.customAttributes.list(locationId) -> SyncPagingIterable<CustomAttribute>
-
@@ -25325,7 +25325,7 @@ Keys can be any valid string, but must be unique for every request.
## Loyalty Programs Promotions
-client.loyalty.programs.promotions.list(programId) -> SyncPagingIterable<LoyaltyPromotion>
+client.loyalty.programs.promotions.list(programId) -> SyncPagingIterable<LoyaltyPromotion>
-
@@ -25708,7 +25708,7 @@ promotion that has an `ACTIVE` or `SCHEDULED` status.
## Merchants CustomAttributeDefinitions
-client.merchants.customAttributeDefinitions.list() -> SyncPagingIterable<CustomAttributeDefinition>
+client.merchants.customAttributeDefinitions.list() -> SyncPagingIterable<CustomAttributeDefinition>
-
@@ -25838,7 +25838,7 @@ client.merchants().customAttributeDefinitions().create(
.key("alternative_seller_name")
.schema(
new HashMap() {{
- put("\\$ref", "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String");
+ put("$ref", "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String");
}}
)
.name("Alternative Merchant Name")
@@ -26306,7 +26306,7 @@ information needed to create or update a custom attribute.
-client.merchants.customAttributes.list(merchantId) -> SyncPagingIterable<CustomAttribute>
+client.merchants.customAttributes.list(merchantId) -> SyncPagingIterable<CustomAttribute>
-
@@ -26705,7 +26705,7 @@ definition owner, you must use the qualified key.
## Orders CustomAttributeDefinitions
-client.orders.customAttributeDefinitions.list() -> SyncPagingIterable<CustomAttributeDefinition>
+client.orders.customAttributeDefinitions.list() -> SyncPagingIterable<CustomAttributeDefinition>
-
@@ -26836,7 +26836,7 @@ client.orders().customAttributeDefinitions().create(
.key("cover-count")
.schema(
new HashMap() {{
- put("\\$ref", "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number");
+ put("$ref", "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number");
}}
)
.name("Cover count")
@@ -27307,7 +27307,7 @@ client.orders().customAttributes().batchUpsert(
-client.orders.customAttributes.list(orderId) -> SyncPagingIterable<CustomAttribute>
+client.orders.customAttributes.list(orderId) -> SyncPagingIterable<CustomAttribute>
-
@@ -28873,7 +28873,7 @@ client.webhooks().eventTypes().list(
## Webhooks Subscriptions
-client.webhooks.subscriptions.list() -> SyncPagingIterable<WebhookSubscription>
+client.webhooks.subscriptions.list() -> SyncPagingIterable<WebhookSubscription>
-
@@ -29386,3 +29386,4 @@ contained in the list of event types in the [Subscription](entity:WebhookSubscri
+
diff --git a/src/main/java/com/squareup/square/AsyncRawApplePayClient.java b/src/main/java/com/squareup/square/AsyncRawApplePayClient.java
index c7e7cf02..f8a02a0e 100644
--- a/src/main/java/com/squareup/square/AsyncRawApplePayClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawApplePayClient.java
@@ -66,10 +66,14 @@ public CompletableFuture> regis
*/
public CompletableFuture> registerDomain(
RegisterDomainRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/apple-pay/domains")
- .build();
+ .addPathSegments("v2/apple-pay/domains");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -78,7 +82,7 @@ public CompletableFuture> regis
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
diff --git a/src/main/java/com/squareup/square/AsyncRawBankAccountsClient.java b/src/main/java/com/squareup/square/AsyncRawBankAccountsClient.java
index 93c04a34..95090c88 100644
--- a/src/main/java/com/squareup/square/AsyncRawBankAccountsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawBankAccountsClient.java
@@ -95,6 +95,11 @@ public CompletableFuture {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
@@ -165,10 +170,14 @@ public CompletableFuture> cr
*/
public CompletableFuture> createBankAccount(
CreateBankAccountRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/bank-accounts")
- .build();
+ .addPathSegments("v2/bank-accounts");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -177,7 +186,7 @@ public CompletableFuture> cr
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -230,13 +239,17 @@ public CompletableFuture>
*/
public CompletableFuture> getByV1Id(
GetByV1IdBankAccountsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/bank-accounts/by-v1-id")
- .addPathSegment(request.getV1BankAccountId())
- .build();
+ .addPathSegment(request.getV1BankAccountId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -287,13 +300,17 @@ public CompletableFuture> get(G
*/
public CompletableFuture> get(
GetBankAccountsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/bank-accounts")
- .addPathSegment(request.getBankAccountId())
- .build();
+ .addPathSegment(request.getBankAccountId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -344,14 +361,18 @@ public CompletableFuture> d
*/
public CompletableFuture> disableBankAccount(
DisableBankAccountRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/bank-accounts")
.addPathSegment(request.getBankAccountId())
- .addPathSegments("disable")
- .build();
+ .addPathSegments("disable");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", RequestBody.create("", null))
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
diff --git a/src/main/java/com/squareup/square/AsyncRawBookingsClient.java b/src/main/java/com/squareup/square/AsyncRawBookingsClient.java
index 387e78ec..1ff5a88e 100644
--- a/src/main/java/com/squareup/square/AsyncRawBookingsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawBookingsClient.java
@@ -123,6 +123,11 @@ public CompletableFuture>>
QueryStringMapper.addQueryParameter(
httpUrl, "start_at_max", request.getStartAtMax().get(), false);
}
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
@@ -215,10 +220,14 @@ public CompletableFuture> create
*/
public CompletableFuture> create(
CreateBookingRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/bookings")
- .build();
+ .addPathSegments("v2/bookings");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -227,7 +236,7 @@ public CompletableFuture> create
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -283,10 +292,14 @@ public CompletableFuture> s
*/
public CompletableFuture> searchAvailability(
SearchAvailabilityRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/bookings/availability/search")
- .build();
+ .addPathSegments("v2/bookings/availability/search");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -295,7 +308,7 @@ public CompletableFuture> s
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -352,10 +365,14 @@ public CompletableFuture>
*/
public CompletableFuture> bulkRetrieveBookings(
BulkRetrieveBookingsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/bookings/bulk-retrieve")
- .build();
+ .addPathSegments("v2/bookings/bulk-retrieve");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -364,7 +381,7 @@ public CompletableFuture>
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -416,12 +433,16 @@ public CompletableFuture> getBusinessProfile(
RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/bookings/business-booking-profile")
- .build();
+ .addPathSegments("v2/bookings/business-booking-profile");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json")
@@ -475,13 +496,17 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
public CompletableFuture>
retrieveLocationBookingProfile(
RetrieveLocationBookingProfileRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/bookings/location-booking-profiles")
- .addPathSegment(request.getLocationId())
- .build();
+ .addPathSegment(request.getLocationId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -535,10 +560,14 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
public CompletableFuture>
bulkRetrieveTeamMemberBookingProfiles(
BulkRetrieveTeamMemberBookingProfilesRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/bookings/team-member-booking-profiles/bulk-retrieve")
- .build();
+ .addPathSegments("v2/bookings/team-member-booking-profiles/bulk-retrieve");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -547,7 +576,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -604,13 +633,17 @@ public CompletableFuture> get(GetBo
*/
public CompletableFuture> get(
GetBookingsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/bookings")
- .addPathSegment(request.getBookingId())
- .build();
+ .addPathSegment(request.getBookingId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -668,11 +701,15 @@ public CompletableFuture> update
*/
public CompletableFuture> update(
UpdateBookingRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/bookings")
- .addPathSegment(request.getBookingId())
- .build();
+ .addPathSegment(request.getBookingId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -681,7 +718,7 @@ public CompletableFuture> update
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("PUT", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -740,12 +777,16 @@ public CompletableFuture> cancel
*/
public CompletableFuture> cancel(
CancelBookingRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/bookings")
.addPathSegment(request.getBookingId())
- .addPathSegments("cancel")
- .build();
+ .addPathSegments("cancel");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -754,7 +795,7 @@ public CompletableFuture> cancel
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
diff --git a/src/main/java/com/squareup/square/AsyncRawCardsClient.java b/src/main/java/com/squareup/square/AsyncRawCardsClient.java
index f34826cb..03377a58 100644
--- a/src/main/java/com/squareup/square/AsyncRawCardsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawCardsClient.java
@@ -99,6 +99,11 @@ public CompletableFuture>> lis
QueryStringMapper.addQueryParameter(
httpUrl, "sort_order", request.getSortOrder().get(), false);
}
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
@@ -166,10 +171,14 @@ public CompletableFuture> create(Cr
*/
public CompletableFuture> create(
CreateCardRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/cards")
- .build();
+ .addPathSegments("v2/cards");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -178,7 +187,7 @@ public CompletableFuture> create(
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -229,13 +238,17 @@ public CompletableFuture> get(GetCards
*/
public CompletableFuture> get(
GetCardsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/cards")
- .addPathSegment(request.getCardId())
- .build();
+ .addPathSegment(request.getCardId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -287,14 +300,18 @@ public CompletableFuture> disable(
*/
public CompletableFuture> disable(
DisableCardsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/cards")
.addPathSegment(request.getCardId())
- .addPathSegments("disable")
- .build();
+ .addPathSegments("disable");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", RequestBody.create("", null))
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
diff --git a/src/main/java/com/squareup/square/AsyncRawCatalogClient.java b/src/main/java/com/squareup/square/AsyncRawCatalogClient.java
index 290ef2de..ccf12869 100644
--- a/src/main/java/com/squareup/square/AsyncRawCatalogClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawCatalogClient.java
@@ -90,10 +90,14 @@ public CompletableFuture> batchDelete(
BatchDeleteCatalogObjectsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/catalog/batch-delete")
- .build();
+ .addPathSegments("v2/catalog/batch-delete");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -102,7 +106,7 @@ public CompletableFuture> batchGet(
BatchGetCatalogObjectsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/catalog/batch-retrieve")
- .build();
+ .addPathSegments("v2/catalog/batch-retrieve");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -178,7 +186,7 @@ public CompletableFuture> batchUpsert(
BatchUpsertCatalogObjectsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/catalog/batch-upsert")
- .build();
+ .addPathSegments("v2/catalog/batch-upsert");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -265,7 +277,7 @@ public CompletableFuture> info() {
* limits that can be used by the BatchUpsertCatalogObjects endpoint.
*/
public CompletableFuture> info(RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/catalog/info")
- .build();
+ .addPathSegments("v2/catalog/info");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json")
@@ -425,6 +441,11 @@ public CompletableFuture {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
@@ -546,10 +567,14 @@ public CompletableFuture>
*/
public CompletableFuture> search(
SearchCatalogObjectsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/catalog/search")
- .build();
+ .addPathSegments("v2/catalog/search");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -558,7 +583,7 @@ public CompletableFuture>
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -662,10 +687,14 @@ public CompletableFuture> s
*/
public CompletableFuture> searchItems(
SearchCatalogItemsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/catalog/search-catalog-items")
- .build();
+ .addPathSegments("v2/catalog/search-catalog-items");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -674,7 +703,7 @@ public CompletableFuture> s
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -731,10 +760,14 @@ public CompletableFuture> updateItemModifierLists(
UpdateItemModifierListsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/catalog/update-item-modifier-lists")
- .build();
+ .addPathSegments("v2/catalog/update-item-modifier-lists");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -743,7 +776,7 @@ public CompletableFuture> upda
*/
public CompletableFuture> updateItemTaxes(
UpdateItemTaxesRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/catalog/update-item-taxes")
- .build();
+ .addPathSegments("v2/catalog/update-item-taxes");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -812,7 +849,7 @@ public CompletableFuture> upda
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
diff --git a/src/main/java/com/squareup/square/AsyncRawChannelsClient.java b/src/main/java/com/squareup/square/AsyncRawChannelsClient.java
index 0beb2ce8..6f52cc20 100644
--- a/src/main/java/com/squareup/square/AsyncRawChannelsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawChannelsClient.java
@@ -82,6 +82,11 @@ public CompletableFuture>>
QueryStringMapper.addQueryParameter(
httpUrl, "limit", request.getLimit().get(), false);
}
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
@@ -145,10 +150,14 @@ public CompletableFuture>
public CompletableFuture> bulkRetrieve(
BulkRetrieveChannelsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/channels/bulk-retrieve")
- .build();
+ .addPathSegments("v2/channels/bulk-retrieve");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -157,7 +166,7 @@ public CompletableFuture>
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -203,13 +212,17 @@ public CompletableFuture> get(
public CompletableFuture> get(
GetChannelsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/channels")
- .addPathSegment(request.getChannelId())
- .build();
+ .addPathSegment(request.getChannelId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
diff --git a/src/main/java/com/squareup/square/AsyncRawCheckoutClient.java b/src/main/java/com/squareup/square/AsyncRawCheckoutClient.java
index ac9c907b..31d77f93 100644
--- a/src/main/java/com/squareup/square/AsyncRawCheckoutClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawCheckoutClient.java
@@ -51,13 +51,17 @@ public CompletableFuture> retrieveLocationSettings(
RetrieveLocationSettingsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/online-checkout/location-settings")
- .addPathSegment(request.getLocationId())
- .build();
+ .addPathSegment(request.getLocationId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -110,11 +114,15 @@ public CompletableFuture> updateLocationSettings(
UpdateLocationSettingsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/online-checkout/location-settings")
- .addPathSegment(request.getLocationId())
- .build();
+ .addPathSegment(request.getLocationId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -123,7 +131,7 @@ public CompletableFuture> retrieveMerchantSettings(
RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/online-checkout/merchant-settings")
- .build();
+ .addPathSegments("v2/online-checkout/merchant-settings");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json")
@@ -233,10 +245,14 @@ public CompletableFuture> updateMerchantSettings(
UpdateMerchantSettingsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/online-checkout/merchant-settings")
- .build();
+ .addPathSegments("v2/online-checkout/merchant-settings");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -245,7 +261,7 @@ public CompletableFuture>>
QueryStringMapper.addQueryParameter(
httpUrl, "count", request.getCount().get(), false);
}
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
@@ -239,10 +244,14 @@ public CompletableFuture> creat
*/
public CompletableFuture> create(
CreateCustomerRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/customers")
- .build();
+ .addPathSegments("v2/customers");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -251,7 +260,7 @@ public CompletableFuture> creat
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -321,10 +330,14 @@ public CompletableFuture>
*/
public CompletableFuture> batchCreate(
BulkCreateCustomersRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/customers/bulk-create")
- .build();
+ .addPathSegments("v2/customers/bulk-create");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -333,7 +346,7 @@ public CompletableFuture>
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -388,10 +401,14 @@ public CompletableFuture>
*/
public CompletableFuture> bulkDeleteCustomers(
BulkDeleteCustomersRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/customers/bulk-delete")
- .build();
+ .addPathSegments("v2/customers/bulk-delete");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -400,7 +417,7 @@ public CompletableFuture>
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -455,10 +472,14 @@ public CompletableFuture
*/
public CompletableFuture> bulkRetrieveCustomers(
BulkRetrieveCustomersRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/customers/bulk-retrieve")
- .build();
+ .addPathSegments("v2/customers/bulk-retrieve");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -467,7 +488,7 @@ public CompletableFuture
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -522,10 +543,14 @@ public CompletableFuture>
*/
public CompletableFuture> bulkUpdateCustomers(
BulkUpdateCustomersRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/customers/bulk-update")
- .build();
+ .addPathSegments("v2/customers/bulk-update");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -534,7 +559,7 @@ public CompletableFuture>
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -624,10 +649,14 @@ public CompletableFuture> sear
*/
public CompletableFuture> search(
SearchCustomersRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/customers/search")
- .build();
+ .addPathSegments("v2/customers/search");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -636,7 +665,7 @@ public CompletableFuture> sear
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -687,13 +716,17 @@ public CompletableFuture> get(GetC
*/
public CompletableFuture> get(
GetCustomersRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/customers")
- .addPathSegment(request.getCustomerId())
- .build();
+ .addPathSegment(request.getCustomerId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -747,11 +780,15 @@ public CompletableFuture> updat
*/
public CompletableFuture> update(
UpdateCustomerRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/customers")
- .addPathSegment(request.getCustomerId())
- .build();
+ .addPathSegment(request.getCustomerId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -760,7 +797,7 @@ public CompletableFuture> updat
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("PUT", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -821,6 +858,11 @@ public CompletableFuture> delet
QueryStringMapper.addQueryParameter(
httpUrl, "version", request.getVersion().get(), false);
}
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("DELETE", null)
diff --git a/src/main/java/com/squareup/square/AsyncRawDevicesClient.java b/src/main/java/com/squareup/square/AsyncRawDevicesClient.java
index 5dc7fd67..b4091838 100644
--- a/src/main/java/com/squareup/square/AsyncRawDevicesClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawDevicesClient.java
@@ -88,6 +88,11 @@ public CompletableFuture>> l
QueryStringMapper.addQueryParameter(
httpUrl, "location_id", request.getLocationId().get(), false);
}
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
@@ -156,13 +161,17 @@ public CompletableFuture> get(GetDev
*/
public CompletableFuture> get(
GetDevicesRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/devices")
- .addPathSegment(request.getDeviceId())
- .build();
+ .addPathSegment(request.getDeviceId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
diff --git a/src/main/java/com/squareup/square/AsyncRawDisputesClient.java b/src/main/java/com/squareup/square/AsyncRawDisputesClient.java
index a32662d8..99314536 100644
--- a/src/main/java/com/squareup/square/AsyncRawDisputesClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawDisputesClient.java
@@ -95,6 +95,11 @@ public CompletableFuture>>
QueryStringMapper.addQueryParameter(
httpUrl, "location_id", request.getLocationId().get(), false);
}
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
@@ -163,13 +168,17 @@ public CompletableFuture> get(GetDi
*/
public CompletableFuture> get(
GetDisputesRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/disputes")
- .addPathSegment(request.getDisputeId())
- .build();
+ .addPathSegment(request.getDisputeId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -225,14 +234,18 @@ public CompletableFuture> accept
*/
public CompletableFuture> accept(
AcceptDisputesRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/disputes")
.addPathSegment(request.getDisputeId())
- .addPathSegments("accept")
- .build();
+ .addPathSegments("accept");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", RequestBody.create("", null))
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -285,12 +298,16 @@ public CompletableFuture> createEvidenceFile(
CreateEvidenceFileDisputesRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/disputes")
.addPathSegment(request.getDisputeId())
- .addPathSegments("evidence-files")
- .build();
+ .addPathSegments("evidence-files");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM);
try {
if (request.getRequest().isPresent()) {
@@ -313,7 +330,7 @@ public CompletableFuture> createEvidenceText(
CreateDisputeEvidenceTextRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/disputes")
.addPathSegment(request.getDisputeId())
- .addPathSegments("evidence-text")
- .build();
+ .addPathSegments("evidence-text");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -380,7 +401,7 @@ public CompletableFuture> submi
*/
public CompletableFuture> submitEvidence(
SubmitEvidenceDisputesRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/disputes")
.addPathSegment(request.getDisputeId())
- .addPathSegments("submit-evidence")
- .build();
+ .addPathSegments("submit-evidence");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", RequestBody.create("", null))
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
diff --git a/src/main/java/com/squareup/square/AsyncRawEmployeesClient.java b/src/main/java/com/squareup/square/AsyncRawEmployeesClient.java
index af975ef0..e88990e0 100644
--- a/src/main/java/com/squareup/square/AsyncRawEmployeesClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawEmployeesClient.java
@@ -74,6 +74,11 @@ public CompletableFuture>>
QueryStringMapper.addQueryParameter(
httpUrl, "cursor", request.getCursor().get(), false);
}
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
@@ -136,13 +141,17 @@ public CompletableFuture> get(GetE
public CompletableFuture> get(
GetEmployeesRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/employees")
- .addPathSegment(request.getId())
- .build();
+ .addPathSegment(request.getId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
diff --git a/src/main/java/com/squareup/square/AsyncRawEventsClient.java b/src/main/java/com/squareup/square/AsyncRawEventsClient.java
index 3aac832c..7f63bd14 100644
--- a/src/main/java/com/squareup/square/AsyncRawEventsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawEventsClient.java
@@ -65,10 +65,14 @@ public CompletableFuture> searchE
*/
public CompletableFuture> searchEvents(
SearchEventsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/events")
- .build();
+ .addPathSegments("v2/events");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -77,7 +81,7 @@ public CompletableFuture> searchE
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -132,12 +136,16 @@ public CompletableFuture> disabl
*/
public CompletableFuture> disableEvents(
RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/events/disable")
- .build();
+ .addPathSegments("v2/events/disable");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("PUT", RequestBody.create("", null))
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json")
@@ -187,12 +195,16 @@ public CompletableFuture> enableE
*/
public CompletableFuture> enableEvents(
RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/events/enable")
- .build();
+ .addPathSegments("v2/events/enable");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("PUT", RequestBody.create("", null))
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json")
@@ -265,6 +277,11 @@ public CompletableFuture> listE
QueryStringMapper.addQueryParameter(
httpUrl, "api_version", request.getApiVersion().get(), false);
}
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
diff --git a/src/main/java/com/squareup/square/AsyncRawGiftCardsClient.java b/src/main/java/com/squareup/square/AsyncRawGiftCardsClient.java
index 728ec6c0..58f784fc 100644
--- a/src/main/java/com/squareup/square/AsyncRawGiftCardsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawGiftCardsClient.java
@@ -107,6 +107,11 @@ public CompletableFuture>>
QueryStringMapper.addQueryParameter(
httpUrl, "customer_id", request.getCustomerId().get(), false);
}
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
@@ -183,10 +188,14 @@ public CompletableFuture> creat
*/
public CompletableFuture> create(
CreateGiftCardRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/gift-cards")
- .build();
+ .addPathSegments("v2/gift-cards");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -195,7 +204,7 @@ public CompletableFuture> creat
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -247,10 +256,14 @@ public CompletableFuture> g
*/
public CompletableFuture> getFromGan(
GetGiftCardFromGanRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/gift-cards/from-gan")
- .build();
+ .addPathSegments("v2/gift-cards/from-gan");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -259,7 +272,7 @@ public CompletableFuture> g
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -312,10 +325,14 @@ public CompletableFuture>
*/
public CompletableFuture> getFromNonce(
GetGiftCardFromNonceRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/gift-cards/from-nonce")
- .build();
+ .addPathSegments("v2/gift-cards/from-nonce");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -324,7 +341,7 @@ public CompletableFuture>
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -377,12 +394,16 @@ public CompletableFuture> linkCustomer(
LinkCustomerToGiftCardRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/gift-cards")
.addPathSegment(request.getGiftCardId())
- .addPathSegments("link-customer")
- .build();
+ .addPathSegments("link-customer");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -391,7 +412,7 @@ public CompletableFuture> unlinkCustomer(
UnlinkCustomerFromGiftCardRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/gift-cards")
.addPathSegment(request.getGiftCardId())
- .addPathSegments("unlink-customer")
- .build();
+ .addPathSegments("unlink-customer");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -458,7 +483,7 @@ public CompletableFuture> get(GetG
*/
public CompletableFuture> get(
GetGiftCardsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/gift-cards")
- .addPathSegment(request.getId())
- .build();
+ .addPathSegment(request.getId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
diff --git a/src/main/java/com/squareup/square/AsyncRawInventoryClient.java b/src/main/java/com/squareup/square/AsyncRawInventoryClient.java
index 17795c1a..b7a6ca87 100644
--- a/src/main/java/com/squareup/square/AsyncRawInventoryClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawInventoryClient.java
@@ -72,13 +72,17 @@ public CompletableFuture> deprecatedGetAdjustment(
DeprecatedGetAdjustmentInventoryRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/inventory/adjustment")
- .addPathSegment(request.getAdjustmentId())
- .build();
+ .addPathSegment(request.getAdjustmentId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -132,13 +136,17 @@ public CompletableFuture> getAdjustment(
GetAdjustmentInventoryRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/inventory/adjustments")
- .addPathSegment(request.getAdjustmentId())
- .build();
+ .addPathSegment(request.getAdjustmentId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -192,10 +200,14 @@ public CompletableFuture>
*/
public CompletableFuture> deprecatedBatchChange(
BatchChangeInventoryRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/inventory/batch-change")
- .build();
+ .addPathSegments("v2/inventory/batch-change");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -204,7 +216,7 @@ public CompletableFuture>
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -278,10 +290,14 @@ public CompletableFuture> deprecatedBatchGetChanges(
BatchRetrieveInventoryChangesRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/inventory/batch-retrieve-changes")
- .build();
+ .addPathSegments("v2/inventory/batch-retrieve-changes");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -290,7 +306,7 @@ public CompletableFuture> deprecatedBatchGetCounts(
BatchGetInventoryCountsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/inventory/batch-retrieve-counts")
- .build();
+ .addPathSegments("v2/inventory/batch-retrieve-counts");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -375,7 +395,7 @@ public CompletableFuture>
*/
public CompletableFuture> batchCreateChanges(
BatchChangeInventoryRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/inventory/changes/batch-create")
- .build();
+ .addPathSegments("v2/inventory/changes/batch-create");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -446,7 +470,7 @@ public CompletableFuture>
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -534,10 +558,14 @@ public CompletableFuture>> batchGetChanges(
BatchRetrieveInventoryChangesRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/inventory/changes/batch-retrieve")
- .build();
+ .addPathSegments("v2/inventory/changes/batch-retrieve");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -546,7 +574,7 @@ public CompletableFuture>> batchGetCounts(
BatchGetInventoryCountsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/inventory/counts/batch-retrieve")
- .build();
+ .addPathSegments("v2/inventory/counts/batch-retrieve");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -677,7 +709,7 @@ public CompletableFuture> deprecatedGetPhysicalCount(
DeprecatedGetPhysicalCountInventoryRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/inventory/physical-count")
- .addPathSegment(request.getPhysicalCountId())
- .build();
+ .addPathSegment(request.getPhysicalCountId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -810,13 +846,17 @@ public CompletableFuture> getPhysicalCount(
GetPhysicalCountInventoryRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/inventory/physical-counts")
- .addPathSegment(request.getPhysicalCountId())
- .build();
+ .addPathSegment(request.getPhysicalCountId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -871,13 +911,17 @@ public CompletableFuture>
*/
public CompletableFuture> getTransfer(
GetTransferInventoryRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/inventory/transfers")
- .addPathSegment(request.getTransferId())
- .build();
+ .addPathSegment(request.getTransferId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -947,6 +991,11 @@ public CompletableFuture {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
@@ -1048,6 +1097,11 @@ public CompletableFuture {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
diff --git a/src/main/java/com/squareup/square/AsyncRawInvoicesClient.java b/src/main/java/com/squareup/square/AsyncRawInvoicesClient.java
index ef2153a8..b22d6656 100644
--- a/src/main/java/com/squareup/square/AsyncRawInvoicesClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawInvoicesClient.java
@@ -89,6 +89,11 @@ public CompletableFuture>>
QueryStringMapper.addQueryParameter(
httpUrl, "limit", request.getLimit().get(), false);
}
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
@@ -163,10 +168,14 @@ public CompletableFuture> create
*/
public CompletableFuture> create(
CreateInvoiceRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/invoices")
- .build();
+ .addPathSegments("v2/invoices");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -175,7 +184,7 @@ public CompletableFuture> create
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -236,10 +245,14 @@ public CompletableFuture> searc
*/
public CompletableFuture> search(
SearchInvoicesRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/invoices/search")
- .build();
+ .addPathSegments("v2/invoices/search");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -248,7 +261,7 @@ public CompletableFuture> searc
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -299,13 +312,17 @@ public CompletableFuture> get(GetIn
*/
public CompletableFuture> get(
GetInvoicesRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/invoices")
- .addPathSegment(request.getInvoiceId())
- .build();
+ .addPathSegment(request.getInvoiceId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -361,11 +378,15 @@ public CompletableFuture> update
*/
public CompletableFuture> update(
UpdateInvoiceRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/invoices")
- .addPathSegment(request.getInvoiceId())
- .build();
+ .addPathSegment(request.getInvoiceId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -374,7 +395,7 @@ public CompletableFuture> update
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("PUT", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -437,6 +458,11 @@ public CompletableFuture> delete
QueryStringMapper.addQueryParameter(
httpUrl, "version", request.getVersion().get(), false);
}
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("DELETE", null)
@@ -499,12 +525,16 @@ public CompletableFuture> createInvoiceAttachment(
CreateInvoiceAttachmentRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/invoices")
.addPathSegment(request.getInvoiceId())
- .addPathSegments("attachments")
- .build();
+ .addPathSegments("attachments");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM);
try {
if (request.getRequest().isPresent()) {
@@ -527,7 +557,7 @@ public CompletableFuture> deleteInvoiceAttachment(
DeleteInvoiceAttachmentRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/invoices")
.addPathSegment(request.getInvoiceId())
.addPathSegments("attachments")
- .addPathSegment(request.getAttachmentId())
- .build();
+ .addPathSegment(request.getAttachmentId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("DELETE", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -644,12 +678,16 @@ public CompletableFuture> cancel
*/
public CompletableFuture> cancel(
CancelInvoiceRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/invoices")
.addPathSegment(request.getInvoiceId())
- .addPathSegments("cancel")
- .build();
+ .addPathSegments("cancel");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -658,7 +696,7 @@ public CompletableFuture> cancel
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -729,12 +767,16 @@ public CompletableFuture> publi
*/
public CompletableFuture> publish(
PublishInvoiceRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/invoices")
.addPathSegment(request.getInvoiceId())
- .addPathSegments("publish")
- .build();
+ .addPathSegments("publish");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -743,7 +785,7 @@ public CompletableFuture> publi
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
diff --git a/src/main/java/com/squareup/square/AsyncRawLaborClient.java b/src/main/java/com/squareup/square/AsyncRawLaborClient.java
index 39757426..36d17fed 100644
--- a/src/main/java/com/squareup/square/AsyncRawLaborClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawLaborClient.java
@@ -82,10 +82,14 @@ public CompletableFuture>
*/
public CompletableFuture> createScheduledShift(
CreateScheduledShiftRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/labor/scheduled-shifts")
- .build();
+ .addPathSegments("v2/labor/scheduled-shifts");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -94,7 +98,7 @@ public CompletableFuture>
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -155,10 +159,14 @@ public CompletableFuture> bulkPublishScheduledShifts(
BulkPublishScheduledShiftsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/labor/scheduled-shifts/bulk-publish")
- .build();
+ .addPathSegments("v2/labor/scheduled-shifts/bulk-publish");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -167,7 +175,7 @@ public CompletableFuture
*/
public CompletableFuture> searchScheduledShifts(
SearchScheduledShiftsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/labor/scheduled-shifts/search")
- .build();
+ .addPathSegments("v2/labor/scheduled-shifts/search");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -252,7 +264,7 @@ public CompletableFuture
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -305,13 +317,17 @@ public CompletableFuture> retrieveScheduledShift(
RetrieveScheduledShiftRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/labor/scheduled-shifts")
- .addPathSegment(request.getId())
- .build();
+ .addPathSegment(request.getId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -383,11 +399,15 @@ public CompletableFuture>
*/
public CompletableFuture> updateScheduledShift(
UpdateScheduledShiftRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/labor/scheduled-shifts")
- .addPathSegment(request.getId())
- .build();
+ .addPathSegment(request.getId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -396,7 +416,7 @@ public CompletableFuture>
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("PUT", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -451,12 +471,16 @@ public CompletableFuture
*/
public CompletableFuture> publishScheduledShift(
PublishScheduledShiftRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/labor/scheduled-shifts")
.addPathSegment(request.getId())
- .addPathSegments("publish")
- .build();
+ .addPathSegments("publish");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -465,7 +489,7 @@ public CompletableFuture
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -554,10 +578,14 @@ public CompletableFuture> creat
*/
public CompletableFuture> createTimecard(
CreateTimecardRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/labor/timecards")
- .build();
+ .addPathSegments("v2/labor/timecards");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -566,7 +594,7 @@ public CompletableFuture> creat
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -697,10 +725,14 @@ public CompletableFuture> sear
*/
public CompletableFuture> searchTimecards(
SearchTimecardsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/labor/timecards/search")
- .build();
+ .addPathSegments("v2/labor/timecards/search");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -709,7 +741,7 @@ public CompletableFuture> sear
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -761,13 +793,17 @@ public CompletableFuture> ret
*/
public CompletableFuture> retrieveTimecard(
RetrieveTimecardRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/labor/timecards")
- .addPathSegment(request.getId())
- .build();
+ .addPathSegment(request.getId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -826,11 +862,15 @@ public CompletableFuture> updat
*/
public CompletableFuture> updateTimecard(
UpdateTimecardRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/labor/timecards")
- .addPathSegment(request.getId())
- .build();
+ .addPathSegment(request.getId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -839,7 +879,7 @@ public CompletableFuture> updat
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("PUT", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -891,13 +931,17 @@ public CompletableFuture> delet
*/
public CompletableFuture> deleteTimecard(
DeleteTimecardRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/labor/timecards")
- .addPathSegment(request.getId())
- .build();
+ .addPathSegment(request.getId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("DELETE", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
diff --git a/src/main/java/com/squareup/square/AsyncRawLocationsClient.java b/src/main/java/com/squareup/square/AsyncRawLocationsClient.java
index 82187940..d5eec538 100644
--- a/src/main/java/com/squareup/square/AsyncRawLocationsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawLocationsClient.java
@@ -53,12 +53,16 @@ public CompletableFuture> list()
* including those with an inactive status. Locations are listed alphabetically by name.
*/
public CompletableFuture> list(RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/locations")
- .build();
+ .addPathSegments("v2/locations");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json")
@@ -146,10 +150,14 @@ public CompletableFuture> creat
*/
public CompletableFuture> create(
CreateLocationRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
- .addPathSegments("v2/locations")
- .build();
+ .addPathSegments("v2/locations");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -158,7 +166,7 @@ public CompletableFuture> creat
throw new SquareException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
@@ -211,13 +219,17 @@ public CompletableFuture> get(GetL
*/
public CompletableFuture> get(
GetLocationsRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/locations")
- .addPathSegment(request.getLocationId())
- .build();
+ .addPathSegment(request.getLocationId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
Request.Builder _requestBuilder = new Request.Builder()
- .url(httpUrl)
+ .url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
@@ -267,11 +279,15 @@ public CompletableFuture> updat
*/
public CompletableFuture> update(
UpdateLocationRequest request, RequestOptions requestOptions) {
- HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/locations")
- .addPathSegment(request.getLocationId())
- .build();
+ .addPathSegment(request.getLocationId());
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
RequestBody body;
try {
body = RequestBody.create(
@@ -280,7 +296,7 @@ public CompletableFuture