Skip to content

Commit

Permalink
refactor (SMS/Batches): Generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
JPPortier committed Dec 17, 2024
1 parent fd899b2 commit 5a0b2c1
Showing 1 changed file with 59 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.sinch.sdk.core.http.HttpResponse;
import com.sinch.sdk.core.http.HttpStatus;
import com.sinch.sdk.core.http.URLParameter;
import com.sinch.sdk.core.http.URLParameterUtils;
import com.sinch.sdk.core.http.URLPathUtils;
import com.sinch.sdk.core.models.ServerConfiguration;
import com.sinch.sdk.domains.sms.models.v1.batches.request.BatchRequest;
Expand Down Expand Up @@ -192,30 +193,24 @@ private HttpRequest dryRunRequestBuilder(
URLPathUtils.encodePathSegment(this.servicePlanId.toString()));

List<URLParameter> localVarQueryParams = new ArrayList<>();
DryRunQueryParameters guardParameters =
null != queryParameter ? queryParameter : DryRunQueryParameters.builder().build();

guardParameters
.getPerRecipient()
.ifPresent(
g ->
localVarQueryParams.add(
new URLParameter(
"per_recipient",
g,
URLParameter.STYLE.valueOf("form".toUpperCase()),
true)));

guardParameters
.getNumberOfRecipients()
.ifPresent(
g ->
localVarQueryParams.add(
new URLParameter(
"number_of_recipients",
g,
URLParameter.STYLE.valueOf("form".toUpperCase()),
true)));
if (null != queryParameter) {

URLParameterUtils.addQueryParam(
queryParameter.getPerRecipient(),
"per_recipient",
URLParameter.form,
null,
localVarQueryParams,
true);

URLParameterUtils.addQueryParam(
queryParameter.getNumberOfRecipients(),
"number_of_recipients",
URLParameter.form,
null,
localVarQueryParams,
true);
}

Map<String, String> localVarHeaderParams = new HashMap<>();

Expand Down Expand Up @@ -352,65 +347,46 @@ private HttpRequest listRequestBuilder(ListBatchesQueryParameters queryParameter
URLPathUtils.encodePathSegment(this.servicePlanId.toString()));

List<URLParameter> localVarQueryParams = new ArrayList<>();
ListBatchesQueryParameters guardParameters =
null != queryParameter ? queryParameter : ListBatchesQueryParameters.builder().build();

guardParameters
.getPage()
.ifPresent(
g ->
localVarQueryParams.add(
new URLParameter(
"page", g, URLParameter.STYLE.valueOf("form".toUpperCase()), true)));

guardParameters
.getPageSize()
.ifPresent(
g ->
localVarQueryParams.add(
new URLParameter(
"page_size", g, URLParameter.STYLE.valueOf("form".toUpperCase()), true)));

guardParameters
.getFrom()
.ifPresent(
g ->
localVarQueryParams.add(
new URLParameter(
"from", g, URLParameter.STYLE.valueOf("form".toUpperCase()), true)));

guardParameters
.getStartDate()
.ifPresent(
g ->
localVarQueryParams.add(
new URLParameter(
"start_date",
InstantToIso8601Serializer.getInstance().apply(g),
URLParameter.STYLE.valueOf("form".toUpperCase()),
true)));

guardParameters
.getEndDate()
.ifPresent(
g ->
localVarQueryParams.add(
new URLParameter(
"end_date",
InstantToIso8601Serializer.getInstance().apply(g),
URLParameter.STYLE.valueOf("form".toUpperCase()),
true)));

guardParameters
.getClientReference()
.ifPresent(
g ->
localVarQueryParams.add(
new URLParameter(
"client_reference",
g,
URLParameter.STYLE.valueOf("form".toUpperCase()),
true)));
if (null != queryParameter) {

URLParameterUtils.addQueryParam(
queryParameter.getPage(), "page", URLParameter.form, null, localVarQueryParams, true);

URLParameterUtils.addQueryParam(
queryParameter.getPageSize(),
"page_size",
URLParameter.form,
null,
localVarQueryParams,
true);

URLParameterUtils.addQueryParam(
queryParameter.getFrom(), "from", URLParameter.form, null, localVarQueryParams, true);

URLParameterUtils.addQueryParam(
queryParameter.getStartDate(),
"start_date",
URLParameter.form,
InstantToIso8601Serializer.getInstance(),
localVarQueryParams,
true);

URLParameterUtils.addQueryParam(
queryParameter.getEndDate(),
"end_date",
URLParameter.form,
InstantToIso8601Serializer.getInstance(),
localVarQueryParams,
true);

URLParameterUtils.addQueryParam(
queryParameter.getClientReference(),
"client_reference",
URLParameter.form,
null,
localVarQueryParams,
true);
}

Map<String, String> localVarHeaderParams = new HashMap<>();

Expand Down

0 comments on commit 5a0b2c1

Please sign in to comment.