Skip to content

Commit 14b998d

Browse files
committed
NO-ISSUE pebble
1 parent 668da5b commit 14b998d

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

  • generator/src/main/resources/line-bot-sdk-ruby-generator

generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,33 @@ module Line
1313
module V2
1414
module {{ packageName | camelize }}
1515
class Api{{ operations.classname.indexOf('Blob') != -1 ? 'Blob' : '' }}Client
16+
# Initializes a new {Line::Bot::V2::{{ packageName | camelize }}::Api{{ operations.classname.indexOf('Blob') != -1 ? 'Blob' : '' }}Client} instance.
17+
#
18+
# @param base_url [String] The base URL for requests (optional).
19+
# Defaults to '{{endpoint(operations.classname)}}' if none is provided.
20+
# You can override this for testing or to use a mock server.
21+
{%- if packageName == 'module_attach' %}
22+
# @param channel_id [String] The channel ID for Basic authentication.
23+
# @param channel_secret [String] The channel secret for Basic authentication.
24+
{%- elseif packageName != 'channel_access_token' %}
25+
# @param channel_access_token [String] The channel access token for authorization.
26+
{%- endif %}
27+
# @param http_options [Hash] HTTP options (same as Net::HTTP options).
28+
# See: https://docs.ruby-lang.org/en/3.4/Net/HTTP.html to understand the options.
29+
#
30+
# @example
31+
# @client ||= Line::Bot::V2::{{ packageName | camelize }}::Api{{ operations.classname.indexOf('Blob') != -1 ? 'Blob' : '' }}Client.new(
32+
{%- if packageName == 'module_attach' %}
33+
# channel_id: "YOUR_CHANNEL_ID",
34+
# channel_secret: "YOUR_CHANNEL_SECRET",
35+
{%- elseif packageName != 'channel_access_token' %}
36+
# channel_access_token: "YOUR_CHANNEL_ACCESS_TOKEN",
37+
{%- endif %}
38+
# http_options: {
39+
# open_timeout: 5,
40+
# read_timeout: 5,
41+
# }
42+
# )
1643
def initialize(base_url: nil{% if packageName == 'channel_access_token' %}{% elseif packageName == 'module_attach' %}, channel_id:, channel_secret:{% else %}, channel_access_token:{% endif %}, http_options: {})
1744
@http_client = HttpClient.new(
1845
base_url: base_url || '{{endpoint(operations.classname)}}'{% if packageName == 'channel_access_token' %}{% elseif packageName == 'module_attach' %},

0 commit comments

Comments
 (0)