Skip to content

Commit

Permalink
feat: Update Dapr to 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
manusa committed Sep 24, 2021
1 parent 287af96 commit 2667499
Show file tree
Hide file tree
Showing 11 changed files with 1,052 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Chaos Mesh is chaos engineering platform that orchestrates chaos on Kubernetes e
](https://javadoc.io/doc/com.marcnuri.yakc.apis/dapr)

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

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

Expand Down
3 changes: 2 additions & 1 deletion apis/dapr/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def templatesDirs = new File(rootProject.projectDir, "schema/templates")
def schemaDir = new File(projectDir, "schema")
def availableSchemaNames = Arrays.asList(
"dapr-1.0.1.json",
"dapr-1.3.0.json"
"dapr-1.3.0.json",
"dapr-1.4.1.json"
)
def availableSchemas = availableSchemaNames.stream()
.map { s -> new File(schemaDir, s) }
Expand Down
1 change: 1 addition & 0 deletions apis/dapr/schema/dapr-1.4.1.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import lombok.ToString;

/**
* Subscription describes an pub/sub event subscription
* Subscription describes an pub/sub event subscription.
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import lombok.ToString;

/**
* SubscriptionSpec is the spec for an event subscription
* SubscriptionSpec is the spec for an event subscription.
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* Copyright 2020 Marc Nuri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.marcnuri.yakc.model.io.dapr.v2alpha1;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.Model;
import com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Singular;
import lombok.ToString;

/**
* Subscription describes an pub/sub event subscription.
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class Subscription implements Model {


/**
* 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
*/
@JsonProperty("apiVersion")
private String apiVersion;

/**
* 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
*/
@JsonProperty("kind")
private String kind;

@JsonProperty("metadata")
private ObjectMeta metadata;

@JsonProperty("scopes")
@Singular(value = "addToScopes", ignoreNullCollections = true)
private List<String> scopes;

@JsonProperty("spec")
private SubscriptionSpec spec;

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright 2020 Marc Nuri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.marcnuri.yakc.model.io.dapr.v2alpha1;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.ListModel;
import com.marcnuri.yakc.model.Model;
import com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Singular;
import lombok.ToString;

/**
* SubscriptionList is a list of Subscription
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class SubscriptionList implements Model, ListModel<Subscription> {


/**
* 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
*/
@JsonProperty("apiVersion")
private String apiVersion;

/**
* List of subscriptions. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md
*/
@NonNull
@JsonProperty("items")
@Singular(value = "addToItems", ignoreNullCollections = true)
private List<Subscription> items;

/**
* 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
*/
@JsonProperty("kind")
private String kind;

@JsonProperty("metadata")
private ListMeta metadata;

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright 2020 Marc Nuri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.marcnuri.yakc.model.io.dapr.v2alpha1;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.Model;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Singular;
import lombok.ToString;

/**
* SubscriptionSpec is the spec for an event subscription.
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class SubscriptionSpec implements Model {


/**
* The optional metadata to provide the the subscription.
*/
@JsonProperty("metadata")
@Singular(value = "putInMetadata", ignoreNullCollections = true)
private Map<String, String> metadata;

/**
* The PubSub component name.
*/
@NonNull
@JsonProperty("pubsubname")
private String pubsubname;

@NonNull
@JsonProperty("routes")
private SubscriptionSpecRoutes routes;

/**
* The topic name to subscribe to.
*/
@NonNull
@JsonProperty("topic")
private String topic;

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright 2020 Marc Nuri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.marcnuri.yakc.model.io.dapr.v2alpha1;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.Model;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Singular;
import lombok.ToString;

/**
* The Routes configuration for this topic.
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class SubscriptionSpecRoutes implements Model {


@JsonProperty("default")
private String defaults;

/**
* The list of rules for this topic.
*/
@JsonProperty("rules")
@Singular(value = "addToRules", ignoreNullCollections = true)
private List<SubscriptionSpecRoutesRules> rules;

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2020 Marc Nuri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.marcnuri.yakc.model.io.dapr.v2alpha1;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.ToString;

/**
* Rule is used to specify the condition for sending a message to a specific path.
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class SubscriptionSpecRoutesRules implements Model {


/**
* 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.
*/
@NonNull
@JsonProperty("match")
private String match;

/**
* The path for events that match this rule.
*/
@NonNull
@JsonProperty("path")
private String path;

}

0 comments on commit 2667499

Please sign in to comment.