add darabonba sdk & demo & sdk docs; (#177)
support java, go, php, py3, ts, csharp
diff --git a/.gitignore b/.gitignore
index 088abd7..423227b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,3 +22,7 @@
start/target/
common/target/
supports/*/target/
+*libraries*
+.vscode/
+node_modules/
+*.sln
\ No newline at end of file
diff --git a/adapter/api/src/main/java/org/apache/rocketmq/eventbridge/adapter/api/converter/CloudEventBatchedConverter.java b/adapter/api/src/main/java/org/apache/rocketmq/eventbridge/adapter/api/converter/CloudEventBatchedConverter.java
index 9b4207c..ec7ba4d 100644
--- a/adapter/api/src/main/java/org/apache/rocketmq/eventbridge/adapter/api/converter/CloudEventBatchedConverter.java
+++ b/adapter/api/src/main/java/org/apache/rocketmq/eventbridge/adapter/api/converter/CloudEventBatchedConverter.java
@@ -34,6 +34,9 @@
@Override
public boolean hit(Map<String, String> headers) {
String contentType = headers.get(CONTENT_TYPE);
+ if(Strings.isNullOrEmpty(contentType)){
+ contentType = headers.get(CONTENT_TYPE.toLowerCase());
+ }
return !Strings.isNullOrEmpty(contentType) && contentType.startsWith(HTTP_BATCHED_PROTOCOL_BINDING);
}
diff --git a/adapter/api/src/main/java/org/apache/rocketmq/eventbridge/adapter/api/converter/CloudEventBinaryConverter.java b/adapter/api/src/main/java/org/apache/rocketmq/eventbridge/adapter/api/converter/CloudEventBinaryConverter.java
index 745cb4d..3673943 100644
--- a/adapter/api/src/main/java/org/apache/rocketmq/eventbridge/adapter/api/converter/CloudEventBinaryConverter.java
+++ b/adapter/api/src/main/java/org/apache/rocketmq/eventbridge/adapter/api/converter/CloudEventBinaryConverter.java
@@ -26,6 +26,7 @@
import java.util.Map;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedHashMap;
+
import org.springframework.stereotype.Service;
import static org.apache.http.protocol.HTTP.CONTENT_TYPE;
@@ -38,6 +39,9 @@
@Override
public boolean hit(Map<String, String> headers) {
String contentType = headers.get(CONTENT_TYPE);
+ if(Strings.isNullOrEmpty(contentType)){
+ contentType = headers.get(CONTENT_TYPE.toLowerCase());
+ }
if (Strings.isNullOrEmpty(contentType) || !contentType.startsWith(HTTP_BINARY_PROTOCOL_BINDING)) {
return false;
}
@@ -61,6 +65,9 @@
.stream()
.forEach(entry -> headerMap.add(entry.getKey(), entry.getValue()));
String mediaType = headers.get(CONTENT_TYPE);
+ if(Strings.isNullOrEmpty(mediaType)){
+ mediaType = headers.get(CONTENT_TYPE.toLowerCase());
+ }
CloudEvent cloudEvent = RestfulWSMessageFactory.create(MediaType.valueOf(mediaType), headerMap, body)
.toEvent();
return Lists.newArrayList(cloudEvent);
diff --git a/adapter/api/src/main/java/org/apache/rocketmq/eventbridge/adapter/api/converter/CloudEventStructuredConverter.java b/adapter/api/src/main/java/org/apache/rocketmq/eventbridge/adapter/api/converter/CloudEventStructuredConverter.java
index 1ebcac4..0ce35b1 100644
--- a/adapter/api/src/main/java/org/apache/rocketmq/eventbridge/adapter/api/converter/CloudEventStructuredConverter.java
+++ b/adapter/api/src/main/java/org/apache/rocketmq/eventbridge/adapter/api/converter/CloudEventStructuredConverter.java
@@ -36,6 +36,9 @@
@Override
public boolean hit(Map<String, String> headers) {
String contentType = headers.get(CONTENT_TYPE);
+ if(Strings.isNullOrEmpty(contentType)){
+ contentType = headers.get(CONTENT_TYPE.toLowerCase());
+ }
return !Strings.isNullOrEmpty(contentType) && contentType.startsWith(HTTP_STRUCTURED_PROTOCOL_BINDING);
}
diff --git a/sdk/Darafile b/sdk/Darafile
new file mode 100644
index 0000000..3e6e4c4
--- /dev/null
+++ b/sdk/Darafile
@@ -0,0 +1,87 @@
+{
+ "scope": "SDKClient",
+ "name": "sdk-client",
+ "version": "1.0.0",
+ "main": "./main.dara",
+ "libraries": {
+ "Util": "darabonba:Util:*",
+ "OpenApi": "alibabacloud:OpenApi:*"
+ },
+ "releases": {
+ "java": "org.apache.rocketmq.eventbridge:sdk:0.0.0",
+ "go": "github.com/org-apache-rocketmq/eventbridge-sdk/client:v0.0.0",
+ "csharp": "RocketMQ.Eventbridge.SDK:1.0.0",
+ "ts": "@org.apache.rocketmq/eventbridge-sdk:0.0.0",
+ "php": "rocketmq/eventbridge-sdk:0.0.0",
+ "python": "rocketmq_eventbridge20240701:0.0.0"
+ },
+ "java": {
+ "className": "Client",
+ "package": "org.apache.rocketmq.eventbridge.sdk",
+ "enableMinimizeModelName": false,
+ "packageInfo": {
+ "groupId": "org.apache.rocketmq.eventbridge",
+ "artifactId": "sdk",
+ "version": "0.0.0",
+ "description": "Eventbridge (20240701) SDK for Java",
+ "url": "",
+ "licenseName": "The Apache License, Version 2.0",
+ "licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt",
+ "developerId": "rocketmq",
+ "developerName": "rocketmq",
+ "developerEmail": "zjuludi@gmail.com"
+ }
+ },
+ "ts":{
+ "packageName": "SDKClient"
+ },
+ "csharp": {
+ "className": "SDKClient",
+ "namespace": "RocketMQ.Eventbridge.SDK",
+ "packageInfo": {
+ "name": "sdk",
+ "version": "0.0.0",
+ "title": "eventbridge-sdk",
+ "description": "open source eventbridge (20240701) SDK Library for .NET"
+ }
+ },
+ "php": {
+ "package": "RocketMQ.Eventbridge.SDK",
+ "clientName": "SDKClient",
+ "packageInfo": {
+ "name": "rocketmq/eventbridge-sdk",
+ "desc": "RocketMQ eventbridge (20240701) SDK Library for PHP",
+ "github": "unavailable",
+ "files": {
+ "LICENSE": "../LICENSE"
+ }
+ }
+ },
+ "python": {
+ "package": "rocketmq_eventbridge",
+ "clientName": "client",
+ "packageInfo": {
+ "name": "rocketmq_eventbridge",
+ "desc": "Alibaba Cloud eventbridge (20240701) SDK Library for Python",
+ "github": "https://github.com/aliyun/alibabacloud-python-sdk",
+ "author": "Alibaba Cloud SDK",
+ "email": "sdk-team@alibabacloud.com"
+ }
+ },
+ "swift": {
+ "clientName": "Client",
+ "packageInfo": {
+ "name": "AlibabacloudEventbridge20240701",
+ "desc": "Alibaba Cloud eventbridge (20240701) SDK Library for Swift",
+ "github": "https://github.com/alibabacloud-sdk-swift/eventbridge-20240701",
+ "author": "Alibaba Cloud SDK",
+ "email": "sdk-team@alibabacloud.com"
+ }
+ },
+ "go": {
+ "interface": true,
+ "clientName": "Client"
+ },
+ "productId": "eventbridge",
+ "apiVersions": "2024-07-01"
+}
\ No newline at end of file
diff --git a/sdk/Readme.md b/sdk/Readme.md
new file mode 100644
index 0000000..2a18453
--- /dev/null
+++ b/sdk/Readme.md
@@ -0,0 +1,37 @@
+# Daranbonba
+
+通过 darabonba 生成的多语言 SDK 实现对 eventBridge 进行 RPC 管控
+
+# 多语言 SDK 生成
+
+## dara 安装
+
+```
+npm install @darabonba/cli -g
+```
+
+# 目录结构
+
+- demo
+ - 包含了 sdk demo 的源码和生成样例,按 controller 分类
+- doc
+ - 各语言的 sdk 生成使用文档
+- generated
+ - 包含了 sdk client 的各语言生成样例
+- Darafile
+ - dara 配置文件
+- main.dara
+ - dara 源码
+
+# 支持语言
+
+- java
+- golang
+- csharp
+- php
+- python
+- typescript
+
+# 使用
+各语言 sdk 使用方法请参考 doc 中的文档
+
diff --git a/sdk/demo/ApiDestination/Darafile b/sdk/demo/ApiDestination/Darafile
new file mode 100644
index 0000000..b15ddca
--- /dev/null
+++ b/sdk/demo/ApiDestination/Darafile
@@ -0,0 +1,66 @@
+{
+ "scope": "Demo",
+ "name": "demo",
+ "version": "0.0.0",
+ "main": "./demo.dara",
+ "libraries": {
+ "SDKClient" : "../../",
+ "Util": "darabonba:Util:*",
+ "OpenApi": "alibabacloud:OpenApi:*",
+ "OpenApiUtil": "alibabacloud:OpenApiUtil:*",
+ "Console": "darabonba:Console:*"
+ },
+ "java": {
+ "package": "org.apache.rocketmq.eventbridge.demo",
+ "className": "Demo",
+ "packageInfo": {
+ "groupId": "org.apache.rocketmq.eventbridge",
+ "artifactId": "demo",
+ "version": "0.0.0",
+ "description": "EventBridge SDK demo for Java",
+ "url": "",
+ "licenseName": "The Apache License, Version 2.0",
+ "licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt",
+ "developerId": "ludi",
+ "developerName": "EventBridge SDK",
+ "developerEmail": "zjuludi@gmail.com",
+ "scmConnection": "",
+ "scmDeveloperConnection": "",
+ "scmUrl": ""
+ }
+ },
+ "go": {
+ "clientName": "DemoClient"
+ },
+ "csharp": {
+ "className": "Demo",
+ "namespace": "RocketMQ.Eventbridge.Demo",
+ "packageInfo": {
+ "name": "sdkDemo",
+ "version": "0.0.0",
+ "title": "eventbridge-sdk-demo",
+ "description": "open source eventbridge (20240701) SDK Demo Library for .NET"
+ }
+ },
+ "php": {
+ "package": "RocketMQ.Eventbridge.SDK.Demo",
+ "clientName": "Demo",
+ "packageInfo": {
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "desc": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "github": "unavailable",
+ "files": {
+ "LICENSE": "../LICENSE"
+ }
+ }
+ },
+ "python": {
+ "package": "rocketmq_eventbridge_demo",
+ "clientName": "demo",
+ "packageInfo": {
+ "name": "rocketmq_eventbridge_demo",
+ "desc": "Alibaba Cloud eventbridge (20240701) SDK Library for Python",
+ "github": "unavailable"
+ }
+ }
+}
\ No newline at end of file
diff --git a/sdk/demo/ApiDestination/demo.dara b/sdk/demo/ApiDestination/demo.dara
new file mode 100644
index 0000000..f484050
--- /dev/null
+++ b/sdk/demo/ApiDestination/demo.dara
@@ -0,0 +1,117 @@
+import Util;
+import OpenApi;
+import SDKClient;
+import Console;
+
+type @sdkClient = SDKClient;
+type @endpoint = string;
+
+init(){
+ @endpoint = '127.0.0.1:7001';
+ var config = new OpenApi.Config{
+ endpoint = @endpoint
+ };
+ @sdkClient = new SDKClient(config);
+}
+
+/**
+ ApiDestination Controller apis:
+ * createApiDestination *
+ * updateApiDestination *
+ * getApiDestination *
+ * deleteApiDestination *
+ * listApiDestinations *
+*/
+
+async function testCreateApiDestination(): void {
+ var request = new SDKClient.CreateApiDestinationRequest{
+ apiDestinationName = "new-api-destination",
+ connectionName = "new-connection",
+ description = "demo api destination for test",
+ httpApiParameters = new SDKClient.CreateApiDestinationRequest.httpApiParameters{
+ endpoint = @endpoint,
+ method = "POST"
+ }
+ };
+
+ try {
+ var res = @sdkClient.createApiDestination(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testUpdateApiDestination(): void {
+ var request = new SDKClient.UpdateApiDestinationRequest{
+ apiDestinationName = "new-api-destination",
+ connectionName = "new-connection",
+ description = "!updated! demo api destination for test",
+ httpApiParameters = new SDKClient.UpdateApiDestinationRequest.httpApiParameters{
+ endpoint = @endpoint,
+ method = "GET"
+ }
+ };
+
+ try {
+ var res = @sdkClient.updateApiDestination(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testGetApiDestination(): void {
+ var request = new SDKClient.GetApiDestinationRequest{
+ apiDestinationName = "new-api-destination"
+ };
+ try {
+ var res = @sdkClient.getApiDestination(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+}
+
+async function testDeleteApiDestination(): void {
+ var request = new SDKClient.DeleteApiDestinationRequest{
+ apiDestinationName = "new-api-destination"
+ };
+ try {
+ var res = @sdkClient.deleteApiDestination(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+}
+
+async function testListApiDestinations(): void {
+ var request = new SDKClient.ListApiDestinationsRequest{
+ maxResults = 2
+ };
+
+ try {
+ var res = @sdkClient.listApiDestinations(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
diff --git a/sdk/demo/ApiDestination/generated/csharp/core/Demo.cs b/sdk/demo/ApiDestination/generated/csharp/core/Demo.cs
new file mode 100644
index 0000000..269e206
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/csharp/core/Demo.cs
@@ -0,0 +1,392 @@
+// This file is auto-generated, don't edit it. Thanks.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+
+using Tea;
+using Tea.Utils;
+
+
+namespace RocketMQ.Eventbridge.Demo
+{
+ public class Demo
+ {
+ protected RocketMQ.Eventbridge.SDK.SDKClient _sdkClient;
+ protected string _endpoint;
+
+ public Demo()
+ {
+ this._endpoint = "127.0.0.1:7001";
+ AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config
+ {
+ Endpoint = _endpoint,
+ };
+ this._sdkClient = new RocketMQ.Eventbridge.SDK.SDKClient(config);
+ }
+
+ static void Main(string[] _args){
+ Demo demo = new Demo();
+ demo.TestListApiDestinations();
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>ApiDestination Controller apis:
+ /// createApiDestination *
+ /// updateApiDestination *
+ /// getApiDestination *
+ /// deleteApiDestination *
+ /// listApiDestinations *</para>
+ /// </description>
+ public void TestCreateApiDestination()
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateApiDestinationRequest request = new RocketMQ.Eventbridge.SDK.Models.CreateApiDestinationRequest
+ {
+ ApiDestinationName = "new-api-destination",
+ ConnectionName = "new-connection",
+ Description = "demo api destination for test",
+ HttpApiParameters = new RocketMQ.Eventbridge.SDK.Models.CreateApiDestinationRequest.CreateApiDestinationRequestHttpApiParameters
+ {
+ Endpoint = _endpoint,
+ Method = "POST",
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateApiDestinationResponse res = this._sdkClient.CreateApiDestination(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>ApiDestination Controller apis:
+ /// createApiDestination *
+ /// updateApiDestination *
+ /// getApiDestination *
+ /// deleteApiDestination *
+ /// listApiDestinations *</para>
+ /// </description>
+ public async Task TestCreateApiDestinationAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateApiDestinationRequest request = new RocketMQ.Eventbridge.SDK.Models.CreateApiDestinationRequest
+ {
+ ApiDestinationName = "new-api-destination",
+ ConnectionName = "new-connection",
+ Description = "demo api destination for test",
+ HttpApiParameters = new RocketMQ.Eventbridge.SDK.Models.CreateApiDestinationRequest.CreateApiDestinationRequestHttpApiParameters
+ {
+ Endpoint = _endpoint,
+ Method = "POST",
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateApiDestinationResponse res = await this._sdkClient.CreateApiDestinationAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestUpdateApiDestination()
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateApiDestinationRequest request = new RocketMQ.Eventbridge.SDK.Models.UpdateApiDestinationRequest
+ {
+ ApiDestinationName = "new-api-destination",
+ ConnectionName = "new-connection",
+ Description = "!updated! demo api destination for test",
+ HttpApiParameters = new RocketMQ.Eventbridge.SDK.Models.UpdateApiDestinationRequest.UpdateApiDestinationRequestHttpApiParameters
+ {
+ Endpoint = _endpoint,
+ Method = "GET",
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateApiDestinationResponse res = this._sdkClient.UpdateApiDestination(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestUpdateApiDestinationAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateApiDestinationRequest request = new RocketMQ.Eventbridge.SDK.Models.UpdateApiDestinationRequest
+ {
+ ApiDestinationName = "new-api-destination",
+ ConnectionName = "new-connection",
+ Description = "!updated! demo api destination for test",
+ HttpApiParameters = new RocketMQ.Eventbridge.SDK.Models.UpdateApiDestinationRequest.UpdateApiDestinationRequestHttpApiParameters
+ {
+ Endpoint = _endpoint,
+ Method = "GET",
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateApiDestinationResponse res = await this._sdkClient.UpdateApiDestinationAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestGetApiDestination()
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetApiDestinationRequest request = new RocketMQ.Eventbridge.SDK.Models.GetApiDestinationRequest
+ {
+ ApiDestinationName = "new-api-destination",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetApiDestinationResponse res = this._sdkClient.GetApiDestination(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestGetApiDestinationAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetApiDestinationRequest request = new RocketMQ.Eventbridge.SDK.Models.GetApiDestinationRequest
+ {
+ ApiDestinationName = "new-api-destination",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetApiDestinationResponse res = await this._sdkClient.GetApiDestinationAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestDeleteApiDestination()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteApiDestinationRequest request = new RocketMQ.Eventbridge.SDK.Models.DeleteApiDestinationRequest
+ {
+ ApiDestinationName = "new-api-destination",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteApiDestinationResponse res = this._sdkClient.DeleteApiDestination(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestDeleteApiDestinationAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteApiDestinationRequest request = new RocketMQ.Eventbridge.SDK.Models.DeleteApiDestinationRequest
+ {
+ ApiDestinationName = "new-api-destination",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteApiDestinationResponse res = await this._sdkClient.DeleteApiDestinationAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestListApiDestinations()
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListApiDestinationsRequest request = new RocketMQ.Eventbridge.SDK.Models.ListApiDestinationsRequest
+ {
+ MaxResults = 2,
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListApiDestinationsResponse res = this._sdkClient.ListApiDestinations(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestListApiDestinationsAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListApiDestinationsRequest request = new RocketMQ.Eventbridge.SDK.Models.ListApiDestinationsRequest
+ {
+ MaxResults = 2,
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListApiDestinationsResponse res = await this._sdkClient.ListApiDestinationsAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ }
+}
diff --git a/sdk/demo/ApiDestination/generated/csharp/core/Properties/AssemblyInfo.cs b/sdk/demo/ApiDestination/generated/csharp/core/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..6e4eeb0
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/csharp/core/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("eventbridge-sdk-demo")]
+[assembly: AssemblyDescription("open source eventbridge (20240701) SDK Demo Library for .NET")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("6dece9a0-8a59-11ef-8d20-217abdacd26b")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("0.0.1.0")]
+[assembly: AssemblyFileVersion("0.0.1.0")]
diff --git a/sdk/demo/ApiDestination/generated/csharp/core/sdkDemo.csproj b/sdk/demo/ApiDestination/generated/csharp/core/sdkDemo.csproj
new file mode 100644
index 0000000..8ea12bc
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/csharp/core/sdkDemo.csproj
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFrameworks>netstandard2.0;net45;netcoreapp8.0</TargetFrameworks>
+ <RootNamespace>RocketMQ.Eventbridge.Demo</RootNamespace>
+ <OutputType>Exe</OutputType>
+ <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
+ <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+ <AssemblyName>RocketMQ.Eventbridge.Demo</AssemblyName>
+ <Version/>
+ <LangVersion>5</LangVersion>
+ <Description>open source eventbridge (20240701) SDK Demo Library for .NET</Description>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
+ <DefineConstants>NETSTANDARD2_0</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <DefineConstants>NET45</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <Reference Include="mscorlib"/>
+ <Reference Include="System"/>
+ <Reference Include="System.Core"/>
+ <Reference Include="Microsoft.CSharp"/>
+ <Reference Include="System.Data"/>
+ <Reference Include="System.Web"/>
+ <Reference Include="System.Drawing"/>
+ <Reference Include="System.Security"/>
+ <Reference Include="System.Xml"/>
+ <Reference Include="System.Configuration"/>
+ <Reference Include="System.Net.Http"/>
+ </ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
+ </PackageReference>
+ <PackageReference Include="AlibabaCloud.TeaUtil" Version="0.1.19"/>
+ <PackageReference Include="AlibabaCloud.OpenApiClient" Version="0.1.12"/>
+ <PackageReference Include="RocketMQ.Eventbridge.SDK" Version="1.0.0"/>
+ <PackageReference Include="AlibabaCloud.TeaConsole" Version="0.1.0"/>
+ <PackageReference Include="Tea" Version="1.1.0"/>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/sdk/demo/ApiDestination/generated/go/client/client.go b/sdk/demo/ApiDestination/generated/go/client/client.go
new file mode 100644
index 0000000..bd7a683
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/go/client/client.go
@@ -0,0 +1,239 @@
+// This file is auto-generated, don't edit it. Thanks.
+package client
+
+import (
+ openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
+ console "github.com/alibabacloud-go/tea-console/client"
+ util "github.com/alibabacloud-go/tea-utils/v2/service"
+ "github.com/alibabacloud-go/tea/tea"
+ sdkclient "github.com/org-apache-rocketmq/eventbridge-sdk/client"
+)
+
+type DemoClient struct {
+ SdkClient *sdkclient.Client
+ Endpoint *string
+}
+
+func NewClient() (*DemoClient, error) {
+ client := new(DemoClient)
+ err := client.Init()
+ return client, err
+}
+
+func (client *DemoClient) Init() (_err error) {
+ client.Endpoint = tea.String("127.0.0.1:7001")
+ config := &openapi.Config{
+ Endpoint: client.Endpoint,
+ }
+ client.SdkClient, _err = sdkclient.NewClient(config)
+ if _err != nil {
+ return _err
+ }
+
+ return nil
+}
+
+// Description:
+//
+// ApiDestination Controller apis:
+//
+// createApiDestination *
+//
+// updateApiDestination *
+//
+// getApiDestination *
+//
+// deleteApiDestination *
+//
+// listApiDestinations *
+func (client *DemoClient) TestCreateApiDestination() (_err error) {
+ request := &sdkclient.CreateApiDestinationRequest{
+ ApiDestinationName: tea.String("new-api-destination"),
+ ConnectionName: tea.String("new-connection"),
+ Description: tea.String("demo api destination for test"),
+ HttpApiParameters: &sdkclient.CreateApiDestinationRequestHttpApiParameters{
+ Endpoint: client.Endpoint,
+ Method: tea.String("POST"),
+ },
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.CreateApiDestination(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestUpdateApiDestination() (_err error) {
+ request := &sdkclient.UpdateApiDestinationRequest{
+ ApiDestinationName: tea.String("new-api-destination"),
+ ConnectionName: tea.String("new-connection"),
+ Description: tea.String("!updated! demo api destination for test"),
+ HttpApiParameters: &sdkclient.UpdateApiDestinationRequestHttpApiParameters{
+ Endpoint: client.Endpoint,
+ Method: tea.String("GET"),
+ },
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.UpdateApiDestination(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestGetApiDestination() (_err error) {
+ request := &sdkclient.GetApiDestinationRequest{
+ ApiDestinationName: tea.String("new-api-destination"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.GetApiDestination(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestDeleteApiDestination() (_err error) {
+ request := &sdkclient.DeleteApiDestinationRequest{
+ ApiDestinationName: tea.String("new-api-destination"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.DeleteApiDestination(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestListApiDestinations() (_err error) {
+ request := &sdkclient.ListApiDestinationsRequest{
+ MaxResults: tea.Int32(2),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.ListApiDestinations(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
diff --git a/sdk/demo/ApiDestination/generated/go/go.mod b/sdk/demo/ApiDestination/generated/go/go.mod
new file mode 100644
index 0000000..ff35824
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/go/go.mod
@@ -0,0 +1,9 @@
+module client
+
+require (
+ github.com/alibabacloud-go/tea-utils/v2 v2.0.6
+ github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10
+ github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0
+ github.com/alibabacloud-go/tea-console v1.0.0
+)
+replace github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0 => ../../../../generated/go/
diff --git a/sdk/demo/ApiDestination/generated/go/main.go b/sdk/demo/ApiDestination/generated/go/main.go
new file mode 100644
index 0000000..22c02f4
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/go/main.go
@@ -0,0 +1,11 @@
+package main
+
+import (
+ "client/client"
+)
+
+func main() {
+ demo := new(client.DemoClient)
+ demo.Init()
+ demo.TestListApiDestinations()
+}
diff --git a/sdk/demo/ApiDestination/generated/java/pom.xml b/sdk/demo/ApiDestination/generated/java/pom.xml
new file mode 100644
index 0000000..ef0ec32
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/java/pom.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>demo</artifactId>
+ <version>0.0.0</version>
+ <packaging>jar</packaging>
+ <name>demo</name>
+ <description>EventBridge SDK demo for Java
+ </description>
+ <url></url>
+ <licenses>
+ <license>
+ <name>The Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ </license>
+ </licenses>
+ <developers>
+ <developer>
+ <id>ludi</id>
+ <name>EventBridge SDK</name>
+ <email>zjuludi@gmail.com</email>
+ </developer>
+ </developers>
+ <distributionManagement>
+ <snapshotRepository>
+ <id>sonatype-nexus-snapshots</id>
+ <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ <repository>
+ <id>sonatype-nexus-staging</id>
+ <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+ </repository>
+ </distributionManagement>
+ <scm>
+ <connection></connection>
+ <developerConnection></developerConnection>
+ <url></url>
+ </scm>
+ <dependencies>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-util</artifactId>
+ <version>0.2.23</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-openapi</artifactId>
+ <version>0.3.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>sdk</artifactId>
+ <version>0.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-console</artifactId>
+ <version>0.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea</artifactId>
+ <version>1.1.14</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.6.1</version>
+ <configuration>
+ <source>8</source>
+ <target>8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.6</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.6.3</version>
+ <extensions>true</extensions>
+ <configuration>
+ <serverId>sonatype-nexus-staging</serverId>
+ <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
+ <autoReleaseAfterClose>true</autoReleaseAfterClose>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.1.1</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <doclint>none</doclint>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.22.1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
diff --git a/sdk/demo/ApiDestination/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java b/sdk/demo/ApiDestination/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
new file mode 100644
index 0000000..69b7b9e
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
@@ -0,0 +1,142 @@
+// This file is auto-generated, don't edit it. Thanks.
+package org.apache.rocketmq.eventbridge.demo;
+
+import com.aliyun.tea.*;
+
+public class Demo {
+
+ public org.apache.rocketmq.eventbridge.sdk.Client _sdkClient;
+ public String _endpoint;
+ public Demo() throws Exception {
+ this._endpoint = "127.0.0.1:7001";
+ com.aliyun.teaopenapi.models.Config config = com.aliyun.teaopenapi.models.Config.build(TeaConverter.buildMap(
+ new TeaPair("endpoint", _endpoint)
+ ));
+ this._sdkClient = new org.apache.rocketmq.eventbridge.sdk.Client(config);
+ }
+
+ public static void main(String[] args) {
+ try {
+ Demo demo = new Demo();
+ demo.testListApiDestinations();
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+
+ /**
+ * <b>description</b> :
+ * <p>ApiDestination Controller apis:
+ * createApiDestination *
+ * updateApiDestination *
+ * getApiDestination *
+ * deleteApiDestination *
+ * listApiDestinations *</p>
+ */
+ public void testCreateApiDestination() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.CreateApiDestinationRequest request = org.apache.rocketmq.eventbridge.sdk.models.CreateApiDestinationRequest.build(TeaConverter.buildMap(
+ new TeaPair("apiDestinationName", "new-api-destination"),
+ new TeaPair("connectionName", "new-connection"),
+ new TeaPair("description", "demo api destination for test"),
+ new TeaPair("httpApiParameters", org.apache.rocketmq.eventbridge.sdk.models.CreateApiDestinationRequest.CreateApiDestinationRequestHttpApiParameters.build(TeaConverter.buildMap(
+ new TeaPair("endpoint", _endpoint),
+ new TeaPair("method", "POST")
+ )))
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.CreateApiDestinationResponse res = _sdkClient.createApiDestination(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testUpdateApiDestination() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.UpdateApiDestinationRequest request = org.apache.rocketmq.eventbridge.sdk.models.UpdateApiDestinationRequest.build(TeaConverter.buildMap(
+ new TeaPair("apiDestinationName", "new-api-destination"),
+ new TeaPair("connectionName", "new-connection"),
+ new TeaPair("description", "!updated! demo api destination for test"),
+ new TeaPair("httpApiParameters", org.apache.rocketmq.eventbridge.sdk.models.UpdateApiDestinationRequest.UpdateApiDestinationRequestHttpApiParameters.build(TeaConverter.buildMap(
+ new TeaPair("endpoint", _endpoint),
+ new TeaPair("method", "GET")
+ )))
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.UpdateApiDestinationResponse res = _sdkClient.updateApiDestination(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testGetApiDestination() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.GetApiDestinationRequest request = org.apache.rocketmq.eventbridge.sdk.models.GetApiDestinationRequest.build(TeaConverter.buildMap(
+ new TeaPair("apiDestinationName", "new-api-destination")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.GetApiDestinationResponse res = _sdkClient.getApiDestination(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testDeleteApiDestination() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.DeleteApiDestinationRequest request = org.apache.rocketmq.eventbridge.sdk.models.DeleteApiDestinationRequest.build(TeaConverter.buildMap(
+ new TeaPair("apiDestinationName", "new-api-destination")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.DeleteApiDestinationResponse res = _sdkClient.deleteApiDestination(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testListApiDestinations() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.ListApiDestinationsRequest request = org.apache.rocketmq.eventbridge.sdk.models.ListApiDestinationsRequest.build(TeaConverter.buildMap(
+ new TeaPair("maxResults", 2)
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.ListApiDestinationsResponse res = _sdkClient.listApiDestinations(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/ApiDestination/generated/php/.gitignore b/sdk/demo/ApiDestination/generated/php/.gitignore
new file mode 100644
index 0000000..89c7aa5
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/php/.gitignore
@@ -0,0 +1,15 @@
+composer.phar
+/vendor/
+
+# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
+# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
+composer.lock
+
+.vscode/
+.idea
+.DS_Store
+
+cache/
+*.cache
+runtime/
+.php_cs.cache
diff --git a/sdk/demo/ApiDestination/generated/php/.php_cs.dist b/sdk/demo/ApiDestination/generated/php/.php_cs.dist
new file mode 100644
index 0000000..8617ec2
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/php/.php_cs.dist
@@ -0,0 +1,65 @@
+<?php
+/*
+ * This document has been generated with
+ * https://mlocati.github.io/php-cs-fixer-configurator/#version:2.15|configurator
+ * you can change this configuration by importing this file.
+ */
+
+return PhpCsFixer\Config::create()
+ ->setRiskyAllowed(true)
+ ->setIndent(' ')
+ ->setRules([
+ '@PSR2' => true,
+ '@PhpCsFixer' => true,
+ '@Symfony:risky' => true,
+ 'concat_space' => ['spacing' => 'one'],
+ 'array_syntax' => ['syntax' => 'short'],
+ 'array_indentation' => true,
+ 'combine_consecutive_unsets' => true,
+ 'method_separation' => true,
+ 'single_quote' => true,
+ 'declare_equal_normalize' => true,
+ 'function_typehint_space' => true,
+ 'hash_to_slash_comment' => true,
+ 'include' => true,
+ 'lowercase_cast' => true,
+ 'no_multiline_whitespace_before_semicolons' => true,
+ 'no_leading_import_slash' => true,
+ 'no_multiline_whitespace_around_double_arrow' => true,
+ 'no_spaces_around_offset' => true,
+ 'no_unneeded_control_parentheses' => true,
+ 'no_unused_imports' => true,
+ 'no_whitespace_before_comma_in_array' => true,
+ 'no_whitespace_in_blank_line' => true,
+ 'object_operator_without_whitespace' => true,
+ 'single_blank_line_before_namespace' => true,
+ 'single_class_element_per_statement' => true,
+ 'space_after_semicolon' => true,
+ 'standardize_not_equals' => true,
+ 'ternary_operator_spaces' => true,
+ 'trailing_comma_in_multiline_array' => true,
+ 'trim_array_spaces' => true,
+ 'unary_operator_spaces' => true,
+ 'whitespace_after_comma_in_array' => true,
+ 'no_extra_consecutive_blank_lines' => [
+ 'curly_brace_block',
+ 'extra',
+ 'parenthesis_brace_block',
+ 'square_brace_block',
+ 'throw',
+ 'use',
+ ],
+ 'binary_operator_spaces' => [
+ 'align_double_arrow' => true,
+ 'align_equals' => true,
+ ],
+ 'braces' => [
+ 'allow_single_line_closure' => true,
+ ],
+ ])
+ ->setFinder(
+ PhpCsFixer\Finder::create()
+ ->exclude('vendor')
+ ->exclude('tests')
+ ->in(__DIR__)
+ );
diff --git a/sdk/demo/ApiDestination/generated/php/autoload.php b/sdk/demo/ApiDestination/generated/php/autoload.php
new file mode 100644
index 0000000..5bfe0a1
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/php/autoload.php
@@ -0,0 +1,15 @@
+<?php
+
+if (file_exists(__DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php')) {
+ require_once __DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
+}
+
+spl_autoload_register(function ($class) {
+ $name = str_replace('RocketMQ\\Eventbridge\\SDK\\Demo\\', '', $class);
+ $file = __DIR__ . \DIRECTORY_SEPARATOR . 'src' . \DIRECTORY_SEPARATOR . str_replace('\\', \DIRECTORY_SEPARATOR, $name) . '.php';
+ if (file_exists($file)) {
+ require_once $file;
+ return true;
+ }
+ return false;
+});
diff --git a/sdk/demo/ApiDestination/generated/php/composer.json b/sdk/demo/ApiDestination/generated/php/composer.json
new file mode 100644
index 0000000..2edbfb8
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/php/composer.json
@@ -0,0 +1,34 @@
+{
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "description": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "type": "library",
+ "license": "Apache-2.0",
+ "authors": [],
+ "require": {
+ "php": ">5.5",
+ "alibabacloud/tea-utils": "^0.2.21",
+ "alibabacloud/darabonba-openapi": "^0.2.12",
+ "rocketmq/eventbridge-sdk": "^0.0.0",
+ "alibabacloud/tea-console": "^0.1.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "RocketMQ\\Eventbridge\\SDK\\Demo\\": "src"
+ }
+ },
+ "scripts": {
+ "fixer": "php-cs-fixer fix ./"
+ },
+ "config": {
+ "sort-packages": true,
+ "preferred-install": "dist",
+ "optimize-autoloader": true
+ },
+ "prefer-stable": true,
+ "repositories": {
+ "rocketmq":{
+ "type" : "path",
+ "url": "../../../../generated/php"
+ }
+ }
+}
diff --git a/sdk/demo/ApiDestination/generated/php/main.php b/sdk/demo/ApiDestination/generated/php/main.php
new file mode 100644
index 0000000..da38d99
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/php/main.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace RocketMQ\Eventbridge\SDK\Demo;
+require 'vendor/autoload.php';
+include 'src/Demo.php';
+
+$demo = new Demo();
+$demo->testListApiDestinations();
diff --git a/sdk/demo/ApiDestination/generated/php/src/Demo.php b/sdk/demo/ApiDestination/generated/php/src/Demo.php
new file mode 100644
index 0000000..fad3232
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/php/src/Demo.php
@@ -0,0 +1,165 @@
+<?php
+
+// This file is auto-generated, don't edit it. Thanks.
+namespace RocketMQ\Eventbridge\SDK\Demo;
+
+use RocketMQ\Eventbridge\SDK\SDKClient;
+use AlibabaCloud\Tea\Utils\Utils;
+use AlibabaCloud\Tea\Console\Console;
+use \Exception;
+use AlibabaCloud\Tea\Exception\TeaError;
+
+use Darabonba\OpenApi\Models\Config;
+use RocketMQ\Eventbridge\SDK\Models\CreateApiDestinationRequest;
+use RocketMQ\Eventbridge\SDK\Models\CreateApiDestinationRequest\httpApiParameters;
+use RocketMQ\Eventbridge\SDK\Models\UpdateApiDestinationRequest;
+use RocketMQ\Eventbridge\SDK\Models\GetApiDestinationRequest;
+use RocketMQ\Eventbridge\SDK\Models\DeleteApiDestinationRequest;
+use RocketMQ\Eventbridge\SDK\Models\ListApiDestinationsRequest;
+
+class Demo {
+ protected $_sdkClient;
+
+ protected $_endpoint;
+
+ public function __construct(){
+ $this->_endpoint = "127.0.0.1:7001";
+ $config = new Config([
+ "endpoint" => $this->_endpoint
+ ]);
+ $this->_sdkClient = new SDKClient($config);
+ }
+
+ /**
+ * ApiDestination Controller apis:
+ * * createApiDestination *
+ * * updateApiDestination *
+ * * getApiDestination *
+ * * deleteApiDestination *
+ * * listApiDestinations *
+ * @return void
+ */
+ public function testCreateApiDestination(){
+ $request = new CreateApiDestinationRequest([
+ "apiDestinationName" => "new-api-destination",
+ "connectionName" => "new-connection",
+ "description" => "demo api destination for test",
+ "httpApiParameters" => new httpApiParameters([
+ "endpoint" => $this->_endpoint,
+ "method" => "POST"
+ ])
+ ]);
+ try {
+ $res = $this->_sdkClient->createApiDestination($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testUpdateApiDestination(){
+ $request = new UpdateApiDestinationRequest([
+ "apiDestinationName" => "new-api-destination",
+ "connectionName" => "new-connection",
+ "description" => "!updated! demo api destination for test",
+ "httpApiParameters" => new \RocketMQ\Eventbridge\SDK\Models\UpdateApiDestinationRequest\httpApiParameters([
+ "endpoint" => $this->_endpoint,
+ "method" => "GET"
+ ])
+ ]);
+ try {
+ $res = $this->_sdkClient->updateApiDestination($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testGetApiDestination(){
+ $request = new GetApiDestinationRequest([
+ "apiDestinationName" => "new-api-destination"
+ ]);
+ try {
+ $res = $this->_sdkClient->getApiDestination($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testDeleteApiDestination(){
+ $request = new DeleteApiDestinationRequest([
+ "apiDestinationName" => "new-api-destination"
+ ]);
+ try {
+ $res = $this->_sdkClient->deleteApiDestination($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testListApiDestinations(){
+ $request = new ListApiDestinationsRequest([
+ "maxResults" => 2
+ ]);
+ try {
+ $res = $this->_sdkClient->listApiDestinations($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/ApiDestination/generated/python/.gitignore b/sdk/demo/ApiDestination/generated/python/.gitignore
new file mode 100644
index 0000000..2bcfffa
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/python/.gitignore
@@ -0,0 +1,5 @@
+runtime/
+.idea/
+.vscode/
+__pycache__/
+.pytest_cache/
\ No newline at end of file
diff --git a/sdk/demo/ApiDestination/generated/python/rocketmq_eventbridge_demo/__init__.py b/sdk/demo/ApiDestination/generated/python/rocketmq_eventbridge_demo/__init__.py
new file mode 100644
index 0000000..5becc17
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/python/rocketmq_eventbridge_demo/__init__.py
@@ -0,0 +1 @@
+__version__ = "1.0.0"
diff --git a/sdk/demo/ApiDestination/generated/python/rocketmq_eventbridge_demo/demo.py b/sdk/demo/ApiDestination/generated/python/rocketmq_eventbridge_demo/demo.py
new file mode 100644
index 0000000..cda5f5e
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/python/rocketmq_eventbridge_demo/demo.py
@@ -0,0 +1,191 @@
+# -*- coding: utf-8 -*-
+# This file is auto-generated, don't edit it. Thanks.
+from rocketmq_eventbridge.client import Client as SDKClientClient
+from alibabacloud_tea_openapi import models as open_api_models
+from rocketmq_eventbridge import models as sdkclient_models
+from alibabacloud_tea_console.client import Client as ConsoleClient
+from alibabacloud_tea_util.client import Client as UtilClient
+
+
+class Demo:
+ _sdk_client: SDKClientClient = None
+ _endpoint: str = None
+
+ def __init__(self):
+ self._endpoint = '127.0.0.1:7001'
+ config = open_api_models.Config(
+ endpoint=self._endpoint
+ )
+ self._sdk_client = SDKClientClient(config)
+
+ def test_create_api_destination(self) -> None:
+ """
+ ApiDestination Controller apis:
+ createApiDestination *\
+ updateApiDestination *\
+ getApiDestination *\
+ deleteApiDestination *\
+ listApiDestinations *\
+ """
+ request = sdkclient_models.CreateApiDestinationRequest(
+ api_destination_name='new-api-destination',
+ connection_name='new-connection',
+ description='demo api destination for test',
+ http_api_parameters=sdkclient_models.CreateApiDestinationRequestHttpApiParameters(
+ endpoint=self._endpoint,
+ method='POST'
+ )
+ )
+ try:
+ res = self._sdk_client.create_api_destination(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_create_api_destination_async(self) -> None:
+ """
+ ApiDestination Controller apis:
+ createApiDestination *\
+ updateApiDestination *\
+ getApiDestination *\
+ deleteApiDestination *\
+ listApiDestinations *\
+ """
+ request = sdkclient_models.CreateApiDestinationRequest(
+ api_destination_name='new-api-destination',
+ connection_name='new-connection',
+ description='demo api destination for test',
+ http_api_parameters=sdkclient_models.CreateApiDestinationRequestHttpApiParameters(
+ endpoint=self._endpoint,
+ method='POST'
+ )
+ )
+ try:
+ res = await self._sdk_client.create_api_destination_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_update_api_destination(self) -> None:
+ request = sdkclient_models.UpdateApiDestinationRequest(
+ api_destination_name='new-api-destination',
+ connection_name='new-connection',
+ description='!updated! demo api destination for test',
+ http_api_parameters=sdkclient_models.UpdateApiDestinationRequestHttpApiParameters(
+ endpoint=self._endpoint,
+ method='GET'
+ )
+ )
+ try:
+ res = self._sdk_client.update_api_destination(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_update_api_destination_async(self) -> None:
+ request = sdkclient_models.UpdateApiDestinationRequest(
+ api_destination_name='new-api-destination',
+ connection_name='new-connection',
+ description='!updated! demo api destination for test',
+ http_api_parameters=sdkclient_models.UpdateApiDestinationRequestHttpApiParameters(
+ endpoint=self._endpoint,
+ method='GET'
+ )
+ )
+ try:
+ res = await self._sdk_client.update_api_destination_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_get_api_destination(self) -> None:
+ request = sdkclient_models.GetApiDestinationRequest(
+ api_destination_name='new-api-destination'
+ )
+ try:
+ res = self._sdk_client.get_api_destination(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_get_api_destination_async(self) -> None:
+ request = sdkclient_models.GetApiDestinationRequest(
+ api_destination_name='new-api-destination'
+ )
+ try:
+ res = await self._sdk_client.get_api_destination_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_delete_api_destination(self) -> None:
+ request = sdkclient_models.DeleteApiDestinationRequest(
+ api_destination_name='new-api-destination'
+ )
+ try:
+ res = self._sdk_client.delete_api_destination(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_delete_api_destination_async(self) -> None:
+ request = sdkclient_models.DeleteApiDestinationRequest(
+ api_destination_name='new-api-destination'
+ )
+ try:
+ res = await self._sdk_client.delete_api_destination_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_list_api_destinations(self) -> None:
+ request = sdkclient_models.ListApiDestinationsRequest(
+ max_results=2
+ )
+ try:
+ res = self._sdk_client.list_api_destinations(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_list_api_destinations_async(self) -> None:
+ request = sdkclient_models.ListApiDestinationsRequest(
+ max_results=2
+ )
+ try:
+ res = await self._sdk_client.list_api_destinations_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+demo = Demo()
+demo.test_list_api_destinations()
diff --git a/sdk/demo/ApiDestination/generated/python/setup.py b/sdk/demo/ApiDestination/generated/python/setup.py
new file mode 100644
index 0000000..48e4b4b
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/python/setup.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+"""
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+"""
+
+import os
+from setuptools import setup, find_packages
+
+"""
+setup module for rocketmq_eventbridge_demo.
+
+Created on 15/10/2024
+
+@author:
+"""
+
+PACKAGE = "rocketmq_eventbridge_demo"
+NAME = "rocketmq_eventbridge_demo" or "alibabacloud-package"
+DESCRIPTION = "Alibaba Cloud eventbridge (20240701) SDK Library for Python"
+AUTHOR = ""
+AUTHOR_EMAIL = ""
+URL = "unavailable"
+VERSION = __import__(PACKAGE).__version__
+REQUIRES = [
+ "alibabacloud_tea_util>=0.3.13, <1.0.0",
+ "alibabacloud_tea_openapi>=0.3.12, <1.0.0",
+ "rocketmq_eventbridge20240701>=0.0.0, <1.0.0",
+ "alibabacloud_tea_console>=0.0.1, <1.0.0"
+]
+
+LONG_DESCRIPTION = ''
+if os.path.exists('./README.md'):
+ with open("README.md", encoding='utf-8') as fp:
+ LONG_DESCRIPTION = fp.read()
+
+setup(
+ name=NAME,
+ version=VERSION,
+ description=DESCRIPTION,
+ long_description=LONG_DESCRIPTION,
+ long_description_content_type='text/markdown',
+ author=AUTHOR,
+ author_email=AUTHOR_EMAIL,
+ license="Apache License 2.0",
+ url=URL,
+ keywords=["rocketmq","eventbridge","demo"],
+ packages=find_packages(exclude=["tests*"]),
+ include_package_data=True,
+ platforms="any",
+ install_requires=REQUIRES,
+ python_requires=">=3.6",
+ classifiers=(
+ "Development Status :: 4 - Beta",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: Apache Software License",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.6",
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ "Topic :: Software Development"
+ )
+)
diff --git a/sdk/demo/ApiDestination/generated/ts/package.json b/sdk/demo/ApiDestination/generated/ts/package.json
new file mode 100644
index 0000000..be9669b
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/ts/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "",
+ "version": "1.0.0",
+ "description": "",
+ "main": "dist/client.js",
+ "scripts": {
+ "test": "mocha --reporter spec --timeout 3000 test/*.test.js",
+ "test-cov": "nyc -e .ts -r=html -r=text -r=lcov npm run test",
+ "build": "tsc",
+ "prepublishOnly": "tsc"
+ },
+ "author": "",
+ "license": "ISC",
+ "devDependencies": {
+ "@types/node": "^12.12.26",
+ "nyc": "^15.0.0",
+ "source-map-support": "^0.5.16",
+ "ts-node": "^8.6.2",
+ "typescript": "^3.7.5"
+ },
+ "dependencies": {
+ "@alicloud/tea-typescript": "^1.7.1",
+ "@alicloud/tea-util": "^1.4.9",
+ "@alicloud/openapi-client": "^0.4.12",
+ "@alicloud/tea-console": "^1.0.0"
+ },
+ "files": [
+ "dist",
+ "src"
+ ]
+}
\ No newline at end of file
diff --git a/sdk/demo/ApiDestination/generated/ts/src/client.ts b/sdk/demo/ApiDestination/generated/ts/src/client.ts
new file mode 100644
index 0000000..c38b9d4
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/ts/src/client.ts
@@ -0,0 +1,118 @@
+// This file is auto-generated, don't edit it
+import Util from '@alicloud/tea-util';
+import OpenApi, * as $OpenApi from '@alicloud/openapi-client';
+import SDKClient, * as $SDKClient from '../../../../../generated/ts/src/client';
+import Console from '@alicloud/tea-console';
+import * as $tea from '@alicloud/tea-typescript';
+
+
+export default class Client {
+ _sdkClient: SDKClient;
+ _endpoint: string;
+
+ constructor() {
+ this._endpoint = "127.0.0.1:7001";
+ let config = new $OpenApi.Config({
+ endpoint: this._endpoint,
+ });
+ this._sdkClient = new SDKClient(config);
+ }
+
+
+ /**
+ * @remarks
+ * ApiDestination Controller apis:
+ * createApiDestination *
+ * updateApiDestination *
+ * getApiDestination *
+ * deleteApiDestination *
+ * listApiDestinations *
+ */
+ async testCreateApiDestination(): Promise<void> {
+ let request = new $SDKClient.CreateApiDestinationRequest({
+ apiDestinationName: "new-api-destination",
+ connectionName: "new-connection",
+ description: "demo api destination for test",
+ httpApiParameters: new $SDKClient.CreateApiDestinationRequestHttpApiParameters({
+ endpoint: this._endpoint,
+ method: "POST",
+ }),
+ });
+ try {
+ let res = await this._sdkClient.createApiDestination(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testUpdateApiDestination(): Promise<void> {
+ let request = new $SDKClient.UpdateApiDestinationRequest({
+ apiDestinationName: "new-api-destination",
+ connectionName: "new-connection",
+ description: "!updated! demo api destination for test",
+ httpApiParameters: new $SDKClient.UpdateApiDestinationRequestHttpApiParameters({
+ endpoint: this._endpoint,
+ method: "GET",
+ }),
+ });
+ try {
+ let res = await this._sdkClient.updateApiDestination(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testGetApiDestination(): Promise<void> {
+ let request = new $SDKClient.GetApiDestinationRequest({
+ apiDestinationName: "new-api-destination",
+ });
+ try {
+ let res = await this._sdkClient.getApiDestination(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testDeleteApiDestination(): Promise<void> {
+ let request = new $SDKClient.DeleteApiDestinationRequest({
+ apiDestinationName: "new-api-destination",
+ });
+ try {
+ let res = await this._sdkClient.deleteApiDestination(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testListApiDestinations(): Promise<void> {
+ let request = new $SDKClient.ListApiDestinationsRequest({
+ maxResults: 2,
+ });
+ try {
+ let res = await this._sdkClient.listApiDestinations(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+}
diff --git a/sdk/demo/ApiDestination/generated/ts/src/main.ts b/sdk/demo/ApiDestination/generated/ts/src/main.ts
new file mode 100644
index 0000000..e7aa5d2
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/ts/src/main.ts
@@ -0,0 +1,4 @@
+import Client from './client'
+
+let c = new Client()
+c.testListApiDestinations()
\ No newline at end of file
diff --git a/sdk/demo/ApiDestination/generated/ts/tsconfig.json b/sdk/demo/ApiDestination/generated/ts/tsconfig.json
new file mode 100644
index 0000000..ae66f5b
--- /dev/null
+++ b/sdk/demo/ApiDestination/generated/ts/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "compilerOptions": {
+ "target": "es2017",
+ "module": "commonjs",
+ "declaration": true,
+ "sourceMap": true,
+ "outDir": "./dist",
+ "esModuleInterop": true
+ },
+ "include": [
+ "src/**/*"
+ ]
+}
\ No newline at end of file
diff --git a/sdk/demo/Connection/Darafile b/sdk/demo/Connection/Darafile
new file mode 100644
index 0000000..b15ddca
--- /dev/null
+++ b/sdk/demo/Connection/Darafile
@@ -0,0 +1,66 @@
+{
+ "scope": "Demo",
+ "name": "demo",
+ "version": "0.0.0",
+ "main": "./demo.dara",
+ "libraries": {
+ "SDKClient" : "../../",
+ "Util": "darabonba:Util:*",
+ "OpenApi": "alibabacloud:OpenApi:*",
+ "OpenApiUtil": "alibabacloud:OpenApiUtil:*",
+ "Console": "darabonba:Console:*"
+ },
+ "java": {
+ "package": "org.apache.rocketmq.eventbridge.demo",
+ "className": "Demo",
+ "packageInfo": {
+ "groupId": "org.apache.rocketmq.eventbridge",
+ "artifactId": "demo",
+ "version": "0.0.0",
+ "description": "EventBridge SDK demo for Java",
+ "url": "",
+ "licenseName": "The Apache License, Version 2.0",
+ "licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt",
+ "developerId": "ludi",
+ "developerName": "EventBridge SDK",
+ "developerEmail": "zjuludi@gmail.com",
+ "scmConnection": "",
+ "scmDeveloperConnection": "",
+ "scmUrl": ""
+ }
+ },
+ "go": {
+ "clientName": "DemoClient"
+ },
+ "csharp": {
+ "className": "Demo",
+ "namespace": "RocketMQ.Eventbridge.Demo",
+ "packageInfo": {
+ "name": "sdkDemo",
+ "version": "0.0.0",
+ "title": "eventbridge-sdk-demo",
+ "description": "open source eventbridge (20240701) SDK Demo Library for .NET"
+ }
+ },
+ "php": {
+ "package": "RocketMQ.Eventbridge.SDK.Demo",
+ "clientName": "Demo",
+ "packageInfo": {
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "desc": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "github": "unavailable",
+ "files": {
+ "LICENSE": "../LICENSE"
+ }
+ }
+ },
+ "python": {
+ "package": "rocketmq_eventbridge_demo",
+ "clientName": "demo",
+ "packageInfo": {
+ "name": "rocketmq_eventbridge_demo",
+ "desc": "Alibaba Cloud eventbridge (20240701) SDK Library for Python",
+ "github": "unavailable"
+ }
+ }
+}
\ No newline at end of file
diff --git a/sdk/demo/Connection/demo.dara b/sdk/demo/Connection/demo.dara
new file mode 100644
index 0000000..f3bdecd
--- /dev/null
+++ b/sdk/demo/Connection/demo.dara
@@ -0,0 +1,146 @@
+import Util;
+import OpenApi;
+import SDKClient;
+import Console;
+
+type @sdkClient = SDKClient;
+type @endpoint = string;
+
+init(){
+ @endpoint = '127.0.0.1:7001';
+ var config = new OpenApi.Config{
+ endpoint = @endpoint
+ };
+ @sdkClient = new SDKClient(config);
+}
+
+/**
+ test func for Connection Controller apis:
+ * createConnection *
+ * deleteConnection *
+ * updateConnection *
+ * getConnection *
+ * selectOneConnection *
+ * listConnections *
+ * listEnumsResponse *
+*/
+
+async function testCreateConnection(): void {
+ var request = new SDKClient.CreateConnectionRequest{
+ connectionName = "new-connection",
+ networkParameters = new SDKClient.CreateConnectionRequest.networkParameters{
+ networkType = "PublicNetwork"
+ }
+ };
+
+ try {
+ var res = @sdkClient.createConnection(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testDeleteConnection(): void {
+ var request = new SDKClient.DeleteConnectionRequest{
+ connectionName = "new-connection"
+ };
+ try {
+ var res = @sdkClient.deleteConnection(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+}
+
+async function testUpdateConnection(): void {
+ var request = new SDKClient.UpdateConnectionRequest{
+ connectionName = "new-connection",
+ networkParameters = new SDKClient.UpdateConnectionRequest.networkParameters{
+ networkType = "PrivateNetwork",
+ securityGroupId = "eb-167adad548759-security_grop/sg-bp1addad26peuh9qh9rtyb",
+ vpcId = "eb-test/vpc-bp1symadadwnwgmqud",
+ vswitcheId = "vsw-bp1iu4x7aeradadown1og8,vsw-bp193sqmadadlaszpeqbt2c"
+ }
+ };
+
+ try {
+ var res = @sdkClient.updateConnection(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testGetConnections(): void {
+ var request = new SDKClient.GetConnectionRequest{
+ connectionName = "new-connection"
+ };
+ try {
+ var res = @sdkClient.getConnection(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testSelectOneConnection(): void {
+ var request = new SDKClient.GetConnectionRequest{
+ connectionName = "new-connection"
+ };
+ try {
+ var res = @sdkClient.selectOneConnection(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testListConnections(): void {
+ var request = new SDKClient.ListConnectionsRequest{
+ maxResults = 2
+ };
+
+ try {
+ var res = @sdkClient.listConnections(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testListEnumsResponse(): void {
+ try {
+ var res = @sdkClient.listEnumsResponse();
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
\ No newline at end of file
diff --git a/sdk/demo/Connection/generated/csharp/core/Demo.cs b/sdk/demo/Connection/generated/csharp/core/Demo.cs
new file mode 100644
index 0000000..dec45ac
--- /dev/null
+++ b/sdk/demo/Connection/generated/csharp/core/Demo.cs
@@ -0,0 +1,506 @@
+// This file is auto-generated, don't edit it. Thanks.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+
+using Tea;
+using Tea.Utils;
+
+
+namespace RocketMQ.Eventbridge.Demo
+{
+ public class Demo
+ {
+ protected RocketMQ.Eventbridge.SDK.SDKClient _sdkClient;
+ protected string _endpoint;
+
+ public Demo()
+ {
+ this._endpoint = "127.0.0.1:7001";
+ AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config
+ {
+ Endpoint = _endpoint,
+ };
+ this._sdkClient = new RocketMQ.Eventbridge.SDK.SDKClient(config);
+ }
+
+ static void Main(string[] _args){
+ Demo demo = new Demo();
+ demo.TestListConnections();
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>test func for Connection Controller apis:
+ /// createConnection *
+ /// deleteConnection *
+ /// updateConnection *
+ /// getConnection *
+ /// selectOneConnection *
+ /// listConnections *
+ /// listEnumsResponse *</para>
+ /// </description>
+ public void TestCreateConnection()
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateConnectionRequest request = new RocketMQ.Eventbridge.SDK.Models.CreateConnectionRequest
+ {
+ ConnectionName = "new-connection",
+ NetworkParameters = new RocketMQ.Eventbridge.SDK.Models.CreateConnectionRequest.CreateConnectionRequestNetworkParameters
+ {
+ NetworkType = "PublicNetwork",
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateConnectionResponse res = this._sdkClient.CreateConnection(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>test func for Connection Controller apis:
+ /// createConnection *
+ /// deleteConnection *
+ /// updateConnection *
+ /// getConnection *
+ /// selectOneConnection *
+ /// listConnections *
+ /// listEnumsResponse *</para>
+ /// </description>
+ public async Task TestCreateConnectionAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateConnectionRequest request = new RocketMQ.Eventbridge.SDK.Models.CreateConnectionRequest
+ {
+ ConnectionName = "new-connection",
+ NetworkParameters = new RocketMQ.Eventbridge.SDK.Models.CreateConnectionRequest.CreateConnectionRequestNetworkParameters
+ {
+ NetworkType = "PublicNetwork",
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateConnectionResponse res = await this._sdkClient.CreateConnectionAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestDeleteConnection()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteConnectionRequest request = new RocketMQ.Eventbridge.SDK.Models.DeleteConnectionRequest
+ {
+ ConnectionName = "new-connection",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteConnectionResponse res = this._sdkClient.DeleteConnection(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestDeleteConnectionAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteConnectionRequest request = new RocketMQ.Eventbridge.SDK.Models.DeleteConnectionRequest
+ {
+ ConnectionName = "new-connection",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteConnectionResponse res = await this._sdkClient.DeleteConnectionAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestUpdateConnection()
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateConnectionRequest request = new RocketMQ.Eventbridge.SDK.Models.UpdateConnectionRequest
+ {
+ ConnectionName = "new-connection",
+ NetworkParameters = new RocketMQ.Eventbridge.SDK.Models.UpdateConnectionRequest.UpdateConnectionRequestNetworkParameters
+ {
+ NetworkType = "PrivateNetwork",
+ SecurityGroupId = "eb-167adad548759-security_grop/sg-bp1addad26peuh9qh9rtyb",
+ VpcId = "eb-test/vpc-bp1symadadwnwgmqud",
+ VswitcheId = "vsw-bp1iu4x7aeradadown1og8,vsw-bp193sqmadadlaszpeqbt2c",
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateConnectionResponse res = this._sdkClient.UpdateConnection(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestUpdateConnectionAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateConnectionRequest request = new RocketMQ.Eventbridge.SDK.Models.UpdateConnectionRequest
+ {
+ ConnectionName = "new-connection",
+ NetworkParameters = new RocketMQ.Eventbridge.SDK.Models.UpdateConnectionRequest.UpdateConnectionRequestNetworkParameters
+ {
+ NetworkType = "PrivateNetwork",
+ SecurityGroupId = "eb-167adad548759-security_grop/sg-bp1addad26peuh9qh9rtyb",
+ VpcId = "eb-test/vpc-bp1symadadwnwgmqud",
+ VswitcheId = "vsw-bp1iu4x7aeradadown1og8,vsw-bp193sqmadadlaszpeqbt2c",
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateConnectionResponse res = await this._sdkClient.UpdateConnectionAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestGetConnections()
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetConnectionRequest request = new RocketMQ.Eventbridge.SDK.Models.GetConnectionRequest
+ {
+ ConnectionName = "new-connection",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetConnectionResponse res = this._sdkClient.GetConnection(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestGetConnectionsAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetConnectionRequest request = new RocketMQ.Eventbridge.SDK.Models.GetConnectionRequest
+ {
+ ConnectionName = "new-connection",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetConnectionResponse res = await this._sdkClient.GetConnectionAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestSelectOneConnection()
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetConnectionRequest request = new RocketMQ.Eventbridge.SDK.Models.GetConnectionRequest
+ {
+ ConnectionName = "new-connection",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetConnectionResponse res = this._sdkClient.SelectOneConnection(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestSelectOneConnectionAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetConnectionRequest request = new RocketMQ.Eventbridge.SDK.Models.GetConnectionRequest
+ {
+ ConnectionName = "new-connection",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetConnectionResponse res = await this._sdkClient.SelectOneConnectionAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestListConnections()
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListConnectionsRequest request = new RocketMQ.Eventbridge.SDK.Models.ListConnectionsRequest
+ {
+ MaxResults = 2,
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListConnectionsResponse res = this._sdkClient.ListConnections(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestListConnectionsAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListConnectionsRequest request = new RocketMQ.Eventbridge.SDK.Models.ListConnectionsRequest
+ {
+ MaxResults = 2,
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListConnectionsResponse res = await this._sdkClient.ListConnectionsAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestListEnumsResponse()
+ {
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEnumsResponseResponse res = this._sdkClient.ListEnumsResponse();
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestListEnumsResponseAsync()
+ {
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEnumsResponseResponse res = await this._sdkClient.ListEnumsResponseAsync();
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ }
+}
diff --git a/sdk/demo/Connection/generated/csharp/core/Properties/AssemblyInfo.cs b/sdk/demo/Connection/generated/csharp/core/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..f8b5e0d
--- /dev/null
+++ b/sdk/demo/Connection/generated/csharp/core/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("eventbridge-sdk-demo")]
+[assembly: AssemblyDescription("open source eventbridge (20240701) SDK Demo Library for .NET")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("3a6bbd10-8a2f-11ef-8de3-c5c0a1b1f193")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("0.0.1.0")]
+[assembly: AssemblyFileVersion("0.0.1.0")]
diff --git a/sdk/demo/Connection/generated/csharp/core/sdkDemo.csproj b/sdk/demo/Connection/generated/csharp/core/sdkDemo.csproj
new file mode 100644
index 0000000..8ea12bc
--- /dev/null
+++ b/sdk/demo/Connection/generated/csharp/core/sdkDemo.csproj
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFrameworks>netstandard2.0;net45;netcoreapp8.0</TargetFrameworks>
+ <RootNamespace>RocketMQ.Eventbridge.Demo</RootNamespace>
+ <OutputType>Exe</OutputType>
+ <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
+ <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+ <AssemblyName>RocketMQ.Eventbridge.Demo</AssemblyName>
+ <Version/>
+ <LangVersion>5</LangVersion>
+ <Description>open source eventbridge (20240701) SDK Demo Library for .NET</Description>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
+ <DefineConstants>NETSTANDARD2_0</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <DefineConstants>NET45</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <Reference Include="mscorlib"/>
+ <Reference Include="System"/>
+ <Reference Include="System.Core"/>
+ <Reference Include="Microsoft.CSharp"/>
+ <Reference Include="System.Data"/>
+ <Reference Include="System.Web"/>
+ <Reference Include="System.Drawing"/>
+ <Reference Include="System.Security"/>
+ <Reference Include="System.Xml"/>
+ <Reference Include="System.Configuration"/>
+ <Reference Include="System.Net.Http"/>
+ </ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
+ </PackageReference>
+ <PackageReference Include="AlibabaCloud.TeaUtil" Version="0.1.19"/>
+ <PackageReference Include="AlibabaCloud.OpenApiClient" Version="0.1.12"/>
+ <PackageReference Include="RocketMQ.Eventbridge.SDK" Version="1.0.0"/>
+ <PackageReference Include="AlibabaCloud.TeaConsole" Version="0.1.0"/>
+ <PackageReference Include="Tea" Version="1.1.0"/>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/sdk/demo/Connection/generated/go/client/client.go b/sdk/demo/Connection/generated/go/client/client.go
new file mode 100644
index 0000000..f170ef7
--- /dev/null
+++ b/sdk/demo/Connection/generated/go/client/client.go
@@ -0,0 +1,309 @@
+// This file is auto-generated, don't edit it. Thanks.
+package client
+
+import (
+ openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
+ console "github.com/alibabacloud-go/tea-console/client"
+ util "github.com/alibabacloud-go/tea-utils/v2/service"
+ "github.com/alibabacloud-go/tea/tea"
+ sdkclient "github.com/org-apache-rocketmq/eventbridge-sdk/client"
+)
+
+type DemoClient struct {
+ SdkClient *sdkclient.Client
+ Endpoint *string
+}
+
+func NewClient() (*DemoClient, error) {
+ client := new(DemoClient)
+ err := client.Init()
+ return client, err
+}
+
+func (client *DemoClient) Init() (_err error) {
+ client.Endpoint = tea.String("127.0.0.1:7001")
+ config := &openapi.Config{
+ Endpoint: client.Endpoint,
+ }
+ client.SdkClient, _err = sdkclient.NewClient(config)
+ if _err != nil {
+ return _err
+ }
+
+ return nil
+}
+
+// Description:
+//
+// test func for Connection Controller apis:
+//
+// createConnection *
+//
+// deleteConnection *
+//
+// updateConnection *
+//
+// getConnection *
+//
+// selectOneConnection *
+//
+// listConnections *
+//
+// listEnumsResponse *
+func (client *DemoClient) TestCreateConnection() (_err error) {
+ request := &sdkclient.CreateConnectionRequest{
+ ConnectionName: tea.String("new-connection"),
+ NetworkParameters: &sdkclient.CreateConnectionRequestNetworkParameters{
+ NetworkType: tea.String("PublicNetwork"),
+ },
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.CreateConnection(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestDeleteConnection() (_err error) {
+ request := &sdkclient.DeleteConnectionRequest{
+ ConnectionName: tea.String("new-connection"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.DeleteConnection(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestUpdateConnection() (_err error) {
+ request := &sdkclient.UpdateConnectionRequest{
+ ConnectionName: tea.String("new-connection"),
+ NetworkParameters: &sdkclient.UpdateConnectionRequestNetworkParameters{
+ NetworkType: tea.String("PrivateNetwork"),
+ SecurityGroupId: tea.String("eb-167adad548759-security_grop/sg-bp1addad26peuh9qh9rtyb"),
+ VpcId: tea.String("eb-test/vpc-bp1symadadwnwgmqud"),
+ VswitcheId: tea.String("vsw-bp1iu4x7aeradadown1og8,vsw-bp193sqmadadlaszpeqbt2c"),
+ },
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.UpdateConnection(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestGetConnections() (_err error) {
+ request := &sdkclient.GetConnectionRequest{
+ ConnectionName: tea.String("new-connection"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.GetConnection(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestSelectOneConnection() (_err error) {
+ request := &sdkclient.GetConnectionRequest{
+ ConnectionName: tea.String("new-connection"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.SelectOneConnection(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestListConnections() (_err error) {
+ request := &sdkclient.ListConnectionsRequest{
+ MaxResults: tea.Int32(2),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.ListConnections(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestListEnumsResponse() (_err error) {
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.ListEnumsResponse()
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
diff --git a/sdk/demo/Connection/generated/go/go.mod b/sdk/demo/Connection/generated/go/go.mod
new file mode 100644
index 0000000..ff35824
--- /dev/null
+++ b/sdk/demo/Connection/generated/go/go.mod
@@ -0,0 +1,9 @@
+module client
+
+require (
+ github.com/alibabacloud-go/tea-utils/v2 v2.0.6
+ github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10
+ github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0
+ github.com/alibabacloud-go/tea-console v1.0.0
+)
+replace github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0 => ../../../../generated/go/
diff --git a/sdk/demo/Connection/generated/go/main.go b/sdk/demo/Connection/generated/go/main.go
new file mode 100644
index 0000000..6907074
--- /dev/null
+++ b/sdk/demo/Connection/generated/go/main.go
@@ -0,0 +1,11 @@
+package main
+
+import (
+ "client/client"
+)
+
+func main() {
+ demo := new(client.DemoClient)
+ demo.Init()
+ demo.TestListConnections()
+}
diff --git a/sdk/demo/Connection/generated/java/pom.xml b/sdk/demo/Connection/generated/java/pom.xml
new file mode 100644
index 0000000..ef0ec32
--- /dev/null
+++ b/sdk/demo/Connection/generated/java/pom.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>demo</artifactId>
+ <version>0.0.0</version>
+ <packaging>jar</packaging>
+ <name>demo</name>
+ <description>EventBridge SDK demo for Java
+ </description>
+ <url></url>
+ <licenses>
+ <license>
+ <name>The Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ </license>
+ </licenses>
+ <developers>
+ <developer>
+ <id>ludi</id>
+ <name>EventBridge SDK</name>
+ <email>zjuludi@gmail.com</email>
+ </developer>
+ </developers>
+ <distributionManagement>
+ <snapshotRepository>
+ <id>sonatype-nexus-snapshots</id>
+ <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ <repository>
+ <id>sonatype-nexus-staging</id>
+ <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+ </repository>
+ </distributionManagement>
+ <scm>
+ <connection></connection>
+ <developerConnection></developerConnection>
+ <url></url>
+ </scm>
+ <dependencies>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-util</artifactId>
+ <version>0.2.23</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-openapi</artifactId>
+ <version>0.3.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>sdk</artifactId>
+ <version>0.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-console</artifactId>
+ <version>0.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea</artifactId>
+ <version>1.1.14</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.6.1</version>
+ <configuration>
+ <source>8</source>
+ <target>8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.6</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.6.3</version>
+ <extensions>true</extensions>
+ <configuration>
+ <serverId>sonatype-nexus-staging</serverId>
+ <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
+ <autoReleaseAfterClose>true</autoReleaseAfterClose>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.1.1</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <doclint>none</doclint>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.22.1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
diff --git a/sdk/demo/Connection/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java b/sdk/demo/Connection/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
new file mode 100644
index 0000000..ce40ada
--- /dev/null
+++ b/sdk/demo/Connection/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
@@ -0,0 +1,176 @@
+// This file is auto-generated, don't edit it. Thanks.
+package org.apache.rocketmq.eventbridge.demo;
+
+import com.aliyun.tea.*;
+
+public class Demo {
+
+ public org.apache.rocketmq.eventbridge.sdk.Client _sdkClient;
+ public String _endpoint;
+ public Demo() throws Exception {
+ this._endpoint = "127.0.0.1:7001";
+ com.aliyun.teaopenapi.models.Config config = com.aliyun.teaopenapi.models.Config.build(TeaConverter.buildMap(
+ new TeaPair("endpoint", _endpoint)
+ ));
+ this._sdkClient = new org.apache.rocketmq.eventbridge.sdk.Client(config);
+ }
+
+ public static void main(String[] args) {
+ try {
+ Demo demo = new Demo();
+ demo.testListConnections();
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+
+ /**
+ * <b>description</b> :
+ * <p>test func for Connection Controller apis:
+ * createConnection *
+ * deleteConnection *
+ * updateConnection *
+ * getConnection *
+ * selectOneConnection *
+ * listConnections *
+ * listEnumsResponse *</p>
+ */
+ public void testCreateConnection() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.CreateConnectionRequest request = org.apache.rocketmq.eventbridge.sdk.models.CreateConnectionRequest.build(TeaConverter.buildMap(
+ new TeaPair("connectionName", "new-connection"),
+ new TeaPair("networkParameters", org.apache.rocketmq.eventbridge.sdk.models.CreateConnectionRequest.CreateConnectionRequestNetworkParameters.build(TeaConverter.buildMap(
+ new TeaPair("networkType", "PublicNetwork")
+ )))
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.CreateConnectionResponse res = _sdkClient.createConnection(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testDeleteConnection() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.DeleteConnectionRequest request = org.apache.rocketmq.eventbridge.sdk.models.DeleteConnectionRequest.build(TeaConverter.buildMap(
+ new TeaPair("connectionName", "new-connection")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.DeleteConnectionResponse res = _sdkClient.deleteConnection(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testUpdateConnection() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.UpdateConnectionRequest request = org.apache.rocketmq.eventbridge.sdk.models.UpdateConnectionRequest.build(TeaConverter.buildMap(
+ new TeaPair("connectionName", "new-connection"),
+ new TeaPair("networkParameters", org.apache.rocketmq.eventbridge.sdk.models.UpdateConnectionRequest.UpdateConnectionRequestNetworkParameters.build(TeaConverter.buildMap(
+ new TeaPair("networkType", "PrivateNetwork"),
+ new TeaPair("securityGroupId", "eb-167adad548759-security_grop/sg-bp1addad26peuh9qh9rtyb"),
+ new TeaPair("vpcId", "eb-test/vpc-bp1symadadwnwgmqud"),
+ new TeaPair("vswitcheId", "vsw-bp1iu4x7aeradadown1og8,vsw-bp193sqmadadlaszpeqbt2c")
+ )))
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.UpdateConnectionResponse res = _sdkClient.updateConnection(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testGetConnections() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.GetConnectionRequest request = org.apache.rocketmq.eventbridge.sdk.models.GetConnectionRequest.build(TeaConverter.buildMap(
+ new TeaPair("connectionName", "new-connection")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.GetConnectionResponse res = _sdkClient.getConnection(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testSelectOneConnection() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.GetConnectionRequest request = org.apache.rocketmq.eventbridge.sdk.models.GetConnectionRequest.build(TeaConverter.buildMap(
+ new TeaPair("connectionName", "new-connection")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.GetConnectionResponse res = _sdkClient.selectOneConnection(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testListConnections() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.ListConnectionsRequest request = org.apache.rocketmq.eventbridge.sdk.models.ListConnectionsRequest.build(TeaConverter.buildMap(
+ new TeaPair("maxResults", 2)
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.ListConnectionsResponse res = _sdkClient.listConnections(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testListEnumsResponse() throws Exception {
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.ListEnumsResponseResponse res = _sdkClient.listEnumsResponse();
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/Connection/generated/php/.gitignore b/sdk/demo/Connection/generated/php/.gitignore
new file mode 100644
index 0000000..89c7aa5
--- /dev/null
+++ b/sdk/demo/Connection/generated/php/.gitignore
@@ -0,0 +1,15 @@
+composer.phar
+/vendor/
+
+# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
+# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
+composer.lock
+
+.vscode/
+.idea
+.DS_Store
+
+cache/
+*.cache
+runtime/
+.php_cs.cache
diff --git a/sdk/demo/Connection/generated/php/.php_cs.dist b/sdk/demo/Connection/generated/php/.php_cs.dist
new file mode 100644
index 0000000..8617ec2
--- /dev/null
+++ b/sdk/demo/Connection/generated/php/.php_cs.dist
@@ -0,0 +1,65 @@
+<?php
+/*
+ * This document has been generated with
+ * https://mlocati.github.io/php-cs-fixer-configurator/#version:2.15|configurator
+ * you can change this configuration by importing this file.
+ */
+
+return PhpCsFixer\Config::create()
+ ->setRiskyAllowed(true)
+ ->setIndent(' ')
+ ->setRules([
+ '@PSR2' => true,
+ '@PhpCsFixer' => true,
+ '@Symfony:risky' => true,
+ 'concat_space' => ['spacing' => 'one'],
+ 'array_syntax' => ['syntax' => 'short'],
+ 'array_indentation' => true,
+ 'combine_consecutive_unsets' => true,
+ 'method_separation' => true,
+ 'single_quote' => true,
+ 'declare_equal_normalize' => true,
+ 'function_typehint_space' => true,
+ 'hash_to_slash_comment' => true,
+ 'include' => true,
+ 'lowercase_cast' => true,
+ 'no_multiline_whitespace_before_semicolons' => true,
+ 'no_leading_import_slash' => true,
+ 'no_multiline_whitespace_around_double_arrow' => true,
+ 'no_spaces_around_offset' => true,
+ 'no_unneeded_control_parentheses' => true,
+ 'no_unused_imports' => true,
+ 'no_whitespace_before_comma_in_array' => true,
+ 'no_whitespace_in_blank_line' => true,
+ 'object_operator_without_whitespace' => true,
+ 'single_blank_line_before_namespace' => true,
+ 'single_class_element_per_statement' => true,
+ 'space_after_semicolon' => true,
+ 'standardize_not_equals' => true,
+ 'ternary_operator_spaces' => true,
+ 'trailing_comma_in_multiline_array' => true,
+ 'trim_array_spaces' => true,
+ 'unary_operator_spaces' => true,
+ 'whitespace_after_comma_in_array' => true,
+ 'no_extra_consecutive_blank_lines' => [
+ 'curly_brace_block',
+ 'extra',
+ 'parenthesis_brace_block',
+ 'square_brace_block',
+ 'throw',
+ 'use',
+ ],
+ 'binary_operator_spaces' => [
+ 'align_double_arrow' => true,
+ 'align_equals' => true,
+ ],
+ 'braces' => [
+ 'allow_single_line_closure' => true,
+ ],
+ ])
+ ->setFinder(
+ PhpCsFixer\Finder::create()
+ ->exclude('vendor')
+ ->exclude('tests')
+ ->in(__DIR__)
+ );
diff --git a/sdk/demo/Connection/generated/php/autoload.php b/sdk/demo/Connection/generated/php/autoload.php
new file mode 100644
index 0000000..5bfe0a1
--- /dev/null
+++ b/sdk/demo/Connection/generated/php/autoload.php
@@ -0,0 +1,15 @@
+<?php
+
+if (file_exists(__DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php')) {
+ require_once __DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
+}
+
+spl_autoload_register(function ($class) {
+ $name = str_replace('RocketMQ\\Eventbridge\\SDK\\Demo\\', '', $class);
+ $file = __DIR__ . \DIRECTORY_SEPARATOR . 'src' . \DIRECTORY_SEPARATOR . str_replace('\\', \DIRECTORY_SEPARATOR, $name) . '.php';
+ if (file_exists($file)) {
+ require_once $file;
+ return true;
+ }
+ return false;
+});
diff --git a/sdk/demo/Connection/generated/php/composer.json b/sdk/demo/Connection/generated/php/composer.json
new file mode 100644
index 0000000..2edbfb8
--- /dev/null
+++ b/sdk/demo/Connection/generated/php/composer.json
@@ -0,0 +1,34 @@
+{
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "description": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "type": "library",
+ "license": "Apache-2.0",
+ "authors": [],
+ "require": {
+ "php": ">5.5",
+ "alibabacloud/tea-utils": "^0.2.21",
+ "alibabacloud/darabonba-openapi": "^0.2.12",
+ "rocketmq/eventbridge-sdk": "^0.0.0",
+ "alibabacloud/tea-console": "^0.1.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "RocketMQ\\Eventbridge\\SDK\\Demo\\": "src"
+ }
+ },
+ "scripts": {
+ "fixer": "php-cs-fixer fix ./"
+ },
+ "config": {
+ "sort-packages": true,
+ "preferred-install": "dist",
+ "optimize-autoloader": true
+ },
+ "prefer-stable": true,
+ "repositories": {
+ "rocketmq":{
+ "type" : "path",
+ "url": "../../../../generated/php"
+ }
+ }
+}
diff --git a/sdk/demo/Connection/generated/php/main.php b/sdk/demo/Connection/generated/php/main.php
new file mode 100644
index 0000000..858dd3d
--- /dev/null
+++ b/sdk/demo/Connection/generated/php/main.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace RocketMQ\Eventbridge\SDK\Demo;
+require 'vendor/autoload.php';
+include 'src/Demo.php';
+
+$demo = new Demo();
+$demo->testListConnections();
diff --git a/sdk/demo/Connection/generated/php/src/Demo.php b/sdk/demo/Connection/generated/php/src/Demo.php
new file mode 100644
index 0000000..e34d11f
--- /dev/null
+++ b/sdk/demo/Connection/generated/php/src/Demo.php
@@ -0,0 +1,207 @@
+<?php
+
+// This file is auto-generated, don't edit it. Thanks.
+namespace RocketMQ\Eventbridge\SDK\Demo;
+
+use RocketMQ\Eventbridge\SDK\SDKClient;
+use AlibabaCloud\Tea\Utils\Utils;
+use AlibabaCloud\Tea\Console\Console;
+use \Exception;
+use AlibabaCloud\Tea\Exception\TeaError;
+
+use Darabonba\OpenApi\Models\Config;
+use RocketMQ\Eventbridge\SDK\Models\CreateConnectionRequest;
+use RocketMQ\Eventbridge\SDK\Models\CreateConnectionRequest\networkParameters;
+use RocketMQ\Eventbridge\SDK\Models\DeleteConnectionRequest;
+use RocketMQ\Eventbridge\SDK\Models\UpdateConnectionRequest;
+use RocketMQ\Eventbridge\SDK\Models\GetConnectionRequest;
+use RocketMQ\Eventbridge\SDK\Models\ListConnectionsRequest;
+
+class Demo {
+ protected $_sdkClient;
+
+ protected $_endpoint;
+
+ public function __construct(){
+ $this->_endpoint = "127.0.0.1:7001";
+ $config = new Config([
+ "endpoint" => $this->_endpoint
+ ]);
+ $this->_sdkClient = new SDKClient($config);
+ }
+
+ /**
+ * test func for Connection Controller apis:
+ * * createConnection *
+ * * deleteConnection *
+ * * updateConnection *
+ * * getConnection *
+ * * selectOneConnection *
+ * * listConnections *
+ * * listEnumsResponse *
+ * @return void
+ */
+ public function testCreateConnection(){
+ $request = new CreateConnectionRequest([
+ "connectionName" => "new-connection",
+ "networkParameters" => new networkParameters([
+ "networkType" => "PublicNetwork"
+ ])
+ ]);
+ try {
+ $res = $this->_sdkClient->createConnection($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testDeleteConnection(){
+ $request = new DeleteConnectionRequest([
+ "connectionName" => "new-connection"
+ ]);
+ try {
+ $res = $this->_sdkClient->deleteConnection($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testUpdateConnection(){
+ $request = new UpdateConnectionRequest([
+ "connectionName" => "new-connection",
+ "networkParameters" => new \RocketMQ\Eventbridge\SDK\Models\UpdateConnectionRequest\networkParameters([
+ "networkType" => "PrivateNetwork",
+ "securityGroupId" => "eb-167adad548759-security_grop/sg-bp1addad26peuh9qh9rtyb",
+ "vpcId" => "eb-test/vpc-bp1symadadwnwgmqud",
+ "vswitcheId" => "vsw-bp1iu4x7aeradadown1og8,vsw-bp193sqmadadlaszpeqbt2c"
+ ])
+ ]);
+ try {
+ $res = $this->_sdkClient->updateConnection($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testGetConnections(){
+ $request = new GetConnectionRequest([
+ "connectionName" => "new-connection"
+ ]);
+ try {
+ $res = $this->_sdkClient->getConnection($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testSelectOneConnection(){
+ $request = new GetConnectionRequest([
+ "connectionName" => "new-connection"
+ ]);
+ try {
+ $res = $this->_sdkClient->selectOneConnection($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testListConnections(){
+ $request = new ListConnectionsRequest([
+ "maxResults" => 2
+ ]);
+ try {
+ $res = $this->_sdkClient->listConnections($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testListEnumsResponse(){
+ try {
+ $res = $this->_sdkClient->listEnumsResponse();
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/Connection/generated/python/.gitignore b/sdk/demo/Connection/generated/python/.gitignore
new file mode 100644
index 0000000..2bcfffa
--- /dev/null
+++ b/sdk/demo/Connection/generated/python/.gitignore
@@ -0,0 +1,5 @@
+runtime/
+.idea/
+.vscode/
+__pycache__/
+.pytest_cache/
\ No newline at end of file
diff --git a/sdk/demo/Connection/generated/python/rocketmq_eventbridge_demo/__init__.py b/sdk/demo/Connection/generated/python/rocketmq_eventbridge_demo/__init__.py
new file mode 100644
index 0000000..5becc17
--- /dev/null
+++ b/sdk/demo/Connection/generated/python/rocketmq_eventbridge_demo/__init__.py
@@ -0,0 +1 @@
+__version__ = "1.0.0"
diff --git a/sdk/demo/Connection/generated/python/rocketmq_eventbridge_demo/demo.py b/sdk/demo/Connection/generated/python/rocketmq_eventbridge_demo/demo.py
new file mode 100644
index 0000000..d23431d
--- /dev/null
+++ b/sdk/demo/Connection/generated/python/rocketmq_eventbridge_demo/demo.py
@@ -0,0 +1,235 @@
+# -*- coding: utf-8 -*-
+# This file is auto-generated, don't edit it. Thanks.
+from rocketmq_eventbridge.client import Client as SDKClientClient
+from alibabacloud_tea_openapi import models as open_api_models
+from rocketmq_eventbridge import models as sdkclient_models
+from alibabacloud_tea_console.client import Client as ConsoleClient
+from alibabacloud_tea_util.client import Client as UtilClient
+
+
+class Demo:
+ _sdk_client: SDKClientClient = None
+ _endpoint: str = None
+
+ def __init__(self):
+ self._endpoint = '127.0.0.1:7001'
+ config = open_api_models.Config(
+ endpoint=self._endpoint
+ )
+ self._sdk_client = SDKClientClient(config)
+
+ def test_create_connection(self) -> None:
+ """
+ test func for Connection Controller apis:
+ createConnection *\
+ deleteConnection *\
+ updateConnection *\
+ getConnection *\
+ selectOneConnection *\
+ listConnections *\
+ listEnumsResponse *\
+ """
+ request = sdkclient_models.CreateConnectionRequest(
+ connection_name='new-connection',
+ network_parameters=sdkclient_models.CreateConnectionRequestNetworkParameters(
+ network_type='PublicNetwork'
+ )
+ )
+ try:
+ res = self._sdk_client.create_connection(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_create_connection_async(self) -> None:
+ """
+ test func for Connection Controller apis:
+ createConnection *\
+ deleteConnection *\
+ updateConnection *\
+ getConnection *\
+ selectOneConnection *\
+ listConnections *\
+ listEnumsResponse *\
+ """
+ request = sdkclient_models.CreateConnectionRequest(
+ connection_name='new-connection',
+ network_parameters=sdkclient_models.CreateConnectionRequestNetworkParameters(
+ network_type='PublicNetwork'
+ )
+ )
+ try:
+ res = await self._sdk_client.create_connection_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_delete_connection(self) -> None:
+ request = sdkclient_models.DeleteConnectionRequest(
+ connection_name='new-connection'
+ )
+ try:
+ res = self._sdk_client.delete_connection(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_delete_connection_async(self) -> None:
+ request = sdkclient_models.DeleteConnectionRequest(
+ connection_name='new-connection'
+ )
+ try:
+ res = await self._sdk_client.delete_connection_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_update_connection(self) -> None:
+ request = sdkclient_models.UpdateConnectionRequest(
+ connection_name='new-connection',
+ network_parameters=sdkclient_models.UpdateConnectionRequestNetworkParameters(
+ network_type='PrivateNetwork',
+ security_group_id='eb-167adad548759-security_grop/sg-bp1addad26peuh9qh9rtyb',
+ vpc_id='eb-test/vpc-bp1symadadwnwgmqud',
+ vswitche_id='vsw-bp1iu4x7aeradadown1og8,vsw-bp193sqmadadlaszpeqbt2c'
+ )
+ )
+ try:
+ res = self._sdk_client.update_connection(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_update_connection_async(self) -> None:
+ request = sdkclient_models.UpdateConnectionRequest(
+ connection_name='new-connection',
+ network_parameters=sdkclient_models.UpdateConnectionRequestNetworkParameters(
+ network_type='PrivateNetwork',
+ security_group_id='eb-167adad548759-security_grop/sg-bp1addad26peuh9qh9rtyb',
+ vpc_id='eb-test/vpc-bp1symadadwnwgmqud',
+ vswitche_id='vsw-bp1iu4x7aeradadown1og8,vsw-bp193sqmadadlaszpeqbt2c'
+ )
+ )
+ try:
+ res = await self._sdk_client.update_connection_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_get_connections(self) -> None:
+ request = sdkclient_models.GetConnectionRequest(
+ connection_name='new-connection'
+ )
+ try:
+ res = self._sdk_client.get_connection(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_get_connections_async(self) -> None:
+ request = sdkclient_models.GetConnectionRequest(
+ connection_name='new-connection'
+ )
+ try:
+ res = await self._sdk_client.get_connection_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_select_one_connection(self) -> None:
+ request = sdkclient_models.GetConnectionRequest(
+ connection_name='new-connection'
+ )
+ try:
+ res = self._sdk_client.select_one_connection(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_select_one_connection_async(self) -> None:
+ request = sdkclient_models.GetConnectionRequest(
+ connection_name='new-connection'
+ )
+ try:
+ res = await self._sdk_client.select_one_connection_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_list_connections(self) -> None:
+ request = sdkclient_models.ListConnectionsRequest(
+ max_results=2
+ )
+ try:
+ res = self._sdk_client.list_connections(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_list_connections_async(self) -> None:
+ request = sdkclient_models.ListConnectionsRequest(
+ max_results=2
+ )
+ try:
+ res = await self._sdk_client.list_connections_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_list_enums_response(self) -> None:
+ try:
+ res = self._sdk_client.list_enums_response()
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_list_enums_response_async(self) -> None:
+ try:
+ res = await self._sdk_client.list_enums_response_async()
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+demo = Demo()
+demo.test_list_connections()
diff --git a/sdk/demo/Connection/generated/python/setup.py b/sdk/demo/Connection/generated/python/setup.py
new file mode 100644
index 0000000..3824f4c
--- /dev/null
+++ b/sdk/demo/Connection/generated/python/setup.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+"""
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+"""
+
+import os
+from setuptools import setup, find_packages
+
+"""
+setup module for rocketmq_eventbridge_demo.
+
+Created on 14/10/2024
+
+@author:
+"""
+
+PACKAGE = "rocketmq_eventbridge_demo"
+NAME = "rocketmq_eventbridge_demo" or "alibabacloud-package"
+DESCRIPTION = "Alibaba Cloud eventbridge (20240701) SDK Library for Python"
+AUTHOR = ""
+AUTHOR_EMAIL = ""
+URL = "unavailable"
+VERSION = __import__(PACKAGE).__version__
+REQUIRES = [
+ "alibabacloud_tea_util>=0.3.13, <1.0.0",
+ "alibabacloud_tea_openapi>=0.3.12, <1.0.0",
+ "rocketmq_eventbridge20240701>=0.0.0, <1.0.0",
+ "alibabacloud_tea_console>=0.0.1, <1.0.0"
+]
+
+LONG_DESCRIPTION = ''
+if os.path.exists('./README.md'):
+ with open("README.md", encoding='utf-8') as fp:
+ LONG_DESCRIPTION = fp.read()
+
+setup(
+ name=NAME,
+ version=VERSION,
+ description=DESCRIPTION,
+ long_description=LONG_DESCRIPTION,
+ long_description_content_type='text/markdown',
+ author=AUTHOR,
+ author_email=AUTHOR_EMAIL,
+ license="Apache License 2.0",
+ url=URL,
+ keywords=["rocketmq","eventbridge","demo"],
+ packages=find_packages(exclude=["tests*"]),
+ include_package_data=True,
+ platforms="any",
+ install_requires=REQUIRES,
+ python_requires=">=3.6",
+ classifiers=(
+ "Development Status :: 4 - Beta",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: Apache Software License",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.6",
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ "Topic :: Software Development"
+ )
+)
diff --git a/sdk/demo/Connection/generated/ts/package.json b/sdk/demo/Connection/generated/ts/package.json
new file mode 100644
index 0000000..be9669b
--- /dev/null
+++ b/sdk/demo/Connection/generated/ts/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "",
+ "version": "1.0.0",
+ "description": "",
+ "main": "dist/client.js",
+ "scripts": {
+ "test": "mocha --reporter spec --timeout 3000 test/*.test.js",
+ "test-cov": "nyc -e .ts -r=html -r=text -r=lcov npm run test",
+ "build": "tsc",
+ "prepublishOnly": "tsc"
+ },
+ "author": "",
+ "license": "ISC",
+ "devDependencies": {
+ "@types/node": "^12.12.26",
+ "nyc": "^15.0.0",
+ "source-map-support": "^0.5.16",
+ "ts-node": "^8.6.2",
+ "typescript": "^3.7.5"
+ },
+ "dependencies": {
+ "@alicloud/tea-typescript": "^1.7.1",
+ "@alicloud/tea-util": "^1.4.9",
+ "@alicloud/openapi-client": "^0.4.12",
+ "@alicloud/tea-console": "^1.0.0"
+ },
+ "files": [
+ "dist",
+ "src"
+ ]
+}
\ No newline at end of file
diff --git a/sdk/demo/Connection/generated/ts/src/client.ts b/sdk/demo/Connection/generated/ts/src/client.ts
new file mode 100644
index 0000000..eeb9b51
--- /dev/null
+++ b/sdk/demo/Connection/generated/ts/src/client.ts
@@ -0,0 +1,144 @@
+// This file is auto-generated, don't edit it
+import Util from '@alicloud/tea-util';
+import OpenApi, * as $OpenApi from '@alicloud/openapi-client';
+import SDKClient, * as $SDKClient from '../../../../../generated/ts/src/client';
+import Console from '@alicloud/tea-console';
+import * as $tea from '@alicloud/tea-typescript';
+
+
+export default class Client {
+ _sdkClient: SDKClient;
+ _endpoint: string;
+
+ constructor() {
+ this._endpoint = "127.0.0.1:7001";
+ let config = new $OpenApi.Config({
+ endpoint: this._endpoint,
+ });
+ this._sdkClient = new SDKClient(config);
+ }
+
+
+ /**
+ * @remarks
+ * test func for Connection Controller apis:
+ * createConnection *
+ * deleteConnection *
+ * updateConnection *
+ * getConnection *
+ * selectOneConnection *
+ * listConnections *
+ * listEnumsResponse *
+ */
+ async testCreateConnection(): Promise<void> {
+ let request = new $SDKClient.CreateConnectionRequest({
+ connectionName: "new-connection",
+ networkParameters: new $SDKClient.CreateConnectionRequestNetworkParameters({
+ networkType: "PublicNetwork",
+ }),
+ });
+ try {
+ let res = await this._sdkClient.createConnection(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testDeleteConnection(): Promise<void> {
+ let request = new $SDKClient.DeleteConnectionRequest({
+ connectionName: "new-connection",
+ });
+ try {
+ let res = await this._sdkClient.deleteConnection(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testUpdateConnection(): Promise<void> {
+ let request = new $SDKClient.UpdateConnectionRequest({
+ connectionName: "new-connection",
+ networkParameters: new $SDKClient.UpdateConnectionRequestNetworkParameters({
+ networkType: "PrivateNetwork",
+ securityGroupId: "eb-167adad548759-security_grop/sg-bp1addad26peuh9qh9rtyb",
+ vpcId: "eb-test/vpc-bp1symadadwnwgmqud",
+ vswitcheId: "vsw-bp1iu4x7aeradadown1og8,vsw-bp193sqmadadlaszpeqbt2c",
+ }),
+ });
+ try {
+ let res = await this._sdkClient.updateConnection(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testGetConnections(): Promise<void> {
+ let request = new $SDKClient.GetConnectionRequest({
+ connectionName: "new-connection",
+ });
+ try {
+ let res = await this._sdkClient.getConnection(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testSelectOneConnection(): Promise<void> {
+ let request = new $SDKClient.GetConnectionRequest({
+ connectionName: "new-connection",
+ });
+ try {
+ let res = await this._sdkClient.selectOneConnection(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testListConnections(): Promise<void> {
+ let request = new $SDKClient.ListConnectionsRequest({
+ maxResults: 2,
+ });
+ try {
+ let res = await this._sdkClient.listConnections(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testListEnumsResponse(): Promise<void> {
+ try {
+ let res = await this._sdkClient.listEnumsResponse();
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+}
diff --git a/sdk/demo/Connection/generated/ts/src/main.ts b/sdk/demo/Connection/generated/ts/src/main.ts
new file mode 100644
index 0000000..d24d3d7
--- /dev/null
+++ b/sdk/demo/Connection/generated/ts/src/main.ts
@@ -0,0 +1,4 @@
+import Client from './client'
+
+let c = new Client()
+c.testListConnections()
diff --git a/sdk/demo/Connection/generated/ts/tsconfig.json b/sdk/demo/Connection/generated/ts/tsconfig.json
new file mode 100644
index 0000000..ae66f5b
--- /dev/null
+++ b/sdk/demo/Connection/generated/ts/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "compilerOptions": {
+ "target": "es2017",
+ "module": "commonjs",
+ "declaration": true,
+ "sourceMap": true,
+ "outDir": "./dist",
+ "esModuleInterop": true
+ },
+ "include": [
+ "src/**/*"
+ ]
+}
\ No newline at end of file
diff --git a/sdk/demo/EventBus/Darafile b/sdk/demo/EventBus/Darafile
new file mode 100644
index 0000000..b15ddca
--- /dev/null
+++ b/sdk/demo/EventBus/Darafile
@@ -0,0 +1,66 @@
+{
+ "scope": "Demo",
+ "name": "demo",
+ "version": "0.0.0",
+ "main": "./demo.dara",
+ "libraries": {
+ "SDKClient" : "../../",
+ "Util": "darabonba:Util:*",
+ "OpenApi": "alibabacloud:OpenApi:*",
+ "OpenApiUtil": "alibabacloud:OpenApiUtil:*",
+ "Console": "darabonba:Console:*"
+ },
+ "java": {
+ "package": "org.apache.rocketmq.eventbridge.demo",
+ "className": "Demo",
+ "packageInfo": {
+ "groupId": "org.apache.rocketmq.eventbridge",
+ "artifactId": "demo",
+ "version": "0.0.0",
+ "description": "EventBridge SDK demo for Java",
+ "url": "",
+ "licenseName": "The Apache License, Version 2.0",
+ "licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt",
+ "developerId": "ludi",
+ "developerName": "EventBridge SDK",
+ "developerEmail": "zjuludi@gmail.com",
+ "scmConnection": "",
+ "scmDeveloperConnection": "",
+ "scmUrl": ""
+ }
+ },
+ "go": {
+ "clientName": "DemoClient"
+ },
+ "csharp": {
+ "className": "Demo",
+ "namespace": "RocketMQ.Eventbridge.Demo",
+ "packageInfo": {
+ "name": "sdkDemo",
+ "version": "0.0.0",
+ "title": "eventbridge-sdk-demo",
+ "description": "open source eventbridge (20240701) SDK Demo Library for .NET"
+ }
+ },
+ "php": {
+ "package": "RocketMQ.Eventbridge.SDK.Demo",
+ "clientName": "Demo",
+ "packageInfo": {
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "desc": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "github": "unavailable",
+ "files": {
+ "LICENSE": "../LICENSE"
+ }
+ }
+ },
+ "python": {
+ "package": "rocketmq_eventbridge_demo",
+ "clientName": "demo",
+ "packageInfo": {
+ "name": "rocketmq_eventbridge_demo",
+ "desc": "Alibaba Cloud eventbridge (20240701) SDK Library for Python",
+ "github": "unavailable"
+ }
+ }
+}
\ No newline at end of file
diff --git a/sdk/demo/EventBus/demo.dara b/sdk/demo/EventBus/demo.dara
new file mode 100644
index 0000000..15f96a2
--- /dev/null
+++ b/sdk/demo/EventBus/demo.dara
@@ -0,0 +1,91 @@
+import Util;
+import OpenApi;
+import SDKClient;
+import Console;
+
+type @sdkClient = SDKClient;
+type @endpoint = string;
+
+init(){
+ @endpoint = '127.0.0.1:7001';
+ var config = new OpenApi.Config{
+ endpoint = @endpoint
+ };
+ @sdkClient = new SDKClient(config);
+}
+
+/**
+ test func for EventBus Controller apis:
+ * createEventBus *
+ * getEventBus *
+ * deleteEventBus *
+ * listEventBuses *
+*/
+
+async function testCreateEventBus(): void {
+ var request = new SDKClient.CreateEventBusRequest{
+ eventBusName = 'newBus'
+ };
+
+ try {
+ var res = @sdkClient.createEventBus(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testDeleteEventBus(): void {
+ var request = new SDKClient.DeleteEventBusRequest{
+ eventBusName = 'newBus'
+ };
+
+ try {
+ var res = @sdkClient.deleteEventBus(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testGetEventBus(): void {
+ var request = new SDKClient.GetEventBusRequest{
+ eventBusName = 'newBus'
+ };
+
+ try {
+ var res = @sdkClient.getEventBus(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testListEventBuses(): void {
+ var request = new SDKClient.ListEventBusesRequest{
+ maxResults = 2
+ };
+
+ try {
+ var res = @sdkClient.listEventBuses(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
diff --git a/sdk/demo/EventBus/generated/csharp/core/Demo.cs b/sdk/demo/EventBus/generated/csharp/core/Demo.cs
new file mode 100644
index 0000000..0da97ae
--- /dev/null
+++ b/sdk/demo/EventBus/generated/csharp/core/Demo.cs
@@ -0,0 +1,300 @@
+// This file is auto-generated, don't edit it. Thanks.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+
+using Tea;
+using Tea.Utils;
+
+
+namespace RocketMQ.Eventbridge.Demo
+{
+ public class Demo
+ {
+ protected RocketMQ.Eventbridge.SDK.SDKClient _sdkClient;
+ protected string _endpoint;
+
+ public Demo()
+ {
+ this._endpoint = "127.0.0.1:7001";
+ AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config
+ {
+ Endpoint = _endpoint,
+ };
+ this._sdkClient = new RocketMQ.Eventbridge.SDK.SDKClient(config);
+ }
+
+ static void Main(string[] _args){
+ Demo demo = new Demo();
+ demo.TestListEventBuses();
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>test func for EventBus Controller apis:
+ /// createEventBus *
+ /// getEventBus *
+ /// deleteEventBus *
+ /// listEventBuses *</para>
+ /// </description>
+ public void TestCreateEventBus()
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventBusRequest request = new RocketMQ.Eventbridge.SDK.Models.CreateEventBusRequest
+ {
+ EventBusName = "newBus",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventBusResponse res = this._sdkClient.CreateEventBus(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>test func for EventBus Controller apis:
+ /// createEventBus *
+ /// getEventBus *
+ /// deleteEventBus *
+ /// listEventBuses *</para>
+ /// </description>
+ public async Task TestCreateEventBusAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventBusRequest request = new RocketMQ.Eventbridge.SDK.Models.CreateEventBusRequest
+ {
+ EventBusName = "newBus",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventBusResponse res = await this._sdkClient.CreateEventBusAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestDeleteEventBus()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventBusRequest request = new RocketMQ.Eventbridge.SDK.Models.DeleteEventBusRequest
+ {
+ EventBusName = "newBus",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventBusResponse res = this._sdkClient.DeleteEventBus(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestDeleteEventBusAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventBusRequest request = new RocketMQ.Eventbridge.SDK.Models.DeleteEventBusRequest
+ {
+ EventBusName = "newBus",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventBusResponse res = await this._sdkClient.DeleteEventBusAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestGetEventBus()
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetEventBusRequest request = new RocketMQ.Eventbridge.SDK.Models.GetEventBusRequest
+ {
+ EventBusName = "newBus",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetEventBusResponse res = this._sdkClient.GetEventBus(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestGetEventBusAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetEventBusRequest request = new RocketMQ.Eventbridge.SDK.Models.GetEventBusRequest
+ {
+ EventBusName = "newBus",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetEventBusResponse res = await this._sdkClient.GetEventBusAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestListEventBuses()
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventBusesRequest request = new RocketMQ.Eventbridge.SDK.Models.ListEventBusesRequest
+ {
+ MaxResults = 2,
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventBusesResponse res = this._sdkClient.ListEventBuses(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestListEventBusesAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventBusesRequest request = new RocketMQ.Eventbridge.SDK.Models.ListEventBusesRequest
+ {
+ MaxResults = 2,
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventBusesResponse res = await this._sdkClient.ListEventBusesAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ }
+}
diff --git a/sdk/demo/EventBus/generated/csharp/core/Properties/AssemblyInfo.cs b/sdk/demo/EventBus/generated/csharp/core/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..8aecd4a
--- /dev/null
+++ b/sdk/demo/EventBus/generated/csharp/core/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("eventbridge-sdk-demo")]
+[assembly: AssemblyDescription("open source eventbridge (20240701) SDK Demo Library for .NET")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("3dffb940-8a2f-11ef-8b25-0f1bdddbcdce")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("0.0.1.0")]
+[assembly: AssemblyFileVersion("0.0.1.0")]
diff --git a/sdk/demo/EventBus/generated/csharp/core/sdkDemo.csproj b/sdk/demo/EventBus/generated/csharp/core/sdkDemo.csproj
new file mode 100644
index 0000000..8ea12bc
--- /dev/null
+++ b/sdk/demo/EventBus/generated/csharp/core/sdkDemo.csproj
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFrameworks>netstandard2.0;net45;netcoreapp8.0</TargetFrameworks>
+ <RootNamespace>RocketMQ.Eventbridge.Demo</RootNamespace>
+ <OutputType>Exe</OutputType>
+ <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
+ <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+ <AssemblyName>RocketMQ.Eventbridge.Demo</AssemblyName>
+ <Version/>
+ <LangVersion>5</LangVersion>
+ <Description>open source eventbridge (20240701) SDK Demo Library for .NET</Description>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
+ <DefineConstants>NETSTANDARD2_0</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <DefineConstants>NET45</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <Reference Include="mscorlib"/>
+ <Reference Include="System"/>
+ <Reference Include="System.Core"/>
+ <Reference Include="Microsoft.CSharp"/>
+ <Reference Include="System.Data"/>
+ <Reference Include="System.Web"/>
+ <Reference Include="System.Drawing"/>
+ <Reference Include="System.Security"/>
+ <Reference Include="System.Xml"/>
+ <Reference Include="System.Configuration"/>
+ <Reference Include="System.Net.Http"/>
+ </ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
+ </PackageReference>
+ <PackageReference Include="AlibabaCloud.TeaUtil" Version="0.1.19"/>
+ <PackageReference Include="AlibabaCloud.OpenApiClient" Version="0.1.12"/>
+ <PackageReference Include="RocketMQ.Eventbridge.SDK" Version="1.0.0"/>
+ <PackageReference Include="AlibabaCloud.TeaConsole" Version="0.1.0"/>
+ <PackageReference Include="Tea" Version="1.1.0"/>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/sdk/demo/EventBus/generated/go/client/client.go b/sdk/demo/EventBus/generated/go/client/client.go
new file mode 100644
index 0000000..68f9255
--- /dev/null
+++ b/sdk/demo/EventBus/generated/go/client/client.go
@@ -0,0 +1,189 @@
+// This file is auto-generated, don't edit it. Thanks.
+package client
+
+import (
+ openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
+ console "github.com/alibabacloud-go/tea-console/client"
+ util "github.com/alibabacloud-go/tea-utils/v2/service"
+ "github.com/alibabacloud-go/tea/tea"
+ sdkclient "github.com/org-apache-rocketmq/eventbridge-sdk/client"
+)
+
+type DemoClient struct {
+ SdkClient *sdkclient.Client
+ Endpoint *string
+}
+
+func NewClient() (*DemoClient, error) {
+ client := new(DemoClient)
+ err := client.Init()
+ return client, err
+}
+
+func (client *DemoClient) Init() (_err error) {
+ client.Endpoint = tea.String("127.0.0.1:7001")
+ config := &openapi.Config{
+ Endpoint: client.Endpoint,
+ }
+ client.SdkClient, _err = sdkclient.NewClient(config)
+ if _err != nil {
+ return _err
+ }
+
+ return nil
+}
+
+// Description:
+//
+// test func for EventBus Controller apis:
+//
+// createEventBus *
+//
+// getEventBus *
+//
+// deleteEventBus *
+//
+// listEventBuses *
+func (client *DemoClient) TestCreateEventBus() (_err error) {
+ request := &sdkclient.CreateEventBusRequest{
+ EventBusName: tea.String("newBus"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.CreateEventBus(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestDeleteEventBus() (_err error) {
+ request := &sdkclient.DeleteEventBusRequest{
+ EventBusName: tea.String("newBus"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.DeleteEventBus(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestGetEventBus() (_err error) {
+ request := &sdkclient.GetEventBusRequest{
+ EventBusName: tea.String("newBus"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.GetEventBus(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestListEventBuses() (_err error) {
+ request := &sdkclient.ListEventBusesRequest{
+ MaxResults: tea.Int32(2),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.ListEventBuses(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
diff --git a/sdk/demo/EventBus/generated/go/go.mod b/sdk/demo/EventBus/generated/go/go.mod
new file mode 100644
index 0000000..ff35824
--- /dev/null
+++ b/sdk/demo/EventBus/generated/go/go.mod
@@ -0,0 +1,9 @@
+module client
+
+require (
+ github.com/alibabacloud-go/tea-utils/v2 v2.0.6
+ github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10
+ github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0
+ github.com/alibabacloud-go/tea-console v1.0.0
+)
+replace github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0 => ../../../../generated/go/
diff --git a/sdk/demo/EventBus/generated/go/main.go b/sdk/demo/EventBus/generated/go/main.go
new file mode 100644
index 0000000..4e311a2
--- /dev/null
+++ b/sdk/demo/EventBus/generated/go/main.go
@@ -0,0 +1,11 @@
+package main
+
+import (
+ "client/client"
+)
+
+func main() {
+ demo := new(client.DemoClient)
+ demo.Init()
+ demo.TestCreateEventBus()
+}
diff --git a/sdk/demo/EventBus/generated/java/pom.xml b/sdk/demo/EventBus/generated/java/pom.xml
new file mode 100644
index 0000000..ef0ec32
--- /dev/null
+++ b/sdk/demo/EventBus/generated/java/pom.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>demo</artifactId>
+ <version>0.0.0</version>
+ <packaging>jar</packaging>
+ <name>demo</name>
+ <description>EventBridge SDK demo for Java
+ </description>
+ <url></url>
+ <licenses>
+ <license>
+ <name>The Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ </license>
+ </licenses>
+ <developers>
+ <developer>
+ <id>ludi</id>
+ <name>EventBridge SDK</name>
+ <email>zjuludi@gmail.com</email>
+ </developer>
+ </developers>
+ <distributionManagement>
+ <snapshotRepository>
+ <id>sonatype-nexus-snapshots</id>
+ <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ <repository>
+ <id>sonatype-nexus-staging</id>
+ <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+ </repository>
+ </distributionManagement>
+ <scm>
+ <connection></connection>
+ <developerConnection></developerConnection>
+ <url></url>
+ </scm>
+ <dependencies>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-util</artifactId>
+ <version>0.2.23</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-openapi</artifactId>
+ <version>0.3.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>sdk</artifactId>
+ <version>0.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-console</artifactId>
+ <version>0.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea</artifactId>
+ <version>1.1.14</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.6.1</version>
+ <configuration>
+ <source>8</source>
+ <target>8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.6</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.6.3</version>
+ <extensions>true</extensions>
+ <configuration>
+ <serverId>sonatype-nexus-staging</serverId>
+ <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
+ <autoReleaseAfterClose>true</autoReleaseAfterClose>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.1.1</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <doclint>none</doclint>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.22.1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
diff --git a/sdk/demo/EventBus/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java b/sdk/demo/EventBus/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
new file mode 100644
index 0000000..075a331
--- /dev/null
+++ b/sdk/demo/EventBus/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
@@ -0,0 +1,110 @@
+// This file is auto-generated, don't edit it. Thanks.
+package org.apache.rocketmq.eventbridge.demo;
+
+import com.aliyun.tea.*;
+
+public class Demo {
+
+ public org.apache.rocketmq.eventbridge.sdk.Client _sdkClient;
+ public String _endpoint;
+ public Demo() throws Exception {
+ this._endpoint = "127.0.0.1:7001";
+ com.aliyun.teaopenapi.models.Config config = com.aliyun.teaopenapi.models.Config.build(TeaConverter.buildMap(
+ new TeaPair("endpoint", _endpoint)
+ ));
+ this._sdkClient = new org.apache.rocketmq.eventbridge.sdk.Client(config);
+ }
+
+ public static void main(String[] args) {
+ try {
+ Demo demo = new Demo();
+ demo.testListEventBuses();
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+
+ /**
+ * <b>description</b> :
+ * <p>test func for EventBus Controller apis:
+ * createEventBus *
+ * getEventBus *
+ * deleteEventBus *
+ * listEventBuses *</p>
+ */
+ public void testCreateEventBus() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.CreateEventBusRequest request = org.apache.rocketmq.eventbridge.sdk.models.CreateEventBusRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.CreateEventBusResponse res = _sdkClient.createEventBus(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testDeleteEventBus() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.DeleteEventBusRequest request = org.apache.rocketmq.eventbridge.sdk.models.DeleteEventBusRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.DeleteEventBusResponse res = _sdkClient.deleteEventBus(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testGetEventBus() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.GetEventBusRequest request = org.apache.rocketmq.eventbridge.sdk.models.GetEventBusRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.GetEventBusResponse res = _sdkClient.getEventBus(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testListEventBuses() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.ListEventBusesRequest request = org.apache.rocketmq.eventbridge.sdk.models.ListEventBusesRequest.build(TeaConverter.buildMap(
+ new TeaPair("maxResults", 2)
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.ListEventBusesResponse res = _sdkClient.listEventBuses(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/EventBus/generated/php/.gitignore b/sdk/demo/EventBus/generated/php/.gitignore
new file mode 100644
index 0000000..89c7aa5
--- /dev/null
+++ b/sdk/demo/EventBus/generated/php/.gitignore
@@ -0,0 +1,15 @@
+composer.phar
+/vendor/
+
+# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
+# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
+composer.lock
+
+.vscode/
+.idea
+.DS_Store
+
+cache/
+*.cache
+runtime/
+.php_cs.cache
diff --git a/sdk/demo/EventBus/generated/php/.php_cs.dist b/sdk/demo/EventBus/generated/php/.php_cs.dist
new file mode 100644
index 0000000..8617ec2
--- /dev/null
+++ b/sdk/demo/EventBus/generated/php/.php_cs.dist
@@ -0,0 +1,65 @@
+<?php
+/*
+ * This document has been generated with
+ * https://mlocati.github.io/php-cs-fixer-configurator/#version:2.15|configurator
+ * you can change this configuration by importing this file.
+ */
+
+return PhpCsFixer\Config::create()
+ ->setRiskyAllowed(true)
+ ->setIndent(' ')
+ ->setRules([
+ '@PSR2' => true,
+ '@PhpCsFixer' => true,
+ '@Symfony:risky' => true,
+ 'concat_space' => ['spacing' => 'one'],
+ 'array_syntax' => ['syntax' => 'short'],
+ 'array_indentation' => true,
+ 'combine_consecutive_unsets' => true,
+ 'method_separation' => true,
+ 'single_quote' => true,
+ 'declare_equal_normalize' => true,
+ 'function_typehint_space' => true,
+ 'hash_to_slash_comment' => true,
+ 'include' => true,
+ 'lowercase_cast' => true,
+ 'no_multiline_whitespace_before_semicolons' => true,
+ 'no_leading_import_slash' => true,
+ 'no_multiline_whitespace_around_double_arrow' => true,
+ 'no_spaces_around_offset' => true,
+ 'no_unneeded_control_parentheses' => true,
+ 'no_unused_imports' => true,
+ 'no_whitespace_before_comma_in_array' => true,
+ 'no_whitespace_in_blank_line' => true,
+ 'object_operator_without_whitespace' => true,
+ 'single_blank_line_before_namespace' => true,
+ 'single_class_element_per_statement' => true,
+ 'space_after_semicolon' => true,
+ 'standardize_not_equals' => true,
+ 'ternary_operator_spaces' => true,
+ 'trailing_comma_in_multiline_array' => true,
+ 'trim_array_spaces' => true,
+ 'unary_operator_spaces' => true,
+ 'whitespace_after_comma_in_array' => true,
+ 'no_extra_consecutive_blank_lines' => [
+ 'curly_brace_block',
+ 'extra',
+ 'parenthesis_brace_block',
+ 'square_brace_block',
+ 'throw',
+ 'use',
+ ],
+ 'binary_operator_spaces' => [
+ 'align_double_arrow' => true,
+ 'align_equals' => true,
+ ],
+ 'braces' => [
+ 'allow_single_line_closure' => true,
+ ],
+ ])
+ ->setFinder(
+ PhpCsFixer\Finder::create()
+ ->exclude('vendor')
+ ->exclude('tests')
+ ->in(__DIR__)
+ );
diff --git a/sdk/demo/EventBus/generated/php/autoload.php b/sdk/demo/EventBus/generated/php/autoload.php
new file mode 100644
index 0000000..5bfe0a1
--- /dev/null
+++ b/sdk/demo/EventBus/generated/php/autoload.php
@@ -0,0 +1,15 @@
+<?php
+
+if (file_exists(__DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php')) {
+ require_once __DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
+}
+
+spl_autoload_register(function ($class) {
+ $name = str_replace('RocketMQ\\Eventbridge\\SDK\\Demo\\', '', $class);
+ $file = __DIR__ . \DIRECTORY_SEPARATOR . 'src' . \DIRECTORY_SEPARATOR . str_replace('\\', \DIRECTORY_SEPARATOR, $name) . '.php';
+ if (file_exists($file)) {
+ require_once $file;
+ return true;
+ }
+ return false;
+});
diff --git a/sdk/demo/EventBus/generated/php/composer.json b/sdk/demo/EventBus/generated/php/composer.json
new file mode 100644
index 0000000..2edbfb8
--- /dev/null
+++ b/sdk/demo/EventBus/generated/php/composer.json
@@ -0,0 +1,34 @@
+{
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "description": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "type": "library",
+ "license": "Apache-2.0",
+ "authors": [],
+ "require": {
+ "php": ">5.5",
+ "alibabacloud/tea-utils": "^0.2.21",
+ "alibabacloud/darabonba-openapi": "^0.2.12",
+ "rocketmq/eventbridge-sdk": "^0.0.0",
+ "alibabacloud/tea-console": "^0.1.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "RocketMQ\\Eventbridge\\SDK\\Demo\\": "src"
+ }
+ },
+ "scripts": {
+ "fixer": "php-cs-fixer fix ./"
+ },
+ "config": {
+ "sort-packages": true,
+ "preferred-install": "dist",
+ "optimize-autoloader": true
+ },
+ "prefer-stable": true,
+ "repositories": {
+ "rocketmq":{
+ "type" : "path",
+ "url": "../../../../generated/php"
+ }
+ }
+}
diff --git a/sdk/demo/EventBus/generated/php/main.php b/sdk/demo/EventBus/generated/php/main.php
new file mode 100644
index 0000000..626ca3e
--- /dev/null
+++ b/sdk/demo/EventBus/generated/php/main.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace RocketMQ\Eventbridge\SDK\Demo;
+require 'vendor/autoload.php';
+include 'src/Demo.php';
+
+$demo = new Demo();
+$demo->testListEventBuses();
diff --git a/sdk/demo/EventBus/generated/php/src/Demo.php b/sdk/demo/EventBus/generated/php/src/Demo.php
new file mode 100644
index 0000000..38c66b1
--- /dev/null
+++ b/sdk/demo/EventBus/generated/php/src/Demo.php
@@ -0,0 +1,127 @@
+<?php
+
+// This file is auto-generated, don't edit it. Thanks.
+namespace RocketMQ\Eventbridge\SDK\Demo;
+
+use RocketMQ\Eventbridge\SDK\SDKClient;
+use AlibabaCloud\Tea\Utils\Utils;
+use AlibabaCloud\Tea\Console\Console;
+use \Exception;
+use AlibabaCloud\Tea\Exception\TeaError;
+
+use Darabonba\OpenApi\Models\Config;
+use RocketMQ\Eventbridge\SDK\Models\CreateEventBusRequest;
+use RocketMQ\Eventbridge\SDK\Models\DeleteEventBusRequest;
+use RocketMQ\Eventbridge\SDK\Models\GetEventBusRequest;
+use RocketMQ\Eventbridge\SDK\Models\ListEventBusesRequest;
+
+class Demo {
+ protected $_sdkClient;
+
+ protected $_endpoint;
+
+ public function __construct(){
+ $this->_endpoint = "127.0.0.1:7001";
+ $config = new Config([
+ "endpoint" => $this->_endpoint
+ ]);
+ $this->_sdkClient = new SDKClient($config);
+ }
+
+ /**
+ * test func for EventBus Controller apis:
+ * * createEventBus *
+ * * getEventBus *
+ * * deleteEventBus *
+ * * listEventBuses *
+ * @return void
+ */
+ public function testCreateEventBus(){
+ $request = new CreateEventBusRequest([
+ "eventBusName" => "newBus"
+ ]);
+ try {
+ $res = $this->_sdkClient->createEventBus($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testDeleteEventBus(){
+ $request = new DeleteEventBusRequest([
+ "eventBusName" => "newBus"
+ ]);
+ try {
+ $res = $this->_sdkClient->deleteEventBus($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testGetEventBus(){
+ $request = new GetEventBusRequest([
+ "eventBusName" => "newBus"
+ ]);
+ try {
+ $res = $this->_sdkClient->getEventBus($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testListEventBuses(){
+ $request = new ListEventBusesRequest([
+ "maxResults" => 2
+ ]);
+ try {
+ $res = $this->_sdkClient->listEventBuses($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/EventBus/generated/python/.gitignore b/sdk/demo/EventBus/generated/python/.gitignore
new file mode 100644
index 0000000..2bcfffa
--- /dev/null
+++ b/sdk/demo/EventBus/generated/python/.gitignore
@@ -0,0 +1,5 @@
+runtime/
+.idea/
+.vscode/
+__pycache__/
+.pytest_cache/
\ No newline at end of file
diff --git a/sdk/demo/EventBus/generated/python/rocketmq_eventbridge_demo/__init__.py b/sdk/demo/EventBus/generated/python/rocketmq_eventbridge_demo/__init__.py
new file mode 100644
index 0000000..5becc17
--- /dev/null
+++ b/sdk/demo/EventBus/generated/python/rocketmq_eventbridge_demo/__init__.py
@@ -0,0 +1 @@
+__version__ = "1.0.0"
diff --git a/sdk/demo/EventBus/generated/python/rocketmq_eventbridge_demo/demo.py b/sdk/demo/EventBus/generated/python/rocketmq_eventbridge_demo/demo.py
new file mode 100644
index 0000000..4101592
--- /dev/null
+++ b/sdk/demo/EventBus/generated/python/rocketmq_eventbridge_demo/demo.py
@@ -0,0 +1,139 @@
+# -*- coding: utf-8 -*-
+# This file is auto-generated, don't edit it. Thanks.
+from rocketmq_eventbridge.client import Client as SDKClientClient
+from alibabacloud_tea_openapi import models as open_api_models
+from rocketmq_eventbridge import models as sdkclient_models
+from alibabacloud_tea_console.client import Client as ConsoleClient
+from alibabacloud_tea_util.client import Client as UtilClient
+
+
+class Demo:
+ _sdk_client: SDKClientClient = None
+ _endpoint: str = None
+
+ def __init__(self):
+ self._endpoint = '127.0.0.1:7001'
+ config = open_api_models.Config(
+ endpoint=self._endpoint
+ )
+ self._sdk_client = SDKClientClient(config)
+
+ def test_create_event_bus(self) -> None:
+ """
+ test func for EventBus Controller apis:
+ createEventBus *\
+ getEventBus *\
+ deleteEventBus *\
+ listEventBuses *\
+ """
+ request = sdkclient_models.CreateEventBusRequest(
+ event_bus_name='newBus'
+ )
+ try:
+ res = self._sdk_client.create_event_bus(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_create_event_bus_async(self) -> None:
+ """
+ test func for EventBus Controller apis:
+ createEventBus *\
+ getEventBus *\
+ deleteEventBus *\
+ listEventBuses *\
+ """
+ request = sdkclient_models.CreateEventBusRequest(
+ event_bus_name='newBus'
+ )
+ try:
+ res = await self._sdk_client.create_event_bus_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_delete_event_bus(self) -> None:
+ request = sdkclient_models.DeleteEventBusRequest(
+ event_bus_name='newBus'
+ )
+ try:
+ res = self._sdk_client.delete_event_bus(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_delete_event_bus_async(self) -> None:
+ request = sdkclient_models.DeleteEventBusRequest(
+ event_bus_name='newBus'
+ )
+ try:
+ res = await self._sdk_client.delete_event_bus_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_get_event_bus(self) -> None:
+ request = sdkclient_models.GetEventBusRequest(
+ event_bus_name='newBus'
+ )
+ try:
+ res = self._sdk_client.get_event_bus(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_get_event_bus_async(self) -> None:
+ request = sdkclient_models.GetEventBusRequest(
+ event_bus_name='newBus'
+ )
+ try:
+ res = await self._sdk_client.get_event_bus_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_list_event_buses(self) -> None:
+ request = sdkclient_models.ListEventBusesRequest(
+ max_results=2
+ )
+ try:
+ res = self._sdk_client.list_event_buses(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_list_event_buses_async(self) -> None:
+ request = sdkclient_models.ListEventBusesRequest(
+ max_results=2
+ )
+ try:
+ res = await self._sdk_client.list_event_buses_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+demo = Demo()
+demo.test_list_event_buses()
diff --git a/sdk/demo/EventBus/generated/python/setup.py b/sdk/demo/EventBus/generated/python/setup.py
new file mode 100644
index 0000000..3824f4c
--- /dev/null
+++ b/sdk/demo/EventBus/generated/python/setup.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+"""
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+"""
+
+import os
+from setuptools import setup, find_packages
+
+"""
+setup module for rocketmq_eventbridge_demo.
+
+Created on 14/10/2024
+
+@author:
+"""
+
+PACKAGE = "rocketmq_eventbridge_demo"
+NAME = "rocketmq_eventbridge_demo" or "alibabacloud-package"
+DESCRIPTION = "Alibaba Cloud eventbridge (20240701) SDK Library for Python"
+AUTHOR = ""
+AUTHOR_EMAIL = ""
+URL = "unavailable"
+VERSION = __import__(PACKAGE).__version__
+REQUIRES = [
+ "alibabacloud_tea_util>=0.3.13, <1.0.0",
+ "alibabacloud_tea_openapi>=0.3.12, <1.0.0",
+ "rocketmq_eventbridge20240701>=0.0.0, <1.0.0",
+ "alibabacloud_tea_console>=0.0.1, <1.0.0"
+]
+
+LONG_DESCRIPTION = ''
+if os.path.exists('./README.md'):
+ with open("README.md", encoding='utf-8') as fp:
+ LONG_DESCRIPTION = fp.read()
+
+setup(
+ name=NAME,
+ version=VERSION,
+ description=DESCRIPTION,
+ long_description=LONG_DESCRIPTION,
+ long_description_content_type='text/markdown',
+ author=AUTHOR,
+ author_email=AUTHOR_EMAIL,
+ license="Apache License 2.0",
+ url=URL,
+ keywords=["rocketmq","eventbridge","demo"],
+ packages=find_packages(exclude=["tests*"]),
+ include_package_data=True,
+ platforms="any",
+ install_requires=REQUIRES,
+ python_requires=">=3.6",
+ classifiers=(
+ "Development Status :: 4 - Beta",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: Apache Software License",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.6",
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ "Topic :: Software Development"
+ )
+)
diff --git a/sdk/demo/EventBus/generated/ts/package.json b/sdk/demo/EventBus/generated/ts/package.json
new file mode 100644
index 0000000..be9669b
--- /dev/null
+++ b/sdk/demo/EventBus/generated/ts/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "",
+ "version": "1.0.0",
+ "description": "",
+ "main": "dist/client.js",
+ "scripts": {
+ "test": "mocha --reporter spec --timeout 3000 test/*.test.js",
+ "test-cov": "nyc -e .ts -r=html -r=text -r=lcov npm run test",
+ "build": "tsc",
+ "prepublishOnly": "tsc"
+ },
+ "author": "",
+ "license": "ISC",
+ "devDependencies": {
+ "@types/node": "^12.12.26",
+ "nyc": "^15.0.0",
+ "source-map-support": "^0.5.16",
+ "ts-node": "^8.6.2",
+ "typescript": "^3.7.5"
+ },
+ "dependencies": {
+ "@alicloud/tea-typescript": "^1.7.1",
+ "@alicloud/tea-util": "^1.4.9",
+ "@alicloud/openapi-client": "^0.4.12",
+ "@alicloud/tea-console": "^1.0.0"
+ },
+ "files": [
+ "dist",
+ "src"
+ ]
+}
\ No newline at end of file
diff --git a/sdk/demo/EventBus/generated/ts/src/client.ts b/sdk/demo/EventBus/generated/ts/src/client.ts
new file mode 100644
index 0000000..1696e9c
--- /dev/null
+++ b/sdk/demo/EventBus/generated/ts/src/client.ts
@@ -0,0 +1,90 @@
+// This file is auto-generated, don't edit it
+import Util from '@alicloud/tea-util';
+import OpenApi, * as $OpenApi from '@alicloud/openapi-client';
+import SDKClient, * as $SDKClient from '../../../../../generated/ts/src/client';
+import Console from '@alicloud/tea-console';
+import * as $tea from '@alicloud/tea-typescript';
+
+
+export default class Client {
+ _sdkClient: SDKClient;
+ _endpoint: string;
+
+ constructor() {
+ this._endpoint = "127.0.0.1:7001";
+ let config = new $OpenApi.Config({
+ endpoint: this._endpoint,
+ });
+ this._sdkClient = new SDKClient(config);
+ }
+
+
+ /**
+ * @remarks
+ * test func for EventBus Controller apis:
+ * createEventBus *
+ * getEventBus *
+ * deleteEventBus *
+ * listEventBuses *
+ */
+ async testCreateEventBus(): Promise<void> {
+ let request = new $SDKClient.CreateEventBusRequest({
+ eventBusName: "newBus",
+ });
+ try {
+ let res = await this._sdkClient.createEventBus(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testDeleteEventBus(): Promise<void> {
+ let request = new $SDKClient.DeleteEventBusRequest({
+ eventBusName: "newBus",
+ });
+ try {
+ let res = await this._sdkClient.deleteEventBus(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testGetEventBus(): Promise<void> {
+ let request = new $SDKClient.GetEventBusRequest({
+ eventBusName: "newBus",
+ });
+ try {
+ let res = await this._sdkClient.getEventBus(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testListEventBuses(): Promise<void> {
+ let request = new $SDKClient.ListEventBusesRequest({
+ maxResults: 2,
+ });
+ try {
+ let res = await this._sdkClient.listEventBuses(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+}
diff --git a/sdk/demo/EventBus/generated/ts/src/main.ts b/sdk/demo/EventBus/generated/ts/src/main.ts
new file mode 100644
index 0000000..9d3e5c1
--- /dev/null
+++ b/sdk/demo/EventBus/generated/ts/src/main.ts
@@ -0,0 +1,4 @@
+import Client from './client'
+
+let c = new Client()
+c.testListEventBuses()
\ No newline at end of file
diff --git a/sdk/demo/EventBus/generated/ts/tsconfig.json b/sdk/demo/EventBus/generated/ts/tsconfig.json
new file mode 100644
index 0000000..ae66f5b
--- /dev/null
+++ b/sdk/demo/EventBus/generated/ts/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "compilerOptions": {
+ "target": "es2017",
+ "module": "commonjs",
+ "declaration": true,
+ "sourceMap": true,
+ "outDir": "./dist",
+ "esModuleInterop": true
+ },
+ "include": [
+ "src/**/*"
+ ]
+}
\ No newline at end of file
diff --git a/sdk/demo/EventData/Darafile b/sdk/demo/EventData/Darafile
new file mode 100644
index 0000000..b15ddca
--- /dev/null
+++ b/sdk/demo/EventData/Darafile
@@ -0,0 +1,66 @@
+{
+ "scope": "Demo",
+ "name": "demo",
+ "version": "0.0.0",
+ "main": "./demo.dara",
+ "libraries": {
+ "SDKClient" : "../../",
+ "Util": "darabonba:Util:*",
+ "OpenApi": "alibabacloud:OpenApi:*",
+ "OpenApiUtil": "alibabacloud:OpenApiUtil:*",
+ "Console": "darabonba:Console:*"
+ },
+ "java": {
+ "package": "org.apache.rocketmq.eventbridge.demo",
+ "className": "Demo",
+ "packageInfo": {
+ "groupId": "org.apache.rocketmq.eventbridge",
+ "artifactId": "demo",
+ "version": "0.0.0",
+ "description": "EventBridge SDK demo for Java",
+ "url": "",
+ "licenseName": "The Apache License, Version 2.0",
+ "licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt",
+ "developerId": "ludi",
+ "developerName": "EventBridge SDK",
+ "developerEmail": "zjuludi@gmail.com",
+ "scmConnection": "",
+ "scmDeveloperConnection": "",
+ "scmUrl": ""
+ }
+ },
+ "go": {
+ "clientName": "DemoClient"
+ },
+ "csharp": {
+ "className": "Demo",
+ "namespace": "RocketMQ.Eventbridge.Demo",
+ "packageInfo": {
+ "name": "sdkDemo",
+ "version": "0.0.0",
+ "title": "eventbridge-sdk-demo",
+ "description": "open source eventbridge (20240701) SDK Demo Library for .NET"
+ }
+ },
+ "php": {
+ "package": "RocketMQ.Eventbridge.SDK.Demo",
+ "clientName": "Demo",
+ "packageInfo": {
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "desc": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "github": "unavailable",
+ "files": {
+ "LICENSE": "../LICENSE"
+ }
+ }
+ },
+ "python": {
+ "package": "rocketmq_eventbridge_demo",
+ "clientName": "demo",
+ "packageInfo": {
+ "name": "rocketmq_eventbridge_demo",
+ "desc": "Alibaba Cloud eventbridge (20240701) SDK Library for Python",
+ "github": "unavailable"
+ }
+ }
+}
\ No newline at end of file
diff --git a/sdk/demo/EventData/demo.dara b/sdk/demo/EventData/demo.dara
new file mode 100644
index 0000000..5e88f45
--- /dev/null
+++ b/sdk/demo/EventData/demo.dara
@@ -0,0 +1,38 @@
+import Util;
+import OpenApi;
+import SDKClient;
+import Console;
+
+type @sdkClient = SDKClient;
+type @endpoint = string;
+
+init(){
+ @endpoint = '127.0.0.1:7001';
+ var config = new OpenApi.Config{
+ endpoint = @endpoint
+ };
+ @sdkClient = new SDKClient(config);
+}
+
+/**
+ EventData Controller apis:
+ * putEvents *
+*/
+
+async function testPutEvents(): void {
+ var request = new SDKClient.PutEventsRequest{
+ eventBusName = 'demo-bus',
+ event = 'an event for API test'
+ };
+
+ try {
+ var res = @sdkClient.putEvents(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
diff --git a/sdk/demo/EventData/generated/csharp/core/Demo.cs b/sdk/demo/EventData/generated/csharp/core/Demo.cs
new file mode 100644
index 0000000..db4eb23
--- /dev/null
+++ b/sdk/demo/EventData/generated/csharp/core/Demo.cs
@@ -0,0 +1,110 @@
+// This file is auto-generated, don't edit it. Thanks.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+
+using Tea;
+using Tea.Utils;
+
+
+namespace RocketMQ.Eventbridge.Demo
+{
+ public class Demo
+ {
+ protected RocketMQ.Eventbridge.SDK.SDKClient _sdkClient;
+ protected string _endpoint;
+
+ public Demo()
+ {
+ this._endpoint = "127.0.0.1:7001";
+ AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config
+ {
+ Endpoint = _endpoint,
+ };
+ this._sdkClient = new RocketMQ.Eventbridge.SDK.SDKClient(config);
+ }
+
+ static void Main(string[] _args){
+ Demo demo = new Demo();
+ demo.TestPutEvents();
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>EventData Controller apis:
+ /// putEvents *</para>
+ /// </description>
+ public void TestPutEvents()
+ {
+ RocketMQ.Eventbridge.SDK.Models.PutEventsRequest request = new RocketMQ.Eventbridge.SDK.Models.PutEventsRequest
+ {
+ EventBusName = "demo-bus",
+ Event = "an event for API test",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.PutEventsResponse res = this._sdkClient.PutEvents(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>EventData Controller apis:
+ /// putEvents *</para>
+ /// </description>
+ public async Task TestPutEventsAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.PutEventsRequest request = new RocketMQ.Eventbridge.SDK.Models.PutEventsRequest
+ {
+ EventBusName = "demo-bus",
+ Event = "an event for API test",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.PutEventsResponse res = await this._sdkClient.PutEventsAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ }
+}
diff --git a/sdk/demo/EventData/generated/csharp/core/Properties/AssemblyInfo.cs b/sdk/demo/EventData/generated/csharp/core/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..9650de4
--- /dev/null
+++ b/sdk/demo/EventData/generated/csharp/core/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("eventbridge-sdk-demo")]
+[assembly: AssemblyDescription("open source eventbridge (20240701) SDK Demo Library for .NET")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("45b48850-8a2f-11ef-9161-cba700e38850")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("0.0.1.0")]
+[assembly: AssemblyFileVersion("0.0.1.0")]
diff --git a/sdk/demo/EventData/generated/csharp/core/sdkDemo.csproj b/sdk/demo/EventData/generated/csharp/core/sdkDemo.csproj
new file mode 100644
index 0000000..8ea12bc
--- /dev/null
+++ b/sdk/demo/EventData/generated/csharp/core/sdkDemo.csproj
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFrameworks>netstandard2.0;net45;netcoreapp8.0</TargetFrameworks>
+ <RootNamespace>RocketMQ.Eventbridge.Demo</RootNamespace>
+ <OutputType>Exe</OutputType>
+ <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
+ <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+ <AssemblyName>RocketMQ.Eventbridge.Demo</AssemblyName>
+ <Version/>
+ <LangVersion>5</LangVersion>
+ <Description>open source eventbridge (20240701) SDK Demo Library for .NET</Description>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
+ <DefineConstants>NETSTANDARD2_0</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <DefineConstants>NET45</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <Reference Include="mscorlib"/>
+ <Reference Include="System"/>
+ <Reference Include="System.Core"/>
+ <Reference Include="Microsoft.CSharp"/>
+ <Reference Include="System.Data"/>
+ <Reference Include="System.Web"/>
+ <Reference Include="System.Drawing"/>
+ <Reference Include="System.Security"/>
+ <Reference Include="System.Xml"/>
+ <Reference Include="System.Configuration"/>
+ <Reference Include="System.Net.Http"/>
+ </ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
+ </PackageReference>
+ <PackageReference Include="AlibabaCloud.TeaUtil" Version="0.1.19"/>
+ <PackageReference Include="AlibabaCloud.OpenApiClient" Version="0.1.12"/>
+ <PackageReference Include="RocketMQ.Eventbridge.SDK" Version="1.0.0"/>
+ <PackageReference Include="AlibabaCloud.TeaConsole" Version="0.1.0"/>
+ <PackageReference Include="Tea" Version="1.1.0"/>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/sdk/demo/EventData/generated/go/client/client.go b/sdk/demo/EventData/generated/go/client/client.go
new file mode 100644
index 0000000..3ba1e83
--- /dev/null
+++ b/sdk/demo/EventData/generated/go/client/client.go
@@ -0,0 +1,76 @@
+// This file is auto-generated, don't edit it. Thanks.
+package client
+
+import (
+ openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
+ console "github.com/alibabacloud-go/tea-console/client"
+ util "github.com/alibabacloud-go/tea-utils/v2/service"
+ "github.com/alibabacloud-go/tea/tea"
+ sdkclient "github.com/org-apache-rocketmq/eventbridge-sdk/client"
+)
+
+type DemoClient struct {
+ SdkClient *sdkclient.Client
+ Endpoint *string
+}
+
+func NewClient() (*DemoClient, error) {
+ client := new(DemoClient)
+ err := client.Init()
+ return client, err
+}
+
+func (client *DemoClient) Init() (_err error) {
+ client.Endpoint = tea.String("127.0.0.1:7001")
+ config := &openapi.Config{
+ Endpoint: client.Endpoint,
+ }
+ client.SdkClient, _err = sdkclient.NewClient(config)
+ if _err != nil {
+ return _err
+ }
+
+ return nil
+}
+
+// Description:
+//
+// EventData Controller apis:
+//
+// putEvents *
+func (client *DemoClient) TestPutEvents() (_err error) {
+ request := &sdkclient.PutEventsRequest{
+ EventBusName: tea.String("demo-bus"),
+ Event: tea.String("an event for API test"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.PutEvents(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
diff --git a/sdk/demo/EventData/generated/go/go.mod b/sdk/demo/EventData/generated/go/go.mod
new file mode 100644
index 0000000..ff35824
--- /dev/null
+++ b/sdk/demo/EventData/generated/go/go.mod
@@ -0,0 +1,9 @@
+module client
+
+require (
+ github.com/alibabacloud-go/tea-utils/v2 v2.0.6
+ github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10
+ github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0
+ github.com/alibabacloud-go/tea-console v1.0.0
+)
+replace github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0 => ../../../../generated/go/
diff --git a/sdk/demo/EventData/generated/go/main.go b/sdk/demo/EventData/generated/go/main.go
new file mode 100644
index 0000000..d22e104
--- /dev/null
+++ b/sdk/demo/EventData/generated/go/main.go
@@ -0,0 +1,11 @@
+package main
+
+import (
+ "client/client"
+)
+
+func main() {
+ demo := new(client.DemoClient)
+ demo.Init()
+ demo.TestPutEvents()
+}
diff --git a/sdk/demo/EventData/generated/java/pom.xml b/sdk/demo/EventData/generated/java/pom.xml
new file mode 100644
index 0000000..ef0ec32
--- /dev/null
+++ b/sdk/demo/EventData/generated/java/pom.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>demo</artifactId>
+ <version>0.0.0</version>
+ <packaging>jar</packaging>
+ <name>demo</name>
+ <description>EventBridge SDK demo for Java
+ </description>
+ <url></url>
+ <licenses>
+ <license>
+ <name>The Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ </license>
+ </licenses>
+ <developers>
+ <developer>
+ <id>ludi</id>
+ <name>EventBridge SDK</name>
+ <email>zjuludi@gmail.com</email>
+ </developer>
+ </developers>
+ <distributionManagement>
+ <snapshotRepository>
+ <id>sonatype-nexus-snapshots</id>
+ <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ <repository>
+ <id>sonatype-nexus-staging</id>
+ <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+ </repository>
+ </distributionManagement>
+ <scm>
+ <connection></connection>
+ <developerConnection></developerConnection>
+ <url></url>
+ </scm>
+ <dependencies>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-util</artifactId>
+ <version>0.2.23</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-openapi</artifactId>
+ <version>0.3.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>sdk</artifactId>
+ <version>0.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-console</artifactId>
+ <version>0.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea</artifactId>
+ <version>1.1.14</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.6.1</version>
+ <configuration>
+ <source>8</source>
+ <target>8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.6</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.6.3</version>
+ <extensions>true</extensions>
+ <configuration>
+ <serverId>sonatype-nexus-staging</serverId>
+ <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
+ <autoReleaseAfterClose>true</autoReleaseAfterClose>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.1.1</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <doclint>none</doclint>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.22.1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
diff --git a/sdk/demo/EventData/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java b/sdk/demo/EventData/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
new file mode 100644
index 0000000..5aa8d73
--- /dev/null
+++ b/sdk/demo/EventData/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
@@ -0,0 +1,51 @@
+// This file is auto-generated, don't edit it. Thanks.
+package org.apache.rocketmq.eventbridge.demo;
+
+import com.aliyun.tea.*;
+
+public class Demo {
+
+ public org.apache.rocketmq.eventbridge.sdk.Client _sdkClient;
+ public String _endpoint;
+ public Demo() throws Exception {
+ this._endpoint = "127.0.0.1:7001";
+ com.aliyun.teaopenapi.models.Config config = com.aliyun.teaopenapi.models.Config.build(TeaConverter.buildMap(
+ new TeaPair("endpoint", _endpoint)
+ ));
+ this._sdkClient = new org.apache.rocketmq.eventbridge.sdk.Client(config);
+ }
+
+ public static void main(String[] args) {
+ try {
+ Demo demo = new Demo();
+ demo.testPutEvents();
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+
+ /**
+ * <b>description</b> :
+ * <p>EventData Controller apis:
+ * putEvents *</p>
+ */
+ public void testPutEvents() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.PutEventsRequest request = org.apache.rocketmq.eventbridge.sdk.models.PutEventsRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "demo-bus"),
+ new TeaPair("event", "an event for API test")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.PutEventsResponse res = _sdkClient.putEvents(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/EventData/generated/php/.gitignore b/sdk/demo/EventData/generated/php/.gitignore
new file mode 100644
index 0000000..89c7aa5
--- /dev/null
+++ b/sdk/demo/EventData/generated/php/.gitignore
@@ -0,0 +1,15 @@
+composer.phar
+/vendor/
+
+# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
+# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
+composer.lock
+
+.vscode/
+.idea
+.DS_Store
+
+cache/
+*.cache
+runtime/
+.php_cs.cache
diff --git a/sdk/demo/EventData/generated/php/.php_cs.dist b/sdk/demo/EventData/generated/php/.php_cs.dist
new file mode 100644
index 0000000..8617ec2
--- /dev/null
+++ b/sdk/demo/EventData/generated/php/.php_cs.dist
@@ -0,0 +1,65 @@
+<?php
+/*
+ * This document has been generated with
+ * https://mlocati.github.io/php-cs-fixer-configurator/#version:2.15|configurator
+ * you can change this configuration by importing this file.
+ */
+
+return PhpCsFixer\Config::create()
+ ->setRiskyAllowed(true)
+ ->setIndent(' ')
+ ->setRules([
+ '@PSR2' => true,
+ '@PhpCsFixer' => true,
+ '@Symfony:risky' => true,
+ 'concat_space' => ['spacing' => 'one'],
+ 'array_syntax' => ['syntax' => 'short'],
+ 'array_indentation' => true,
+ 'combine_consecutive_unsets' => true,
+ 'method_separation' => true,
+ 'single_quote' => true,
+ 'declare_equal_normalize' => true,
+ 'function_typehint_space' => true,
+ 'hash_to_slash_comment' => true,
+ 'include' => true,
+ 'lowercase_cast' => true,
+ 'no_multiline_whitespace_before_semicolons' => true,
+ 'no_leading_import_slash' => true,
+ 'no_multiline_whitespace_around_double_arrow' => true,
+ 'no_spaces_around_offset' => true,
+ 'no_unneeded_control_parentheses' => true,
+ 'no_unused_imports' => true,
+ 'no_whitespace_before_comma_in_array' => true,
+ 'no_whitespace_in_blank_line' => true,
+ 'object_operator_without_whitespace' => true,
+ 'single_blank_line_before_namespace' => true,
+ 'single_class_element_per_statement' => true,
+ 'space_after_semicolon' => true,
+ 'standardize_not_equals' => true,
+ 'ternary_operator_spaces' => true,
+ 'trailing_comma_in_multiline_array' => true,
+ 'trim_array_spaces' => true,
+ 'unary_operator_spaces' => true,
+ 'whitespace_after_comma_in_array' => true,
+ 'no_extra_consecutive_blank_lines' => [
+ 'curly_brace_block',
+ 'extra',
+ 'parenthesis_brace_block',
+ 'square_brace_block',
+ 'throw',
+ 'use',
+ ],
+ 'binary_operator_spaces' => [
+ 'align_double_arrow' => true,
+ 'align_equals' => true,
+ ],
+ 'braces' => [
+ 'allow_single_line_closure' => true,
+ ],
+ ])
+ ->setFinder(
+ PhpCsFixer\Finder::create()
+ ->exclude('vendor')
+ ->exclude('tests')
+ ->in(__DIR__)
+ );
diff --git a/sdk/demo/EventData/generated/php/autoload.php b/sdk/demo/EventData/generated/php/autoload.php
new file mode 100644
index 0000000..5bfe0a1
--- /dev/null
+++ b/sdk/demo/EventData/generated/php/autoload.php
@@ -0,0 +1,15 @@
+<?php
+
+if (file_exists(__DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php')) {
+ require_once __DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
+}
+
+spl_autoload_register(function ($class) {
+ $name = str_replace('RocketMQ\\Eventbridge\\SDK\\Demo\\', '', $class);
+ $file = __DIR__ . \DIRECTORY_SEPARATOR . 'src' . \DIRECTORY_SEPARATOR . str_replace('\\', \DIRECTORY_SEPARATOR, $name) . '.php';
+ if (file_exists($file)) {
+ require_once $file;
+ return true;
+ }
+ return false;
+});
diff --git a/sdk/demo/EventData/generated/php/composer.json b/sdk/demo/EventData/generated/php/composer.json
new file mode 100644
index 0000000..2edbfb8
--- /dev/null
+++ b/sdk/demo/EventData/generated/php/composer.json
@@ -0,0 +1,34 @@
+{
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "description": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "type": "library",
+ "license": "Apache-2.0",
+ "authors": [],
+ "require": {
+ "php": ">5.5",
+ "alibabacloud/tea-utils": "^0.2.21",
+ "alibabacloud/darabonba-openapi": "^0.2.12",
+ "rocketmq/eventbridge-sdk": "^0.0.0",
+ "alibabacloud/tea-console": "^0.1.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "RocketMQ\\Eventbridge\\SDK\\Demo\\": "src"
+ }
+ },
+ "scripts": {
+ "fixer": "php-cs-fixer fix ./"
+ },
+ "config": {
+ "sort-packages": true,
+ "preferred-install": "dist",
+ "optimize-autoloader": true
+ },
+ "prefer-stable": true,
+ "repositories": {
+ "rocketmq":{
+ "type" : "path",
+ "url": "../../../../generated/php"
+ }
+ }
+}
diff --git a/sdk/demo/EventData/generated/php/main.php b/sdk/demo/EventData/generated/php/main.php
new file mode 100644
index 0000000..528edaa
--- /dev/null
+++ b/sdk/demo/EventData/generated/php/main.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace RocketMQ\Eventbridge\SDK\Demo;
+require 'vendor/autoload.php';
+include 'src/Demo.php';
+
+$demo = new Demo();
+$demo->testPutEvents();
diff --git a/sdk/demo/EventData/generated/php/src/Demo.php b/sdk/demo/EventData/generated/php/src/Demo.php
new file mode 100644
index 0000000..c738d7f
--- /dev/null
+++ b/sdk/demo/EventData/generated/php/src/Demo.php
@@ -0,0 +1,53 @@
+<?php
+
+// This file is auto-generated, don't edit it. Thanks.
+namespace RocketMQ\Eventbridge\SDK\Demo;
+
+use RocketMQ\Eventbridge\SDK\SDKClient;
+use AlibabaCloud\Tea\Utils\Utils;
+use AlibabaCloud\Tea\Console\Console;
+use \Exception;
+use AlibabaCloud\Tea\Exception\TeaError;
+
+use Darabonba\OpenApi\Models\Config;
+use RocketMQ\Eventbridge\SDK\Models\PutEventsRequest;
+
+class Demo {
+ protected $_sdkClient;
+
+ protected $_endpoint;
+
+ public function __construct(){
+ $this->_endpoint = "127.0.0.1:7001";
+ $config = new Config([
+ "endpoint" => $this->_endpoint
+ ]);
+ $this->_sdkClient = new SDKClient($config);
+ }
+
+ /**
+ * EventData Controller apis:
+ * * putEvents *
+ * @return void
+ */
+ public function testPutEvents(){
+ $request = new PutEventsRequest([
+ "eventBusName" => "demo-bus",
+ "event" => "an event for API test"
+ ]);
+ try {
+ $res = $this->_sdkClient->putEvents($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/EventData/generated/python/.gitignore b/sdk/demo/EventData/generated/python/.gitignore
new file mode 100644
index 0000000..2bcfffa
--- /dev/null
+++ b/sdk/demo/EventData/generated/python/.gitignore
@@ -0,0 +1,5 @@
+runtime/
+.idea/
+.vscode/
+__pycache__/
+.pytest_cache/
\ No newline at end of file
diff --git a/sdk/demo/EventData/generated/python/rocketmq_eventbridge_demo/__init__.py b/sdk/demo/EventData/generated/python/rocketmq_eventbridge_demo/__init__.py
new file mode 100644
index 0000000..5becc17
--- /dev/null
+++ b/sdk/demo/EventData/generated/python/rocketmq_eventbridge_demo/__init__.py
@@ -0,0 +1 @@
+__version__ = "1.0.0"
diff --git a/sdk/demo/EventData/generated/python/rocketmq_eventbridge_demo/demo.py b/sdk/demo/EventData/generated/python/rocketmq_eventbridge_demo/demo.py
new file mode 100644
index 0000000..76277c5
--- /dev/null
+++ b/sdk/demo/EventData/generated/python/rocketmq_eventbridge_demo/demo.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+# This file is auto-generated, don't edit it. Thanks.
+from rocketmq_eventbridge.client import Client as SDKClientClient
+from alibabacloud_tea_openapi import models as open_api_models
+from rocketmq_eventbridge import models as sdkclient_models
+from alibabacloud_tea_console.client import Client as ConsoleClient
+from alibabacloud_tea_util.client import Client as UtilClient
+
+
+class Demo:
+ _sdk_client: SDKClientClient = None
+ _endpoint: str = None
+
+ def __init__(self):
+ self._endpoint = '127.0.0.1:7001'
+ config = open_api_models.Config(
+ endpoint=self._endpoint
+ )
+ self._sdk_client = SDKClientClient(config)
+
+ def test_put_events(self) -> None:
+ """
+ EventData Controller apis:
+ putEvents *\
+ """
+ request = sdkclient_models.PutEventsRequest(
+ event_bus_name='demo-bus',
+ event='an event for API test'
+ )
+ try:
+ res = self._sdk_client.put_events(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_put_events_async(self) -> None:
+ """
+ EventData Controller apis:
+ putEvents *\
+ """
+ request = sdkclient_models.PutEventsRequest(
+ event_bus_name='demo-bus',
+ event='an event for API test'
+ )
+ try:
+ res = await self._sdk_client.put_events_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+demo = Demo()
+demo.test_put_events()
diff --git a/sdk/demo/EventData/generated/python/setup.py b/sdk/demo/EventData/generated/python/setup.py
new file mode 100644
index 0000000..3824f4c
--- /dev/null
+++ b/sdk/demo/EventData/generated/python/setup.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+"""
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+"""
+
+import os
+from setuptools import setup, find_packages
+
+"""
+setup module for rocketmq_eventbridge_demo.
+
+Created on 14/10/2024
+
+@author:
+"""
+
+PACKAGE = "rocketmq_eventbridge_demo"
+NAME = "rocketmq_eventbridge_demo" or "alibabacloud-package"
+DESCRIPTION = "Alibaba Cloud eventbridge (20240701) SDK Library for Python"
+AUTHOR = ""
+AUTHOR_EMAIL = ""
+URL = "unavailable"
+VERSION = __import__(PACKAGE).__version__
+REQUIRES = [
+ "alibabacloud_tea_util>=0.3.13, <1.0.0",
+ "alibabacloud_tea_openapi>=0.3.12, <1.0.0",
+ "rocketmq_eventbridge20240701>=0.0.0, <1.0.0",
+ "alibabacloud_tea_console>=0.0.1, <1.0.0"
+]
+
+LONG_DESCRIPTION = ''
+if os.path.exists('./README.md'):
+ with open("README.md", encoding='utf-8') as fp:
+ LONG_DESCRIPTION = fp.read()
+
+setup(
+ name=NAME,
+ version=VERSION,
+ description=DESCRIPTION,
+ long_description=LONG_DESCRIPTION,
+ long_description_content_type='text/markdown',
+ author=AUTHOR,
+ author_email=AUTHOR_EMAIL,
+ license="Apache License 2.0",
+ url=URL,
+ keywords=["rocketmq","eventbridge","demo"],
+ packages=find_packages(exclude=["tests*"]),
+ include_package_data=True,
+ platforms="any",
+ install_requires=REQUIRES,
+ python_requires=">=3.6",
+ classifiers=(
+ "Development Status :: 4 - Beta",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: Apache Software License",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.6",
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ "Topic :: Software Development"
+ )
+)
diff --git a/sdk/demo/EventData/generated/ts/package.json b/sdk/demo/EventData/generated/ts/package.json
new file mode 100644
index 0000000..be9669b
--- /dev/null
+++ b/sdk/demo/EventData/generated/ts/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "",
+ "version": "1.0.0",
+ "description": "",
+ "main": "dist/client.js",
+ "scripts": {
+ "test": "mocha --reporter spec --timeout 3000 test/*.test.js",
+ "test-cov": "nyc -e .ts -r=html -r=text -r=lcov npm run test",
+ "build": "tsc",
+ "prepublishOnly": "tsc"
+ },
+ "author": "",
+ "license": "ISC",
+ "devDependencies": {
+ "@types/node": "^12.12.26",
+ "nyc": "^15.0.0",
+ "source-map-support": "^0.5.16",
+ "ts-node": "^8.6.2",
+ "typescript": "^3.7.5"
+ },
+ "dependencies": {
+ "@alicloud/tea-typescript": "^1.7.1",
+ "@alicloud/tea-util": "^1.4.9",
+ "@alicloud/openapi-client": "^0.4.12",
+ "@alicloud/tea-console": "^1.0.0"
+ },
+ "files": [
+ "dist",
+ "src"
+ ]
+}
\ No newline at end of file
diff --git a/sdk/demo/EventData/generated/ts/src/client.ts b/sdk/demo/EventData/generated/ts/src/client.ts
new file mode 100644
index 0000000..76539d1
--- /dev/null
+++ b/sdk/demo/EventData/generated/ts/src/client.ts
@@ -0,0 +1,43 @@
+// This file is auto-generated, don't edit it
+import Util from '@alicloud/tea-util';
+import OpenApi, * as $OpenApi from '@alicloud/openapi-client';
+import SDKClient, * as $SDKClient from '../../../../../generated/ts/src/client';
+import Console from '@alicloud/tea-console';
+import * as $tea from '@alicloud/tea-typescript';
+
+
+export default class Client {
+ _sdkClient: SDKClient;
+ _endpoint: string;
+
+ constructor() {
+ this._endpoint = "127.0.0.1:7001";
+ let config = new $OpenApi.Config({
+ endpoint: this._endpoint,
+ });
+ this._sdkClient = new SDKClient(config);
+ }
+
+
+ /**
+ * @remarks
+ * EventData Controller apis:
+ * putEvents *
+ */
+ async testPutEvents(): Promise<void> {
+ let request = new $SDKClient.PutEventsRequest({
+ eventBusName: "demo-bus",
+ event: "an event for API test",
+ });
+ try {
+ let res = await this._sdkClient.putEvents(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+}
diff --git a/sdk/demo/EventData/generated/ts/src/main.ts b/sdk/demo/EventData/generated/ts/src/main.ts
new file mode 100644
index 0000000..9ed2306
--- /dev/null
+++ b/sdk/demo/EventData/generated/ts/src/main.ts
@@ -0,0 +1,4 @@
+import Client from './client'
+
+let c = new Client()
+c.testPutEvents()
diff --git a/sdk/demo/EventData/generated/ts/tsconfig.json b/sdk/demo/EventData/generated/ts/tsconfig.json
new file mode 100644
index 0000000..ae66f5b
--- /dev/null
+++ b/sdk/demo/EventData/generated/ts/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "compilerOptions": {
+ "target": "es2017",
+ "module": "commonjs",
+ "declaration": true,
+ "sourceMap": true,
+ "outDir": "./dist",
+ "esModuleInterop": true
+ },
+ "include": [
+ "src/**/*"
+ ]
+}
\ No newline at end of file
diff --git a/sdk/demo/EventRule/Darafile b/sdk/demo/EventRule/Darafile
new file mode 100644
index 0000000..b15ddca
--- /dev/null
+++ b/sdk/demo/EventRule/Darafile
@@ -0,0 +1,66 @@
+{
+ "scope": "Demo",
+ "name": "demo",
+ "version": "0.0.0",
+ "main": "./demo.dara",
+ "libraries": {
+ "SDKClient" : "../../",
+ "Util": "darabonba:Util:*",
+ "OpenApi": "alibabacloud:OpenApi:*",
+ "OpenApiUtil": "alibabacloud:OpenApiUtil:*",
+ "Console": "darabonba:Console:*"
+ },
+ "java": {
+ "package": "org.apache.rocketmq.eventbridge.demo",
+ "className": "Demo",
+ "packageInfo": {
+ "groupId": "org.apache.rocketmq.eventbridge",
+ "artifactId": "demo",
+ "version": "0.0.0",
+ "description": "EventBridge SDK demo for Java",
+ "url": "",
+ "licenseName": "The Apache License, Version 2.0",
+ "licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt",
+ "developerId": "ludi",
+ "developerName": "EventBridge SDK",
+ "developerEmail": "zjuludi@gmail.com",
+ "scmConnection": "",
+ "scmDeveloperConnection": "",
+ "scmUrl": ""
+ }
+ },
+ "go": {
+ "clientName": "DemoClient"
+ },
+ "csharp": {
+ "className": "Demo",
+ "namespace": "RocketMQ.Eventbridge.Demo",
+ "packageInfo": {
+ "name": "sdkDemo",
+ "version": "0.0.0",
+ "title": "eventbridge-sdk-demo",
+ "description": "open source eventbridge (20240701) SDK Demo Library for .NET"
+ }
+ },
+ "php": {
+ "package": "RocketMQ.Eventbridge.SDK.Demo",
+ "clientName": "Demo",
+ "packageInfo": {
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "desc": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "github": "unavailable",
+ "files": {
+ "LICENSE": "../LICENSE"
+ }
+ }
+ },
+ "python": {
+ "package": "rocketmq_eventbridge_demo",
+ "clientName": "demo",
+ "packageInfo": {
+ "name": "rocketmq_eventbridge_demo",
+ "desc": "Alibaba Cloud eventbridge (20240701) SDK Library for Python",
+ "github": "unavailable"
+ }
+ }
+}
\ No newline at end of file
diff --git a/sdk/demo/EventRule/demo.dara b/sdk/demo/EventRule/demo.dara
new file mode 100644
index 0000000..2aa157b
--- /dev/null
+++ b/sdk/demo/EventRule/demo.dara
@@ -0,0 +1,157 @@
+import Util;
+import OpenApi;
+import SDKClient;
+import Console;
+
+type @sdkClient = SDKClient;
+type @endpoint = string;
+
+init(){
+ @endpoint = '127.0.0.1:7001';
+ var config = new OpenApi.Config{
+ endpoint = @endpoint
+ };
+ @sdkClient = new SDKClient(config);
+}
+
+/**
+ EventRule Controller apis:
+ * createEventRule *
+ * getEventRule *
+ * deleteEventRule *
+ * updateEventRule *
+ * listEventRules *
+ * enableEventRule *
+ * disableEventRule *
+*/
+
+async function testCreateEventRule(): void {
+ var request = new SDKClient.CreateEventRuleRequest{
+ eventBusName = 'newBus',
+ eventRuleName = 'newRule',
+ description = 'an event rule for test',
+ filterPattern = "{}"
+ };
+
+ try {
+ var res = @sdkClient.createEventRule(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testGetEventRule(): void {
+ var request = new SDKClient.GetEventRuleRequest{
+ eventBusName = 'newBus',
+ eventRuleName = 'newRule',
+ };
+
+ try {
+ var res = @sdkClient.getEventRule(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testDeleteEventRule(): void {
+ var request = new SDKClient.DeleteEventRuleRequest{
+ eventBusName = 'newBus',
+ eventRuleName = 'newRule',
+ };
+
+ try {
+ var res = @sdkClient.deleteEventRule(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testUpdateEventRule(): void {
+ var request = new SDKClient.UpdateEventRuleRequest{
+ eventBusName = 'newBus',
+ eventRuleName = 'newRule',
+ description = 'new description for testing update API',
+ filterPattern = '{}'
+ };
+
+ try {
+ var res = @sdkClient.updateEventRule(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testListEventRules(): void {
+ var request = new SDKClient.ListEventRulesRequest{
+ eventBusName = 'newBus',
+ maxResults = 2,
+ nextToken = "0"
+ };
+
+ try {
+ var res = @sdkClient.listEventRules(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testEnableEventRule(): void {
+ var request = new SDKClient.EnableEventRuleRequest{
+ eventBusName = 'newBus',
+ eventRuleName = 'newRule',
+ };
+
+ try {
+ var res = @sdkClient.enableEventRule(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testDisableEventRule(): void {
+ var request = new SDKClient.DisableEventRuleRequest{
+ eventBusName = 'newBus',
+ eventRuleName = 'newRule',
+ };
+
+ try {
+ var res = @sdkClient.disableEventRule(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
\ No newline at end of file
diff --git a/sdk/demo/EventRule/generated/csharp/core/Demo.cs b/sdk/demo/EventRule/generated/csharp/core/Demo.cs
new file mode 100644
index 0000000..c040929
--- /dev/null
+++ b/sdk/demo/EventRule/generated/csharp/core/Demo.cs
@@ -0,0 +1,516 @@
+// This file is auto-generated, don't edit it. Thanks.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+
+using Tea;
+using Tea.Utils;
+
+
+namespace RocketMQ.Eventbridge.Demo
+{
+ public class Demo
+ {
+ protected RocketMQ.Eventbridge.SDK.SDKClient _sdkClient;
+ protected string _endpoint;
+
+ public Demo()
+ {
+ this._endpoint = "127.0.0.1:7001";
+ AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config
+ {
+ Endpoint = _endpoint,
+ };
+ this._sdkClient = new RocketMQ.Eventbridge.SDK.SDKClient(config);
+ }
+
+ static void Main(string[] _args){
+ Demo demo = new Demo();
+ demo.TestListEventRules();
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>EventRule Controller apis:
+ /// createEventRule *
+ /// getEventRule *
+ /// deleteEventRule *
+ /// updateEventRule *
+ /// listEventRules *
+ /// enableEventRule *
+ /// disableEventRule *</para>
+ /// </description>
+ public void TestCreateEventRule()
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventRuleRequest request = new RocketMQ.Eventbridge.SDK.Models.CreateEventRuleRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ Description = "an event rule for test",
+ FilterPattern = "{}",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventRuleResponse res = this._sdkClient.CreateEventRule(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>EventRule Controller apis:
+ /// createEventRule *
+ /// getEventRule *
+ /// deleteEventRule *
+ /// updateEventRule *
+ /// listEventRules *
+ /// enableEventRule *
+ /// disableEventRule *</para>
+ /// </description>
+ public async Task TestCreateEventRuleAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventRuleRequest request = new RocketMQ.Eventbridge.SDK.Models.CreateEventRuleRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ Description = "an event rule for test",
+ FilterPattern = "{}",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventRuleResponse res = await this._sdkClient.CreateEventRuleAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestGetEventRule()
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetEventRuleRequest request = new RocketMQ.Eventbridge.SDK.Models.GetEventRuleRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetEventRuleResponse res = this._sdkClient.GetEventRule(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestGetEventRuleAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetEventRuleRequest request = new RocketMQ.Eventbridge.SDK.Models.GetEventRuleRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetEventRuleResponse res = await this._sdkClient.GetEventRuleAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestDeleteEventRule()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventRuleRequest request = new RocketMQ.Eventbridge.SDK.Models.DeleteEventRuleRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventRuleResponse res = this._sdkClient.DeleteEventRule(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestDeleteEventRuleAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventRuleRequest request = new RocketMQ.Eventbridge.SDK.Models.DeleteEventRuleRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventRuleResponse res = await this._sdkClient.DeleteEventRuleAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestUpdateEventRule()
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateEventRuleRequest request = new RocketMQ.Eventbridge.SDK.Models.UpdateEventRuleRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ Description = "new description for testing update API",
+ FilterPattern = "{}",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateEventRuleResponse res = this._sdkClient.UpdateEventRule(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestUpdateEventRuleAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateEventRuleRequest request = new RocketMQ.Eventbridge.SDK.Models.UpdateEventRuleRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ Description = "new description for testing update API",
+ FilterPattern = "{}",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateEventRuleResponse res = await this._sdkClient.UpdateEventRuleAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestListEventRules()
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventRulesRequest request = new RocketMQ.Eventbridge.SDK.Models.ListEventRulesRequest
+ {
+ EventBusName = "newBus",
+ MaxResults = 2,
+ NextToken = "0",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventRulesResponse res = this._sdkClient.ListEventRules(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestListEventRulesAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventRulesRequest request = new RocketMQ.Eventbridge.SDK.Models.ListEventRulesRequest
+ {
+ EventBusName = "newBus",
+ MaxResults = 2,
+ NextToken = "0",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventRulesResponse res = await this._sdkClient.ListEventRulesAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestEnableEventRule()
+ {
+ RocketMQ.Eventbridge.SDK.Models.EnableEventRuleRequest request = new RocketMQ.Eventbridge.SDK.Models.EnableEventRuleRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.EnableEventRuleResponse res = this._sdkClient.EnableEventRule(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestEnableEventRuleAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.EnableEventRuleRequest request = new RocketMQ.Eventbridge.SDK.Models.EnableEventRuleRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.EnableEventRuleResponse res = await this._sdkClient.EnableEventRuleAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestDisableEventRule()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DisableEventRuleRequest request = new RocketMQ.Eventbridge.SDK.Models.DisableEventRuleRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DisableEventRuleResponse res = this._sdkClient.DisableEventRule(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestDisableEventRuleAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DisableEventRuleRequest request = new RocketMQ.Eventbridge.SDK.Models.DisableEventRuleRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DisableEventRuleResponse res = await this._sdkClient.DisableEventRuleAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ }
+}
diff --git a/sdk/demo/EventRule/generated/csharp/core/Properties/AssemblyInfo.cs b/sdk/demo/EventRule/generated/csharp/core/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..e45f1c7
--- /dev/null
+++ b/sdk/demo/EventRule/generated/csharp/core/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("eventbridge-sdk-demo")]
+[assembly: AssemblyDescription("open source eventbridge (20240701) SDK Demo Library for .NET")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("48d131a0-8a2f-11ef-b432-13443a168538")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("0.0.1.0")]
+[assembly: AssemblyFileVersion("0.0.1.0")]
diff --git a/sdk/demo/EventRule/generated/csharp/core/sdkDemo.csproj b/sdk/demo/EventRule/generated/csharp/core/sdkDemo.csproj
new file mode 100644
index 0000000..8ea12bc
--- /dev/null
+++ b/sdk/demo/EventRule/generated/csharp/core/sdkDemo.csproj
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFrameworks>netstandard2.0;net45;netcoreapp8.0</TargetFrameworks>
+ <RootNamespace>RocketMQ.Eventbridge.Demo</RootNamespace>
+ <OutputType>Exe</OutputType>
+ <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
+ <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+ <AssemblyName>RocketMQ.Eventbridge.Demo</AssemblyName>
+ <Version/>
+ <LangVersion>5</LangVersion>
+ <Description>open source eventbridge (20240701) SDK Demo Library for .NET</Description>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
+ <DefineConstants>NETSTANDARD2_0</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <DefineConstants>NET45</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <Reference Include="mscorlib"/>
+ <Reference Include="System"/>
+ <Reference Include="System.Core"/>
+ <Reference Include="Microsoft.CSharp"/>
+ <Reference Include="System.Data"/>
+ <Reference Include="System.Web"/>
+ <Reference Include="System.Drawing"/>
+ <Reference Include="System.Security"/>
+ <Reference Include="System.Xml"/>
+ <Reference Include="System.Configuration"/>
+ <Reference Include="System.Net.Http"/>
+ </ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
+ </PackageReference>
+ <PackageReference Include="AlibabaCloud.TeaUtil" Version="0.1.19"/>
+ <PackageReference Include="AlibabaCloud.OpenApiClient" Version="0.1.12"/>
+ <PackageReference Include="RocketMQ.Eventbridge.SDK" Version="1.0.0"/>
+ <PackageReference Include="AlibabaCloud.TeaConsole" Version="0.1.0"/>
+ <PackageReference Include="Tea" Version="1.1.0"/>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/sdk/demo/EventRule/generated/go/client/client.go b/sdk/demo/EventRule/generated/go/client/client.go
new file mode 100644
index 0000000..a666a61
--- /dev/null
+++ b/sdk/demo/EventRule/generated/go/client/client.go
@@ -0,0 +1,315 @@
+// This file is auto-generated, don't edit it. Thanks.
+package client
+
+import (
+ openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
+ console "github.com/alibabacloud-go/tea-console/client"
+ util "github.com/alibabacloud-go/tea-utils/v2/service"
+ "github.com/alibabacloud-go/tea/tea"
+ sdkclient "github.com/org-apache-rocketmq/eventbridge-sdk/client"
+)
+
+type DemoClient struct {
+ SdkClient *sdkclient.Client
+ Endpoint *string
+}
+
+func NewClient() (*DemoClient, error) {
+ client := new(DemoClient)
+ err := client.Init()
+ return client, err
+}
+
+func (client *DemoClient) Init() (_err error) {
+ client.Endpoint = tea.String("127.0.0.1:7001")
+ config := &openapi.Config{
+ Endpoint: client.Endpoint,
+ }
+ client.SdkClient, _err = sdkclient.NewClient(config)
+ if _err != nil {
+ return _err
+ }
+
+ return nil
+}
+
+// Description:
+//
+// EventRule Controller apis:
+//
+// createEventRule *
+//
+// getEventRule *
+//
+// deleteEventRule *
+//
+// updateEventRule *
+//
+// listEventRules *
+//
+// enableEventRule *
+//
+// disableEventRule *
+func (client *DemoClient) TestCreateEventRule() (_err error) {
+ request := &sdkclient.CreateEventRuleRequest{
+ EventBusName: tea.String("newBus"),
+ EventRuleName: tea.String("newRule"),
+ Description: tea.String("an event rule for test"),
+ FilterPattern: tea.String("{}"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.CreateEventRule(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestGetEventRule() (_err error) {
+ request := &sdkclient.GetEventRuleRequest{
+ EventBusName: tea.String("newBus"),
+ EventRuleName: tea.String("newRule"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.GetEventRule(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestDeleteEventRule() (_err error) {
+ request := &sdkclient.DeleteEventRuleRequest{
+ EventBusName: tea.String("newBus"),
+ EventRuleName: tea.String("newRule"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.DeleteEventRule(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestUpdateEventRule() (_err error) {
+ request := &sdkclient.UpdateEventRuleRequest{
+ EventBusName: tea.String("newBus"),
+ EventRuleName: tea.String("newRule"),
+ Description: tea.String("new description for testing update API"),
+ FilterPattern: tea.String("{}"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.UpdateEventRule(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestListEventRules() (_err error) {
+ request := &sdkclient.ListEventRulesRequest{
+ EventBusName: tea.String("newBus"),
+ MaxResults: tea.Int32(2),
+ NextToken: tea.String("0"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.ListEventRules(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestEnableEventRule() (_err error) {
+ request := &sdkclient.EnableEventRuleRequest{
+ EventBusName: tea.String("newBus"),
+ EventRuleName: tea.String("newRule"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.EnableEventRule(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestDisableEventRule() (_err error) {
+ request := &sdkclient.DisableEventRuleRequest{
+ EventBusName: tea.String("newBus"),
+ EventRuleName: tea.String("newRule"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.DisableEventRule(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
diff --git a/sdk/demo/EventRule/generated/go/go.mod b/sdk/demo/EventRule/generated/go/go.mod
new file mode 100644
index 0000000..ff35824
--- /dev/null
+++ b/sdk/demo/EventRule/generated/go/go.mod
@@ -0,0 +1,9 @@
+module client
+
+require (
+ github.com/alibabacloud-go/tea-utils/v2 v2.0.6
+ github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10
+ github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0
+ github.com/alibabacloud-go/tea-console v1.0.0
+)
+replace github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0 => ../../../../generated/go/
diff --git a/sdk/demo/EventRule/generated/go/main.go b/sdk/demo/EventRule/generated/go/main.go
new file mode 100644
index 0000000..445d8fc
--- /dev/null
+++ b/sdk/demo/EventRule/generated/go/main.go
@@ -0,0 +1,11 @@
+package main
+
+import (
+ "client/client"
+)
+
+func main() {
+ demo := new(client.DemoClient)
+ demo.Init()
+ demo.TestListEventRules()
+}
diff --git a/sdk/demo/EventRule/generated/java/pom.xml b/sdk/demo/EventRule/generated/java/pom.xml
new file mode 100644
index 0000000..ef0ec32
--- /dev/null
+++ b/sdk/demo/EventRule/generated/java/pom.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>demo</artifactId>
+ <version>0.0.0</version>
+ <packaging>jar</packaging>
+ <name>demo</name>
+ <description>EventBridge SDK demo for Java
+ </description>
+ <url></url>
+ <licenses>
+ <license>
+ <name>The Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ </license>
+ </licenses>
+ <developers>
+ <developer>
+ <id>ludi</id>
+ <name>EventBridge SDK</name>
+ <email>zjuludi@gmail.com</email>
+ </developer>
+ </developers>
+ <distributionManagement>
+ <snapshotRepository>
+ <id>sonatype-nexus-snapshots</id>
+ <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ <repository>
+ <id>sonatype-nexus-staging</id>
+ <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+ </repository>
+ </distributionManagement>
+ <scm>
+ <connection></connection>
+ <developerConnection></developerConnection>
+ <url></url>
+ </scm>
+ <dependencies>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-util</artifactId>
+ <version>0.2.23</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-openapi</artifactId>
+ <version>0.3.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>sdk</artifactId>
+ <version>0.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-console</artifactId>
+ <version>0.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea</artifactId>
+ <version>1.1.14</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.6.1</version>
+ <configuration>
+ <source>8</source>
+ <target>8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.6</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.6.3</version>
+ <extensions>true</extensions>
+ <configuration>
+ <serverId>sonatype-nexus-staging</serverId>
+ <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
+ <autoReleaseAfterClose>true</autoReleaseAfterClose>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.1.1</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <doclint>none</doclint>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.22.1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
diff --git a/sdk/demo/EventRule/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java b/sdk/demo/EventRule/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
new file mode 100644
index 0000000..075fb44
--- /dev/null
+++ b/sdk/demo/EventRule/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
@@ -0,0 +1,192 @@
+// This file is auto-generated, don't edit it. Thanks.
+package org.apache.rocketmq.eventbridge.demo;
+
+import com.aliyun.tea.*;
+
+public class Demo {
+
+ public org.apache.rocketmq.eventbridge.sdk.Client _sdkClient;
+ public String _endpoint;
+ public Demo() throws Exception {
+ this._endpoint = "127.0.0.1:7001";
+ com.aliyun.teaopenapi.models.Config config = com.aliyun.teaopenapi.models.Config.build(TeaConverter.buildMap(
+ new TeaPair("endpoint", _endpoint)
+ ));
+ this._sdkClient = new org.apache.rocketmq.eventbridge.sdk.Client(config);
+ }
+
+ public static void main(String[] args) {
+ try {
+ Demo demo = new Demo();
+ demo.testListEventRules();
+ // demo.testCreateEventRule();
+ // demo.testGetEventRule();
+ // demo.testUpdateEventRule();
+ // demo.testGetEventRule();
+ // demo.testDisableEventRule();
+ // demo.testGetEventRule();
+ // demo.testEnableEventRule();
+ // demo.testGetEventRule();
+ // demo.testDeleteEventRule();
+ // demo.testListEventRules();
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+
+ /**
+ * <b>description</b> :
+ * <p>EventRule Controller apis:
+ * createEventRule *
+ * getEventRule *
+ * deleteEventRule *
+ * updateEventRule *
+ * listEventRules *
+ * enableEventRule *
+ * disableEventRule *</p>
+ */
+ public void testCreateEventRule() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.CreateEventRuleRequest request = org.apache.rocketmq.eventbridge.sdk.models.CreateEventRuleRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventRuleName", "newRule"),
+ new TeaPair("description", "an event rule for test"),
+ new TeaPair("filterPattern", "{}")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.CreateEventRuleResponse res = _sdkClient.createEventRule(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testGetEventRule() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.GetEventRuleRequest request = org.apache.rocketmq.eventbridge.sdk.models.GetEventRuleRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventRuleName", "newRule")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.GetEventRuleResponse res = _sdkClient.getEventRule(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testDeleteEventRule() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.DeleteEventRuleRequest request = org.apache.rocketmq.eventbridge.sdk.models.DeleteEventRuleRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventRuleName", "newRule")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.DeleteEventRuleResponse res = _sdkClient.deleteEventRule(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testUpdateEventRule() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.UpdateEventRuleRequest request = org.apache.rocketmq.eventbridge.sdk.models.UpdateEventRuleRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventRuleName", "newRule"),
+ new TeaPair("description", "new description for testing update API"),
+ new TeaPair("filterPattern", "{}")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.UpdateEventRuleResponse res = _sdkClient.updateEventRule(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testListEventRules() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.ListEventRulesRequest request = org.apache.rocketmq.eventbridge.sdk.models.ListEventRulesRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("maxResults", 2),
+ new TeaPair("nextToken", "0")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.ListEventRulesResponse res = _sdkClient.listEventRules(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testEnableEventRule() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.EnableEventRuleRequest request = org.apache.rocketmq.eventbridge.sdk.models.EnableEventRuleRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventRuleName", "newRule")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.EnableEventRuleResponse res = _sdkClient.enableEventRule(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testDisableEventRule() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.DisableEventRuleRequest request = org.apache.rocketmq.eventbridge.sdk.models.DisableEventRuleRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventRuleName", "newRule")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.DisableEventRuleResponse res = _sdkClient.disableEventRule(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/EventRule/generated/php/.gitignore b/sdk/demo/EventRule/generated/php/.gitignore
new file mode 100644
index 0000000..89c7aa5
--- /dev/null
+++ b/sdk/demo/EventRule/generated/php/.gitignore
@@ -0,0 +1,15 @@
+composer.phar
+/vendor/
+
+# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
+# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
+composer.lock
+
+.vscode/
+.idea
+.DS_Store
+
+cache/
+*.cache
+runtime/
+.php_cs.cache
diff --git a/sdk/demo/EventRule/generated/php/.php_cs.dist b/sdk/demo/EventRule/generated/php/.php_cs.dist
new file mode 100644
index 0000000..8617ec2
--- /dev/null
+++ b/sdk/demo/EventRule/generated/php/.php_cs.dist
@@ -0,0 +1,65 @@
+<?php
+/*
+ * This document has been generated with
+ * https://mlocati.github.io/php-cs-fixer-configurator/#version:2.15|configurator
+ * you can change this configuration by importing this file.
+ */
+
+return PhpCsFixer\Config::create()
+ ->setRiskyAllowed(true)
+ ->setIndent(' ')
+ ->setRules([
+ '@PSR2' => true,
+ '@PhpCsFixer' => true,
+ '@Symfony:risky' => true,
+ 'concat_space' => ['spacing' => 'one'],
+ 'array_syntax' => ['syntax' => 'short'],
+ 'array_indentation' => true,
+ 'combine_consecutive_unsets' => true,
+ 'method_separation' => true,
+ 'single_quote' => true,
+ 'declare_equal_normalize' => true,
+ 'function_typehint_space' => true,
+ 'hash_to_slash_comment' => true,
+ 'include' => true,
+ 'lowercase_cast' => true,
+ 'no_multiline_whitespace_before_semicolons' => true,
+ 'no_leading_import_slash' => true,
+ 'no_multiline_whitespace_around_double_arrow' => true,
+ 'no_spaces_around_offset' => true,
+ 'no_unneeded_control_parentheses' => true,
+ 'no_unused_imports' => true,
+ 'no_whitespace_before_comma_in_array' => true,
+ 'no_whitespace_in_blank_line' => true,
+ 'object_operator_without_whitespace' => true,
+ 'single_blank_line_before_namespace' => true,
+ 'single_class_element_per_statement' => true,
+ 'space_after_semicolon' => true,
+ 'standardize_not_equals' => true,
+ 'ternary_operator_spaces' => true,
+ 'trailing_comma_in_multiline_array' => true,
+ 'trim_array_spaces' => true,
+ 'unary_operator_spaces' => true,
+ 'whitespace_after_comma_in_array' => true,
+ 'no_extra_consecutive_blank_lines' => [
+ 'curly_brace_block',
+ 'extra',
+ 'parenthesis_brace_block',
+ 'square_brace_block',
+ 'throw',
+ 'use',
+ ],
+ 'binary_operator_spaces' => [
+ 'align_double_arrow' => true,
+ 'align_equals' => true,
+ ],
+ 'braces' => [
+ 'allow_single_line_closure' => true,
+ ],
+ ])
+ ->setFinder(
+ PhpCsFixer\Finder::create()
+ ->exclude('vendor')
+ ->exclude('tests')
+ ->in(__DIR__)
+ );
diff --git a/sdk/demo/EventRule/generated/php/autoload.php b/sdk/demo/EventRule/generated/php/autoload.php
new file mode 100644
index 0000000..5bfe0a1
--- /dev/null
+++ b/sdk/demo/EventRule/generated/php/autoload.php
@@ -0,0 +1,15 @@
+<?php
+
+if (file_exists(__DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php')) {
+ require_once __DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
+}
+
+spl_autoload_register(function ($class) {
+ $name = str_replace('RocketMQ\\Eventbridge\\SDK\\Demo\\', '', $class);
+ $file = __DIR__ . \DIRECTORY_SEPARATOR . 'src' . \DIRECTORY_SEPARATOR . str_replace('\\', \DIRECTORY_SEPARATOR, $name) . '.php';
+ if (file_exists($file)) {
+ require_once $file;
+ return true;
+ }
+ return false;
+});
diff --git a/sdk/demo/EventRule/generated/php/composer.json b/sdk/demo/EventRule/generated/php/composer.json
new file mode 100644
index 0000000..2edbfb8
--- /dev/null
+++ b/sdk/demo/EventRule/generated/php/composer.json
@@ -0,0 +1,34 @@
+{
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "description": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "type": "library",
+ "license": "Apache-2.0",
+ "authors": [],
+ "require": {
+ "php": ">5.5",
+ "alibabacloud/tea-utils": "^0.2.21",
+ "alibabacloud/darabonba-openapi": "^0.2.12",
+ "rocketmq/eventbridge-sdk": "^0.0.0",
+ "alibabacloud/tea-console": "^0.1.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "RocketMQ\\Eventbridge\\SDK\\Demo\\": "src"
+ }
+ },
+ "scripts": {
+ "fixer": "php-cs-fixer fix ./"
+ },
+ "config": {
+ "sort-packages": true,
+ "preferred-install": "dist",
+ "optimize-autoloader": true
+ },
+ "prefer-stable": true,
+ "repositories": {
+ "rocketmq":{
+ "type" : "path",
+ "url": "../../../../generated/php"
+ }
+ }
+}
diff --git a/sdk/demo/EventRule/generated/php/main.php b/sdk/demo/EventRule/generated/php/main.php
new file mode 100644
index 0000000..894cdf9
--- /dev/null
+++ b/sdk/demo/EventRule/generated/php/main.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace RocketMQ\Eventbridge\SDK\Demo;
+require 'vendor/autoload.php';
+include 'src/Demo.php';
+
+$demo = new Demo();
+$demo->testListEventRules();
diff --git a/sdk/demo/EventRule/generated/php/src/Demo.php b/sdk/demo/EventRule/generated/php/src/Demo.php
new file mode 100644
index 0000000..072127e
--- /dev/null
+++ b/sdk/demo/EventRule/generated/php/src/Demo.php
@@ -0,0 +1,214 @@
+<?php
+
+// This file is auto-generated, don't edit it. Thanks.
+namespace RocketMQ\Eventbridge\SDK\Demo;
+
+use RocketMQ\Eventbridge\SDK\SDKClient;
+use AlibabaCloud\Tea\Utils\Utils;
+use AlibabaCloud\Tea\Console\Console;
+use \Exception;
+use AlibabaCloud\Tea\Exception\TeaError;
+
+use Darabonba\OpenApi\Models\Config;
+use RocketMQ\Eventbridge\SDK\Models\CreateEventRuleRequest;
+use RocketMQ\Eventbridge\SDK\Models\GetEventRuleRequest;
+use RocketMQ\Eventbridge\SDK\Models\DeleteEventRuleRequest;
+use RocketMQ\Eventbridge\SDK\Models\UpdateEventRuleRequest;
+use RocketMQ\Eventbridge\SDK\Models\ListEventRulesRequest;
+use RocketMQ\Eventbridge\SDK\Models\EnableEventRuleRequest;
+use RocketMQ\Eventbridge\SDK\Models\DisableEventRuleRequest;
+
+class Demo {
+ protected $_sdkClient;
+
+ protected $_endpoint;
+
+ public function __construct(){
+ $this->_endpoint = "127.0.0.1:7001";
+ $config = new Config([
+ "endpoint" => $this->_endpoint
+ ]);
+ $this->_sdkClient = new SDKClient($config);
+ }
+
+ /**
+ * EventRule Controller apis:
+ * * createEventRule *
+ * * getEventRule *
+ * * deleteEventRule *
+ * * updateEventRule *
+ * * listEventRules *
+ * * enableEventRule *
+ * * disableEventRule *
+ * @return void
+ */
+ public function testCreateEventRule(){
+ $request = new CreateEventRuleRequest([
+ "eventBusName" => "newBus",
+ "eventRuleName" => "newRule",
+ "description" => "an event rule for test",
+ "filterPattern" => "{}"
+ ]);
+ try {
+ $res = $this->_sdkClient->createEventRule($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testGetEventRule(){
+ $request = new GetEventRuleRequest([
+ "eventBusName" => "newBus",
+ "eventRuleName" => "newRule"
+ ]);
+ try {
+ $res = $this->_sdkClient->getEventRule($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testDeleteEventRule(){
+ $request = new DeleteEventRuleRequest([
+ "eventBusName" => "newBus",
+ "eventRuleName" => "newRule"
+ ]);
+ try {
+ $res = $this->_sdkClient->deleteEventRule($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testUpdateEventRule(){
+ $request = new UpdateEventRuleRequest([
+ "eventBusName" => "newBus",
+ "eventRuleName" => "newRule",
+ "description" => "new description for testing update API",
+ "filterPattern" => "{}"
+ ]);
+ try {
+ $res = $this->_sdkClient->updateEventRule($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testListEventRules(){
+ $request = new ListEventRulesRequest([
+ "eventBusName" => "newBus",
+ "maxResults" => 2,
+ "nextToken" => "0"
+ ]);
+ try {
+ $res = $this->_sdkClient->listEventRules($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testEnableEventRule(){
+ $request = new EnableEventRuleRequest([
+ "eventBusName" => "newBus",
+ "eventRuleName" => "newRule"
+ ]);
+ try {
+ $res = $this->_sdkClient->enableEventRule($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testDisableEventRule(){
+ $request = new DisableEventRuleRequest([
+ "eventBusName" => "newBus",
+ "eventRuleName" => "newRule"
+ ]);
+ try {
+ $res = $this->_sdkClient->disableEventRule($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/EventRule/generated/python/.gitignore b/sdk/demo/EventRule/generated/python/.gitignore
new file mode 100644
index 0000000..2bcfffa
--- /dev/null
+++ b/sdk/demo/EventRule/generated/python/.gitignore
@@ -0,0 +1,5 @@
+runtime/
+.idea/
+.vscode/
+__pycache__/
+.pytest_cache/
\ No newline at end of file
diff --git a/sdk/demo/EventRule/generated/python/rocketmq_eventbridge_demo/__init__.py b/sdk/demo/EventRule/generated/python/rocketmq_eventbridge_demo/__init__.py
new file mode 100644
index 0000000..5becc17
--- /dev/null
+++ b/sdk/demo/EventRule/generated/python/rocketmq_eventbridge_demo/__init__.py
@@ -0,0 +1 @@
+__version__ = "1.0.0"
diff --git a/sdk/demo/EventRule/generated/python/rocketmq_eventbridge_demo/demo.py b/sdk/demo/EventRule/generated/python/rocketmq_eventbridge_demo/demo.py
new file mode 100644
index 0000000..a8142e7
--- /dev/null
+++ b/sdk/demo/EventRule/generated/python/rocketmq_eventbridge_demo/demo.py
@@ -0,0 +1,247 @@
+# -*- coding: utf-8 -*-
+# This file is auto-generated, don't edit it. Thanks.
+from rocketmq_eventbridge.client import Client as SDKClientClient
+from alibabacloud_tea_openapi import models as open_api_models
+from rocketmq_eventbridge import models as sdkclient_models
+from alibabacloud_tea_console.client import Client as ConsoleClient
+from alibabacloud_tea_util.client import Client as UtilClient
+
+
+class Demo:
+ _sdk_client: SDKClientClient = None
+ _endpoint: str = None
+
+ def __init__(self):
+ self._endpoint = '127.0.0.1:7001'
+ config = open_api_models.Config(
+ endpoint=self._endpoint
+ )
+ self._sdk_client = SDKClientClient(config)
+
+ def test_create_event_rule(self) -> None:
+ """
+ EventRule Controller apis:
+ createEventRule *\
+ getEventRule *\
+ deleteEventRule *\
+ updateEventRule *\
+ listEventRules *\
+ enableEventRule *\
+ disableEventRule *\
+ """
+ request = sdkclient_models.CreateEventRuleRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule',
+ description='an event rule for test',
+ filter_pattern='{}'
+ )
+ try:
+ res = self._sdk_client.create_event_rule(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_create_event_rule_async(self) -> None:
+ """
+ EventRule Controller apis:
+ createEventRule *\
+ getEventRule *\
+ deleteEventRule *\
+ updateEventRule *\
+ listEventRules *\
+ enableEventRule *\
+ disableEventRule *\
+ """
+ request = sdkclient_models.CreateEventRuleRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule',
+ description='an event rule for test',
+ filter_pattern='{}'
+ )
+ try:
+ res = await self._sdk_client.create_event_rule_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_get_event_rule(self) -> None:
+ request = sdkclient_models.GetEventRuleRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule'
+ )
+ try:
+ res = self._sdk_client.get_event_rule(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_get_event_rule_async(self) -> None:
+ request = sdkclient_models.GetEventRuleRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule'
+ )
+ try:
+ res = await self._sdk_client.get_event_rule_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_delete_event_rule(self) -> None:
+ request = sdkclient_models.DeleteEventRuleRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule'
+ )
+ try:
+ res = self._sdk_client.delete_event_rule(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_delete_event_rule_async(self) -> None:
+ request = sdkclient_models.DeleteEventRuleRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule'
+ )
+ try:
+ res = await self._sdk_client.delete_event_rule_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_update_event_rule(self) -> None:
+ request = sdkclient_models.UpdateEventRuleRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule',
+ description='new description for testing update API',
+ filter_pattern='{}'
+ )
+ try:
+ res = self._sdk_client.update_event_rule(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_update_event_rule_async(self) -> None:
+ request = sdkclient_models.UpdateEventRuleRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule',
+ description='new description for testing update API',
+ filter_pattern='{}'
+ )
+ try:
+ res = await self._sdk_client.update_event_rule_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_list_event_rules(self) -> None:
+ request = sdkclient_models.ListEventRulesRequest(
+ event_bus_name='newBus',
+ max_results=2,
+ next_token='0'
+ )
+ try:
+ res = self._sdk_client.list_event_rules(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_list_event_rules_async(self) -> None:
+ request = sdkclient_models.ListEventRulesRequest(
+ event_bus_name='newBus',
+ max_results=2,
+ next_token='0'
+ )
+ try:
+ res = await self._sdk_client.list_event_rules_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_enable_event_rule(self) -> None:
+ request = sdkclient_models.EnableEventRuleRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule'
+ )
+ try:
+ res = self._sdk_client.enable_event_rule(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_enable_event_rule_async(self) -> None:
+ request = sdkclient_models.EnableEventRuleRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule'
+ )
+ try:
+ res = await self._sdk_client.enable_event_rule_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_disable_event_rule(self) -> None:
+ request = sdkclient_models.DisableEventRuleRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule'
+ )
+ try:
+ res = self._sdk_client.disable_event_rule(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_disable_event_rule_async(self) -> None:
+ request = sdkclient_models.DisableEventRuleRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule'
+ )
+ try:
+ res = await self._sdk_client.disable_event_rule_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+demo = Demo()
+demo.test_list_event_rules()
diff --git a/sdk/demo/EventRule/generated/python/setup.py b/sdk/demo/EventRule/generated/python/setup.py
new file mode 100644
index 0000000..3824f4c
--- /dev/null
+++ b/sdk/demo/EventRule/generated/python/setup.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+"""
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+"""
+
+import os
+from setuptools import setup, find_packages
+
+"""
+setup module for rocketmq_eventbridge_demo.
+
+Created on 14/10/2024
+
+@author:
+"""
+
+PACKAGE = "rocketmq_eventbridge_demo"
+NAME = "rocketmq_eventbridge_demo" or "alibabacloud-package"
+DESCRIPTION = "Alibaba Cloud eventbridge (20240701) SDK Library for Python"
+AUTHOR = ""
+AUTHOR_EMAIL = ""
+URL = "unavailable"
+VERSION = __import__(PACKAGE).__version__
+REQUIRES = [
+ "alibabacloud_tea_util>=0.3.13, <1.0.0",
+ "alibabacloud_tea_openapi>=0.3.12, <1.0.0",
+ "rocketmq_eventbridge20240701>=0.0.0, <1.0.0",
+ "alibabacloud_tea_console>=0.0.1, <1.0.0"
+]
+
+LONG_DESCRIPTION = ''
+if os.path.exists('./README.md'):
+ with open("README.md", encoding='utf-8') as fp:
+ LONG_DESCRIPTION = fp.read()
+
+setup(
+ name=NAME,
+ version=VERSION,
+ description=DESCRIPTION,
+ long_description=LONG_DESCRIPTION,
+ long_description_content_type='text/markdown',
+ author=AUTHOR,
+ author_email=AUTHOR_EMAIL,
+ license="Apache License 2.0",
+ url=URL,
+ keywords=["rocketmq","eventbridge","demo"],
+ packages=find_packages(exclude=["tests*"]),
+ include_package_data=True,
+ platforms="any",
+ install_requires=REQUIRES,
+ python_requires=">=3.6",
+ classifiers=(
+ "Development Status :: 4 - Beta",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: Apache Software License",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.6",
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ "Topic :: Software Development"
+ )
+)
diff --git a/sdk/demo/EventRule/generated/ts/package.json b/sdk/demo/EventRule/generated/ts/package.json
new file mode 100644
index 0000000..be9669b
--- /dev/null
+++ b/sdk/demo/EventRule/generated/ts/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "",
+ "version": "1.0.0",
+ "description": "",
+ "main": "dist/client.js",
+ "scripts": {
+ "test": "mocha --reporter spec --timeout 3000 test/*.test.js",
+ "test-cov": "nyc -e .ts -r=html -r=text -r=lcov npm run test",
+ "build": "tsc",
+ "prepublishOnly": "tsc"
+ },
+ "author": "",
+ "license": "ISC",
+ "devDependencies": {
+ "@types/node": "^12.12.26",
+ "nyc": "^15.0.0",
+ "source-map-support": "^0.5.16",
+ "ts-node": "^8.6.2",
+ "typescript": "^3.7.5"
+ },
+ "dependencies": {
+ "@alicloud/tea-typescript": "^1.7.1",
+ "@alicloud/tea-util": "^1.4.9",
+ "@alicloud/openapi-client": "^0.4.12",
+ "@alicloud/tea-console": "^1.0.0"
+ },
+ "files": [
+ "dist",
+ "src"
+ ]
+}
\ No newline at end of file
diff --git a/sdk/demo/EventRule/generated/ts/src/client.ts b/sdk/demo/EventRule/generated/ts/src/client.ts
new file mode 100644
index 0000000..f0ac25d
--- /dev/null
+++ b/sdk/demo/EventRule/generated/ts/src/client.ts
@@ -0,0 +1,150 @@
+// This file is auto-generated, don't edit it
+import Util from '@alicloud/tea-util';
+import OpenApi, * as $OpenApi from '@alicloud/openapi-client';
+import SDKClient, * as $SDKClient from '../../../../../generated/ts/src/client';
+import Console from '@alicloud/tea-console';
+import * as $tea from '@alicloud/tea-typescript';
+
+
+export default class Client {
+ _sdkClient: SDKClient;
+ _endpoint: string;
+
+ constructor() {
+ this._endpoint = "127.0.0.1:7001";
+ let config = new $OpenApi.Config({
+ endpoint: this._endpoint,
+ });
+ this._sdkClient = new SDKClient(config);
+ }
+
+
+ /**
+ * @remarks
+ * EventRule Controller apis:
+ * createEventRule *
+ * getEventRule *
+ * deleteEventRule *
+ * updateEventRule *
+ * listEventRules *
+ * enableEventRule *
+ * disableEventRule *
+ */
+ async testCreateEventRule(): Promise<void> {
+ let request = new $SDKClient.CreateEventRuleRequest({
+ eventBusName: "newBus",
+ eventRuleName: "newRule",
+ description: "an event rule for test",
+ filterPattern: "{}",
+ });
+ try {
+ let res = await this._sdkClient.createEventRule(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testGetEventRule(): Promise<void> {
+ let request = new $SDKClient.GetEventRuleRequest({
+ eventBusName: "newBus",
+ eventRuleName: "newRule",
+ });
+ try {
+ let res = await this._sdkClient.getEventRule(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testDeleteEventRule(): Promise<void> {
+ let request = new $SDKClient.DeleteEventRuleRequest({
+ eventBusName: "newBus",
+ eventRuleName: "newRule",
+ });
+ try {
+ let res = await this._sdkClient.deleteEventRule(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testUpdateEventRule(): Promise<void> {
+ let request = new $SDKClient.UpdateEventRuleRequest({
+ eventBusName: "newBus",
+ eventRuleName: "newRule",
+ description: "new description for testing update API",
+ filterPattern: "{}",
+ });
+ try {
+ let res = await this._sdkClient.updateEventRule(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testListEventRules(): Promise<void> {
+ let request = new $SDKClient.ListEventRulesRequest({
+ eventBusName: "newBus",
+ maxResults: 2,
+ nextToken: "0",
+ });
+ try {
+ let res = await this._sdkClient.listEventRules(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testEnableEventRule(): Promise<void> {
+ let request = new $SDKClient.EnableEventRuleRequest({
+ eventBusName: "newBus",
+ eventRuleName: "newRule",
+ });
+ try {
+ let res = await this._sdkClient.enableEventRule(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testDisableEventRule(): Promise<void> {
+ let request = new $SDKClient.DisableEventRuleRequest({
+ eventBusName: "newBus",
+ eventRuleName: "newRule",
+ });
+ try {
+ let res = await this._sdkClient.disableEventRule(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+}
diff --git a/sdk/demo/EventRule/generated/ts/src/main.ts b/sdk/demo/EventRule/generated/ts/src/main.ts
new file mode 100644
index 0000000..0d262db
--- /dev/null
+++ b/sdk/demo/EventRule/generated/ts/src/main.ts
@@ -0,0 +1,4 @@
+import Client from './client'
+
+let c = new Client()
+c.testListEventRules()
diff --git a/sdk/demo/EventRule/generated/ts/tsconfig.json b/sdk/demo/EventRule/generated/ts/tsconfig.json
new file mode 100644
index 0000000..ae66f5b
--- /dev/null
+++ b/sdk/demo/EventRule/generated/ts/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "compilerOptions": {
+ "target": "es2017",
+ "module": "commonjs",
+ "declaration": true,
+ "sourceMap": true,
+ "outDir": "./dist",
+ "esModuleInterop": true
+ },
+ "include": [
+ "src/**/*"
+ ]
+}
\ No newline at end of file
diff --git a/sdk/demo/EventSource/Darafile b/sdk/demo/EventSource/Darafile
new file mode 100644
index 0000000..b15ddca
--- /dev/null
+++ b/sdk/demo/EventSource/Darafile
@@ -0,0 +1,66 @@
+{
+ "scope": "Demo",
+ "name": "demo",
+ "version": "0.0.0",
+ "main": "./demo.dara",
+ "libraries": {
+ "SDKClient" : "../../",
+ "Util": "darabonba:Util:*",
+ "OpenApi": "alibabacloud:OpenApi:*",
+ "OpenApiUtil": "alibabacloud:OpenApiUtil:*",
+ "Console": "darabonba:Console:*"
+ },
+ "java": {
+ "package": "org.apache.rocketmq.eventbridge.demo",
+ "className": "Demo",
+ "packageInfo": {
+ "groupId": "org.apache.rocketmq.eventbridge",
+ "artifactId": "demo",
+ "version": "0.0.0",
+ "description": "EventBridge SDK demo for Java",
+ "url": "",
+ "licenseName": "The Apache License, Version 2.0",
+ "licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt",
+ "developerId": "ludi",
+ "developerName": "EventBridge SDK",
+ "developerEmail": "zjuludi@gmail.com",
+ "scmConnection": "",
+ "scmDeveloperConnection": "",
+ "scmUrl": ""
+ }
+ },
+ "go": {
+ "clientName": "DemoClient"
+ },
+ "csharp": {
+ "className": "Demo",
+ "namespace": "RocketMQ.Eventbridge.Demo",
+ "packageInfo": {
+ "name": "sdkDemo",
+ "version": "0.0.0",
+ "title": "eventbridge-sdk-demo",
+ "description": "open source eventbridge (20240701) SDK Demo Library for .NET"
+ }
+ },
+ "php": {
+ "package": "RocketMQ.Eventbridge.SDK.Demo",
+ "clientName": "Demo",
+ "packageInfo": {
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "desc": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "github": "unavailable",
+ "files": {
+ "LICENSE": "../LICENSE"
+ }
+ }
+ },
+ "python": {
+ "package": "rocketmq_eventbridge_demo",
+ "clientName": "demo",
+ "packageInfo": {
+ "name": "rocketmq_eventbridge_demo",
+ "desc": "Alibaba Cloud eventbridge (20240701) SDK Library for Python",
+ "github": "unavailable"
+ }
+ }
+}
\ No newline at end of file
diff --git a/sdk/demo/EventSource/demo.dara b/sdk/demo/EventSource/demo.dara
new file mode 100644
index 0000000..86ea869
--- /dev/null
+++ b/sdk/demo/EventSource/demo.dara
@@ -0,0 +1,118 @@
+import Util;
+import OpenApi;
+import SDKClient;
+import Console;
+
+type @sdkClient = SDKClient;
+type @endpoint = string;
+
+init(){
+ @endpoint = '127.0.0.1:7001';
+ var config = new OpenApi.Config{
+ endpoint = @endpoint
+ };
+ @sdkClient = new SDKClient(config);
+}
+
+/**
+ EventSource Controller apis:
+ * createEventSource *
+ * updateEventSource *
+ * deleteEventSource *
+ * getEventSource *
+ * listEventSources *
+*/
+
+async function testCreateEventSource(): void {
+ var request = new SDKClient.CreateEventSourceRequest{
+ eventBusName = 'newBus',
+ eventSourceName = 'newSource',
+ description = 'a source for test'
+ };
+
+ try {
+ var res = @sdkClient.createEventSource(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testUpdateEventSource(): void {
+ var request = new SDKClient.UpdateEventSourceRequest{
+ eventBusName = 'newBus',
+ eventSourceName = 'newSource',
+ description = 'new description for testing Update API'
+ };
+
+ try {
+ var res = @sdkClient.updateEventSource(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testDeleteEventSource(): void {
+ var request = new SDKClient.DeleteEventSourceRequest{
+ eventBusName = 'newBus',
+ eventSourceName = 'newSource'
+ };
+
+ try {
+ var res = @sdkClient.deleteEventSource(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testGetEventSource(): void {
+ var request = new SDKClient.GetEventSourceRequest{
+ eventBusName = 'newBus',
+ eventSourceName = 'newSource'
+ };
+
+ try {
+ var res = @sdkClient.getEventSource(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testListEventSources(): void {
+ var request = new SDKClient.ListEventSourcesRequest{
+ eventBusName = 'newBus',
+ eventSourceType = 'USER_DEFINED',
+ maxResults = 10,
+ nextToken = "0"
+ };
+
+ try {
+ var res = @sdkClient.listEventSources(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
diff --git a/sdk/demo/EventSource/generated/csharp/core/Demo.cs b/sdk/demo/EventSource/generated/csharp/core/Demo.cs
new file mode 100644
index 0000000..56d5b8e
--- /dev/null
+++ b/sdk/demo/EventSource/generated/csharp/core/Demo.cs
@@ -0,0 +1,382 @@
+// This file is auto-generated, don't edit it. Thanks.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+
+using Tea;
+using Tea.Utils;
+
+
+namespace RocketMQ.Eventbridge.Demo
+{
+ public class Demo
+ {
+ protected RocketMQ.Eventbridge.SDK.SDKClient _sdkClient;
+ protected string _endpoint;
+
+ public Demo()
+ {
+ this._endpoint = "127.0.0.1:7001";
+ AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config
+ {
+ Endpoint = _endpoint,
+ };
+ this._sdkClient = new RocketMQ.Eventbridge.SDK.SDKClient(config);
+ }
+
+ static void Main(string[] _args){
+ Demo demo = new Demo();
+ demo.TestListEventSources();
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>EventSource Controller apis:
+ /// createEventSource *
+ /// updateEventSource *
+ /// deleteEventSource *
+ /// getEventSource *
+ /// listEventSources *</para>
+ /// </description>
+ public void TestCreateEventSource()
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventSourceRequest request = new RocketMQ.Eventbridge.SDK.Models.CreateEventSourceRequest
+ {
+ EventBusName = "newBus",
+ EventSourceName = "newSource",
+ Description = "a source for test",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventSourceResponse res = this._sdkClient.CreateEventSource(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>EventSource Controller apis:
+ /// createEventSource *
+ /// updateEventSource *
+ /// deleteEventSource *
+ /// getEventSource *
+ /// listEventSources *</para>
+ /// </description>
+ public async Task TestCreateEventSourceAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventSourceRequest request = new RocketMQ.Eventbridge.SDK.Models.CreateEventSourceRequest
+ {
+ EventBusName = "newBus",
+ EventSourceName = "newSource",
+ Description = "a source for test",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventSourceResponse res = await this._sdkClient.CreateEventSourceAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestUpdateEventSource()
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateEventSourceRequest request = new RocketMQ.Eventbridge.SDK.Models.UpdateEventSourceRequest
+ {
+ EventBusName = "newBus",
+ EventSourceName = "newSource",
+ Description = "new description for testing Update API",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateEventSourceResponse res = this._sdkClient.UpdateEventSource(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestUpdateEventSourceAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateEventSourceRequest request = new RocketMQ.Eventbridge.SDK.Models.UpdateEventSourceRequest
+ {
+ EventBusName = "newBus",
+ EventSourceName = "newSource",
+ Description = "new description for testing Update API",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateEventSourceResponse res = await this._sdkClient.UpdateEventSourceAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestDeleteEventSource()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventSourceRequest request = new RocketMQ.Eventbridge.SDK.Models.DeleteEventSourceRequest
+ {
+ EventBusName = "newBus",
+ EventSourceName = "newSource",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventSourceResponse res = this._sdkClient.DeleteEventSource(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestDeleteEventSourceAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventSourceRequest request = new RocketMQ.Eventbridge.SDK.Models.DeleteEventSourceRequest
+ {
+ EventBusName = "newBus",
+ EventSourceName = "newSource",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventSourceResponse res = await this._sdkClient.DeleteEventSourceAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestGetEventSource()
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetEventSourceRequest request = new RocketMQ.Eventbridge.SDK.Models.GetEventSourceRequest
+ {
+ EventBusName = "newBus",
+ EventSourceName = "newSource",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetEventSourceResponse res = this._sdkClient.GetEventSource(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestGetEventSourceAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetEventSourceRequest request = new RocketMQ.Eventbridge.SDK.Models.GetEventSourceRequest
+ {
+ EventBusName = "newBus",
+ EventSourceName = "newSource",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.GetEventSourceResponse res = await this._sdkClient.GetEventSourceAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestListEventSources()
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventSourcesRequest request = new RocketMQ.Eventbridge.SDK.Models.ListEventSourcesRequest
+ {
+ EventBusName = "newBus",
+ EventSourceType = "USER_DEFINED",
+ MaxResults = 10,
+ NextToken = "0",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventSourcesResponse res = this._sdkClient.ListEventSources(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestListEventSourcesAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventSourcesRequest request = new RocketMQ.Eventbridge.SDK.Models.ListEventSourcesRequest
+ {
+ EventBusName = "newBus",
+ EventSourceType = "USER_DEFINED",
+ MaxResults = 10,
+ NextToken = "0",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventSourcesResponse res = await this._sdkClient.ListEventSourcesAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ }
+}
diff --git a/sdk/demo/EventSource/generated/csharp/core/Properties/AssemblyInfo.cs b/sdk/demo/EventSource/generated/csharp/core/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..d3ad26b
--- /dev/null
+++ b/sdk/demo/EventSource/generated/csharp/core/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("eventbridge-sdk-demo")]
+[assembly: AssemblyDescription("open source eventbridge (20240701) SDK Demo Library for .NET")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("4d52c220-8a2f-11ef-86de-b912b93e8d64")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("0.0.1.0")]
+[assembly: AssemblyFileVersion("0.0.1.0")]
diff --git a/sdk/demo/EventSource/generated/csharp/core/sdkDemo.csproj b/sdk/demo/EventSource/generated/csharp/core/sdkDemo.csproj
new file mode 100644
index 0000000..8ea12bc
--- /dev/null
+++ b/sdk/demo/EventSource/generated/csharp/core/sdkDemo.csproj
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFrameworks>netstandard2.0;net45;netcoreapp8.0</TargetFrameworks>
+ <RootNamespace>RocketMQ.Eventbridge.Demo</RootNamespace>
+ <OutputType>Exe</OutputType>
+ <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
+ <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+ <AssemblyName>RocketMQ.Eventbridge.Demo</AssemblyName>
+ <Version/>
+ <LangVersion>5</LangVersion>
+ <Description>open source eventbridge (20240701) SDK Demo Library for .NET</Description>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
+ <DefineConstants>NETSTANDARD2_0</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <DefineConstants>NET45</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <Reference Include="mscorlib"/>
+ <Reference Include="System"/>
+ <Reference Include="System.Core"/>
+ <Reference Include="Microsoft.CSharp"/>
+ <Reference Include="System.Data"/>
+ <Reference Include="System.Web"/>
+ <Reference Include="System.Drawing"/>
+ <Reference Include="System.Security"/>
+ <Reference Include="System.Xml"/>
+ <Reference Include="System.Configuration"/>
+ <Reference Include="System.Net.Http"/>
+ </ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
+ </PackageReference>
+ <PackageReference Include="AlibabaCloud.TeaUtil" Version="0.1.19"/>
+ <PackageReference Include="AlibabaCloud.OpenApiClient" Version="0.1.12"/>
+ <PackageReference Include="RocketMQ.Eventbridge.SDK" Version="1.0.0"/>
+ <PackageReference Include="AlibabaCloud.TeaConsole" Version="0.1.0"/>
+ <PackageReference Include="Tea" Version="1.1.0"/>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/sdk/demo/EventSource/generated/go/client/client.go b/sdk/demo/EventSource/generated/go/client/client.go
new file mode 100644
index 0000000..bf48f70
--- /dev/null
+++ b/sdk/demo/EventSource/generated/go/client/client.go
@@ -0,0 +1,236 @@
+// This file is auto-generated, don't edit it. Thanks.
+package client
+
+import (
+ openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
+ console "github.com/alibabacloud-go/tea-console/client"
+ util "github.com/alibabacloud-go/tea-utils/v2/service"
+ "github.com/alibabacloud-go/tea/tea"
+ sdkclient "github.com/org-apache-rocketmq/eventbridge-sdk/client"
+)
+
+type DemoClient struct {
+ SdkClient *sdkclient.Client
+ Endpoint *string
+}
+
+func NewClient() (*DemoClient, error) {
+ client := new(DemoClient)
+ err := client.Init()
+ return client, err
+}
+
+func (client *DemoClient) Init() (_err error) {
+ client.Endpoint = tea.String("127.0.0.1:7001")
+ config := &openapi.Config{
+ Endpoint: client.Endpoint,
+ }
+ client.SdkClient, _err = sdkclient.NewClient(config)
+ if _err != nil {
+ return _err
+ }
+
+ return nil
+}
+
+// Description:
+//
+// EventSource Controller apis:
+//
+// createEventSource *
+//
+// updateEventSource *
+//
+// deleteEventSource *
+//
+// getEventSource *
+//
+// listEventSources *
+func (client *DemoClient) TestCreateEventSource() (_err error) {
+ request := &sdkclient.CreateEventSourceRequest{
+ EventBusName: tea.String("newBus"),
+ EventSourceName: tea.String("newSource"),
+ Description: tea.String("a source for test"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.CreateEventSource(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestUpdateEventSource() (_err error) {
+ request := &sdkclient.UpdateEventSourceRequest{
+ EventBusName: tea.String("newBus"),
+ EventSourceName: tea.String("newSource"),
+ Description: tea.String("new description for testing Update API"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.UpdateEventSource(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestDeleteEventSource() (_err error) {
+ request := &sdkclient.DeleteEventSourceRequest{
+ EventBusName: tea.String("newBus"),
+ EventSourceName: tea.String("newSource"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.DeleteEventSource(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestGetEventSource() (_err error) {
+ request := &sdkclient.GetEventSourceRequest{
+ EventBusName: tea.String("newBus"),
+ EventSourceName: tea.String("newSource"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.GetEventSource(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestListEventSources() (_err error) {
+ request := &sdkclient.ListEventSourcesRequest{
+ EventBusName: tea.String("newBus"),
+ EventSourceType: tea.String("USER_DEFINED"),
+ MaxResults: tea.Int32(10),
+ NextToken: tea.String("0"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.ListEventSources(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
diff --git a/sdk/demo/EventSource/generated/go/go.mod b/sdk/demo/EventSource/generated/go/go.mod
new file mode 100644
index 0000000..ff35824
--- /dev/null
+++ b/sdk/demo/EventSource/generated/go/go.mod
@@ -0,0 +1,9 @@
+module client
+
+require (
+ github.com/alibabacloud-go/tea-utils/v2 v2.0.6
+ github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10
+ github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0
+ github.com/alibabacloud-go/tea-console v1.0.0
+)
+replace github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0 => ../../../../generated/go/
diff --git a/sdk/demo/EventSource/generated/go/main.go b/sdk/demo/EventSource/generated/go/main.go
new file mode 100644
index 0000000..99f5dcf
--- /dev/null
+++ b/sdk/demo/EventSource/generated/go/main.go
@@ -0,0 +1,11 @@
+package main
+
+import (
+ "client/client"
+)
+
+func main() {
+ demo := new(client.DemoClient)
+ demo.Init()
+ demo.TestCreateEventSource()
+}
diff --git a/sdk/demo/EventSource/generated/java/pom.xml b/sdk/demo/EventSource/generated/java/pom.xml
new file mode 100644
index 0000000..ef0ec32
--- /dev/null
+++ b/sdk/demo/EventSource/generated/java/pom.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>demo</artifactId>
+ <version>0.0.0</version>
+ <packaging>jar</packaging>
+ <name>demo</name>
+ <description>EventBridge SDK demo for Java
+ </description>
+ <url></url>
+ <licenses>
+ <license>
+ <name>The Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ </license>
+ </licenses>
+ <developers>
+ <developer>
+ <id>ludi</id>
+ <name>EventBridge SDK</name>
+ <email>zjuludi@gmail.com</email>
+ </developer>
+ </developers>
+ <distributionManagement>
+ <snapshotRepository>
+ <id>sonatype-nexus-snapshots</id>
+ <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ <repository>
+ <id>sonatype-nexus-staging</id>
+ <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+ </repository>
+ </distributionManagement>
+ <scm>
+ <connection></connection>
+ <developerConnection></developerConnection>
+ <url></url>
+ </scm>
+ <dependencies>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-util</artifactId>
+ <version>0.2.23</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-openapi</artifactId>
+ <version>0.3.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>sdk</artifactId>
+ <version>0.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-console</artifactId>
+ <version>0.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea</artifactId>
+ <version>1.1.14</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.6.1</version>
+ <configuration>
+ <source>8</source>
+ <target>8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.6</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.6.3</version>
+ <extensions>true</extensions>
+ <configuration>
+ <serverId>sonatype-nexus-staging</serverId>
+ <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
+ <autoReleaseAfterClose>true</autoReleaseAfterClose>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.1.1</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <doclint>none</doclint>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.22.1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
diff --git a/sdk/demo/EventSource/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java b/sdk/demo/EventSource/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
new file mode 100644
index 0000000..ab4dd0d
--- /dev/null
+++ b/sdk/demo/EventSource/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
@@ -0,0 +1,139 @@
+// This file is auto-generated, don't edit it. Thanks.
+package org.apache.rocketmq.eventbridge.demo;
+
+import com.aliyun.tea.*;
+
+public class Demo {
+
+ public org.apache.rocketmq.eventbridge.sdk.Client _sdkClient;
+ public String _endpoint;
+ public Demo() throws Exception {
+ this._endpoint = "127.0.0.1:7001";
+ com.aliyun.teaopenapi.models.Config config = com.aliyun.teaopenapi.models.Config.build(TeaConverter.buildMap(
+ new TeaPair("endpoint", _endpoint)
+ ));
+ this._sdkClient = new org.apache.rocketmq.eventbridge.sdk.Client(config);
+ }
+
+ public static void main(String[] args) {
+ try {
+ Demo demo = new Demo();
+ demo.testListEventSources();
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+
+ /**
+ * <b>description</b> :
+ * <p>EventSource Controller apis:
+ * createEventSource *
+ * updateEventSource *
+ * deleteEventSource *
+ * getEventSource *
+ * listEventSources *</p>
+ */
+ public void testCreateEventSource() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.CreateEventSourceRequest request = org.apache.rocketmq.eventbridge.sdk.models.CreateEventSourceRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventSourceName", "newSource"),
+ new TeaPair("description", "a source for test")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.CreateEventSourceResponse res = _sdkClient.createEventSource(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testUpdateEventSource() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.UpdateEventSourceRequest request = org.apache.rocketmq.eventbridge.sdk.models.UpdateEventSourceRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventSourceName", "newSource"),
+ new TeaPair("description", "new description for testing Update API")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.UpdateEventSourceResponse res = _sdkClient.updateEventSource(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testDeleteEventSource() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.DeleteEventSourceRequest request = org.apache.rocketmq.eventbridge.sdk.models.DeleteEventSourceRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventSourceName", "newSource")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.DeleteEventSourceResponse res = _sdkClient.deleteEventSource(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testGetEventSource() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.GetEventSourceRequest request = org.apache.rocketmq.eventbridge.sdk.models.GetEventSourceRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventSourceName", "newSource")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.GetEventSourceResponse res = _sdkClient.getEventSource(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testListEventSources() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.ListEventSourcesRequest request = org.apache.rocketmq.eventbridge.sdk.models.ListEventSourcesRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventSourceType", "USER_DEFINED"),
+ new TeaPair("maxResults", 10),
+ new TeaPair("nextToken", "0")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.ListEventSourcesResponse res = _sdkClient.listEventSources(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/EventSource/generated/php/.gitignore b/sdk/demo/EventSource/generated/php/.gitignore
new file mode 100644
index 0000000..89c7aa5
--- /dev/null
+++ b/sdk/demo/EventSource/generated/php/.gitignore
@@ -0,0 +1,15 @@
+composer.phar
+/vendor/
+
+# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
+# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
+composer.lock
+
+.vscode/
+.idea
+.DS_Store
+
+cache/
+*.cache
+runtime/
+.php_cs.cache
diff --git a/sdk/demo/EventSource/generated/php/.php_cs.dist b/sdk/demo/EventSource/generated/php/.php_cs.dist
new file mode 100644
index 0000000..8617ec2
--- /dev/null
+++ b/sdk/demo/EventSource/generated/php/.php_cs.dist
@@ -0,0 +1,65 @@
+<?php
+/*
+ * This document has been generated with
+ * https://mlocati.github.io/php-cs-fixer-configurator/#version:2.15|configurator
+ * you can change this configuration by importing this file.
+ */
+
+return PhpCsFixer\Config::create()
+ ->setRiskyAllowed(true)
+ ->setIndent(' ')
+ ->setRules([
+ '@PSR2' => true,
+ '@PhpCsFixer' => true,
+ '@Symfony:risky' => true,
+ 'concat_space' => ['spacing' => 'one'],
+ 'array_syntax' => ['syntax' => 'short'],
+ 'array_indentation' => true,
+ 'combine_consecutive_unsets' => true,
+ 'method_separation' => true,
+ 'single_quote' => true,
+ 'declare_equal_normalize' => true,
+ 'function_typehint_space' => true,
+ 'hash_to_slash_comment' => true,
+ 'include' => true,
+ 'lowercase_cast' => true,
+ 'no_multiline_whitespace_before_semicolons' => true,
+ 'no_leading_import_slash' => true,
+ 'no_multiline_whitespace_around_double_arrow' => true,
+ 'no_spaces_around_offset' => true,
+ 'no_unneeded_control_parentheses' => true,
+ 'no_unused_imports' => true,
+ 'no_whitespace_before_comma_in_array' => true,
+ 'no_whitespace_in_blank_line' => true,
+ 'object_operator_without_whitespace' => true,
+ 'single_blank_line_before_namespace' => true,
+ 'single_class_element_per_statement' => true,
+ 'space_after_semicolon' => true,
+ 'standardize_not_equals' => true,
+ 'ternary_operator_spaces' => true,
+ 'trailing_comma_in_multiline_array' => true,
+ 'trim_array_spaces' => true,
+ 'unary_operator_spaces' => true,
+ 'whitespace_after_comma_in_array' => true,
+ 'no_extra_consecutive_blank_lines' => [
+ 'curly_brace_block',
+ 'extra',
+ 'parenthesis_brace_block',
+ 'square_brace_block',
+ 'throw',
+ 'use',
+ ],
+ 'binary_operator_spaces' => [
+ 'align_double_arrow' => true,
+ 'align_equals' => true,
+ ],
+ 'braces' => [
+ 'allow_single_line_closure' => true,
+ ],
+ ])
+ ->setFinder(
+ PhpCsFixer\Finder::create()
+ ->exclude('vendor')
+ ->exclude('tests')
+ ->in(__DIR__)
+ );
diff --git a/sdk/demo/EventSource/generated/php/autoload.php b/sdk/demo/EventSource/generated/php/autoload.php
new file mode 100644
index 0000000..5bfe0a1
--- /dev/null
+++ b/sdk/demo/EventSource/generated/php/autoload.php
@@ -0,0 +1,15 @@
+<?php
+
+if (file_exists(__DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php')) {
+ require_once __DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
+}
+
+spl_autoload_register(function ($class) {
+ $name = str_replace('RocketMQ\\Eventbridge\\SDK\\Demo\\', '', $class);
+ $file = __DIR__ . \DIRECTORY_SEPARATOR . 'src' . \DIRECTORY_SEPARATOR . str_replace('\\', \DIRECTORY_SEPARATOR, $name) . '.php';
+ if (file_exists($file)) {
+ require_once $file;
+ return true;
+ }
+ return false;
+});
diff --git a/sdk/demo/EventSource/generated/php/composer.json b/sdk/demo/EventSource/generated/php/composer.json
new file mode 100644
index 0000000..2edbfb8
--- /dev/null
+++ b/sdk/demo/EventSource/generated/php/composer.json
@@ -0,0 +1,34 @@
+{
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "description": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "type": "library",
+ "license": "Apache-2.0",
+ "authors": [],
+ "require": {
+ "php": ">5.5",
+ "alibabacloud/tea-utils": "^0.2.21",
+ "alibabacloud/darabonba-openapi": "^0.2.12",
+ "rocketmq/eventbridge-sdk": "^0.0.0",
+ "alibabacloud/tea-console": "^0.1.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "RocketMQ\\Eventbridge\\SDK\\Demo\\": "src"
+ }
+ },
+ "scripts": {
+ "fixer": "php-cs-fixer fix ./"
+ },
+ "config": {
+ "sort-packages": true,
+ "preferred-install": "dist",
+ "optimize-autoloader": true
+ },
+ "prefer-stable": true,
+ "repositories": {
+ "rocketmq":{
+ "type" : "path",
+ "url": "../../../../generated/php"
+ }
+ }
+}
diff --git a/sdk/demo/EventSource/generated/php/main.php b/sdk/demo/EventSource/generated/php/main.php
new file mode 100644
index 0000000..8ac08ad
--- /dev/null
+++ b/sdk/demo/EventSource/generated/php/main.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace RocketMQ\Eventbridge\SDK\Demo;
+require 'vendor/autoload.php';
+include 'src/Demo.php';
+
+$demo = new Demo();
+$demo->testListEventSources();
diff --git a/sdk/demo/EventSource/generated/php/src/Demo.php b/sdk/demo/EventSource/generated/php/src/Demo.php
new file mode 100644
index 0000000..2d3bbfc
--- /dev/null
+++ b/sdk/demo/EventSource/generated/php/src/Demo.php
@@ -0,0 +1,161 @@
+<?php
+
+// This file is auto-generated, don't edit it. Thanks.
+namespace RocketMQ\Eventbridge\SDK\Demo;
+
+use RocketMQ\Eventbridge\SDK\SDKClient;
+use AlibabaCloud\Tea\Utils\Utils;
+use AlibabaCloud\Tea\Console\Console;
+use \Exception;
+use AlibabaCloud\Tea\Exception\TeaError;
+
+use Darabonba\OpenApi\Models\Config;
+use RocketMQ\Eventbridge\SDK\Models\CreateEventSourceRequest;
+use RocketMQ\Eventbridge\SDK\Models\UpdateEventSourceRequest;
+use RocketMQ\Eventbridge\SDK\Models\DeleteEventSourceRequest;
+use RocketMQ\Eventbridge\SDK\Models\GetEventSourceRequest;
+use RocketMQ\Eventbridge\SDK\Models\ListEventSourcesRequest;
+
+class Demo {
+ protected $_sdkClient;
+
+ protected $_endpoint;
+
+ public function __construct(){
+ $this->_endpoint = "127.0.0.1:7001";
+ $config = new Config([
+ "endpoint" => $this->_endpoint
+ ]);
+ $this->_sdkClient = new SDKClient($config);
+ }
+
+ /**
+ * EventSource Controller apis:
+ * * createEventSource *
+ * * updateEventSource *
+ * * deleteEventSource *
+ * * getEventSource *
+ * * listEventSources *
+ * @return void
+ */
+ public function testCreateEventSource(){
+ $request = new CreateEventSourceRequest([
+ "eventBusName" => "newBus",
+ "eventSourceName" => "newSource",
+ "description" => "a source for test"
+ ]);
+ try {
+ $res = $this->_sdkClient->createEventSource($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testUpdateEventSource(){
+ $request = new UpdateEventSourceRequest([
+ "eventBusName" => "newBus",
+ "eventSourceName" => "newSource",
+ "description" => "new description for testing Update API"
+ ]);
+ try {
+ $res = $this->_sdkClient->updateEventSource($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testDeleteEventSource(){
+ $request = new DeleteEventSourceRequest([
+ "eventBusName" => "newBus",
+ "eventSourceName" => "newSource"
+ ]);
+ try {
+ $res = $this->_sdkClient->deleteEventSource($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testGetEventSource(){
+ $request = new GetEventSourceRequest([
+ "eventBusName" => "newBus",
+ "eventSourceName" => "newSource"
+ ]);
+ try {
+ $res = $this->_sdkClient->getEventSource($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testListEventSources(){
+ $request = new ListEventSourcesRequest([
+ "eventBusName" => "newBus",
+ "eventSourceType" => "USER_DEFINED",
+ "maxResults" => 10,
+ "nextToken" => "0"
+ ]);
+ try {
+ $res = $this->_sdkClient->listEventSources($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/EventSource/generated/python/.gitignore b/sdk/demo/EventSource/generated/python/.gitignore
new file mode 100644
index 0000000..2bcfffa
--- /dev/null
+++ b/sdk/demo/EventSource/generated/python/.gitignore
@@ -0,0 +1,5 @@
+runtime/
+.idea/
+.vscode/
+__pycache__/
+.pytest_cache/
\ No newline at end of file
diff --git a/sdk/demo/EventSource/generated/python/rocketmq_eventbridge_demo/__init__.py b/sdk/demo/EventSource/generated/python/rocketmq_eventbridge_demo/__init__.py
new file mode 100644
index 0000000..5becc17
--- /dev/null
+++ b/sdk/demo/EventSource/generated/python/rocketmq_eventbridge_demo/__init__.py
@@ -0,0 +1 @@
+__version__ = "1.0.0"
diff --git a/sdk/demo/EventSource/generated/python/rocketmq_eventbridge_demo/demo.py b/sdk/demo/EventSource/generated/python/rocketmq_eventbridge_demo/demo.py
new file mode 100644
index 0000000..b156681
--- /dev/null
+++ b/sdk/demo/EventSource/generated/python/rocketmq_eventbridge_demo/demo.py
@@ -0,0 +1,185 @@
+# -*- coding: utf-8 -*-
+# This file is auto-generated, don't edit it. Thanks.
+from rocketmq_eventbridge.client import Client as SDKClientClient
+from alibabacloud_tea_openapi import models as open_api_models
+from rocketmq_eventbridge import models as sdkclient_models
+from alibabacloud_tea_console.client import Client as ConsoleClient
+from alibabacloud_tea_util.client import Client as UtilClient
+
+
+class Demo:
+ _sdk_client: SDKClientClient = None
+ _endpoint: str = None
+
+ def __init__(self):
+ self._endpoint = '127.0.0.1:7001'
+ config = open_api_models.Config(
+ endpoint=self._endpoint
+ )
+ self._sdk_client = SDKClientClient(config)
+
+ def test_create_event_source(self) -> None:
+ """
+ EventSource Controller apis:
+ createEventSource *\
+ updateEventSource *\
+ deleteEventSource *\
+ getEventSource *\
+ listEventSources *\
+ """
+ request = sdkclient_models.CreateEventSourceRequest(
+ event_bus_name='newBus',
+ event_source_name='newSource',
+ description='a source for test'
+ )
+ try:
+ res = self._sdk_client.create_event_source(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_create_event_source_async(self) -> None:
+ """
+ EventSource Controller apis:
+ createEventSource *\
+ updateEventSource *\
+ deleteEventSource *\
+ getEventSource *\
+ listEventSources *\
+ """
+ request = sdkclient_models.CreateEventSourceRequest(
+ event_bus_name='newBus',
+ event_source_name='newSource',
+ description='a source for test'
+ )
+ try:
+ res = await self._sdk_client.create_event_source_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_update_event_source(self) -> None:
+ request = sdkclient_models.UpdateEventSourceRequest(
+ event_bus_name='newBus',
+ event_source_name='newSource',
+ description='new description for testing Update API'
+ )
+ try:
+ res = self._sdk_client.update_event_source(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_update_event_source_async(self) -> None:
+ request = sdkclient_models.UpdateEventSourceRequest(
+ event_bus_name='newBus',
+ event_source_name='newSource',
+ description='new description for testing Update API'
+ )
+ try:
+ res = await self._sdk_client.update_event_source_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_delete_event_source(self) -> None:
+ request = sdkclient_models.DeleteEventSourceRequest(
+ event_bus_name='newBus',
+ event_source_name='newSource'
+ )
+ try:
+ res = self._sdk_client.delete_event_source(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_delete_event_source_async(self) -> None:
+ request = sdkclient_models.DeleteEventSourceRequest(
+ event_bus_name='newBus',
+ event_source_name='newSource'
+ )
+ try:
+ res = await self._sdk_client.delete_event_source_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_get_event_source(self) -> None:
+ request = sdkclient_models.GetEventSourceRequest(
+ event_bus_name='newBus',
+ event_source_name='newSource'
+ )
+ try:
+ res = self._sdk_client.get_event_source(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_get_event_source_async(self) -> None:
+ request = sdkclient_models.GetEventSourceRequest(
+ event_bus_name='newBus',
+ event_source_name='newSource'
+ )
+ try:
+ res = await self._sdk_client.get_event_source_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_list_event_sources(self) -> None:
+ request = sdkclient_models.ListEventSourcesRequest(
+ event_bus_name='newBus',
+ event_source_type='USER_DEFINED',
+ max_results=10,
+ next_token='0'
+ )
+ try:
+ res = self._sdk_client.list_event_sources(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_list_event_sources_async(self) -> None:
+ request = sdkclient_models.ListEventSourcesRequest(
+ event_bus_name='newBus',
+ event_source_type='USER_DEFINED',
+ max_results=10,
+ next_token='0'
+ )
+ try:
+ res = await self._sdk_client.list_event_sources_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+demo = Demo()
+demo.test_list_event_sources()
diff --git a/sdk/demo/EventSource/generated/python/setup.py b/sdk/demo/EventSource/generated/python/setup.py
new file mode 100644
index 0000000..3824f4c
--- /dev/null
+++ b/sdk/demo/EventSource/generated/python/setup.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+"""
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+"""
+
+import os
+from setuptools import setup, find_packages
+
+"""
+setup module for rocketmq_eventbridge_demo.
+
+Created on 14/10/2024
+
+@author:
+"""
+
+PACKAGE = "rocketmq_eventbridge_demo"
+NAME = "rocketmq_eventbridge_demo" or "alibabacloud-package"
+DESCRIPTION = "Alibaba Cloud eventbridge (20240701) SDK Library for Python"
+AUTHOR = ""
+AUTHOR_EMAIL = ""
+URL = "unavailable"
+VERSION = __import__(PACKAGE).__version__
+REQUIRES = [
+ "alibabacloud_tea_util>=0.3.13, <1.0.0",
+ "alibabacloud_tea_openapi>=0.3.12, <1.0.0",
+ "rocketmq_eventbridge20240701>=0.0.0, <1.0.0",
+ "alibabacloud_tea_console>=0.0.1, <1.0.0"
+]
+
+LONG_DESCRIPTION = ''
+if os.path.exists('./README.md'):
+ with open("README.md", encoding='utf-8') as fp:
+ LONG_DESCRIPTION = fp.read()
+
+setup(
+ name=NAME,
+ version=VERSION,
+ description=DESCRIPTION,
+ long_description=LONG_DESCRIPTION,
+ long_description_content_type='text/markdown',
+ author=AUTHOR,
+ author_email=AUTHOR_EMAIL,
+ license="Apache License 2.0",
+ url=URL,
+ keywords=["rocketmq","eventbridge","demo"],
+ packages=find_packages(exclude=["tests*"]),
+ include_package_data=True,
+ platforms="any",
+ install_requires=REQUIRES,
+ python_requires=">=3.6",
+ classifiers=(
+ "Development Status :: 4 - Beta",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: Apache Software License",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.6",
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ "Topic :: Software Development"
+ )
+)
diff --git a/sdk/demo/EventSource/generated/ts/package.json b/sdk/demo/EventSource/generated/ts/package.json
new file mode 100644
index 0000000..be9669b
--- /dev/null
+++ b/sdk/demo/EventSource/generated/ts/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "",
+ "version": "1.0.0",
+ "description": "",
+ "main": "dist/client.js",
+ "scripts": {
+ "test": "mocha --reporter spec --timeout 3000 test/*.test.js",
+ "test-cov": "nyc -e .ts -r=html -r=text -r=lcov npm run test",
+ "build": "tsc",
+ "prepublishOnly": "tsc"
+ },
+ "author": "",
+ "license": "ISC",
+ "devDependencies": {
+ "@types/node": "^12.12.26",
+ "nyc": "^15.0.0",
+ "source-map-support": "^0.5.16",
+ "ts-node": "^8.6.2",
+ "typescript": "^3.7.5"
+ },
+ "dependencies": {
+ "@alicloud/tea-typescript": "^1.7.1",
+ "@alicloud/tea-util": "^1.4.9",
+ "@alicloud/openapi-client": "^0.4.12",
+ "@alicloud/tea-console": "^1.0.0"
+ },
+ "files": [
+ "dist",
+ "src"
+ ]
+}
\ No newline at end of file
diff --git a/sdk/demo/EventSource/generated/ts/src/client.ts b/sdk/demo/EventSource/generated/ts/src/client.ts
new file mode 100644
index 0000000..9b9d841
--- /dev/null
+++ b/sdk/demo/EventSource/generated/ts/src/client.ts
@@ -0,0 +1,115 @@
+// This file is auto-generated, don't edit it
+import Util from '@alicloud/tea-util';
+import OpenApi, * as $OpenApi from '@alicloud/openapi-client';
+import SDKClient, * as $SDKClient from '../../../../../generated/ts/src/client';
+import Console from '@alicloud/tea-console';
+import * as $tea from '@alicloud/tea-typescript';
+
+
+export default class Client {
+ _sdkClient: SDKClient;
+ _endpoint: string;
+
+ constructor() {
+ this._endpoint = "127.0.0.1:7001";
+ let config = new $OpenApi.Config({
+ endpoint: this._endpoint,
+ });
+ this._sdkClient = new SDKClient(config);
+ }
+
+
+ /**
+ * @remarks
+ * EventSource Controller apis:
+ * createEventSource *
+ * updateEventSource *
+ * deleteEventSource *
+ * getEventSource *
+ * listEventSources *
+ */
+ async testCreateEventSource(): Promise<void> {
+ let request = new $SDKClient.CreateEventSourceRequest({
+ eventBusName: "newBus",
+ eventSourceName: "newSource",
+ description: "a source for test",
+ });
+ try {
+ let res = await this._sdkClient.createEventSource(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testUpdateEventSource(): Promise<void> {
+ let request = new $SDKClient.UpdateEventSourceRequest({
+ eventBusName: "newBus",
+ eventSourceName: "newSource",
+ description: "new description for testing Update API",
+ });
+ try {
+ let res = await this._sdkClient.updateEventSource(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testDeleteEventSource(): Promise<void> {
+ let request = new $SDKClient.DeleteEventSourceRequest({
+ eventBusName: "newBus",
+ eventSourceName: "newSource",
+ });
+ try {
+ let res = await this._sdkClient.deleteEventSource(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testGetEventSource(): Promise<void> {
+ let request = new $SDKClient.GetEventSourceRequest({
+ eventBusName: "newBus",
+ eventSourceName: "newSource",
+ });
+ try {
+ let res = await this._sdkClient.getEventSource(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testListEventSources(): Promise<void> {
+ let request = new $SDKClient.ListEventSourcesRequest({
+ eventBusName: "newBus",
+ eventSourceType: "USER_DEFINED",
+ maxResults: 10,
+ nextToken: "0",
+ });
+ try {
+ let res = await this._sdkClient.listEventSources(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+}
diff --git a/sdk/demo/EventSource/generated/ts/src/main.ts b/sdk/demo/EventSource/generated/ts/src/main.ts
new file mode 100644
index 0000000..f732c02
--- /dev/null
+++ b/sdk/demo/EventSource/generated/ts/src/main.ts
@@ -0,0 +1,4 @@
+import Client from './client'
+
+let c = new Client()
+c.testListEventSources()
diff --git a/sdk/demo/EventSource/generated/ts/tsconfig.json b/sdk/demo/EventSource/generated/ts/tsconfig.json
new file mode 100644
index 0000000..ae66f5b
--- /dev/null
+++ b/sdk/demo/EventSource/generated/ts/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "compilerOptions": {
+ "target": "es2017",
+ "module": "commonjs",
+ "declaration": true,
+ "sourceMap": true,
+ "outDir": "./dist",
+ "esModuleInterop": true
+ },
+ "include": [
+ "src/**/*"
+ ]
+}
\ No newline at end of file
diff --git a/sdk/demo/EventTarget/Darafile b/sdk/demo/EventTarget/Darafile
new file mode 100644
index 0000000..b15ddca
--- /dev/null
+++ b/sdk/demo/EventTarget/Darafile
@@ -0,0 +1,66 @@
+{
+ "scope": "Demo",
+ "name": "demo",
+ "version": "0.0.0",
+ "main": "./demo.dara",
+ "libraries": {
+ "SDKClient" : "../../",
+ "Util": "darabonba:Util:*",
+ "OpenApi": "alibabacloud:OpenApi:*",
+ "OpenApiUtil": "alibabacloud:OpenApiUtil:*",
+ "Console": "darabonba:Console:*"
+ },
+ "java": {
+ "package": "org.apache.rocketmq.eventbridge.demo",
+ "className": "Demo",
+ "packageInfo": {
+ "groupId": "org.apache.rocketmq.eventbridge",
+ "artifactId": "demo",
+ "version": "0.0.0",
+ "description": "EventBridge SDK demo for Java",
+ "url": "",
+ "licenseName": "The Apache License, Version 2.0",
+ "licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt",
+ "developerId": "ludi",
+ "developerName": "EventBridge SDK",
+ "developerEmail": "zjuludi@gmail.com",
+ "scmConnection": "",
+ "scmDeveloperConnection": "",
+ "scmUrl": ""
+ }
+ },
+ "go": {
+ "clientName": "DemoClient"
+ },
+ "csharp": {
+ "className": "Demo",
+ "namespace": "RocketMQ.Eventbridge.Demo",
+ "packageInfo": {
+ "name": "sdkDemo",
+ "version": "0.0.0",
+ "title": "eventbridge-sdk-demo",
+ "description": "open source eventbridge (20240701) SDK Demo Library for .NET"
+ }
+ },
+ "php": {
+ "package": "RocketMQ.Eventbridge.SDK.Demo",
+ "clientName": "Demo",
+ "packageInfo": {
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "desc": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "github": "unavailable",
+ "files": {
+ "LICENSE": "../LICENSE"
+ }
+ }
+ },
+ "python": {
+ "package": "rocketmq_eventbridge_demo",
+ "clientName": "demo",
+ "packageInfo": {
+ "name": "rocketmq_eventbridge_demo",
+ "desc": "Alibaba Cloud eventbridge (20240701) SDK Library for Python",
+ "github": "unavailable"
+ }
+ }
+}
\ No newline at end of file
diff --git a/sdk/demo/EventTarget/demo.dara b/sdk/demo/EventTarget/demo.dara
new file mode 100644
index 0000000..8fe7fc6
--- /dev/null
+++ b/sdk/demo/EventTarget/demo.dara
@@ -0,0 +1,162 @@
+import Util;
+import OpenApi;
+import SDKClient;
+import Console;
+
+type @sdkClient = SDKClient;
+type @endpoint = string;
+
+init(){
+ @endpoint = '127.0.0.1:7001';
+ var config = new OpenApi.Config{
+ endpoint = @endpoint
+ };
+ @sdkClient = new SDKClient(config);
+}
+
+/**
+ EventTarget Controller apis:
+ * createEventTargets *
+ * updateEventTargets *
+ * deleteEventTargets *
+ * listEventTargets *
+*/
+
+async function testCreateEventTargets(): void {
+ var config_ : map[string]any = {
+ fileName = "~/Target",
+ line = "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}"
+ };
+
+ var config2_ : map[string]any = {
+ fileName = "~/Target222",
+ line = "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}"
+ };
+
+ var request = new SDKClient.CreateEventTargetsRequest{
+ eventBusName = 'newBus',
+ eventRuleName = 'newRule',
+ eventTargets = [
+ new SDKClient.EventTarget{
+ eventTargetName = 'newTarget',
+ className = 'file',
+ config = config_,
+ runOptions = new SDKClient.EventTarget.runOptions{
+ errorsTolerance = "",
+ retryStrategy = new SDKClient.EventTarget.runOptions.retryStrategy{
+ pushRetryStrategy = "",
+ maximumEventAgeInSeconds = 100,
+ maximumRetryAttempts = 100
+ },
+ deadLetterQueue = new SDKClient.EventTarget.runOptions.deadLetterQueue{
+ type = ""
+ }
+ }
+ },
+ new SDKClient.EventTarget{
+ eventTargetName = 'newTarget222',
+ className = 'file',
+ config = config2_,
+ runOptions = new SDKClient.EventTarget.runOptions{
+ errorsTolerance = "",
+ retryStrategy = new SDKClient.EventTarget.runOptions.retryStrategy{
+ pushRetryStrategy = "",
+ maximumEventAgeInSeconds = 100,
+ maximumRetryAttempts = 100
+ },
+ deadLetterQueue = new SDKClient.EventTarget.runOptions.deadLetterQueue{
+ type = ""
+ }
+ }
+ }
+ ]
+ };
+
+ try {
+ var res = @sdkClient.createEventTargets(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testUpdateEventTargets(): void {
+ var config_ : map[string]any = {
+ fileName = "~/Target",
+ line = "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}"
+ };
+
+ var config2_ : map[string]any = {
+ fileName = "~/Target222",
+ line = "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}"
+ };
+
+ var request = new SDKClient.UpdateEventTargetsRequest{
+ eventBusName = 'newBus',
+ eventRuleName = 'newRule',
+ eventTargets = [
+ new SDKClient.EventTarget{
+ eventTargetName = 'newTarget',
+ className = 'file',
+ config = config_
+ },
+ new SDKClient.EventTarget{
+ eventTargetName = 'newTarget222',
+ className = 'file',
+ config = config2_
+ }
+ ]
+ };
+
+ try {
+ var res = @sdkClient.updateEventTargets(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testDeleteEventTargets(): void {
+ var request = new SDKClient.DeleteEventTargetsRequest{
+ eventBusName = 'newBus',
+ eventRuleName = 'newRule',
+ eventTargetNames = ["newTarget", "newTarget222"]
+ };
+
+ try {
+ var res = @sdkClient.deleteEventTargets(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
+
+async function testListEventTargets(): void {
+ var request = new SDKClient.ListEventTargetsRequest{
+ eventBusName = 'newBus',
+ eventRuleName = 'newRule'
+ };
+
+ try {
+ var res = @sdkClient.listEventTargets(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch(err) {
+ Console.log('err!');
+ Console.log(err.message);
+ } finally {
+ Console.log('test end!');
+ }
+
+}
diff --git a/sdk/demo/EventTarget/generated/csharp/core/Demo.cs b/sdk/demo/EventTarget/generated/csharp/core/Demo.cs
new file mode 100644
index 0000000..45b3087
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/csharp/core/Demo.cs
@@ -0,0 +1,474 @@
+// This file is auto-generated, don't edit it. Thanks.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+
+using Tea;
+using Tea.Utils;
+
+
+namespace RocketMQ.Eventbridge.Demo
+{
+ public class Demo
+ {
+ protected RocketMQ.Eventbridge.SDK.SDKClient _sdkClient;
+ protected string _endpoint;
+
+ public Demo()
+ {
+ this._endpoint = "127.0.0.1:7001";
+ AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config
+ {
+ Endpoint = _endpoint,
+ };
+ this._sdkClient = new RocketMQ.Eventbridge.SDK.SDKClient(config);
+ }
+
+ static void Main(string[] _args){
+ Demo demo = new Demo();
+ demo.TestListEventTargets();
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>EventTarget Controller apis:
+ /// createEventTargets *
+ /// updateEventTargets *
+ /// deleteEventTargets *
+ /// listEventTargets *</para>
+ /// </description>
+ public void TestCreateEventTargets()
+ {
+ Dictionary<string, object> config_ = new Dictionary<string, object>
+ {
+ {"fileName", "~/Target"},
+ {"line", "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}"},
+ };
+ Dictionary<string, object> config2_ = new Dictionary<string, object>
+ {
+ {"fileName", "~/Target222"},
+ {"line", "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}"},
+ };
+ RocketMQ.Eventbridge.SDK.Models.CreateEventTargetsRequest request = new RocketMQ.Eventbridge.SDK.Models.CreateEventTargetsRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ EventTargets = new List<RocketMQ.Eventbridge.SDK.Models.EventTarget>
+ {
+ new RocketMQ.Eventbridge.SDK.Models.EventTarget
+ {
+ EventTargetName = "newTarget",
+ ClassName = "file",
+ Config = config_,
+ RunOptions = new RocketMQ.Eventbridge.SDK.Models.EventTarget.EventTargetRunOptions
+ {
+ ErrorsTolerance = "",
+ RetryStrategy = new RocketMQ.Eventbridge.SDK.Models.EventTarget.EventTargetRunOptions.EventTargetRunOptionsRetryStrategy
+ {
+ PushRetryStrategy = "",
+ MaximumEventAgeInSeconds = 100,
+ MaximumRetryAttempts = 100,
+ },
+ DeadLetterQueue = new RocketMQ.Eventbridge.SDK.Models.EventTarget.EventTargetRunOptions.EventTargetRunOptionsDeadLetterQueue
+ {
+ Type = "",
+ },
+ },
+ },
+ new RocketMQ.Eventbridge.SDK.Models.EventTarget
+ {
+ EventTargetName = "newTarget222",
+ ClassName = "file",
+ Config = config2_,
+ RunOptions = new RocketMQ.Eventbridge.SDK.Models.EventTarget.EventTargetRunOptions
+ {
+ ErrorsTolerance = "",
+ RetryStrategy = new RocketMQ.Eventbridge.SDK.Models.EventTarget.EventTargetRunOptions.EventTargetRunOptionsRetryStrategy
+ {
+ PushRetryStrategy = "",
+ MaximumEventAgeInSeconds = 100,
+ MaximumRetryAttempts = 100,
+ },
+ DeadLetterQueue = new RocketMQ.Eventbridge.SDK.Models.EventTarget.EventTargetRunOptions.EventTargetRunOptionsDeadLetterQueue
+ {
+ Type = "",
+ },
+ },
+ }
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventTargetsResponse res = this._sdkClient.CreateEventTargets(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ /// <term><b>Description:</b></term>
+ /// <description>
+ /// <para>EventTarget Controller apis:
+ /// createEventTargets *
+ /// updateEventTargets *
+ /// deleteEventTargets *
+ /// listEventTargets *</para>
+ /// </description>
+ public async Task TestCreateEventTargetsAsync()
+ {
+ Dictionary<string, object> config_ = new Dictionary<string, object>
+ {
+ {"fileName", "~/Target"},
+ {"line", "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}"},
+ };
+ Dictionary<string, object> config2_ = new Dictionary<string, object>
+ {
+ {"fileName", "~/Target222"},
+ {"line", "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}"},
+ };
+ RocketMQ.Eventbridge.SDK.Models.CreateEventTargetsRequest request = new RocketMQ.Eventbridge.SDK.Models.CreateEventTargetsRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ EventTargets = new List<RocketMQ.Eventbridge.SDK.Models.EventTarget>
+ {
+ new RocketMQ.Eventbridge.SDK.Models.EventTarget
+ {
+ EventTargetName = "newTarget",
+ ClassName = "file",
+ Config = config_,
+ RunOptions = new RocketMQ.Eventbridge.SDK.Models.EventTarget.EventTargetRunOptions
+ {
+ ErrorsTolerance = "",
+ RetryStrategy = new RocketMQ.Eventbridge.SDK.Models.EventTarget.EventTargetRunOptions.EventTargetRunOptionsRetryStrategy
+ {
+ PushRetryStrategy = "",
+ MaximumEventAgeInSeconds = 100,
+ MaximumRetryAttempts = 100,
+ },
+ DeadLetterQueue = new RocketMQ.Eventbridge.SDK.Models.EventTarget.EventTargetRunOptions.EventTargetRunOptionsDeadLetterQueue
+ {
+ Type = "",
+ },
+ },
+ },
+ new RocketMQ.Eventbridge.SDK.Models.EventTarget
+ {
+ EventTargetName = "newTarget222",
+ ClassName = "file",
+ Config = config2_,
+ RunOptions = new RocketMQ.Eventbridge.SDK.Models.EventTarget.EventTargetRunOptions
+ {
+ ErrorsTolerance = "",
+ RetryStrategy = new RocketMQ.Eventbridge.SDK.Models.EventTarget.EventTargetRunOptions.EventTargetRunOptionsRetryStrategy
+ {
+ PushRetryStrategy = "",
+ MaximumEventAgeInSeconds = 100,
+ MaximumRetryAttempts = 100,
+ },
+ DeadLetterQueue = new RocketMQ.Eventbridge.SDK.Models.EventTarget.EventTargetRunOptions.EventTargetRunOptionsDeadLetterQueue
+ {
+ Type = "",
+ },
+ },
+ }
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.CreateEventTargetsResponse res = await this._sdkClient.CreateEventTargetsAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestUpdateEventTargets()
+ {
+ Dictionary<string, object> config_ = new Dictionary<string, object>
+ {
+ {"fileName", "~/Target"},
+ {"line", "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}"},
+ };
+ Dictionary<string, object> config2_ = new Dictionary<string, object>
+ {
+ {"fileName", "~/Target222"},
+ {"line", "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}"},
+ };
+ RocketMQ.Eventbridge.SDK.Models.UpdateEventTargetsRequest request = new RocketMQ.Eventbridge.SDK.Models.UpdateEventTargetsRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ EventTargets = new List<RocketMQ.Eventbridge.SDK.Models.EventTarget>
+ {
+ new RocketMQ.Eventbridge.SDK.Models.EventTarget
+ {
+ EventTargetName = "newTarget",
+ ClassName = "file",
+ Config = config_,
+ },
+ new RocketMQ.Eventbridge.SDK.Models.EventTarget
+ {
+ EventTargetName = "newTarget222",
+ ClassName = "file",
+ Config = config2_,
+ }
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateEventTargetsResponse res = this._sdkClient.UpdateEventTargets(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestUpdateEventTargetsAsync()
+ {
+ Dictionary<string, object> config_ = new Dictionary<string, object>
+ {
+ {"fileName", "~/Target"},
+ {"line", "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}"},
+ };
+ Dictionary<string, object> config2_ = new Dictionary<string, object>
+ {
+ {"fileName", "~/Target222"},
+ {"line", "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}"},
+ };
+ RocketMQ.Eventbridge.SDK.Models.UpdateEventTargetsRequest request = new RocketMQ.Eventbridge.SDK.Models.UpdateEventTargetsRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ EventTargets = new List<RocketMQ.Eventbridge.SDK.Models.EventTarget>
+ {
+ new RocketMQ.Eventbridge.SDK.Models.EventTarget
+ {
+ EventTargetName = "newTarget",
+ ClassName = "file",
+ Config = config_,
+ },
+ new RocketMQ.Eventbridge.SDK.Models.EventTarget
+ {
+ EventTargetName = "newTarget222",
+ ClassName = "file",
+ Config = config2_,
+ }
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.UpdateEventTargetsResponse res = await this._sdkClient.UpdateEventTargetsAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestDeleteEventTargets()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventTargetsRequest request = new RocketMQ.Eventbridge.SDK.Models.DeleteEventTargetsRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ EventTargetNames = new List<string>
+ {
+ "newTarget",
+ "newTarget222"
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventTargetsResponse res = this._sdkClient.DeleteEventTargets(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestDeleteEventTargetsAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventTargetsRequest request = new RocketMQ.Eventbridge.SDK.Models.DeleteEventTargetsRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ EventTargetNames = new List<string>
+ {
+ "newTarget",
+ "newTarget222"
+ },
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.DeleteEventTargetsResponse res = await this._sdkClient.DeleteEventTargetsAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public void TestListEventTargets()
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventTargetsRequest request = new RocketMQ.Eventbridge.SDK.Models.ListEventTargetsRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventTargetsResponse res = this._sdkClient.ListEventTargets(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ public async Task TestListEventTargetsAsync()
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventTargetsRequest request = new RocketMQ.Eventbridge.SDK.Models.ListEventTargetsRequest
+ {
+ EventBusName = "newBus",
+ EventRuleName = "newRule",
+ };
+ try
+ {
+ RocketMQ.Eventbridge.SDK.Models.ListEventTargetsResponse res = await this._sdkClient.ListEventTargetsAsync(request);
+ AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(res.Body));
+ }
+ catch (TeaException err)
+ {
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ AlibabaCloud.TeaConsole.Client.Log("err!");
+ AlibabaCloud.TeaConsole.Client.Log(err.Message);
+ }
+ finally
+ {
+ AlibabaCloud.TeaConsole.Client.Log("test end!");
+ }
+ }
+
+ }
+}
diff --git a/sdk/demo/EventTarget/generated/csharp/core/Properties/AssemblyInfo.cs b/sdk/demo/EventTarget/generated/csharp/core/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..d923df4
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/csharp/core/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("eventbridge-sdk-demo")]
+[assembly: AssemblyDescription("open source eventbridge (20240701) SDK Demo Library for .NET")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("51cdc2f0-8a2f-11ef-80d7-99b8e5e82b54")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("0.0.1.0")]
+[assembly: AssemblyFileVersion("0.0.1.0")]
diff --git a/sdk/demo/EventTarget/generated/csharp/core/sdkDemo.csproj b/sdk/demo/EventTarget/generated/csharp/core/sdkDemo.csproj
new file mode 100644
index 0000000..8ea12bc
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/csharp/core/sdkDemo.csproj
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFrameworks>netstandard2.0;net45;netcoreapp8.0</TargetFrameworks>
+ <RootNamespace>RocketMQ.Eventbridge.Demo</RootNamespace>
+ <OutputType>Exe</OutputType>
+ <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
+ <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+ <AssemblyName>RocketMQ.Eventbridge.Demo</AssemblyName>
+ <Version/>
+ <LangVersion>5</LangVersion>
+ <Description>open source eventbridge (20240701) SDK Demo Library for .NET</Description>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
+ <DefineConstants>NETSTANDARD2_0</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <DefineConstants>NET45</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <Reference Include="mscorlib"/>
+ <Reference Include="System"/>
+ <Reference Include="System.Core"/>
+ <Reference Include="Microsoft.CSharp"/>
+ <Reference Include="System.Data"/>
+ <Reference Include="System.Web"/>
+ <Reference Include="System.Drawing"/>
+ <Reference Include="System.Security"/>
+ <Reference Include="System.Xml"/>
+ <Reference Include="System.Configuration"/>
+ <Reference Include="System.Net.Http"/>
+ </ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
+ </PackageReference>
+ <PackageReference Include="AlibabaCloud.TeaUtil" Version="0.1.19"/>
+ <PackageReference Include="AlibabaCloud.OpenApiClient" Version="0.1.12"/>
+ <PackageReference Include="RocketMQ.Eventbridge.SDK" Version="1.0.0"/>
+ <PackageReference Include="AlibabaCloud.TeaConsole" Version="0.1.0"/>
+ <PackageReference Include="Tea" Version="1.1.0"/>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/sdk/demo/EventTarget/generated/go/client/client.go b/sdk/demo/EventTarget/generated/go/client/client.go
new file mode 100644
index 0000000..d382be9
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/go/client/client.go
@@ -0,0 +1,250 @@
+// This file is auto-generated, don't edit it. Thanks.
+package client
+
+import (
+ openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
+ console "github.com/alibabacloud-go/tea-console/client"
+ util "github.com/alibabacloud-go/tea-utils/v2/service"
+ "github.com/alibabacloud-go/tea/tea"
+ sdkclient "github.com/org-apache-rocketmq/eventbridge-sdk/client"
+)
+
+type DemoClient struct {
+ SdkClient *sdkclient.Client
+ Endpoint *string
+}
+
+func NewClient() (*DemoClient, error) {
+ client := new(DemoClient)
+ err := client.Init()
+ return client, err
+}
+
+func (client *DemoClient) Init() (_err error) {
+ client.Endpoint = tea.String("127.0.0.1:7001")
+ config := &openapi.Config{
+ Endpoint: client.Endpoint,
+ }
+ client.SdkClient, _err = sdkclient.NewClient(config)
+ if _err != nil {
+ return _err
+ }
+
+ return nil
+}
+
+// Description:
+//
+// EventTarget Controller apis:
+//
+// createEventTargets *
+//
+// updateEventTargets *
+//
+// deleteEventTargets *
+//
+// listEventTargets *
+func (client *DemoClient) TestCreateEventTargets() (_err error) {
+ config_ := map[string]interface{}{
+ "fileName": "~/Target",
+ "line": "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}",
+ }
+ config2_ := map[string]interface{}{
+ "fileName": "~/Target222",
+ "line": "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}",
+ }
+ request := &sdkclient.CreateEventTargetsRequest{
+ EventBusName: tea.String("newBus"),
+ EventRuleName: tea.String("newRule"),
+ EventTargets: []*sdkclient.EventTarget{&sdkclient.EventTarget{
+ EventTargetName: tea.String("newTarget"),
+ ClassName: tea.String("file"),
+ Config: config_,
+ RunOptions: &sdkclient.EventTargetRunOptions{
+ ErrorsTolerance: tea.String(""),
+ RetryStrategy: &sdkclient.EventTargetRunOptionsRetryStrategy{
+ PushRetryStrategy: tea.String(""),
+ MaximumEventAgeInSeconds: tea.Int32(100),
+ MaximumRetryAttempts: tea.Int32(100),
+ },
+ DeadLetterQueue: &sdkclient.EventTargetRunOptionsDeadLetterQueue{
+ Type: tea.String(""),
+ },
+ },
+ }, &sdkclient.EventTarget{
+ EventTargetName: tea.String("newTarget222"),
+ ClassName: tea.String("file"),
+ Config: config2_,
+ RunOptions: &sdkclient.EventTargetRunOptions{
+ ErrorsTolerance: tea.String(""),
+ RetryStrategy: &sdkclient.EventTargetRunOptionsRetryStrategy{
+ PushRetryStrategy: tea.String(""),
+ MaximumEventAgeInSeconds: tea.Int32(100),
+ MaximumRetryAttempts: tea.Int32(100),
+ },
+ DeadLetterQueue: &sdkclient.EventTargetRunOptionsDeadLetterQueue{
+ Type: tea.String(""),
+ },
+ },
+ }},
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.CreateEventTargets(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestUpdateEventTargets() (_err error) {
+ config_ := map[string]interface{}{
+ "fileName": "~/Target",
+ "line": "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}",
+ }
+ config2_ := map[string]interface{}{
+ "fileName": "~/Target222",
+ "line": "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}",
+ }
+ request := &sdkclient.UpdateEventTargetsRequest{
+ EventBusName: tea.String("newBus"),
+ EventRuleName: tea.String("newRule"),
+ EventTargets: []*sdkclient.EventTarget{&sdkclient.EventTarget{
+ EventTargetName: tea.String("newTarget"),
+ ClassName: tea.String("file"),
+ Config: config_,
+ }, &sdkclient.EventTarget{
+ EventTargetName: tea.String("newTarget222"),
+ ClassName: tea.String("file"),
+ Config: config2_,
+ }},
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.UpdateEventTargets(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestDeleteEventTargets() (_err error) {
+ request := &sdkclient.DeleteEventTargetsRequest{
+ EventBusName: tea.String("newBus"),
+ EventRuleName: tea.String("newRule"),
+ EventTargetNames: []*string{tea.String("newTarget"), tea.String("newTarget222")},
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.DeleteEventTargets(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
+
+func (client *DemoClient) TestListEventTargets() (_err error) {
+ request := &sdkclient.ListEventTargetsRequest{
+ EventBusName: tea.String("newBus"),
+ EventRuleName: tea.String("newRule"),
+ }
+ defer func() {
+ console.Log(tea.String("test end!"))
+ }()
+ tryErr := func() (_e error) {
+ defer func() {
+ if r := tea.Recover(recover()); r != nil {
+ _e = r
+ }
+ }()
+ res, _err := client.SdkClient.ListEventTargets(request)
+ if _err != nil {
+ return _err
+ }
+
+ console.Log(util.ToJSONString(res.Body))
+
+ return nil
+ }()
+
+ if tryErr != nil {
+ var err = &tea.SDKError{}
+ if _t, ok := tryErr.(*tea.SDKError); ok {
+ err = _t
+ } else {
+ err.Message = tea.String(tryErr.Error())
+ }
+ console.Log(tea.String("err!"))
+ console.Log(err.Message)
+ }
+ return _err
+}
diff --git a/sdk/demo/EventTarget/generated/go/go.mod b/sdk/demo/EventTarget/generated/go/go.mod
new file mode 100644
index 0000000..ff35824
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/go/go.mod
@@ -0,0 +1,9 @@
+module client
+
+require (
+ github.com/alibabacloud-go/tea-utils/v2 v2.0.6
+ github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10
+ github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0
+ github.com/alibabacloud-go/tea-console v1.0.0
+)
+replace github.com/org-apache-rocketmq/eventbridge-sdk v0.0.0 => ../../../../generated/go/
diff --git a/sdk/demo/EventTarget/generated/go/main.go b/sdk/demo/EventTarget/generated/go/main.go
new file mode 100644
index 0000000..be528f5
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/go/main.go
@@ -0,0 +1,11 @@
+package main
+
+import (
+ "client/client"
+)
+
+func main() {
+ demo := new(client.DemoClient)
+ demo.Init()
+ demo.TestListEventTargets()
+}
diff --git a/sdk/demo/EventTarget/generated/java/pom.xml b/sdk/demo/EventTarget/generated/java/pom.xml
new file mode 100644
index 0000000..ef0ec32
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/java/pom.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>demo</artifactId>
+ <version>0.0.0</version>
+ <packaging>jar</packaging>
+ <name>demo</name>
+ <description>EventBridge SDK demo for Java
+ </description>
+ <url></url>
+ <licenses>
+ <license>
+ <name>The Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ </license>
+ </licenses>
+ <developers>
+ <developer>
+ <id>ludi</id>
+ <name>EventBridge SDK</name>
+ <email>zjuludi@gmail.com</email>
+ </developer>
+ </developers>
+ <distributionManagement>
+ <snapshotRepository>
+ <id>sonatype-nexus-snapshots</id>
+ <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ <repository>
+ <id>sonatype-nexus-staging</id>
+ <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+ </repository>
+ </distributionManagement>
+ <scm>
+ <connection></connection>
+ <developerConnection></developerConnection>
+ <url></url>
+ </scm>
+ <dependencies>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-util</artifactId>
+ <version>0.2.23</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-openapi</artifactId>
+ <version>0.3.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.rocketmq.eventbridge</groupId>
+ <artifactId>sdk</artifactId>
+ <version>0.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea-console</artifactId>
+ <version>0.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.aliyun</groupId>
+ <artifactId>tea</artifactId>
+ <version>1.1.14</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.6.1</version>
+ <configuration>
+ <source>8</source>
+ <target>8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.6</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.6.3</version>
+ <extensions>true</extensions>
+ <configuration>
+ <serverId>sonatype-nexus-staging</serverId>
+ <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
+ <autoReleaseAfterClose>true</autoReleaseAfterClose>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.1.1</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <doclint>none</doclint>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.22.1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
diff --git a/sdk/demo/EventTarget/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java b/sdk/demo/EventTarget/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
new file mode 100644
index 0000000..ab933e7
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/java/src/main/java/org/apache/rocketmq/eventbridge/demo/Demo.java
@@ -0,0 +1,186 @@
+// This file is auto-generated, don't edit it. Thanks.
+package org.apache.rocketmq.eventbridge.demo;
+
+import com.aliyun.tea.*;
+
+public class Demo {
+
+ public org.apache.rocketmq.eventbridge.sdk.Client _sdkClient;
+ public String _endpoint;
+ public Demo() throws Exception {
+ this._endpoint = "127.0.0.1:7001";
+ com.aliyun.teaopenapi.models.Config config = com.aliyun.teaopenapi.models.Config.build(TeaConverter.buildMap(
+ new TeaPair("endpoint", _endpoint)
+ ));
+ this._sdkClient = new org.apache.rocketmq.eventbridge.sdk.Client(config);
+ }
+
+ public static void main(String[] args) {
+ try {
+ Demo demo = new Demo();
+ demo.testListEventTargets();
+ // demo.testCreateEventTargets();
+ // demo.testListEventTargets();
+ // demo.testUpdateEventTargets();
+ // demo.testListEventTargets();
+ // demo.testDeleteEventTargets();
+ // demo.testListEventTargets();
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+
+ /**
+ * <b>description</b> :
+ * <p>EventTarget Controller apis:
+ * createEventTargets *
+ * updateEventTargets *
+ * deleteEventTargets *
+ * listEventTargets *</p>
+ */
+ public void testCreateEventTargets() throws Exception {
+ java.util.Map<String, Object> config_ = TeaConverter.buildMap(
+ new TeaPair("fileName", "~/Target"),
+ new TeaPair("line", "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}")
+ );
+ java.util.Map<String, Object> config2_ = TeaConverter.buildMap(
+ new TeaPair("fileName", "~/Target222"),
+ new TeaPair("line", "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}")
+ );
+ org.apache.rocketmq.eventbridge.sdk.models.CreateEventTargetsRequest request = org.apache.rocketmq.eventbridge.sdk.models.CreateEventTargetsRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventRuleName", "newRule"),
+ new TeaPair("eventTargets", java.util.Arrays.asList(
+ org.apache.rocketmq.eventbridge.sdk.models.EventTarget.build(TeaConverter.buildMap(
+ new TeaPair("eventTargetName", "newTarget"),
+ new TeaPair("className", "file"),
+ new TeaPair("config", config_),
+ new TeaPair("runOptions", org.apache.rocketmq.eventbridge.sdk.models.EventTarget.EventTargetRunOptions.build(TeaConverter.buildMap(
+ new TeaPair("errorsTolerance", ""),
+ new TeaPair("retryStrategy", org.apache.rocketmq.eventbridge.sdk.models.EventTarget.EventTargetRunOptionsRetryStrategy.build(TeaConverter.buildMap(
+ new TeaPair("pushRetryStrategy", ""),
+ new TeaPair("maximumEventAgeInSeconds", 100),
+ new TeaPair("maximumRetryAttempts", 100)
+ ))),
+ new TeaPair("deadLetterQueue", org.apache.rocketmq.eventbridge.sdk.models.EventTarget.EventTargetRunOptionsDeadLetterQueue.build(TeaConverter.buildMap(
+ new TeaPair("type", "")
+ )))
+ )))
+ )),
+ org.apache.rocketmq.eventbridge.sdk.models.EventTarget.build(TeaConverter.buildMap(
+ new TeaPair("eventTargetName", "newTarget222"),
+ new TeaPair("className", "file"),
+ new TeaPair("config", config2_),
+ new TeaPair("runOptions", org.apache.rocketmq.eventbridge.sdk.models.EventTarget.EventTargetRunOptions.build(TeaConverter.buildMap(
+ new TeaPair("errorsTolerance", ""),
+ new TeaPair("retryStrategy", org.apache.rocketmq.eventbridge.sdk.models.EventTarget.EventTargetRunOptionsRetryStrategy.build(TeaConverter.buildMap(
+ new TeaPair("pushRetryStrategy", ""),
+ new TeaPair("maximumEventAgeInSeconds", 100),
+ new TeaPair("maximumRetryAttempts", 100)
+ ))),
+ new TeaPair("deadLetterQueue", org.apache.rocketmq.eventbridge.sdk.models.EventTarget.EventTargetRunOptionsDeadLetterQueue.build(TeaConverter.buildMap(
+ new TeaPair("type", "")
+ )))
+ )))
+ ))
+ ))
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.CreateEventTargetsResponse res = _sdkClient.createEventTargets(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testUpdateEventTargets() throws Exception {
+ java.util.Map<String, Object> config_ = TeaConverter.buildMap(
+ new TeaPair("fileName", "~/Target"),
+ new TeaPair("line", "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}")
+ );
+ java.util.Map<String, Object> config2_ = TeaConverter.buildMap(
+ new TeaPair("fileName", "~/Target222"),
+ new TeaPair("line", "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}")
+ );
+ org.apache.rocketmq.eventbridge.sdk.models.UpdateEventTargetsRequest request = org.apache.rocketmq.eventbridge.sdk.models.UpdateEventTargetsRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventRuleName", "newRule"),
+ new TeaPair("eventTargets", java.util.Arrays.asList(
+ org.apache.rocketmq.eventbridge.sdk.models.EventTarget.build(TeaConverter.buildMap(
+ new TeaPair("eventTargetName", "newTarget"),
+ new TeaPair("className", "file"),
+ new TeaPair("config", config_)
+ )),
+ org.apache.rocketmq.eventbridge.sdk.models.EventTarget.build(TeaConverter.buildMap(
+ new TeaPair("eventTargetName", "newTarget222"),
+ new TeaPair("className", "file"),
+ new TeaPair("config", config2_)
+ ))
+ ))
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.UpdateEventTargetsResponse res = _sdkClient.updateEventTargets(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testDeleteEventTargets() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.DeleteEventTargetsRequest request = org.apache.rocketmq.eventbridge.sdk.models.DeleteEventTargetsRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventRuleName", "newRule"),
+ new TeaPair("eventTargetNames", java.util.Arrays.asList(
+ "newTarget",
+ "newTarget222"
+ ))
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.DeleteEventTargetsResponse res = _sdkClient.deleteEventTargets(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+
+ public void testListEventTargets() throws Exception {
+ org.apache.rocketmq.eventbridge.sdk.models.ListEventTargetsRequest request = org.apache.rocketmq.eventbridge.sdk.models.ListEventTargetsRequest.build(TeaConverter.buildMap(
+ new TeaPair("eventBusName", "newBus"),
+ new TeaPair("eventRuleName", "newRule")
+ ));
+ try {
+ org.apache.rocketmq.eventbridge.sdk.models.ListEventTargetsResponse res = _sdkClient.listEventTargets(request);
+ com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(res.body));
+ } catch (TeaException err) {
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } catch (Exception _err) {
+ TeaException err = new TeaException(_err.getMessage(), _err);
+ com.aliyun.teaconsole.Client.log("err!");
+ com.aliyun.teaconsole.Client.log(err.message);
+ } finally {
+ com.aliyun.teaconsole.Client.log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/EventTarget/generated/php/.gitignore b/sdk/demo/EventTarget/generated/php/.gitignore
new file mode 100644
index 0000000..89c7aa5
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/php/.gitignore
@@ -0,0 +1,15 @@
+composer.phar
+/vendor/
+
+# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
+# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
+composer.lock
+
+.vscode/
+.idea
+.DS_Store
+
+cache/
+*.cache
+runtime/
+.php_cs.cache
diff --git a/sdk/demo/EventTarget/generated/php/.php_cs.dist b/sdk/demo/EventTarget/generated/php/.php_cs.dist
new file mode 100644
index 0000000..8617ec2
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/php/.php_cs.dist
@@ -0,0 +1,65 @@
+<?php
+/*
+ * This document has been generated with
+ * https://mlocati.github.io/php-cs-fixer-configurator/#version:2.15|configurator
+ * you can change this configuration by importing this file.
+ */
+
+return PhpCsFixer\Config::create()
+ ->setRiskyAllowed(true)
+ ->setIndent(' ')
+ ->setRules([
+ '@PSR2' => true,
+ '@PhpCsFixer' => true,
+ '@Symfony:risky' => true,
+ 'concat_space' => ['spacing' => 'one'],
+ 'array_syntax' => ['syntax' => 'short'],
+ 'array_indentation' => true,
+ 'combine_consecutive_unsets' => true,
+ 'method_separation' => true,
+ 'single_quote' => true,
+ 'declare_equal_normalize' => true,
+ 'function_typehint_space' => true,
+ 'hash_to_slash_comment' => true,
+ 'include' => true,
+ 'lowercase_cast' => true,
+ 'no_multiline_whitespace_before_semicolons' => true,
+ 'no_leading_import_slash' => true,
+ 'no_multiline_whitespace_around_double_arrow' => true,
+ 'no_spaces_around_offset' => true,
+ 'no_unneeded_control_parentheses' => true,
+ 'no_unused_imports' => true,
+ 'no_whitespace_before_comma_in_array' => true,
+ 'no_whitespace_in_blank_line' => true,
+ 'object_operator_without_whitespace' => true,
+ 'single_blank_line_before_namespace' => true,
+ 'single_class_element_per_statement' => true,
+ 'space_after_semicolon' => true,
+ 'standardize_not_equals' => true,
+ 'ternary_operator_spaces' => true,
+ 'trailing_comma_in_multiline_array' => true,
+ 'trim_array_spaces' => true,
+ 'unary_operator_spaces' => true,
+ 'whitespace_after_comma_in_array' => true,
+ 'no_extra_consecutive_blank_lines' => [
+ 'curly_brace_block',
+ 'extra',
+ 'parenthesis_brace_block',
+ 'square_brace_block',
+ 'throw',
+ 'use',
+ ],
+ 'binary_operator_spaces' => [
+ 'align_double_arrow' => true,
+ 'align_equals' => true,
+ ],
+ 'braces' => [
+ 'allow_single_line_closure' => true,
+ ],
+ ])
+ ->setFinder(
+ PhpCsFixer\Finder::create()
+ ->exclude('vendor')
+ ->exclude('tests')
+ ->in(__DIR__)
+ );
diff --git a/sdk/demo/EventTarget/generated/php/autoload.php b/sdk/demo/EventTarget/generated/php/autoload.php
new file mode 100644
index 0000000..5bfe0a1
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/php/autoload.php
@@ -0,0 +1,15 @@
+<?php
+
+if (file_exists(__DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php')) {
+ require_once __DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
+}
+
+spl_autoload_register(function ($class) {
+ $name = str_replace('RocketMQ\\Eventbridge\\SDK\\Demo\\', '', $class);
+ $file = __DIR__ . \DIRECTORY_SEPARATOR . 'src' . \DIRECTORY_SEPARATOR . str_replace('\\', \DIRECTORY_SEPARATOR, $name) . '.php';
+ if (file_exists($file)) {
+ require_once $file;
+ return true;
+ }
+ return false;
+});
diff --git a/sdk/demo/EventTarget/generated/php/composer.json b/sdk/demo/EventTarget/generated/php/composer.json
new file mode 100644
index 0000000..2edbfb8
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/php/composer.json
@@ -0,0 +1,34 @@
+{
+ "name": "rocketmq/eventbridge-sdk-demo",
+ "description": "RocketMQ eventbridge (20240701) SDK Demo for PHP",
+ "type": "library",
+ "license": "Apache-2.0",
+ "authors": [],
+ "require": {
+ "php": ">5.5",
+ "alibabacloud/tea-utils": "^0.2.21",
+ "alibabacloud/darabonba-openapi": "^0.2.12",
+ "rocketmq/eventbridge-sdk": "^0.0.0",
+ "alibabacloud/tea-console": "^0.1.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "RocketMQ\\Eventbridge\\SDK\\Demo\\": "src"
+ }
+ },
+ "scripts": {
+ "fixer": "php-cs-fixer fix ./"
+ },
+ "config": {
+ "sort-packages": true,
+ "preferred-install": "dist",
+ "optimize-autoloader": true
+ },
+ "prefer-stable": true,
+ "repositories": {
+ "rocketmq":{
+ "type" : "path",
+ "url": "../../../../generated/php"
+ }
+ }
+}
diff --git a/sdk/demo/EventTarget/generated/php/main.php b/sdk/demo/EventTarget/generated/php/main.php
new file mode 100644
index 0000000..e2fc870
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/php/main.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace RocketMQ\Eventbridge\SDK\Demo;
+require 'vendor/autoload.php';
+include 'src/Demo.php';
+
+$demo = new Demo();
+$demo->testListEventTargets();
diff --git a/sdk/demo/EventTarget/generated/php/src/Demo.php b/sdk/demo/EventTarget/generated/php/src/Demo.php
new file mode 100644
index 0000000..567b189
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/php/src/Demo.php
@@ -0,0 +1,201 @@
+<?php
+
+// This file is auto-generated, don't edit it. Thanks.
+namespace RocketMQ\Eventbridge\SDK\Demo;
+
+use RocketMQ\Eventbridge\SDK\SDKClient;
+use AlibabaCloud\Tea\Utils\Utils;
+use AlibabaCloud\Tea\Console\Console;
+use \Exception;
+use AlibabaCloud\Tea\Exception\TeaError;
+
+use Darabonba\OpenApi\Models\Config;
+use RocketMQ\Eventbridge\SDK\Models\CreateEventTargetsRequest;
+use RocketMQ\Eventbridge\SDK\Models\EventTarget;
+use RocketMQ\Eventbridge\SDK\Models\EventTarget\runOptions;
+use RocketMQ\Eventbridge\SDK\Models\EventTarget\runOptions\retryStrategy;
+use RocketMQ\Eventbridge\SDK\Models\EventTarget\runOptions\deadLetterQueue;
+use RocketMQ\Eventbridge\SDK\Models\UpdateEventTargetsRequest;
+use RocketMQ\Eventbridge\SDK\Models\DeleteEventTargetsRequest;
+use RocketMQ\Eventbridge\SDK\Models\ListEventTargetsRequest;
+
+class Demo {
+ protected $_sdkClient;
+
+ protected $_endpoint;
+
+ public function __construct(){
+ $this->_endpoint = "127.0.0.1:7001";
+ $config = new Config([
+ "endpoint" => $this->_endpoint
+ ]);
+ $this->_sdkClient = new SDKClient($config);
+ }
+
+ /**
+ * EventTarget Controller apis:
+ * * createEventTargets *
+ * * updateEventTargets *
+ * * deleteEventTargets *
+ * * listEventTargets *
+ * @return void
+ */
+ public function testCreateEventTargets(){
+ $config_ = [
+ "fileName" => "~/Target",
+ "line" => "{ \"form\":\"JSONPATH\", \"value\":\"\$.data\"}"
+ ];
+ $config2_ = [
+ "fileName" => "~/Target222",
+ "line" => "{ \"form\":\"JSONPATH\", \"value\":\"\$.data\"}"
+ ];
+ $request = new CreateEventTargetsRequest([
+ "eventBusName" => "newBus",
+ "eventRuleName" => "newRule",
+ "eventTargets" => [
+ new EventTarget([
+ "eventTargetName" => "newTarget",
+ "className" => "file",
+ "config" => $config_,
+ "runOptions" => new runOptions([
+ "errorsTolerance" => "",
+ "retryStrategy" => new retryStrategy([
+ "pushRetryStrategy" => "",
+ "maximumEventAgeInSeconds" => 100,
+ "maximumRetryAttempts" => 100
+ ]),
+ "deadLetterQueue" => new deadLetterQueue([
+ "type" => ""
+ ])
+ ])
+ ]),
+ new EventTarget([
+ "eventTargetName" => "newTarget222",
+ "className" => "file",
+ "config" => $config2_,
+ "runOptions" => new runOptions([
+ "errorsTolerance" => "",
+ "retryStrategy" => new retryStrategy([
+ "pushRetryStrategy" => "",
+ "maximumEventAgeInSeconds" => 100,
+ "maximumRetryAttempts" => 100
+ ]),
+ "deadLetterQueue" => new deadLetterQueue([
+ "type" => ""
+ ])
+ ])
+ ])
+ ]
+ ]);
+ try {
+ $res = $this->_sdkClient->createEventTargets($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testUpdateEventTargets(){
+ $config_ = [
+ "fileName" => "~/Target",
+ "line" => "{ \"form\":\"JSONPATH\", \"value\":\"\$.data\"}"
+ ];
+ $config2_ = [
+ "fileName" => "~/Target222",
+ "line" => "{ \"form\":\"JSONPATH\", \"value\":\"\$.data\"}"
+ ];
+ $request = new UpdateEventTargetsRequest([
+ "eventBusName" => "newBus",
+ "eventRuleName" => "newRule",
+ "eventTargets" => [
+ new EventTarget([
+ "eventTargetName" => "newTarget",
+ "className" => "file",
+ "config" => $config_
+ ]),
+ new EventTarget([
+ "eventTargetName" => "newTarget222",
+ "className" => "file",
+ "config" => $config2_
+ ])
+ ]
+ ]);
+ try {
+ $res = $this->_sdkClient->updateEventTargets($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testDeleteEventTargets(){
+ $request = new DeleteEventTargetsRequest([
+ "eventBusName" => "newBus",
+ "eventRuleName" => "newRule",
+ "eventTargetNames" => [
+ "newTarget",
+ "newTarget222"
+ ]
+ ]);
+ try {
+ $res = $this->_sdkClient->deleteEventTargets($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+
+ /**
+ * @return void
+ */
+ public function testListEventTargets(){
+ $request = new ListEventTargetsRequest([
+ "eventBusName" => "newBus",
+ "eventRuleName" => "newRule"
+ ]);
+ try {
+ $res = $this->_sdkClient->listEventTargets($request);
+ Console::log(Utils::toJSONString($res->body));
+ }
+ catch (Exception $err) {
+ if (!($err instanceof TeaError)) {
+ $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
+ }
+ Console::log("err!");
+ Console::log($err->message);
+ }
+ finally {
+ Console::log("test end!");
+ }
+ }
+}
diff --git a/sdk/demo/EventTarget/generated/python/.gitignore b/sdk/demo/EventTarget/generated/python/.gitignore
new file mode 100644
index 0000000..2bcfffa
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/python/.gitignore
@@ -0,0 +1,5 @@
+runtime/
+.idea/
+.vscode/
+__pycache__/
+.pytest_cache/
\ No newline at end of file
diff --git a/sdk/demo/EventTarget/generated/python/rocketmq_eventbridge_demo/__init__.py b/sdk/demo/EventTarget/generated/python/rocketmq_eventbridge_demo/__init__.py
new file mode 100644
index 0000000..5becc17
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/python/rocketmq_eventbridge_demo/__init__.py
@@ -0,0 +1 @@
+__version__ = "1.0.0"
diff --git a/sdk/demo/EventTarget/generated/python/rocketmq_eventbridge_demo/demo.py b/sdk/demo/EventTarget/generated/python/rocketmq_eventbridge_demo/demo.py
new file mode 100644
index 0000000..145233b
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/python/rocketmq_eventbridge_demo/demo.py
@@ -0,0 +1,279 @@
+# -*- coding: utf-8 -*-
+# This file is auto-generated, don't edit it. Thanks.
+from rocketmq_eventbridge.client import Client as SDKClientClient
+from alibabacloud_tea_openapi import models as open_api_models
+from rocketmq_eventbridge import models as sdkclient_models
+from alibabacloud_tea_console.client import Client as ConsoleClient
+from alibabacloud_tea_util.client import Client as UtilClient
+
+
+class Demo:
+ _sdk_client: SDKClientClient = None
+ _endpoint: str = None
+
+ def __init__(self):
+ self._endpoint = '127.0.0.1:7001'
+ config = open_api_models.Config(
+ endpoint=self._endpoint
+ )
+ self._sdk_client = SDKClientClient(config)
+
+ def test_create_event_targets(self) -> None:
+ """
+ EventTarget Controller apis:
+ createEventTargets *\
+ updateEventTargets *\
+ deleteEventTargets *\
+ listEventTargets *\
+ """
+ config_ = {
+ 'fileName': '~/Target',
+ 'line': '{ "form":"JSONPATH", "value":"$.data"}'
+ }
+ config_2_ = {
+ 'fileName': '~/Target222',
+ 'line': '{ "form":"JSONPATH", "value":"$.data"}'
+ }
+ request = sdkclient_models.CreateEventTargetsRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule',
+ event_targets=[
+ sdkclient_models.EventTarget(
+ event_target_name='newTarget',
+ class_name='file',
+ config=config_,
+ run_options=sdkclient_models.EventTargetRunOptions(
+ errors_tolerance='',
+ retry_strategy=sdkclient_models.EventTargetRunOptionsRetryStrategy(
+ push_retry_strategy='',
+ maximum_event_age_in_seconds=100,
+ maximum_retry_attempts=100
+ ),
+ dead_letter_queue=sdkclient_models.EventTargetRunOptionsDeadLetterQueue(
+ type=''
+ )
+ )
+ ),
+ sdkclient_models.EventTarget(
+ event_target_name='newTarget222',
+ class_name='file',
+ config=config_2_,
+ run_options=sdkclient_models.EventTargetRunOptions(
+ errors_tolerance='',
+ retry_strategy=sdkclient_models.EventTargetRunOptionsRetryStrategy(
+ push_retry_strategy='',
+ maximum_event_age_in_seconds=100,
+ maximum_retry_attempts=100
+ ),
+ dead_letter_queue=sdkclient_models.EventTargetRunOptionsDeadLetterQueue(
+ type=''
+ )
+ )
+ )
+ ]
+ )
+ try:
+ res = self._sdk_client.create_event_targets(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_create_event_targets_async(self) -> None:
+ """
+ EventTarget Controller apis:
+ createEventTargets *\
+ updateEventTargets *\
+ deleteEventTargets *\
+ listEventTargets *\
+ """
+ config_ = {
+ 'fileName': '~/Target',
+ 'line': '{ "form":"JSONPATH", "value":"$.data"}'
+ }
+ config_2_ = {
+ 'fileName': '~/Target222',
+ 'line': '{ "form":"JSONPATH", "value":"$.data"}'
+ }
+ request = sdkclient_models.CreateEventTargetsRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule',
+ event_targets=[
+ sdkclient_models.EventTarget(
+ event_target_name='newTarget',
+ class_name='file',
+ config=config_,
+ run_options=sdkclient_models.EventTargetRunOptions(
+ errors_tolerance='',
+ retry_strategy=sdkclient_models.EventTargetRunOptionsRetryStrategy(
+ push_retry_strategy='',
+ maximum_event_age_in_seconds=100,
+ maximum_retry_attempts=100
+ ),
+ dead_letter_queue=sdkclient_models.EventTargetRunOptionsDeadLetterQueue(
+ type=''
+ )
+ )
+ ),
+ sdkclient_models.EventTarget(
+ event_target_name='newTarget222',
+ class_name='file',
+ config=config_2_,
+ run_options=sdkclient_models.EventTargetRunOptions(
+ errors_tolerance='',
+ retry_strategy=sdkclient_models.EventTargetRunOptionsRetryStrategy(
+ push_retry_strategy='',
+ maximum_event_age_in_seconds=100,
+ maximum_retry_attempts=100
+ ),
+ dead_letter_queue=sdkclient_models.EventTargetRunOptionsDeadLetterQueue(
+ type=''
+ )
+ )
+ )
+ ]
+ )
+ try:
+ res = await self._sdk_client.create_event_targets_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_update_event_targets(self) -> None:
+ config_ = {
+ 'fileName': '~/Target',
+ 'line': '{ "form":"JSONPATH", "value":"$.data"}'
+ }
+ config_2_ = {
+ 'fileName': '~/Target222',
+ 'line': '{ "form":"JSONPATH", "value":"$.data"}'
+ }
+ request = sdkclient_models.UpdateEventTargetsRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule',
+ event_targets=[
+ sdkclient_models.EventTarget(
+ event_target_name='newTarget',
+ class_name='file',
+ config=config_
+ ),
+ sdkclient_models.EventTarget(
+ event_target_name='newTarget222',
+ class_name='file',
+ config=config_2_
+ )
+ ]
+ )
+ try:
+ res = self._sdk_client.update_event_targets(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_update_event_targets_async(self) -> None:
+ config_ = {
+ 'fileName': '~/Target',
+ 'line': '{ "form":"JSONPATH", "value":"$.data"}'
+ }
+ config_2_ = {
+ 'fileName': '~/Target222',
+ 'line': '{ "form":"JSONPATH", "value":"$.data"}'
+ }
+ request = sdkclient_models.UpdateEventTargetsRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule',
+ event_targets=[
+ sdkclient_models.EventTarget(
+ event_target_name='newTarget',
+ class_name='file',
+ config=config_
+ ),
+ sdkclient_models.EventTarget(
+ event_target_name='newTarget222',
+ class_name='file',
+ config=config_2_
+ )
+ ]
+ )
+ try:
+ res = await self._sdk_client.update_event_targets_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_delete_event_targets(self) -> None:
+ request = sdkclient_models.DeleteEventTargetsRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule',
+ event_target_names=[
+ 'newTarget',
+ 'newTarget222'
+ ]
+ )
+ try:
+ res = self._sdk_client.delete_event_targets(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_delete_event_targets_async(self) -> None:
+ request = sdkclient_models.DeleteEventTargetsRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule',
+ event_target_names=[
+ 'newTarget',
+ 'newTarget222'
+ ]
+ )
+ try:
+ res = await self._sdk_client.delete_event_targets_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ def test_list_event_targets(self) -> None:
+ request = sdkclient_models.ListEventTargetsRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule'
+ )
+ try:
+ res = self._sdk_client.list_event_targets(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+
+ async def test_list_event_targets_async(self) -> None:
+ request = sdkclient_models.ListEventTargetsRequest(
+ event_bus_name='newBus',
+ event_rule_name='newRule'
+ )
+ try:
+ res = await self._sdk_client.list_event_targets_async(request)
+ ConsoleClient.log(UtilClient.to_jsonstring(res.body))
+ except Exception as err:
+ ConsoleClient.log('err!')
+ ConsoleClient.log(err.message)
+ finally:
+ ConsoleClient.log('test end!')
+demo = Demo()
+demo.test_list_event_targets()
diff --git a/sdk/demo/EventTarget/generated/python/setup.py b/sdk/demo/EventTarget/generated/python/setup.py
new file mode 100644
index 0000000..3824f4c
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/python/setup.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+"""
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+"""
+
+import os
+from setuptools import setup, find_packages
+
+"""
+setup module for rocketmq_eventbridge_demo.
+
+Created on 14/10/2024
+
+@author:
+"""
+
+PACKAGE = "rocketmq_eventbridge_demo"
+NAME = "rocketmq_eventbridge_demo" or "alibabacloud-package"
+DESCRIPTION = "Alibaba Cloud eventbridge (20240701) SDK Library for Python"
+AUTHOR = ""
+AUTHOR_EMAIL = ""
+URL = "unavailable"
+VERSION = __import__(PACKAGE).__version__
+REQUIRES = [
+ "alibabacloud_tea_util>=0.3.13, <1.0.0",
+ "alibabacloud_tea_openapi>=0.3.12, <1.0.0",
+ "rocketmq_eventbridge20240701>=0.0.0, <1.0.0",
+ "alibabacloud_tea_console>=0.0.1, <1.0.0"
+]
+
+LONG_DESCRIPTION = ''
+if os.path.exists('./README.md'):
+ with open("README.md", encoding='utf-8') as fp:
+ LONG_DESCRIPTION = fp.read()
+
+setup(
+ name=NAME,
+ version=VERSION,
+ description=DESCRIPTION,
+ long_description=LONG_DESCRIPTION,
+ long_description_content_type='text/markdown',
+ author=AUTHOR,
+ author_email=AUTHOR_EMAIL,
+ license="Apache License 2.0",
+ url=URL,
+ keywords=["rocketmq","eventbridge","demo"],
+ packages=find_packages(exclude=["tests*"]),
+ include_package_data=True,
+ platforms="any",
+ install_requires=REQUIRES,
+ python_requires=">=3.6",
+ classifiers=(
+ "Development Status :: 4 - Beta",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: Apache Software License",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.6",
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ "Topic :: Software Development"
+ )
+)
diff --git a/sdk/demo/EventTarget/generated/ts/package.json b/sdk/demo/EventTarget/generated/ts/package.json
new file mode 100644
index 0000000..be9669b
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/ts/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "",
+ "version": "1.0.0",
+ "description": "",
+ "main": "dist/client.js",
+ "scripts": {
+ "test": "mocha --reporter spec --timeout 3000 test/*.test.js",
+ "test-cov": "nyc -e .ts -r=html -r=text -r=lcov npm run test",
+ "build": "tsc",
+ "prepublishOnly": "tsc"
+ },
+ "author": "",
+ "license": "ISC",
+ "devDependencies": {
+ "@types/node": "^12.12.26",
+ "nyc": "^15.0.0",
+ "source-map-support": "^0.5.16",
+ "ts-node": "^8.6.2",
+ "typescript": "^3.7.5"
+ },
+ "dependencies": {
+ "@alicloud/tea-typescript": "^1.7.1",
+ "@alicloud/tea-util": "^1.4.9",
+ "@alicloud/openapi-client": "^0.4.12",
+ "@alicloud/tea-console": "^1.0.0"
+ },
+ "files": [
+ "dist",
+ "src"
+ ]
+}
\ No newline at end of file
diff --git a/sdk/demo/EventTarget/generated/ts/src/client.ts b/sdk/demo/EventTarget/generated/ts/src/client.ts
new file mode 100644
index 0000000..ebc88aa
--- /dev/null
+++ b/sdk/demo/EventTarget/generated/ts/src/client.ts
@@ -0,0 +1,160 @@
+// This file is auto-generated, don't edit it
+import Util from '@alicloud/tea-util';
+import OpenApi, * as $OpenApi from '@alicloud/openapi-client';
+import SDKClient, * as $SDKClient from '../../../../../generated/ts/src/client';
+import Console from '@alicloud/tea-console';
+import * as $tea from '@alicloud/tea-typescript';
+
+
+export default class Client {
+ _sdkClient: SDKClient;
+ _endpoint: string;
+
+ constructor() {
+ this._endpoint = "127.0.0.1:7001";
+ let config = new $OpenApi.Config({
+ endpoint: this._endpoint,
+ });
+ this._sdkClient = new SDKClient(config);
+ }
+
+
+ /**
+ * @remarks
+ * EventTarget Controller apis:
+ * createEventTargets *
+ * updateEventTargets *
+ * deleteEventTargets *
+ * listEventTargets *
+ */
+ async testCreateEventTargets(): Promise<void> {
+ let config_ : {[key: string ]: any} = {
+ fileName: "~/Target",
+ line: "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}",
+ };
+ let config2_ : {[key: string ]: any} = {
+ fileName: "~/Target222",
+ line: "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}",
+ };
+ let request = new $SDKClient.CreateEventTargetsRequest({
+ eventBusName: "newBus",
+ eventRuleName: "newRule",
+ eventTargets: [
+ new $SDKClient.EventTarget({
+ eventTargetName: "newTarget",
+ className: "file",
+ config: config_,
+ runOptions: new $SDKClient.EventTargetRunOptions({
+ errorsTolerance: "",
+ retryStrategy: new $SDKClient.EventTargetRunOptionsRetryStrategy({
+ pushRetryStrategy: "",
+ maximumEventAgeInSeconds: 100,
+ maximumRetryAttempts: 100,
+ }),
+ deadLetterQueue: new $SDKClient.EventTargetRunOptionsDeadLetterQueue({
+ type: "",
+ }),
+ }),
+ }),
+ new $SDKClient.EventTarget({
+ eventTargetName: "newTarget222",
+ className: "file",
+ config: config2_,
+ runOptions: new $SDKClient.EventTargetRunOptions({
+ errorsTolerance: "",
+ retryStrategy: new $SDKClient.EventTargetRunOptionsRetryStrategy({
+ pushRetryStrategy: "",
+ maximumEventAgeInSeconds: 100,
+ maximumRetryAttempts: 100,
+ }),
+ deadLetterQueue: new $SDKClient.EventTargetRunOptionsDeadLetterQueue({
+ type: "",
+ }),
+ }),
+ })
+ ],
+ });
+ try {
+ let res = await this._sdkClient.createEventTargets(request);
+ Console.log(Util.toJSONString(res.body));
+ } catch (err) {
+ Console.log("err!");
+ Console.log(err.message);
+ } finally {
+ Console.log("test end!");
+ }
+ }
+
+ async testUpdateEventTargets(): Promise<void> {
+ let config_ : {[key: string ]: any} = {
+ fileName: "~/Target",
+ line: "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}",
+ };
+ let config2_ : {[key: string ]: any} = {
+ fileName: "~/Target222",
+ line: "{ \"form\":\"JSONPATH\", \"value\":\"$.data\"}",
+ };
+ let request = new $SDKClient.UpdateEventTargetsRequest({
+ eventBusName: "newBus",
+ eventRuleName: "newRule",
+ eventTargets: [
+ new $SDKClient.EventTarget({
+ eventTargetName: "newTarget",
+ className: "file",
+ config: config_,
+ }),
+ new $SDKClient.EventTarget({
+ eventTargetName: "newTarget222",