23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/microsoft_graph_core/middleware/telemetry_handler.rb', line 23
def (options)
if options.nil? then
options = GraphClientOptions.new
end
service_version_prefix = ""
unless options.graph_service_library_version.nil? || options.graph_service_library_version.empty? then
service_version_prefix = "graph-ruby"
unless options.graph_service_version.nil? || options.graph_service_version.empty? then
service_version_prefix += "-" + options.graph_service_version
end
service_version_prefix += "/" + options.graph_service_library_version + ","
end
feature_suffix = ""
unless RbConfig::CONFIG["host_os"].nil? || RbConfig::CONFIG["host_os"].empty? then
feature_suffix = " hostOS=" + RbConfig::CONFIG["host_os"] + ";"
end
unless RbConfig::CONFIG["host_cpu"].nil? || RbConfig::CONFIG["host_cpu"].empty? then
feature_suffix += " hostArch=" + RbConfig::CONFIG["host_cpu"] + ";"
end
unless RbConfig::CONFIG["ruby_version"].nil? || RbConfig::CONFIG["ruby_version"].empty? then
feature_suffix += " runtimeEnvironment=" + RbConfig::CONFIG["ruby_version"] + ";"
end
return service_version_prefix + "graph-ruby-core/" + MicrosoftGraphCore::VersionInformation::VERSION + feature_suffix
end
|