Sha256: 548f2ddd3e15d84706591bdf9ed217d9827f081ad0ef99df9c8e2c1224f643a3

Contents?: true

Size: 1.28 KB

Versions: 14

Compression:

Stored size: 1.28 KB

Contents

# bandwidth
#
# This file was automatically generated by APIMATIC v2.0
# ( https://apimatic.io ).

module Bandwidth
  # A session object
  class Session < BaseModel
    SKIP = Object.new
    private_constant :SKIP

    # Unique id of the session
    # @return [String]
    attr_accessor :id

    # User defined tag to associate with the session
    # @return [String]
    attr_accessor :tag

    # A mapping from model property names to API property names.
    def self.names
      @_hash = {} if @_hash.nil?
      @_hash['id'] = 'id'
      @_hash['tag'] = 'tag'
      @_hash
    end

    # An array for optional fields
    def optionals
      %w[
        id
        tag
      ]
    end

    # An array for nullable fields
    def nullables
      []
    end

    def initialize(id = nil,
                   tag = nil)
      @id = id unless id == SKIP
      @tag = tag unless tag == SKIP
    end

    # Creates an instance of the object from a hash.
    def self.from_hash(hash)
      return nil unless hash

      # Extract variables from the hash.
      id = hash.key?('id') ? hash['id'] : SKIP
      tag = hash.key?('tag') ? hash['tag'] : SKIP

      # Create object from extracted values.
      Session.new(id,
                  tag)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
bandwidth-sdk-10.5.0 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
bandwidth-sdk-10.4.0 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
bandwidth-sdk-10.3.0 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
bandwidth-sdk-10.2.0 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
bandwidth-sdk-10.1.0 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
bandwidth-sdk-10.0.0 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
bandwidth-sdk-9.4.1 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
bandwidth-sdk-9.4.0 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
bandwidth-sdk-9.3.0 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
bandwidth-sdk-9.2.0 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
bandwidth-sdk-9.1.2 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
bandwidth-sdk-9.1.1 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
bandwidth-sdk-9.1.0 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
bandwidth-sdk-9.0.0 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb