Class: Azure::ARM::Storage::Models::CheckNameAvailabilityResult

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_storage/models/check_name_availability_result.rb

Overview

The CheckNameAvailability operation response.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#messageString

more detail.

Returns:

  • (String)

    Gets an error message explaining the Reason value in



27
28
29
# File 'lib/azure_mgmt_storage/models/check_name_availability_result.rb', line 27

def message
  @message
end

#name_availableBoolean

is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used.

Returns:

  • (Boolean)

    Gets a boolean value that indicates whether the name



18
19
20
# File 'lib/azure_mgmt_storage/models/check_name_availability_result.rb', line 18

def name_available
  @name_available
end

#reasonReason

be used. The Reason element is only returned if NameAvailable is false. Possible values include: ‘AccountNameInvalid’, ‘AlreadyExists’

Returns:

  • (Reason)

    Gets the reason that a storage account name could not



23
24
25
# File 'lib/azure_mgmt_storage/models/check_name_availability_result.rb', line 23

def reason
  @reason
end

Class Method Details

.deserialize_object(object) ⇒ CheckNameAvailabilityResult

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/azure_mgmt_storage/models/check_name_availability_result.rb', line 61

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

  deserialized_property = object['nameAvailable']
  output_object.name_available = deserialized_property

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

  deserialized_property = object['message']
  output_object.message = 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.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/azure_mgmt_storage/models/check_name_availability_result.rb', line 40

def self.serialize_object(object)
  object.validate
  output_object = {}

  serialized_property = object.name_available
  output_object['nameAvailable'] = serialized_property unless serialized_property.nil?

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

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

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



32
33
# File 'lib/azure_mgmt_storage/models/check_name_availability_result.rb', line 32

def validate
end