Class: MicrosoftGraph::Models::AgreementFileProperties

Inherits:
Entity
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/agreement_file_properties.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 agreementFileProperties and sets the default values.



35
36
37
# File 'lib/models/agreement_file_properties.rb', line 35

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 agreement_file_properties

Raises:

  • (StandardError)


58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/models/agreement_file_properties.rb', line 58

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    mapping_value_node = parse_node.get_child_node("@odata.type")
    unless mapping_value_node.nil? then
        mapping_value = mapping_value_node.get_string_value
        case mapping_value
            when "#microsoft.graph.agreementFile"
                return AgreementFile.new
            when "#microsoft.graph.agreementFileLocalization"
                return AgreementFileLocalization.new
            when "#microsoft.graph.agreementFileVersion"
                return AgreementFileVersion.new
        end
    end
    return AgreementFileProperties.new
end

Instance Method Details

#created_date_timeObject

Gets the createdDateTime property value. The date time representing when the file was created.The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.

Returns:

  • a date_time



42
43
44
# File 'lib/models/agreement_file_properties.rb', line 42

def created_date_time
    return @created_date_time
end

#created_date_time=(value) ⇒ Object

Sets the createdDateTime property value. The date time representing when the file was created.The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.

Parameters:

  • value

    Value to set for the createdDateTime property.

Returns:

  • a void



50
51
52
# File 'lib/models/agreement_file_properties.rb', line 50

def created_date_time=(value)
    @created_date_time = value
end

#display_nameObject

Gets the displayName property value. Localized display name of the policy file of an agreement. The localized display name is shown to end users who view the agreement.

Returns:

  • a string



78
79
80
# File 'lib/models/agreement_file_properties.rb', line 78

def display_name
    return @display_name
end

#display_name=(value) ⇒ Object

Sets the displayName property value. Localized display name of the policy file of an agreement. The localized display name is shown to end users who view the agreement.

Parameters:

  • value

    Value to set for the displayName property.

Returns:

  • a void



86
87
88
# File 'lib/models/agreement_file_properties.rb', line 86

def display_name=(value)
    @display_name = value
end

#file_dataObject

Gets the fileData property value. Data that represents the terms of use PDF document. Read-only.

Returns:

  • a agreement_file_data



93
94
95
# File 'lib/models/agreement_file_properties.rb', line 93

def file_data
    return @file_data
end

#file_data=(value) ⇒ Object

Sets the fileData property value. Data that represents the terms of use PDF document. Read-only.

Parameters:

  • value

    Value to set for the fileData property.

Returns:

  • a void



101
102
103
# File 'lib/models/agreement_file_properties.rb', line 101

def file_data=(value)
    @file_data = value
end

#file_nameObject

Gets the fileName property value. Name of the agreement file (for example, TOU.pdf). Read-only.

Returns:

  • a string



108
109
110
# File 'lib/models/agreement_file_properties.rb', line 108

def file_name
    return @file_name
end

#file_name=(value) ⇒ Object

Sets the fileName property value. Name of the agreement file (for example, TOU.pdf). Read-only.

Parameters:

  • value

    Value to set for the fileName property.

Returns:

  • a void



116
117
118
# File 'lib/models/agreement_file_properties.rb', line 116

def file_name=(value)
    @file_name = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



123
124
125
126
127
128
129
130
131
132
133
# File 'lib/models/agreement_file_properties.rb', line 123

def get_field_deserializers()
    return super.merge({
        "createdDateTime" => lambda {|n| @created_date_time = n.get_date_time_value() },
        "displayName" => lambda {|n| @display_name = n.get_string_value() },
        "fileData" => lambda {|n| @file_data = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AgreementFileData.create_from_discriminator_value(pn) }) },
        "fileName" => lambda {|n| @file_name = n.get_string_value() },
        "isDefault" => lambda {|n| @is_default = n.get_boolean_value() },
        "isMajorVersion" => lambda {|n| @is_major_version = n.get_boolean_value() },
        "language" => lambda {|n| @language = n.get_string_value() },
    })
end

#is_defaultObject

Gets the isDefault property value. If none of the languages matches the client preference, indicates whether this is the default agreement file . If none of the files are marked as default, the first one is treated as the default. Read-only.

Returns:

  • a boolean



138
139
140
# File 'lib/models/agreement_file_properties.rb', line 138

def is_default
    return @is_default
end

#is_default=(value) ⇒ Object

Sets the isDefault property value. If none of the languages matches the client preference, indicates whether this is the default agreement file . If none of the files are marked as default, the first one is treated as the default. Read-only.

Parameters:

  • value

    Value to set for the isDefault property.

Returns:

  • a void



146
147
148
# File 'lib/models/agreement_file_properties.rb', line 146

def is_default=(value)
    @is_default = value
end

#is_major_versionObject

Gets the isMajorVersion property value. Indicates whether the agreement file is a major version update. Major version updates invalidate the agreement’s acceptances on the corresponding language.

Returns:

  • a boolean



153
154
155
# File 'lib/models/agreement_file_properties.rb', line 153

def is_major_version
    return @is_major_version
end

#is_major_version=(value) ⇒ Object

Sets the isMajorVersion property value. Indicates whether the agreement file is a major version update. Major version updates invalidate the agreement’s acceptances on the corresponding language.

Parameters:

  • value

    Value to set for the isMajorVersion property.

Returns:

  • a void



161
162
163
# File 'lib/models/agreement_file_properties.rb', line 161

def is_major_version=(value)
    @is_major_version = value
end

#languageObject

Gets the language property value. The language of the agreement file in the format ‘languagecode2-country/regioncode2’. ‘languagecode2’ is a lowercase two-letter code derived from ISO 639-1, while ‘country/regioncode2’ is derived from ISO 3166 and usually consists of two uppercase letters, or a BCP-47 language tag. For example, U.S. English is en-US. Read-only.

Returns:

  • a string



168
169
170
# File 'lib/models/agreement_file_properties.rb', line 168

def language
    return @language
end

#language=(value) ⇒ Object

Sets the language property value. The language of the agreement file in the format ‘languagecode2-country/regioncode2’. ‘languagecode2’ is a lowercase two-letter code derived from ISO 639-1, while ‘country/regioncode2’ is derived from ISO 3166 and usually consists of two uppercase letters, or a BCP-47 language tag. For example, U.S. English is en-US. Read-only.

Parameters:

  • value

    Value to set for the language property.

Returns:

  • a void



176
177
178
# File 'lib/models/agreement_file_properties.rb', line 176

def language=(value)
    @language = 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)


184
185
186
187
188
189
190
191
192
193
194
# File 'lib/models/agreement_file_properties.rb', line 184

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_date_time_value("createdDateTime", @created_date_time)
    writer.write_string_value("displayName", @display_name)
    writer.write_object_value("fileData", @file_data)
    writer.write_string_value("fileName", @file_name)
    writer.write_boolean_value("isDefault", @is_default)
    writer.write_boolean_value("isMajorVersion", @is_major_version)
    writer.write_string_value("language", @language)
end