Class: Azure::ARM::CDN::Models::CheckNameAvailabilityInput

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_cdn/models/check_name_availability_input.rb

Overview

Input of check name availability API

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameString

Returns The resource name to validate.

Returns:

  • (String)

    The resource name to validate



16
17
18
# File 'lib/azure_mgmt_cdn/models/check_name_availability_input.rb', line 16

def name
  @name
end

#typeResourceType

validated. Possible values include: ‘Microsoft.Cdn/Profiles/Endpoints’

Returns:

  • (ResourceType)

    The type of the resource whose name is to be



20
21
22
# File 'lib/azure_mgmt_cdn/models/check_name_availability_input.rb', line 20

def type
  @type
end

Class Method Details

.deserialize_object(object) ⇒ CheckNameAvailabilityInput

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/azure_mgmt_cdn/models/check_name_availability_input.rb', line 53

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

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

  deserialized_property = object['type']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = ResourceType.constants.any? { |e| ResourceType.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum ResourceType 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.



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/azure_mgmt_cdn/models/check_name_availability_input.rb', line 35

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.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.



25
26
27
28
# File 'lib/azure_mgmt_cdn/models/check_name_availability_input.rb', line 25

def validate
  fail MsRest::ValidationError, 'property name is nil' if @name.nil?
  fail MsRest::ValidationError, 'property type is nil' if @type.nil?
end