cadenya 1.4.0 → 1.5.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cadenya/types.rb +75 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85ab8209a6ed24b13c3d761856689187cfed649adf0290d564fd906ce87a0e4b
4
- data.tar.gz: d623e6697eb7de5bd7c41c5c1374ed6dbf79d722855ef5c7c4c3d6e2867c2463
3
+ metadata.gz: 223bf6181a9de37bd24bf02abb889e1473bb6ed030913e6bde182a41d2fa8e68
4
+ data.tar.gz: e57f24e581cb8015bccb16a788c9693f93c8c64cd8b1c501016e559033a0b711
5
5
  SHA512:
6
- metadata.gz: 2275f85ca44b0d036de084a93f235b9f08ef6da73869c17d49241a7b1d2ed42baab12173e2c7ae814958b8e0a9e25e7fb6bcba2a8ef52972e11650a7cf9164d5
7
- data.tar.gz: 20a10bfca04b7eb57d96788a1f4b9d7c0d642d4b092bf52a7327394bb2f717eaab6728aa483b4acf99025480c9dd9d249ae5fc8ca7016eee53af195dbf337302
6
+ metadata.gz: 3bd3b1fd7aa13a95d4d77b2e1d75328b181e4d5bb9001b32422c5737ca48335cb222817a5ebae7205573b71537ca2e88282c05ad775c5d150d9cb60418d23fbb
7
+ data.tar.gz: 71e1e7f8e34ec480611fa8eda3a27fc623b83d5857d2d4110750905f4fa47974dda6cf5a8d9f9f2f1bc3c5abbef7328730ea696fb545ce53786cf67c51a86499
data/lib/cadenya/types.rb CHANGED
@@ -5457,6 +5457,12 @@ module Cadenya
5457
5457
  end
5458
5458
  end
5459
5459
 
5460
+ def self.decode_StatusDetails(data)
5461
+ return Types::WidgetSessionErrorInfo.from_json(data) if data.is_a?(Hash) && ["@type", "domain", "reason"].all? { |k| data.key?(k) }
5462
+ return Types::GoogleProtobufAny.from_json(data) if data.is_a?(Hash)
5463
+ raise ArgumentError, "StatusDetails: no variant matched"
5464
+ end
5465
+
5460
5466
  class Status
5461
5467
  attr_reader :code, :message, :details
5462
5468
 
@@ -5470,7 +5476,7 @@ module Cadenya
5470
5476
  new(
5471
5477
  code: data["code"],
5472
5478
  message: data["message"],
5473
- details: data["details"].nil? ? nil : (data["details"]).map { |item| Types::GoogleProtobufAny.from_json(item) },
5479
+ details: data["details"].nil? ? nil : (data["details"]).map { |item| Types.decode_StatusDetails(item) },
5474
5480
  )
5475
5481
  end
5476
5482
 
@@ -7661,14 +7667,15 @@ module Cadenya
7661
7667
  WidgetSessionState = ["STATE_UNSPECIFIED", "STATE_ACTIVE", "STATE_EXPIRED", "STATE_REVOKED", "STATE_EXHAUSTED"].freeze
7662
7668
 
7663
7669
  class WidgetSession
7664
- attr_reader :metadata, :spec, :info, :state, :secrets
7670
+ attr_reader :metadata, :spec, :info, :state, :secrets, :credentials
7665
7671
 
7666
- def initialize(metadata: nil, spec: nil, info: nil, state: nil, secrets: nil)
7672
+ def initialize(metadata: nil, spec: nil, info: nil, state: nil, secrets: nil, credentials: nil)
7667
7673
  @metadata = metadata
7668
7674
  @spec = spec
7669
7675
  @info = info
7670
7676
  @state = state
7671
7677
  @secrets = secrets
7678
+ @credentials = credentials
7672
7679
  end
7673
7680
 
7674
7681
  def self.from_json(data)
@@ -7678,6 +7685,7 @@ module Cadenya
7678
7685
  info: data["info"].nil? ? nil : Types::WidgetSessionInfo.from_json(data["info"]),
7679
7686
  state: data["state"],
7680
7687
  secrets: data["secrets"].nil? ? nil : (data["secrets"]).map { |item| Types::WidgetSession_Secret.from_json(item) },
7688
+ credentials: data["credentials"].nil? ? nil : Types::WidgetSessionCredentials.from_json(data["credentials"]),
7681
7689
  )
7682
7690
  end
7683
7691
 
@@ -7688,6 +7696,39 @@ module Cadenya
7688
7696
  info: Util.plain(@info),
7689
7697
  state: Util.plain(@state),
7690
7698
  secrets: Util.plain(@secrets),
7699
+ credentials: Util.plain(@credentials),
7700
+ }.reject { |_k, v| v.nil? }
7701
+ end
7702
+ end
7703
+
7704
+ class WidgetSessionCredentials
7705
+ attr_reader :session_id, :host, :token, :token_expires_at, :session_expires_at
7706
+
7707
+ def initialize(session_id: nil, host: nil, token: nil, token_expires_at: nil, session_expires_at: nil)
7708
+ @session_id = session_id
7709
+ @host = host
7710
+ @token = token
7711
+ @token_expires_at = token_expires_at
7712
+ @session_expires_at = session_expires_at
7713
+ end
7714
+
7715
+ def self.from_json(data)
7716
+ new(
7717
+ session_id: data["sessionId"],
7718
+ host: data["host"],
7719
+ token: data["token"],
7720
+ token_expires_at: data["tokenExpiresAt"].nil? ? nil : Time.iso8601(data["tokenExpiresAt"]),
7721
+ session_expires_at: data["sessionExpiresAt"].nil? ? nil : Time.iso8601(data["sessionExpiresAt"]),
7722
+ )
7723
+ end
7724
+
7725
+ def to_h
7726
+ {
7727
+ session_id: Util.plain(@session_id),
7728
+ host: Util.plain(@host),
7729
+ token: Util.plain(@token),
7730
+ token_expires_at: Util.plain(@token_expires_at),
7731
+ session_expires_at: Util.plain(@session_expires_at),
7691
7732
  }.reject { |_k, v| v.nil? }
7692
7733
  end
7693
7734
  end
@@ -10076,6 +10117,37 @@ module Cadenya
10076
10117
  end
10077
10118
  end
10078
10119
 
10120
+ WidgetSessionErrorReason = ["TOKEN_EXPIRED", "SESSION_REVOKED", "SESSION_EXPIRED", "SESSION_EXHAUSTED"].freeze
10121
+
10122
+ class WidgetSessionErrorInfo
10123
+ attr_reader :type, :domain, :reason, :metadata
10124
+
10125
+ def initialize(type: nil, domain: nil, reason: nil, metadata: nil)
10126
+ @type = type
10127
+ @domain = domain
10128
+ @reason = reason
10129
+ @metadata = metadata
10130
+ end
10131
+
10132
+ def self.from_json(data)
10133
+ new(
10134
+ type: data["@type"],
10135
+ domain: data["domain"],
10136
+ reason: data["reason"],
10137
+ metadata: data["metadata"],
10138
+ )
10139
+ end
10140
+
10141
+ def to_h
10142
+ {
10143
+ type: Util.plain(@type),
10144
+ domain: Util.plain(@domain),
10145
+ reason: Util.plain(@reason),
10146
+ metadata: Util.plain(@metadata),
10147
+ }.reject { |_k, v| v.nil? }
10148
+ end
10149
+ end
10150
+
10079
10151
  AgentServiceListAgentsState = ["STATE_UNSPECIFIED", "STATE_DRAFT", "STATE_PUBLISHED", "STATE_ARCHIVED"].freeze
10080
10152
 
10081
10153
  AgentServiceListAgentsVariationSelectionMode = ["VARIATION_SELECTION_MODE_UNSPECIFIED", "VARIATION_SELECTION_MODE_RANDOM", "VARIATION_SELECTION_MODE_WEIGHTED"].freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cadenya
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cadenya
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-16 00:00:00.000000000 Z
11
+ date: 2026-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday