Class: Azure::ARM::Scheduler::Models::HttpRequest

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_scheduler/models/http_request.rb

Overview

Model object.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authenticationHttpAuthentication

Returns Gets or sets the http authentication.

Returns:



16
17
18
# File 'lib/azure_mgmt_scheduler/models/http_request.rb', line 16

def authentication
  @authentication
end

#bodyString

Returns Gets or sets the request body.

Returns:

  • (String)

    Gets or sets the request body.



25
26
27
# File 'lib/azure_mgmt_scheduler/models/http_request.rb', line 25

def body
  @body
end

#headersHash{String => String}

Returns Gets or sets the headers.

Returns:

  • (Hash{String => String})

    Gets or sets the headers.



28
29
30
# File 'lib/azure_mgmt_scheduler/models/http_request.rb', line 28

def headers
  @headers
end

#methodString

Returns Gets or sets the method of the request.

Returns:

  • (String)

    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

#uriString

Returns Gets or sets the Uri.

Returns:

  • (String)

    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.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



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.

Parameters:

  • object

    Model object to serialize.

Returns:

  • (Hash)

    Serialized object in form of 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

#validateObject

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