Class: MicrosoftGraph::Models::KeyCredential

Inherits:
Object
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::AdditionalDataHolder, MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/key_credential.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new keyCredential and sets the default values.



59
60
61
# File 'lib/models/key_credential.rb', line 59

def initialize()
    @additional_data = Hash.new
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 key_credential

Raises:

  • (StandardError)


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

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

Instance Method Details

#additional_dataObject

Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Returns:

  • a i_dictionary



44
45
46
# File 'lib/models/key_credential.rb', line 44

def additional_data
    return @additional_data
end

#additional_data=(value) ⇒ Object

Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Parameters:

  • value

    Value to set for the additionalData property.

Returns:

  • a void



52
53
54
# File 'lib/models/key_credential.rb', line 52

def additional_data=(value)
    @additional_data = value
end

#custom_key_identifierObject

Gets the customKeyIdentifier property value. A 40-character binary type that can be used to identify the credential. Optional. When not provided in the payload, defaults to the thumbprint of the certificate.

Returns:

  • a base64url



75
76
77
# File 'lib/models/key_credential.rb', line 75

def custom_key_identifier
    return @custom_key_identifier
end

#custom_key_identifier=(value) ⇒ Object

Sets the customKeyIdentifier property value. A 40-character binary type that can be used to identify the credential. Optional. When not provided in the payload, defaults to the thumbprint of the certificate.

Parameters:

  • value

    Value to set for the customKeyIdentifier property.

Returns:

  • a void



83
84
85
# File 'lib/models/key_credential.rb', line 83

def custom_key_identifier=(value)
    @custom_key_identifier = value
end

#display_nameObject

Gets the displayName property value. Friendly name for the key. Optional.

Returns:

  • a string



90
91
92
# File 'lib/models/key_credential.rb', line 90

def display_name
    return @display_name
end

#display_name=(value) ⇒ Object

Sets the displayName property value. Friendly name for the key. Optional.

Parameters:

  • value

    Value to set for the displayName property.

Returns:

  • a void



98
99
100
# File 'lib/models/key_credential.rb', line 98

def display_name=(value)
    @display_name = value
end

#end_date_timeObject

Gets the endDateTime property value. The date and time at which the credential expires. The DateTimeOffset 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



105
106
107
# File 'lib/models/key_credential.rb', line 105

def end_date_time
    return @end_date_time
end

#end_date_time=(value) ⇒ Object

Sets the endDateTime property value. The date and time at which the credential expires. The DateTimeOffset 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 endDateTime property.

Returns:

  • a void



113
114
115
# File 'lib/models/key_credential.rb', line 113

def end_date_time=(value)
    @end_date_time = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/models/key_credential.rb', line 120

def get_field_deserializers()
    return {
        "customKeyIdentifier" => lambda {|n| @custom_key_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },
        "displayName" => lambda {|n| @display_name = n.get_string_value() },
        "endDateTime" => lambda {|n| @end_date_time = n.get_date_time_value() },
        "key" => lambda {|n| @key = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },
        "keyId" => lambda {|n| @key_id = n.get_guid_value() },
        "@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
        "startDateTime" => lambda {|n| @start_date_time = n.get_date_time_value() },
        "type" => lambda {|n| @type = n.get_string_value() },
        "usage" => lambda {|n| @usage = n.get_string_value() },
    }
end

#keyObject

Gets the key property value. The certificate’s raw data in byte array converted to Base64 string. Returned only on $select for a single object, that is, GET applications/applicationId?$select=keyCredentials or GET servicePrincipals/servicePrincipalId?$select=keyCredentials; otherwise, it is always null. From a .cer certificate, you can read the key using the Convert.ToBase64String() method. For more information, see Get the certificate key.

Returns:

  • a base64url



137
138
139
# File 'lib/models/key_credential.rb', line 137

def key
    return @key
end

#key=(value) ⇒ Object

Sets the key property value. The certificate’s raw data in byte array converted to Base64 string. Returned only on $select for a single object, that is, GET applications/applicationId?$select=keyCredentials or GET servicePrincipals/servicePrincipalId?$select=keyCredentials; otherwise, it is always null. From a .cer certificate, you can read the key using the Convert.ToBase64String() method. For more information, see Get the certificate key.

Parameters:

  • value

    Value to set for the key property.

Returns:

  • a void



145
146
147
# File 'lib/models/key_credential.rb', line 145

def key=(value)
    @key = value
end

#key_idObject

Gets the keyId property value. The unique identifier (GUID) for the key.

Returns:

  • a guid



152
153
154
# File 'lib/models/key_credential.rb', line 152

def key_id
    return @key_id
end

#key_id=(value) ⇒ Object

Sets the keyId property value. The unique identifier (GUID) for the key.

Parameters:

  • value

    Value to set for the keyId property.

Returns:

  • a void



160
161
162
# File 'lib/models/key_credential.rb', line 160

def key_id=(value)
    @key_id = value
end

#odata_typeObject

Gets the @odata.type property value. The OdataType property

Returns:

  • a string



167
168
169
# File 'lib/models/key_credential.rb', line 167

def odata_type
    return @odata_type
end

#odata_type=(value) ⇒ Object

Sets the @odata.type property value. The OdataType property

Parameters:

  • value

    Value to set for the @odata.type property.

Returns:

  • a void



175
176
177
# File 'lib/models/key_credential.rb', line 175

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


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

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_object_value("customKeyIdentifier", @custom_key_identifier)
    writer.write_string_value("displayName", @display_name)
    writer.write_date_time_value("endDateTime", @end_date_time)
    writer.write_object_value("key", @key)
    writer.write_guid_value("keyId", @key_id)
    writer.write_string_value("@odata.type", @odata_type)
    writer.write_date_time_value("startDateTime", @start_date_time)
    writer.write_string_value("type", @type)
    writer.write_string_value("usage", @usage)
    writer.write_additional_data(@additional_data)
end

#start_date_timeObject

Gets the startDateTime property value. The date and time at which the credential becomes valid.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



200
201
202
# File 'lib/models/key_credential.rb', line 200

def start_date_time
    return @start_date_time
end

#start_date_time=(value) ⇒ Object

Sets the startDateTime property value. The date and time at which the credential becomes valid.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 startDateTime property.

Returns:

  • a void



208
209
210
# File 'lib/models/key_credential.rb', line 208

def start_date_time=(value)
    @start_date_time = value
end

#typeObject

Gets the type property value. The type of key credential; for example, Symmetric, AsymmetricX509Cert.

Returns:

  • a string



215
216
217
# File 'lib/models/key_credential.rb', line 215

def type
    return @type
end

#type=(value) ⇒ Object

Sets the type property value. The type of key credential; for example, Symmetric, AsymmetricX509Cert.

Parameters:

  • value

    Value to set for the type property.

Returns:

  • a void



223
224
225
# File 'lib/models/key_credential.rb', line 223

def type=(value)
    @type = value
end

#usageObject

Gets the usage property value. A string that describes the purpose for which the key can be used; for example, Verify.

Returns:

  • a string



230
231
232
# File 'lib/models/key_credential.rb', line 230

def usage
    return @usage
end

#usage=(value) ⇒ Object

Sets the usage property value. A string that describes the purpose for which the key can be used; for example, Verify.

Parameters:

  • value

    Value to set for the usage property.

Returns:

  • a void



238
239
240
# File 'lib/models/key_credential.rb', line 238

def usage=(value)
    @usage = value
end