Class: MicrosoftGraph::Models::TermStoreRelation

Inherits:
Entity
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/term_store_relation.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#additional_data, #additional_data=, #id, #id=, #odata_type, #odata_type=

Constructor Details

#initializeObject

Instantiates a new termStoreRelation and sets the default values.



25
26
27
# File 'lib/models/term_store_relation.rb', line 25

def initialize()
    super
end

Class Method Details

.create_from_discriminator_value(parse_node) ⇒ Object

Creates a new instance of the appropriate class based on discriminator value

Parameters:

  • parse_node

    The parse node to use to read the discriminator value and create the object

Returns:

  • a term_store_relation

Raises:

  • (StandardError)


33
34
35
36
# File 'lib/models/term_store_relation.rb', line 33

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    return TermStoreRelation.new
end

Instance Method Details

#from_termObject

Gets the fromTerm property value. The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set].

Returns:

  • a term_store_term



41
42
43
# File 'lib/models/term_store_relation.rb', line 41

def from_term
    return @from_term
end

#from_term=(value) ⇒ Object

Sets the fromTerm property value. The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set].

Parameters:

  • value

    Value to set for the fromTerm property.

Returns:

  • a void



49
50
51
# File 'lib/models/term_store_relation.rb', line 49

def from_term=(value)
    @from_term = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



56
57
58
59
60
61
62
63
# File 'lib/models/term_store_relation.rb', line 56

def get_field_deserializers()
    return super.merge({
        "fromTerm" => lambda {|n| @from_term = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TermStoreTerm.create_from_discriminator_value(pn) }) },
        "relationship" => lambda {|n| @relationship = n.get_enum_value(MicrosoftGraph::Models::TermStoreRelationType) },
        "set" => lambda {|n| @set = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TermStoreSet.create_from_discriminator_value(pn) }) },
        "toTerm" => lambda {|n| @to_term = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TermStoreTerm.create_from_discriminator_value(pn) }) },
    })
end

#relationshipObject

Gets the relationship property value. The type of relation. Possible values are: pin, reuse.

Returns:

  • a term_store_relation_type



68
69
70
# File 'lib/models/term_store_relation.rb', line 68

def relationship
    return @relationship
end

#relationship=(value) ⇒ Object

Sets the relationship property value. The type of relation. Possible values are: pin, reuse.

Parameters:

  • value

    Value to set for the relationship property.

Returns:

  • a void



76
77
78
# File 'lib/models/term_store_relation.rb', line 76

def relationship=(value)
    @relationship = value
end

#serialize(writer) ⇒ Object

Serializes information the current object

Parameters:

  • writer

    Serialization writer to use to serialize this model

Returns:

  • a void

Raises:

  • (StandardError)


84
85
86
87
88
89
90
91
# File 'lib/models/term_store_relation.rb', line 84

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_object_value("fromTerm", @from_term)
    writer.write_enum_value("relationship", @relationship)
    writer.write_object_value("set", @set)
    writer.write_object_value("toTerm", @to_term)
end

#setObject

Gets the set property value. The [set] in which the relation is relevant.

Returns:

  • a term_store_set



96
97
98
# File 'lib/models/term_store_relation.rb', line 96

def set
    return @set
end

#set=(value) ⇒ Object

Sets the set property value. The [set] in which the relation is relevant.

Parameters:

  • value

    Value to set for the set property.

Returns:

  • a void



104
105
106
# File 'lib/models/term_store_relation.rb', line 104

def set=(value)
    @set = value
end

#to_termObject

Gets the toTerm property value. The to [term] of the relation. The term to which the relationship is defined.

Returns:

  • a term_store_term



111
112
113
# File 'lib/models/term_store_relation.rb', line 111

def to_term
    return @to_term
end

#to_term=(value) ⇒ Object

Sets the toTerm property value. The to [term] of the relation. The term to which the relationship is defined.

Parameters:

  • value

    Value to set for the toTerm property.

Returns:

  • a void



119
120
121
# File 'lib/models/term_store_relation.rb', line 119

def to_term=(value)
    @to_term = value
end