Class: Google::Apis::FitnessV1::Session

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

Overview

Sessions contain metadata, such as a user-friendly name and time interval information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Session

Returns a new instance of Session.



895
896
897
# File 'lib/google/apis/fitness_v1/classes.rb', line 895

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

Instance Attribute Details

#active_time_millisFixnum

Session active time. While start_time_millis and end_time_millis define the full session time, the active time can be shorter and specified by active_time_millis. If the inactive time during the session is known, it should also be inserted via a com.google.activity.segment data point with a STILL activity value Corresponds to the JSON property activeTimeMillis

Returns:

  • (Fixnum)


852
853
854
# File 'lib/google/apis/fitness_v1/classes.rb', line 852

def active_time_millis
  @active_time_millis
end

#activity_typeFixnum

The type of activity this session represents. Corresponds to the JSON property activityType

Returns:

  • (Fixnum)


857
858
859
# File 'lib/google/apis/fitness_v1/classes.rb', line 857

def activity_type
  @activity_type
end

#applicationGoogle::Apis::FitnessV1::Application

The application that created the session. Corresponds to the JSON property application



862
863
864
# File 'lib/google/apis/fitness_v1/classes.rb', line 862

def application
  @application
end

#descriptionString

A description for this session. Corresponds to the JSON property description

Returns:

  • (String)


867
868
869
# File 'lib/google/apis/fitness_v1/classes.rb', line 867

def description
  @description
end

#end_time_millisFixnum

An end time, in milliseconds since epoch, inclusive. Corresponds to the JSON property endTimeMillis

Returns:

  • (Fixnum)


872
873
874
# File 'lib/google/apis/fitness_v1/classes.rb', line 872

def end_time_millis
  @end_time_millis
end

#idString

A client-generated identifier that is unique across all sessions owned by this particular user. Corresponds to the JSON property id

Returns:

  • (String)


878
879
880
# File 'lib/google/apis/fitness_v1/classes.rb', line 878

def id
  @id
end

#modified_time_millisFixnum

A timestamp that indicates when the session was last modified. Corresponds to the JSON property modifiedTimeMillis

Returns:

  • (Fixnum)


883
884
885
# File 'lib/google/apis/fitness_v1/classes.rb', line 883

def modified_time_millis
  @modified_time_millis
end

#nameString

A human readable name of the session. Corresponds to the JSON property name

Returns:

  • (String)


888
889
890
# File 'lib/google/apis/fitness_v1/classes.rb', line 888

def name
  @name
end

#start_time_millisFixnum

A start time, in milliseconds since epoch, inclusive. Corresponds to the JSON property startTimeMillis

Returns:

  • (Fixnum)


893
894
895
# File 'lib/google/apis/fitness_v1/classes.rb', line 893

def start_time_millis
  @start_time_millis
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



900
901
902
903
904
905
906
907
908
909
910
# File 'lib/google/apis/fitness_v1/classes.rb', line 900

def update!(**args)
  @active_time_millis = args[:active_time_millis] if args.key?(:active_time_millis)
  @activity_type = args[:activity_type] if args.key?(:activity_type)
  @application = args[:application] if args.key?(:application)
  @description = args[:description] if args.key?(:description)
  @end_time_millis = args[:end_time_millis] if args.key?(:end_time_millis)
  @id = args[:id] if args.key?(:id)
  @modified_time_millis = args[:modified_time_millis] if args.key?(:modified_time_millis)
  @name = args[:name] if args.key?(:name)
  @start_time_millis = args[:start_time_millis] if args.key?(:start_time_millis)
end