Class: Google::Apis::SpannerV1::Session

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

Overview

A session in the Cloud Spanner API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Session

Returns a new instance of Session.



5939
5940
5941
# File 'lib/google/apis/spanner_v1/classes.rb', line 5939

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

Instance Attribute Details

#approximate_last_use_timeString

Output only. The approximate timestamp when the session is last used. It is typically earlier than the actual last use time. Corresponds to the JSON property approximateLastUseTime

Returns:

  • (String)


5902
5903
5904
# File 'lib/google/apis/spanner_v1/classes.rb', line 5902

def approximate_last_use_time
  @approximate_last_use_time
end

#create_timeString

Output only. The timestamp when the session is created. Corresponds to the JSON property createTime

Returns:

  • (String)


5907
5908
5909
# File 'lib/google/apis/spanner_v1/classes.rb', line 5907

def create_time
  @create_time
end

#creator_roleString

The database role which created this session. Corresponds to the JSON property creatorRole

Returns:

  • (String)


5912
5913
5914
# File 'lib/google/apis/spanner_v1/classes.rb', line 5912

def creator_role
  @creator_role
end

#labelsHash<String,String>

The labels for the session. * Label keys must be between 1 and 63 characters long and must conform to the following regular expression: [a-z]([-a-z0-9]*[a- z0-9])?. * Label values must be between 0 and 63 characters long and must conform to the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)?. * No more than 64 labels can be associated with a given session. See https://goo.gl/ xmQnxf for more information on and examples of labels. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


5922
5923
5924
# File 'lib/google/apis/spanner_v1/classes.rb', line 5922

def labels
  @labels
end

#multiplexedBoolean Also known as: multiplexed?

Optional. If true, specifies a multiplexed session. Use a multiplexed session for multiple, concurrent read-only operations. Don't use them for read-write transactions, partitioned reads, or partitioned queries. Use CreateSession to create multiplexed sessions. Don't use BatchCreateSessions to create a multiplexed session. You can't delete or list multiplexed sessions. Corresponds to the JSON property multiplexed

Returns:

  • (Boolean)


5931
5932
5933
# File 'lib/google/apis/spanner_v1/classes.rb', line 5931

def multiplexed
  @multiplexed
end

#nameString

Output only. The name of the session. This is always system-assigned. Corresponds to the JSON property name

Returns:

  • (String)


5937
5938
5939
# File 'lib/google/apis/spanner_v1/classes.rb', line 5937

def name
  @name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5944
5945
5946
5947
5948
5949
5950
5951
# File 'lib/google/apis/spanner_v1/classes.rb', line 5944

def update!(**args)
  @approximate_last_use_time = args[:approximate_last_use_time] if args.key?(:approximate_last_use_time)
  @create_time = args[:create_time] if args.key?(:create_time)
  @creator_role = args[:creator_role] if args.key?(:creator_role)
  @labels = args[:labels] if args.key?(:labels)
  @multiplexed = args[:multiplexed] if args.key?(:multiplexed)
  @name = args[:name] if args.key?(:name)
end