Class: Azure::ARM::Scheduler::Models::HttpRequest
- Inherits:
-
Object
- Object
- Azure::ARM::Scheduler::Models::HttpRequest
- Includes:
- MsRestAzure
- Defined in:
- lib/azure_mgmt_scheduler/models/http_request.rb
Overview
Model object.
Instance Attribute Summary collapse
-
#authentication ⇒ HttpAuthentication
Gets or sets the http authentication.
-
#body ⇒ String
Gets or sets the request body.
-
#headers ⇒ Hash{String => String}
Gets or sets the headers.
-
#method ⇒ String
Gets or sets the method of the request.
-
#uri ⇒ String
Gets or sets the Uri.
Class Method Summary collapse
-
.deserialize_object(object) ⇒ HttpRequest
Deserializes given Ruby Hash into Model object.
-
.serialize_object(object) ⇒ Hash
Serializes given Model object into Ruby Hash.
Instance Method Summary collapse
-
#validate ⇒ Object
Validate the object.
Instance Attribute Details
#authentication ⇒ HttpAuthentication
Returns Gets or sets the http authentication.
16 17 18 |
# File 'lib/azure_mgmt_scheduler/models/http_request.rb', line 16 def authentication @authentication end |
#body ⇒ String
Returns Gets or sets the request body.
25 26 27 |
# File 'lib/azure_mgmt_scheduler/models/http_request.rb', line 25 def body @body end |
#headers ⇒ Hash{String => String}
Returns Gets or sets the headers.
28 29 30 |
# File 'lib/azure_mgmt_scheduler/models/http_request.rb', line 28 def headers @headers end |
#method ⇒ String
Returns Gets or sets the method of the request.
22 23 24 |
# File 'lib/azure_mgmt_scheduler/models/http_request.rb', line 22 def method @method end |
#uri ⇒ String
Returns Gets or sets the Uri.
19 20 21 |
# File 'lib/azure_mgmt_scheduler/models/http_request.rb', line 19 def uri @uri end |
Class Method Details
.deserialize_object(object) ⇒ HttpRequest
Deserializes given Ruby Hash into Model object.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/azure_mgmt_scheduler/models/http_request.rb', line 73 def self.deserialize_object(object) return if object.nil? output_object = HttpRequest.new deserialized_property = object['authentication'] unless deserialized_property.nil? deserialized_property = HttpAuthentication.deserialize_object(deserialized_property) end output_object.authentication = deserialized_property deserialized_property = object['uri'] output_object.uri = deserialized_property deserialized_property = object['method'] output_object.method = deserialized_property deserialized_property = object['body'] output_object.body = deserialized_property deserialized_property = object['headers'] output_object.headers = deserialized_property output_object end |
.serialize_object(object) ⇒ Hash
Serializes given Model object into Ruby Hash.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/azure_mgmt_scheduler/models/http_request.rb', line 43 def self.serialize_object(object) object.validate output_object = {} serialized_property = object.authentication unless serialized_property.nil? serialized_property = HttpAuthentication.serialize_object(serialized_property) end output_object['authentication'] = serialized_property unless serialized_property.nil? serialized_property = object.uri output_object['uri'] = serialized_property unless serialized_property.nil? serialized_property = object.method output_object['method'] = serialized_property unless serialized_property.nil? serialized_property = object.body output_object['body'] = serialized_property unless serialized_property.nil? serialized_property = object.headers output_object['headers'] = serialized_property unless serialized_property.nil? output_object end |
Instance Method Details
#validate ⇒ Object
Validate the object. Throws ValidationError if validation fails.
33 34 35 36 |
# File 'lib/azure_mgmt_scheduler/models/http_request.rb', line 33 def validate @authentication.validate unless @authentication.nil? @headers.each{ |e| e.validate if e.respond_to?(:validate) } unless @headers.nil? end |