lyndomiao commented on a change in pull request #6107:
URL: https://github.com/apache/camel/pull/6107#discussion_r712766370



##########
File path: 
components/camel-huawei/camel-huaweicloud-imagerecognition/src/main/java/org/apache/camel/component/huaweicloud/image/ImageRecognitionEndpoint.java
##########
@@ -0,0 +1,292 @@
+/*
+ * 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.
+ */
+package org.apache.camel.component.huaweicloud.image;
+
+import com.huaweicloud.sdk.image.v2.ImageClient;
+import org.apache.camel.Category;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.component.huaweicloud.common.models.ServiceKeys;
+import 
org.apache.camel.component.huaweicloud.image.constants.ImageRecognitionConstants;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
+import org.apache.camel.support.DefaultEndpoint;
+
+/**
+ * component to connect to image recognition service
+ */
+@UriEndpoint(firstVersion = "3.12.0-SNAPSHOT", scheme = "hwcloud-image", title 
= "Huawei Cloud Image Recognition",
+             syntax = "hwcloud-image:operation",
+             category = { Category.CLOUD, Category.MESSAGING }, producerOnly = 
true)
+public class ImageRecognitionEndpoint extends DefaultEndpoint {
+    @UriPath(
+             description = "Name of Image Recognition operation to perform, 
including celebrityRecognition and tagRecognition",
+             displayName = "Operation name", label = "producer")
+    @Metadata(required = true)
+    private String operation;
+
+    @UriParam(description = "Configuration object for cloud service 
authentication",
+              displayName = "Service Configuration", secret = true)
+    @Metadata(required = false)
+    private ServiceKeys serviceKeys;
+
+    @UriParam(description = "Access key for the cloud user", displayName = 
"Account access key (AK)", secret = true)
+    @Metadata(required = true)
+    private String accessKey;
+
+    @UriParam(description = "Secret key for the cloud user", displayName = 
"Account secret key (SK)", secret = true)
+    @Metadata(required = true)
+    private String secretKey;
+
+    @UriParam(description = "Cloud project ID", displayName = "Project ID", 
secret = false)
+    @Metadata(required = true)
+    private String projectId;
+
+    @UriParam(description = "Proxy server ip/hostname", displayName = "Proxy 
server host", secret = false)
+    @Metadata(required = false)
+    private String proxyHost;
+
+    @UriParam(description = "Proxy server port", displayName = "Proxy server 
port", secret = false)
+    @Metadata(required = false)
+    private int proxyPort;
+
+    @UriParam(description = "Proxy authentication user", displayName = "Proxy 
user", secret = true)
+    @Metadata(required = false)
+    private String proxyUser;
+
+    @UriParam(description = "Proxy authentication password", displayName = 
"Proxy password", secret = true)
+    @Metadata(required = false)
+    private String proxyPassword;
+
+    @UriParam(description = "Ignore SSL verification", displayName = "SSL 
Verification Ignored", secret = false,
+              defaultValue = "false", label = "security")
+    @Metadata(required = false)
+    private boolean ignoreSslVerification;
+
+    @UriParam(
+              description = "Image Recognition service region. Currently only 
cn-north-1 and cn-north-4 are supported. This is lower precedence than endpoint 
based configuration.",
+              displayName = "Service region", secret = false)
+    @Metadata(required = true)
+    private String region;
+
+    @UriParam(
+              description = "Fully qualified Image Recognition service url. 
Carries higher precedence than region based configuration.",
+              displayName = "Service endpoint", secret = false)
+    @Metadata(required = false)
+    private String endpoint;
+
+    @UriParam(
+              description = "Indicates the Base64 character string converted 
from the image. The size cannot exceed 10 MB. The image resolution of the 
narrow sides must be greater than 15 pixels, and that of the wide sides cannot 
exceed 4096 pixels."
+                            + "The supported image formats include JPG, PNG, 
and BMP. \n"
+                            + "Configure either this parameter or imageUrl, 
and this one carries higher precedence than imageUrl.",
+              displayName = "imageContent", secret = false)
+    @Metadata(required = false)

Review comment:
       @davsclaus  What I'm concerned is the default value of metadata maybe 
change in the future,  or no default value. So at this point, it's necessary to 
declare required=false explicitly.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to