Class ProviderConfig.Builder

java.lang.Object
cloud.opencode.base.sms.config.ProviderConfig.Builder
Enclosing class:
ProviderConfig

public static class ProviderConfig.Builder extends Object
Builder for ProviderConfig. ProviderConfig的构建器。
Since:
JDK 25, opencode-base-sms V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • name

      public ProviderConfig.Builder name(String name)
      Sets the provider name. 设置服务商名称。
      Parameters:
      name - the name | 名称
      Returns:
      this builder | 此构建器
    • endpoint

      public ProviderConfig.Builder endpoint(String endpoint)
      Sets the API endpoint. 设置API端点。
      Parameters:
      endpoint - the endpoint | 端点
      Returns:
      this builder | 此构建器
    • apiVersion

      public ProviderConfig.Builder apiVersion(String apiVersion)
      Sets the API version. 设置API版本。
      Parameters:
      apiVersion - the API version | API版本
      Returns:
      this builder | 此构建器
    • region

      public ProviderConfig.Builder region(String region)
      Sets the region. 设置区域。
      Parameters:
      region - the region | 区域
      Returns:
      this builder | 此构建器
    • timeout

      public ProviderConfig.Builder timeout(Duration timeout)
      Sets the request timeout. 设置请求超时。
      Parameters:
      timeout - the timeout | 超时
      Returns:
      this builder | 此构建器
    • connectTimeout

      public ProviderConfig.Builder connectTimeout(Duration connectTimeout)
      Sets the connection timeout. 设置连接超时。
      Parameters:
      connectTimeout - the connect timeout | 连接超时
      Returns:
      this builder | 此构建器
    • maxRetries

      public ProviderConfig.Builder maxRetries(int maxRetries)
      Sets the max retries. 设置最大重试次数。
      Parameters:
      maxRetries - the max retries | 最大重试次数
      Returns:
      this builder | 此构建器
    • sdkAppId

      public ProviderConfig.Builder sdkAppId(String sdkAppId)
      Sets the SDK app ID (for Tencent). 设置SDK应用ID(腾讯云)。
      Parameters:
      sdkAppId - the SDK app ID | SDK应用ID
      Returns:
      this builder | 此构建器
    • extraOptions

      public ProviderConfig.Builder extraOptions(Map<String,String> extraOptions)
      Sets extra options. 设置额外选项。
      Parameters:
      extraOptions - the extra options | 额外选项
      Returns:
      this builder | 此构建器
    • option

      public ProviderConfig.Builder option(String key, String value)
      Adds an extra option. 添加额外选项。
      Parameters:
      key - the key | 键
      value - the value | 值
      Returns:
      this builder | 此构建器
    • build

      public ProviderConfig build()
      Builds the ProviderConfig. 构建ProviderConfig。
      Returns:
      the config | 配置