add cpprest and samples

This commit is contained in:
wing328
2016-06-14 16:33:50 +08:00
parent 12b16c1ff5
commit ecd80a3d70
62 changed files with 8609 additions and 2 deletions

View File

@@ -26,15 +26,28 @@ require 'date'
module Petstore
class ArrayTest
attr_accessor :array_of_string
attr_accessor :array_array_of_integer
attr_accessor :array_array_of_model
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'array_of_string' => :'array_of_string',
:'array_array_of_integer' => :'array_array_of_integer',
:'array_array_of_model' => :'array_array_of_model'
}
end
# Attribute type mapping.
def self.swagger_types
{
:'array_of_string' => :'Array<String>',
:'array_array_of_integer' => :'Array<Array<Integer>>',
:'array_array_of_model' => :'Array<Array<ReadOnlyFirst>>'
}
end
@@ -46,6 +59,24 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
if attributes.has_key?(:'array_of_string')
if (value = attributes[:'array_of_string']).is_a?(Array)
self.array_of_string = value
end
end
if attributes.has_key?(:'array_array_of_integer')
if (value = attributes[:'array_array_of_integer']).is_a?(Array)
self.array_array_of_integer = value
end
end
if attributes.has_key?(:'array_array_of_model')
if (value = attributes[:'array_array_of_model']).is_a?(Array)
self.array_array_of_model = value
end
end
end
# Show invalid properties with the reasons. Usually used together with valid?
@@ -58,13 +89,17 @@ module Petstore
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
return true
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
return true if self.equal?(o)
self.class == o.class
self.class == o.class &&
array_of_string == o.array_of_string &&
array_array_of_integer == o.array_array_of_integer &&
array_array_of_model == o.array_array_of_model
end
# @see the `==` method
@@ -76,7 +111,7 @@ module Petstore
# Calculates hash code according to all attributes.
# @return [Fixnum] Hash code
def hash
[].hash
[array_of_string, array_array_of_integer, array_array_of_model].hash
end
# Builds the object from hash