Skip to content

Commit 437a9af

Browse files
committed
user_agent fix
1 parent 689667a commit 437a9af

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lib/sib-api-v3-sdk/api/inbound_parsing_api.rb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ class InboundParsingApi
1919
def initialize(api_client = ApiClient.default)
2020
@api_client = api_client
2121
end
22+
23+
# Set custom user_agent if explicitly passed in api
24+
# default will still remain Swagger-Codegen/#{VERSION}/ruby
25+
def setUserAgent(user_agent)
26+
@user_agent = user_agent
27+
if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_')
28+
@api_client.default_headers['User-Agent'] = @user_agent
29+
end
30+
end
2231
# Retrieve inbound attachment with download token.
2332
# This endpoint will retrieve inbound attachment with download token.
2433
# @param download_token Token to fetch a particular attachment
@@ -38,14 +47,6 @@ def get_inbound_email_attachment_with_http_info(download_token, opts = {})
3847
if @api_client.config.debugging
3948
@api_client.config.logger.debug 'Calling API: InboundParsingApi.get_inbound_email_attachment ...'
4049
end
41-
42-
# Set custom user_agent if explicitly passed in api
43-
# default will still remain Swagger-Codegen/#{VERSION}/ruby
44-
def setUserAgent(user_agent)
45-
@user_agent = user_agent
46-
if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_')
47-
@api_client.default_headers['User-Agent'] = @user_agent
48-
end
4950
# verify the required parameter 'download_token' is set
5051
if @api_client.config.client_side_validation && download_token.nil?
5152
fail ArgumentError, "Missing the required parameter 'download_token' when calling InboundParsingApi.get_inbound_email_attachment"

0 commit comments

Comments
 (0)