Class: MicrosoftGraph::Models::KeyCredential
- Inherits:
-
Object
- Object
- MicrosoftGraph::Models::KeyCredential
- Includes:
- MicrosoftKiotaAbstractions::AdditionalDataHolder, MicrosoftKiotaAbstractions::Parsable
- Defined in:
- lib/models/key_credential.rb
Class Method Summary collapse
-
.create_from_discriminator_value(parse_node) ⇒ Object
Creates a new instance of the appropriate class based on discriminator value.
Instance Method Summary collapse
-
#additional_data ⇒ Object
Gets the additionalData property value.
-
#additional_data=(value) ⇒ Object
Sets the additionalData property value.
-
#custom_key_identifier ⇒ Object
Gets the customKeyIdentifier property value.
-
#custom_key_identifier=(value) ⇒ Object
Sets the customKeyIdentifier property value.
-
#display_name ⇒ Object
Gets the displayName property value.
-
#display_name=(value) ⇒ Object
Sets the displayName property value.
-
#end_date_time ⇒ Object
Gets the endDateTime property value.
-
#end_date_time=(value) ⇒ Object
Sets the endDateTime property value.
-
#get_field_deserializers ⇒ Object
The deserialization information for the current model.
-
#initialize ⇒ Object
constructor
Instantiates a new keyCredential and sets the default values.
-
#key ⇒ Object
Gets the key property value.
-
#key=(value) ⇒ Object
Sets the key property value.
-
#key_id ⇒ Object
Gets the keyId property value.
-
#key_id=(value) ⇒ Object
Sets the keyId property value.
-
#odata_type ⇒ Object
Gets the @odata.type property value.
-
#odata_type=(value) ⇒ Object
Sets the @odata.type property value.
-
#serialize(writer) ⇒ Object
Serializes information the current object.
-
#start_date_time ⇒ Object
Gets the startDateTime property value.
-
#start_date_time=(value) ⇒ Object
Sets the startDateTime property value.
-
#type ⇒ Object
Gets the type property value.
-
#type=(value) ⇒ Object
Sets the type property value.
-
#usage ⇒ Object
Gets the usage property value.
-
#usage=(value) ⇒ Object
Sets the usage property value.
Constructor Details
#initialize ⇒ Object
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
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_data ⇒ Object
Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
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.
52 53 54 |
# File 'lib/models/key_credential.rb', line 52 def additional_data=(value) @additional_data = value end |
#custom_key_identifier ⇒ Object
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.
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.
83 84 85 |
# File 'lib/models/key_credential.rb', line 83 def custom_key_identifier=(value) @custom_key_identifier = value end |
#display_name ⇒ Object
Gets the displayName property value. Friendly name for the key. Optional.
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.
98 99 100 |
# File 'lib/models/key_credential.rb', line 98 def display_name=(value) @display_name = value end |
#end_date_time ⇒ Object
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.
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.
113 114 115 |
# File 'lib/models/key_credential.rb', line 113 def end_date_time=(value) @end_date_time = value end |
#get_field_deserializers ⇒ Object
The deserialization information for the current model
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 |
#key ⇒ Object
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.
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.
145 146 147 |
# File 'lib/models/key_credential.rb', line 145 def key=(value) @key = value end |
#key_id ⇒ Object
Gets the keyId property value. The unique identifier (GUID) for the key.
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.
160 161 162 |
# File 'lib/models/key_credential.rb', line 160 def key_id=(value) @key_id = value end |
#odata_type ⇒ Object
Gets the @odata.type property value. The OdataType property
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
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
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_time ⇒ Object
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.
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.
208 209 210 |
# File 'lib/models/key_credential.rb', line 208 def start_date_time=(value) @start_date_time = value end |
#type ⇒ Object
Gets the type property value. The type of key credential; for example, Symmetric, AsymmetricX509Cert.
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.
223 224 225 |
# File 'lib/models/key_credential.rb', line 223 def type=(value) @type = value end |
#usage ⇒ Object
Gets the usage property value. A string that describes the purpose for which the key can be used; for example, Verify.
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.
238 239 240 |
# File 'lib/models/key_credential.rb', line 238 def usage=(value) @usage = value end |