phaseo_sdk 2.1.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/index.rb CHANGED
@@ -56,14 +56,20 @@ module PhaseoSdk
56
56
  warnings_as_errors: false,
57
57
  logger: nil,
58
58
  lifecycle_resolver: nil,
59
- devtools: nil
59
+ devtools: nil,
60
+ client_source: "phaseo-ruby",
61
+ client_source_version: "2.1.0"
60
62
  )
61
63
  api_key ||= ENV["PHASEO_API_KEY"]
62
64
  raise ArgumentError, "Missing API key. Pass api_key or set PHASEO_API_KEY." if api_key.to_s.empty?
63
65
 
64
66
  @raw_client = ::Phaseo::Gen::Client.new(
65
67
  base_url: base_path,
66
- headers: { "Authorization" => "Bearer #{api_key}" }
68
+ headers: {
69
+ "Authorization" => "Bearer #{api_key}",
70
+ "X-Phaseo-Client" => client_source,
71
+ "X-Phaseo-Client-Version" => client_source_version
72
+ }
67
73
  )
68
74
  @base_path = base_path.sub(%r{/+\z}, "")
69
75
  @enable_deprecation_warnings = enable_deprecation_warnings
@@ -72,7 +78,7 @@ module PhaseoSdk
72
78
  @lifecycle_resolver = lifecycle_resolver
73
79
  @warned_models = {}
74
80
  @model_lifecycle_cache = {}
75
- @telemetry_recorder = TelemetryRecorder.new(devtools, "2.1.0")
81
+ @telemetry_recorder = TelemetryRecorder.new(devtools, "3.0.0")
76
82
  @async_jobs = AsyncJobsResource.new(self)
77
83
  end
78
84
 
@@ -730,7 +736,7 @@ module PhaseoSdk
730
736
  end
731
737
 
732
738
  class TelemetryRecorder
733
- def initialize(config = nil, sdk_version = "2.1.0")
739
+ def initialize(config = nil, sdk_version = "3.0.0")
734
740
  config ||= {}
735
741
  enabled = config.fetch(:enabled, false)
736
742
  directory = config.fetch(:directory, ".phaseo-devtools")