Skip to content

Commit 2667499

Browse files
committed
feat: Update Dapr to 1.4.1
1 parent 287af96 commit 2667499

File tree

11 files changed

+1052
-4
lines changed

11 files changed

+1052
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Chaos Mesh is chaos engineering platform that orchestrates chaos on Kubernetes e
154154
](https://javadoc.io/doc/com.marcnuri.yakc.apis/dapr)
155155

156156
[Retrofit](https://square.github.io/retrofit/) API client Java interfaces for
157-
[Dapr](https://dapr.io/) - Distributed Application Runtime (1.3.0).
157+
[Dapr](https://dapr.io/) - Distributed Application Runtime (1.0.1 - 1.4.1).
158158

159159
Dapr is a portable, event-driven, runtime for building distributed applications across cloud and edge.
160160

apis/dapr/build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def templatesDirs = new File(rootProject.projectDir, "schema/templates")
2222
def schemaDir = new File(projectDir, "schema")
2323
def availableSchemaNames = Arrays.asList(
2424
"dapr-1.0.1.json",
25-
"dapr-1.3.0.json"
25+
"dapr-1.3.0.json",
26+
"dapr-1.4.1.json"
2627
)
2728
def availableSchemas = availableSchemaNames.stream()
2829
.map { s -> new File(schemaDir, s) }

apis/dapr/schema/dapr-1.4.1.json

+1
Large diffs are not rendered by default.

apis/dapr/src/api/java/com/marcnuri/yakc/api/daprio/v2alpha1/DaprIoV2alpha1Api.java

+738
Large diffs are not rendered by default.

apis/dapr/src/model/java/com/marcnuri/yakc/model/io/dapr/v1alpha1/Subscription.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import lombok.ToString;
2929

3030
/**
31-
* Subscription describes an pub/sub event subscription
31+
* Subscription describes an pub/sub event subscription.
3232
*/
3333
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
3434
@Builder(toBuilder = true, builderClassName = "Builder")

apis/dapr/src/model/java/com/marcnuri/yakc/model/io/dapr/v1alpha1/SubscriptionSpec.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import lombok.ToString;
2929

3030
/**
31-
* SubscriptionSpec is the spec for an event subscription
31+
* SubscriptionSpec is the spec for an event subscription.
3232
*/
3333
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
3434
@Builder(toBuilder = true, builderClassName = "Builder")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.marcnuri.yakc.model.io.dapr.v2alpha1;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.Model;
21+
import com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta;
22+
import java.util.List;
23+
import lombok.AllArgsConstructor;
24+
import lombok.Builder;
25+
import lombok.Data;
26+
import lombok.NoArgsConstructor;
27+
import lombok.Singular;
28+
import lombok.ToString;
29+
30+
/**
31+
* Subscription describes an pub/sub event subscription.
32+
*/
33+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
34+
@Builder(toBuilder = true, builderClassName = "Builder")
35+
@AllArgsConstructor
36+
@NoArgsConstructor
37+
@Data
38+
@ToString
39+
public class Subscription implements Model {
40+
41+
42+
/**
43+
* APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
44+
*/
45+
@JsonProperty("apiVersion")
46+
private String apiVersion;
47+
48+
/**
49+
* Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
50+
*/
51+
@JsonProperty("kind")
52+
private String kind;
53+
54+
@JsonProperty("metadata")
55+
private ObjectMeta metadata;
56+
57+
@JsonProperty("scopes")
58+
@Singular(value = "addToScopes", ignoreNullCollections = true)
59+
private List<String> scopes;
60+
61+
@JsonProperty("spec")
62+
private SubscriptionSpec spec;
63+
64+
}
65+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.marcnuri.yakc.model.io.dapr.v2alpha1;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.ListModel;
21+
import com.marcnuri.yakc.model.Model;
22+
import com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta;
23+
import java.util.List;
24+
import lombok.AllArgsConstructor;
25+
import lombok.Builder;
26+
import lombok.Data;
27+
import lombok.NoArgsConstructor;
28+
import lombok.NonNull;
29+
import lombok.Singular;
30+
import lombok.ToString;
31+
32+
/**
33+
* SubscriptionList is a list of Subscription
34+
*/
35+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
36+
@Builder(toBuilder = true, builderClassName = "Builder")
37+
@AllArgsConstructor
38+
@NoArgsConstructor
39+
@Data
40+
@ToString
41+
public class SubscriptionList implements Model, ListModel<Subscription> {
42+
43+
44+
/**
45+
* APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
46+
*/
47+
@JsonProperty("apiVersion")
48+
private String apiVersion;
49+
50+
/**
51+
* List of subscriptions. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md
52+
*/
53+
@NonNull
54+
@JsonProperty("items")
55+
@Singular(value = "addToItems", ignoreNullCollections = true)
56+
private List<Subscription> items;
57+
58+
/**
59+
* Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
60+
*/
61+
@JsonProperty("kind")
62+
private String kind;
63+
64+
@JsonProperty("metadata")
65+
private ListMeta metadata;
66+
67+
}
68+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.marcnuri.yakc.model.io.dapr.v2alpha1;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.Model;
21+
import java.util.Map;
22+
import lombok.AllArgsConstructor;
23+
import lombok.Builder;
24+
import lombok.Data;
25+
import lombok.NoArgsConstructor;
26+
import lombok.NonNull;
27+
import lombok.Singular;
28+
import lombok.ToString;
29+
30+
/**
31+
* SubscriptionSpec is the spec for an event subscription.
32+
*/
33+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
34+
@Builder(toBuilder = true, builderClassName = "Builder")
35+
@AllArgsConstructor
36+
@NoArgsConstructor
37+
@Data
38+
@ToString
39+
public class SubscriptionSpec implements Model {
40+
41+
42+
/**
43+
* The optional metadata to provide the the subscription.
44+
*/
45+
@JsonProperty("metadata")
46+
@Singular(value = "putInMetadata", ignoreNullCollections = true)
47+
private Map<String, String> metadata;
48+
49+
/**
50+
* The PubSub component name.
51+
*/
52+
@NonNull
53+
@JsonProperty("pubsubname")
54+
private String pubsubname;
55+
56+
@NonNull
57+
@JsonProperty("routes")
58+
private SubscriptionSpecRoutes routes;
59+
60+
/**
61+
* The topic name to subscribe to.
62+
*/
63+
@NonNull
64+
@JsonProperty("topic")
65+
private String topic;
66+
67+
}
68+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.marcnuri.yakc.model.io.dapr.v2alpha1;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.Model;
21+
import java.util.List;
22+
import lombok.AllArgsConstructor;
23+
import lombok.Builder;
24+
import lombok.Data;
25+
import lombok.NoArgsConstructor;
26+
import lombok.Singular;
27+
import lombok.ToString;
28+
29+
/**
30+
* The Routes configuration for this topic.
31+
*/
32+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
33+
@Builder(toBuilder = true, builderClassName = "Builder")
34+
@AllArgsConstructor
35+
@NoArgsConstructor
36+
@Data
37+
@ToString
38+
public class SubscriptionSpecRoutes implements Model {
39+
40+
41+
@JsonProperty("default")
42+
private String defaults;
43+
44+
/**
45+
* The list of rules for this topic.
46+
*/
47+
@JsonProperty("rules")
48+
@Singular(value = "addToRules", ignoreNullCollections = true)
49+
private List<SubscriptionSpecRoutesRules> rules;
50+
51+
}
52+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.marcnuri.yakc.model.io.dapr.v2alpha1;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.Model;
21+
import lombok.AllArgsConstructor;
22+
import lombok.Builder;
23+
import lombok.Data;
24+
import lombok.NoArgsConstructor;
25+
import lombok.NonNull;
26+
import lombok.ToString;
27+
28+
/**
29+
* Rule is used to specify the condition for sending a message to a specific path.
30+
*/
31+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
32+
@Builder(toBuilder = true, builderClassName = "Builder")
33+
@AllArgsConstructor
34+
@NoArgsConstructor
35+
@Data
36+
@ToString
37+
public class SubscriptionSpecRoutesRules implements Model {
38+
39+
40+
/**
41+
* The optional CEL expression used to match the event. If the match is not specified, then the route is considered the default. The rules are tested in the order specified, so they should be define from most-to-least specific. The default route should appear last in the list.
42+
*/
43+
@NonNull
44+
@JsonProperty("match")
45+
private String match;
46+
47+
/**
48+
* The path for events that match this rule.
49+
*/
50+
@NonNull
51+
@JsonProperty("path")
52+
private String path;
53+
54+
}
55+

0 commit comments

Comments
 (0)