Skip to content

Commit d9cc27a

Browse files
feat(specs): add authentications to ingestion transformations (generated)
algolia/api-clients-automation#3494 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 5d4e6dc commit d9cc27a

File tree

4 files changed

+161
-9
lines changed

4 files changed

+161
-9
lines changed

algoliasearch/src/main/java/com/algolia/api/IngestionClient.java

Lines changed: 75 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3710,7 +3710,7 @@ public CompletableFuture<SourceWatchResponse> triggerDockerSourceDiscoverAsync(@
37103710
}
37113711

37123712
/**
3713-
* Try a transformation.
3713+
* Try a transformation before creating it.
37143714
*
37153715
* @param transformationTry (required)
37163716
* @param requestOptions The requestOptions to send along with the query, they will be merged with
@@ -3723,7 +3723,7 @@ public TransformationTryResponse tryTransformation(@Nonnull TransformationTry tr
37233723
}
37243724

37253725
/**
3726-
* Try a transformation.
3726+
* Try a transformation before creating it.
37273727
*
37283728
* @param transformationTry (required)
37293729
* @throws AlgoliaRuntimeException If it fails to process the API call
@@ -3733,7 +3733,7 @@ public TransformationTryResponse tryTransformation(@Nonnull TransformationTry tr
37333733
}
37343734

37353735
/**
3736-
* (asynchronously) Try a transformation.
3736+
* (asynchronously) Try a transformation before creating it.
37373737
*
37383738
* @param transformationTry (required)
37393739
* @param requestOptions The requestOptions to send along with the query, they will be merged with
@@ -3751,7 +3751,7 @@ public CompletableFuture<TransformationTryResponse> tryTransformationAsync(
37513751
}
37523752

37533753
/**
3754-
* (asynchronously) Try a transformation.
3754+
* (asynchronously) Try a transformation before creating it.
37553755
*
37563756
* @param transformationTry (required)
37573757
* @throws AlgoliaRuntimeException If it fails to process the API call
@@ -3761,6 +3761,77 @@ public CompletableFuture<TransformationTryResponse> tryTransformationAsync(@Nonn
37613761
return this.tryTransformationAsync(transformationTry, null);
37623762
}
37633763

3764+
/**
3765+
* Try a transformation before updating it.
3766+
*
3767+
* @param transformationID Unique identifier of a transformation. (required)
3768+
* @param transformationTry (required)
3769+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
3770+
* the transporter requestOptions.
3771+
* @throws AlgoliaRuntimeException If it fails to process the API call
3772+
*/
3773+
public TransformationTryResponse tryTransformationBeforeUpdate(
3774+
@Nonnull String transformationID,
3775+
@Nonnull TransformationTry transformationTry,
3776+
RequestOptions requestOptions
3777+
) throws AlgoliaRuntimeException {
3778+
return LaunderThrowable.await(tryTransformationBeforeUpdateAsync(transformationID, transformationTry, requestOptions));
3779+
}
3780+
3781+
/**
3782+
* Try a transformation before updating it.
3783+
*
3784+
* @param transformationID Unique identifier of a transformation. (required)
3785+
* @param transformationTry (required)
3786+
* @throws AlgoliaRuntimeException If it fails to process the API call
3787+
*/
3788+
public TransformationTryResponse tryTransformationBeforeUpdate(
3789+
@Nonnull String transformationID,
3790+
@Nonnull TransformationTry transformationTry
3791+
) throws AlgoliaRuntimeException {
3792+
return this.tryTransformationBeforeUpdate(transformationID, transformationTry, null);
3793+
}
3794+
3795+
/**
3796+
* (asynchronously) Try a transformation before updating it.
3797+
*
3798+
* @param transformationID Unique identifier of a transformation. (required)
3799+
* @param transformationTry (required)
3800+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
3801+
* the transporter requestOptions.
3802+
* @throws AlgoliaRuntimeException If it fails to process the API call
3803+
*/
3804+
public CompletableFuture<TransformationTryResponse> tryTransformationBeforeUpdateAsync(
3805+
@Nonnull String transformationID,
3806+
@Nonnull TransformationTry transformationTry,
3807+
RequestOptions requestOptions
3808+
) throws AlgoliaRuntimeException {
3809+
Parameters.requireNonNull(transformationID, "Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");
3810+
3811+
Parameters.requireNonNull(transformationTry, "Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");
3812+
3813+
HttpRequest request = HttpRequest.builder()
3814+
.setPath("/1/transformations/{transformationID}/try", transformationID)
3815+
.setMethod("POST")
3816+
.setBody(transformationTry)
3817+
.build();
3818+
return executeAsync(request, requestOptions, new TypeReference<TransformationTryResponse>() {});
3819+
}
3820+
3821+
/**
3822+
* (asynchronously) Try a transformation before updating it.
3823+
*
3824+
* @param transformationID Unique identifier of a transformation. (required)
3825+
* @param transformationTry (required)
3826+
* @throws AlgoliaRuntimeException If it fails to process the API call
3827+
*/
3828+
public CompletableFuture<TransformationTryResponse> tryTransformationBeforeUpdateAsync(
3829+
@Nonnull String transformationID,
3830+
@Nonnull TransformationTry transformationTry
3831+
) throws AlgoliaRuntimeException {
3832+
return this.tryTransformationBeforeUpdateAsync(transformationID, transformationTry, null);
3833+
}
3834+
37643835
/**
37653836
* Updates an authentication resource.
37663837
*

algoliasearch/src/main/java/com/algolia/model/ingestion/Transformation.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import com.fasterxml.jackson.annotation.*;
77
import com.fasterxml.jackson.databind.annotation.*;
8+
import java.util.ArrayList;
9+
import java.util.List;
810
import java.util.Objects;
911

1012
/** Transformation */
@@ -13,6 +15,9 @@ public class Transformation {
1315
@JsonProperty("transformationID")
1416
private String transformationID;
1517

18+
@JsonProperty("authenticationIDs")
19+
private List<String> authenticationIDs;
20+
1621
@JsonProperty("code")
1722
private String code;
1823

@@ -39,6 +44,25 @@ public String getTransformationID() {
3944
return transformationID;
4045
}
4146

47+
public Transformation setAuthenticationIDs(List<String> authenticationIDs) {
48+
this.authenticationIDs = authenticationIDs;
49+
return this;
50+
}
51+
52+
public Transformation addAuthenticationIDs(String authenticationIDsItem) {
53+
if (this.authenticationIDs == null) {
54+
this.authenticationIDs = new ArrayList<>();
55+
}
56+
this.authenticationIDs.add(authenticationIDsItem);
57+
return this;
58+
}
59+
60+
/** The authentications associated for the current transformation. */
61+
@javax.annotation.Nullable
62+
public List<String> getAuthenticationIDs() {
63+
return authenticationIDs;
64+
}
65+
4266
public Transformation setCode(String code) {
4367
this.code = code;
4468
return this;
@@ -105,6 +129,7 @@ public boolean equals(Object o) {
105129
Transformation transformation = (Transformation) o;
106130
return (
107131
Objects.equals(this.transformationID, transformation.transformationID) &&
132+
Objects.equals(this.authenticationIDs, transformation.authenticationIDs) &&
108133
Objects.equals(this.code, transformation.code) &&
109134
Objects.equals(this.name, transformation.name) &&
110135
Objects.equals(this.description, transformation.description) &&
@@ -115,14 +140,15 @@ public boolean equals(Object o) {
115140

116141
@Override
117142
public int hashCode() {
118-
return Objects.hash(transformationID, code, name, description, createdAt, updatedAt);
143+
return Objects.hash(transformationID, authenticationIDs, code, name, description, createdAt, updatedAt);
119144
}
120145

121146
@Override
122147
public String toString() {
123148
StringBuilder sb = new StringBuilder();
124149
sb.append("class Transformation {\n");
125150
sb.append(" transformationID: ").append(toIndentedString(transformationID)).append("\n");
151+
sb.append(" authenticationIDs: ").append(toIndentedString(authenticationIDs)).append("\n");
126152
sb.append(" code: ").append(toIndentedString(code)).append("\n");
127153
sb.append(" name: ").append(toIndentedString(name)).append("\n");
128154
sb.append(" description: ").append(toIndentedString(description)).append("\n");

algoliasearch/src/main/java/com/algolia/model/ingestion/TransformationCreate.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import com.fasterxml.jackson.annotation.*;
77
import com.fasterxml.jackson.databind.annotation.*;
8+
import java.util.ArrayList;
9+
import java.util.List;
810
import java.util.Objects;
911

1012
/** API request body for creating a transformation. */
@@ -19,6 +21,9 @@ public class TransformationCreate {
1921
@JsonProperty("description")
2022
private String description;
2123

24+
@JsonProperty("authenticationIDs")
25+
private List<String> authenticationIDs;
26+
2227
public TransformationCreate setCode(String code) {
2328
this.code = code;
2429
return this;
@@ -52,6 +57,25 @@ public String getDescription() {
5257
return description;
5358
}
5459

60+
public TransformationCreate setAuthenticationIDs(List<String> authenticationIDs) {
61+
this.authenticationIDs = authenticationIDs;
62+
return this;
63+
}
64+
65+
public TransformationCreate addAuthenticationIDs(String authenticationIDsItem) {
66+
if (this.authenticationIDs == null) {
67+
this.authenticationIDs = new ArrayList<>();
68+
}
69+
this.authenticationIDs.add(authenticationIDsItem);
70+
return this;
71+
}
72+
73+
/** The authentications associated for the current transformation. */
74+
@javax.annotation.Nullable
75+
public List<String> getAuthenticationIDs() {
76+
return authenticationIDs;
77+
}
78+
5579
@Override
5680
public boolean equals(Object o) {
5781
if (this == o) {
@@ -64,13 +88,14 @@ public boolean equals(Object o) {
6488
return (
6589
Objects.equals(this.code, transformationCreate.code) &&
6690
Objects.equals(this.name, transformationCreate.name) &&
67-
Objects.equals(this.description, transformationCreate.description)
91+
Objects.equals(this.description, transformationCreate.description) &&
92+
Objects.equals(this.authenticationIDs, transformationCreate.authenticationIDs)
6893
);
6994
}
7095

7196
@Override
7297
public int hashCode() {
73-
return Objects.hash(code, name, description);
98+
return Objects.hash(code, name, description, authenticationIDs);
7499
}
75100

76101
@Override
@@ -80,6 +105,7 @@ public String toString() {
80105
sb.append(" code: ").append(toIndentedString(code)).append("\n");
81106
sb.append(" name: ").append(toIndentedString(name)).append("\n");
82107
sb.append(" description: ").append(toIndentedString(description)).append("\n");
108+
sb.append(" authenticationIDs: ").append(toIndentedString(authenticationIDs)).append("\n");
83109
sb.append("}");
84110
return sb.toString();
85111
}

algoliasearch/src/main/java/com/algolia/model/ingestion/TransformationTry.java

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import com.fasterxml.jackson.annotation.*;
77
import com.fasterxml.jackson.databind.annotation.*;
8+
import java.util.ArrayList;
9+
import java.util.List;
810
import java.util.Objects;
911

1012
/** TransformationTry */
@@ -16,6 +18,9 @@ public class TransformationTry {
1618
@JsonProperty("sampleRecord")
1719
private Object sampleRecord;
1820

21+
@JsonProperty("authentications")
22+
private List<AuthenticationCreate> authentications;
23+
1924
public TransformationTry setCode(String code) {
2025
this.code = code;
2126
return this;
@@ -38,6 +43,25 @@ public Object getSampleRecord() {
3843
return sampleRecord;
3944
}
4045

46+
public TransformationTry setAuthentications(List<AuthenticationCreate> authentications) {
47+
this.authentications = authentications;
48+
return this;
49+
}
50+
51+
public TransformationTry addAuthentications(AuthenticationCreate authenticationsItem) {
52+
if (this.authentications == null) {
53+
this.authentications = new ArrayList<>();
54+
}
55+
this.authentications.add(authenticationsItem);
56+
return this;
57+
}
58+
59+
/** Get authentications */
60+
@javax.annotation.Nullable
61+
public List<AuthenticationCreate> getAuthentications() {
62+
return authentications;
63+
}
64+
4165
@Override
4266
public boolean equals(Object o) {
4367
if (this == o) {
@@ -47,12 +71,16 @@ public boolean equals(Object o) {
4771
return false;
4872
}
4973
TransformationTry transformationTry = (TransformationTry) o;
50-
return Objects.equals(this.code, transformationTry.code) && Objects.equals(this.sampleRecord, transformationTry.sampleRecord);
74+
return (
75+
Objects.equals(this.code, transformationTry.code) &&
76+
Objects.equals(this.sampleRecord, transformationTry.sampleRecord) &&
77+
Objects.equals(this.authentications, transformationTry.authentications)
78+
);
5179
}
5280

5381
@Override
5482
public int hashCode() {
55-
return Objects.hash(code, sampleRecord);
83+
return Objects.hash(code, sampleRecord, authentications);
5684
}
5785

5886
@Override
@@ -61,6 +89,7 @@ public String toString() {
6189
sb.append("class TransformationTry {\n");
6290
sb.append(" code: ").append(toIndentedString(code)).append("\n");
6391
sb.append(" sampleRecord: ").append(toIndentedString(sampleRecord)).append("\n");
92+
sb.append(" authentications: ").append(toIndentedString(authentications)).append("\n");
6493
sb.append("}");
6594
return sb.toString();
6695
}

0 commit comments

Comments
 (0)