Class: Google::Apis::AgentidentitycredentialsV1::GoogleCloudAgentidentitycredentialsV1Success

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/agentidentitycredentials_v1/classes.rb,
lib/google/apis/agentidentitycredentials_v1/representations.rb,
lib/google/apis/agentidentitycredentials_v1/representations.rb

Overview

Message indicating successful retrieval of credentials.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAgentidentitycredentialsV1Success

Returns a new instance of GoogleCloudAgentidentitycredentialsV1Success.



222
223
224
# File 'lib/google/apis/agentidentitycredentials_v1/classes.rb', line 222

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#expire_timeString

The expiration time of the token. This does not guarantee that the token will be valid until this time, since the token could be revoked earlier. There could also be clock skew between the auth provider and the client so it may expire slightly earlier. If not set, the token might be permanent or it may be that the service does not (or cannot) know when it will expire. Corresponds to the JSON property expireTime

Returns:

  • (String)


196
197
198
# File 'lib/google/apis/agentidentitycredentials_v1/classes.rb', line 196

def expire_time
  @expire_time
end

#headerString

The HTTP header name where the token should be placed. Corresponds to the JSON property header

Returns:

  • (String)


201
202
203
# File 'lib/google/apis/agentidentitycredentials_v1/classes.rb', line 201

def header
  @header
end

#scopesArray<String>

The scopes actually associated with the retrieved token. End users may have rejected some requested scopes, or the third-party authorization servers can return a different set of scopes than what was asked for. Callers should verify that all required scopes for their intended use are included in this list. Corresponds to the JSON property scopes

Returns:

  • (Array<String>)


210
211
212
# File 'lib/google/apis/agentidentitycredentials_v1/classes.rb', line 210

def scopes
  @scopes
end

#tokenString

The retrieved access token or credential for the end user. On an MCP tool call, for an invalid token the OAuth spec states that this should return 401 or 403, but MCP servers may implement this differently. If you get any flavor of PERMISSION_DENIED, retry your original request to RetrieveCredentials with force_refresh_token set to the expired/invalid token string, which will fetch a new token or initiate a new consent flow. Corresponds to the JSON property token

Returns:

  • (String)


220
221
222
# File 'lib/google/apis/agentidentitycredentials_v1/classes.rb', line 220

def token
  @token
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



227
228
229
230
231
232
# File 'lib/google/apis/agentidentitycredentials_v1/classes.rb', line 227

def update!(**args)
  @expire_time = args[:expire_time] if args.key?(:expire_time)
  @header = args[:header] if args.key?(:header)
  @scopes = args[:scopes] if args.key?(:scopes)
  @token = args[:token] if args.key?(:token)
end