Class: Azure::ARM::Web::Models::BackupRequestProperties

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_web/models/backup_request_properties.rb

Overview

Model object.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#backup_scheduleBackupSchedule

periodically

Returns:



28
29
30
# File 'lib/azure_mgmt_web/models/backup_request_properties.rb', line 28

def backup_schedule
  @backup_schedule
end

#databasesArray<DatabaseBackupSetting>

Returns Databases included in the backup.

Returns:



31
32
33
# File 'lib/azure_mgmt_web/models/backup_request_properties.rb', line 31

def databases
  @databases
end

#enabledBoolean

included in that case), false if the backup schedule should be disabled

Returns:

  • (Boolean)

    True if the backup schedule is enabled (must be



21
22
23
# File 'lib/azure_mgmt_web/models/backup_request_properties.rb', line 21

def enabled
  @enabled
end

#nameString

Returns Name of the backup.

Returns:

  • (String)

    Name of the backup



16
17
18
# File 'lib/azure_mgmt_web/models/backup_request_properties.rb', line 16

def name
  @name
end

#storage_account_urlString

Returns SAS URL to the container.

Returns:

  • (String)

    SAS URL to the container



24
25
26
# File 'lib/azure_mgmt_web/models/backup_request_properties.rb', line 24

def 
  @storage_account_url
end

#typeBackupRestoreOperationType

values include: ‘Default’, ‘Clone’, ‘Relocation’

Returns:



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

def type
  @type
end

Class Method Details

.deserialize_object(object) ⇒ BackupRequestProperties

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/azure_mgmt_web/models/backup_request_properties.rb', line 93

def self.deserialize_object(object)
  return if object.nil?
  output_object = BackupRequestProperties.new

  deserialized_property = object['name']
  output_object.name = deserialized_property

  deserialized_property = object['enabled']
  output_object.enabled = deserialized_property

  deserialized_property = object['storageAccountUrl']
  output_object. = deserialized_property

  deserialized_property = object['backupSchedule']
  unless deserialized_property.nil?
    deserialized_property = BackupSchedule.deserialize_object(deserialized_property)
  end
  output_object.backup_schedule = deserialized_property

  deserialized_property = object['databases']
  unless deserialized_property.nil?
    deserialized_array = []
    deserialized_property.each do |element1|
      unless element1.nil?
        element1 = DatabaseBackupSetting.deserialize_object(element1)
      end
      deserialized_array.push(element1)
    end
    deserialized_property = deserialized_array
  end
  output_object.databases = deserialized_property

  deserialized_property = object['type']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = BackupRestoreOperationType.constants.any? { |e| BackupRestoreOperationType.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum BackupRestoreOperationType does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
  end
  output_object.type = deserialized_property

  output_object
end

.serialize_object(object) ⇒ Hash

Serializes given Model object into Ruby Hash.

Parameters:

  • object

    Model object to serialize.

Returns:

  • (Hash)

    Serialized object in form of Ruby Hash.



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/azure_mgmt_web/models/backup_request_properties.rb', line 50

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.enabled
  output_object['enabled'] = serialized_property unless serialized_property.nil?

  serialized_property = object.
  output_object['storageAccountUrl'] = serialized_property unless serialized_property.nil?

  serialized_property = object.backup_schedule
  unless serialized_property.nil?
    serialized_property = BackupSchedule.serialize_object(serialized_property)
  end
  output_object['backupSchedule'] = serialized_property unless serialized_property.nil?

  serialized_property = object.databases
  unless serialized_property.nil?
    serializedArray = []
    serialized_property.each do |element|
      unless element.nil?
        element = DatabaseBackupSetting.serialize_object(element)
      end
      serializedArray.push(element)
    end
    serialized_property = serializedArray
  end
  output_object['databases'] = serialized_property unless serialized_property.nil?

  serialized_property = object.type
  output_object['type'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



40
41
42
43
# File 'lib/azure_mgmt_web/models/backup_request_properties.rb', line 40

def validate
  @backup_schedule.validate unless @backup_schedule.nil?
  @databases.each{ |e| e.validate if e.respond_to?(:validate) } unless @databases.nil?
end