# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::ARM::Web module Models # # Model object. # class SourceControlProperties include MsRestAzure # @return [String] Name or Source Control Type attr_accessor :name # @return [String] OAuth Access Token attr_accessor :token # @return [String] OAuth Access Token Secret attr_accessor :token_secret # @return [String] OAuth Refresh Token attr_accessor :refresh_token # @return [DateTime] OAuth Token Expiration attr_accessor :expiration_time # # Validate the object. Throws ValidationError if validation fails. # def validate # Nothing to validate end # # Serializes given Model object into Ruby Hash. # @param object Model object to serialize. # @return [Hash] Serialized object in form of Ruby Hash. # def self.serialize_object(object) object.validate output_object = {} serialized_property = object.name output_object['name'] = serialized_property unless serialized_property.nil? serialized_property = object.token output_object['token'] = serialized_property unless serialized_property.nil? serialized_property = object.token_secret output_object['tokenSecret'] = serialized_property unless serialized_property.nil? serialized_property = object.refresh_token output_object['refreshToken'] = serialized_property unless serialized_property.nil? serialized_property = object.expiration_time serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ') output_object['expirationTime'] = serialized_property unless serialized_property.nil? output_object end # # Deserializes given Ruby Hash into Model object. # @param object [Hash] Ruby Hash object to deserialize. # @return [SourceControlProperties] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = SourceControlProperties.new deserialized_property = object['name'] output_object.name = deserialized_property deserialized_property = object['token'] output_object.token = deserialized_property deserialized_property = object['tokenSecret'] output_object.token_secret = deserialized_property deserialized_property = object['refreshToken'] output_object.refresh_token = deserialized_property deserialized_property = object['expirationTime'] deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty? output_object.expiration_time = deserialized_property output_object end end end end