Class: Azure::ARM::CDN::Models::EndpointPropertiesCreateParameters

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

Overview

Model object.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#content_types_to_compressArray<String>

will be applied. The value for the elements should be Internet media type.

Returns:

  • (Array<String>)

    List of content types on which compression



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

def content_types_to_compress
  @content_types_to_compress
end

#is_compression_enabledBoolean

Default value is false. If compression is enabled, the content transferred from cdn endpoint to end user will be compressed. The requested content must be larger than 1 byte and smaller than 1 MB.

Returns:

  • (Boolean)

    Indicates whether the compression is enabled.



32
33
34
# File 'lib/azure_mgmt_cdn/models/endpoint_properties_create_parameters.rb', line 32

def is_compression_enabled
  @is_compression_enabled
end

#is_http_allowedBoolean

endpoint. Default value is true. At least one protocol (http or https) must be allowed.

Returns:

  • (Boolean)

    Indicates whether http traffic is allowed on the



37
38
39
# File 'lib/azure_mgmt_cdn/models/endpoint_properties_create_parameters.rb', line 37

def is_http_allowed
  @is_http_allowed
end

#is_https_allowedBoolean

endpoint. Default value is true. At least one protocol (http or https) must be allowed.

Returns:

  • (Boolean)

    Indicates whether https traffic is allowed on the



42
43
44
# File 'lib/azure_mgmt_cdn/models/endpoint_properties_create_parameters.rb', line 42

def is_https_allowed
  @is_https_allowed
end

#origin_host_headerString

content requests to origins. The default value would be the host name of the origin.

Returns:

  • (String)

    The host header CDN provider will send along with



18
19
20
# File 'lib/azure_mgmt_cdn/models/endpoint_properties_create_parameters.rb', line 18

def origin_host_header
  @origin_host_header
end

#origin_pathString

Returns The path used for origin requests.

Returns:

  • (String)

    The path used for origin requests



21
22
23
# File 'lib/azure_mgmt_cdn/models/endpoint_properties_create_parameters.rb', line 21

def origin_path
  @origin_path
end

#originsArray<DeepCreatedOrigin>

endpoint. When multiple origins exist, the first origin will be used as primary and rest will be used as failover options.

Returns:



52
53
54
# File 'lib/azure_mgmt_cdn/models/endpoint_properties_create_parameters.rb', line 52

def origins
  @origins
end

#query_string_caching_behaviorQueryStringCachingBehavior

behavior. Possible values include: ‘IgnoreQueryString’, ‘BypassCaching’, ‘UseQueryString’, ‘NotSet’

Returns:



47
48
49
# File 'lib/azure_mgmt_cdn/models/endpoint_properties_create_parameters.rb', line 47

def query_string_caching_behavior
  @query_string_caching_behavior
end

Class Method Details

.deserialize_object(object) ⇒ EndpointPropertiesCreateParameters

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/azure_mgmt_cdn/models/endpoint_properties_create_parameters.rb', line 114

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

  deserialized_property = object['origins']
  unless deserialized_property.nil?
    deserialized_array = []
    deserialized_property.each do |element2|
      unless element2.nil?
        element2 = DeepCreatedOrigin.deserialize_object(element2)
      end
      deserialized_array.push(element2)
    end
    deserialized_property = deserialized_array
  end
  output_object.origins = deserialized_property

  deserialized_property = object['originHostHeader']
  output_object.origin_host_header = deserialized_property

  deserialized_property = object['originPath']
  output_object.origin_path = deserialized_property

  deserialized_property = object['contentTypesToCompress']
  output_object.content_types_to_compress = deserialized_property

  deserialized_property = object['isCompressionEnabled']
  output_object.is_compression_enabled = deserialized_property

  deserialized_property = object['isHttpAllowed']
  output_object.is_http_allowed = deserialized_property

  deserialized_property = object['isHttpsAllowed']
  output_object.is_https_allowed = deserialized_property

  deserialized_property = object['queryStringCachingBehavior']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = QueryStringCachingBehavior.constants.any? { |e| QueryStringCachingBehavior.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum QueryStringCachingBehavior does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
  end
  output_object.query_string_caching_behavior = 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.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/azure_mgmt_cdn/models/endpoint_properties_create_parameters.rb', line 68

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

  serialized_property = object.origins
  unless serialized_property.nil?
    serializedArray = []
    serialized_property.each do |element|
      unless element.nil?
        element = DeepCreatedOrigin.serialize_object(element)
      end
      serializedArray.push(element)
    end
    serialized_property = serializedArray
  end
  output_object['origins'] = serialized_property unless serialized_property.nil?

  serialized_property = object.origin_host_header
  output_object['originHostHeader'] = serialized_property unless serialized_property.nil?

  serialized_property = object.origin_path
  output_object['originPath'] = serialized_property unless serialized_property.nil?

  serialized_property = object.content_types_to_compress
  output_object['contentTypesToCompress'] = serialized_property unless serialized_property.nil?

  serialized_property = object.is_compression_enabled
  output_object['isCompressionEnabled'] = serialized_property unless serialized_property.nil?

  serialized_property = object.is_http_allowed
  output_object['isHttpAllowed'] = serialized_property unless serialized_property.nil?

  serialized_property = object.is_https_allowed
  output_object['isHttpsAllowed'] = serialized_property unless serialized_property.nil?

  serialized_property = object.query_string_caching_behavior
  output_object['queryStringCachingBehavior'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



57
58
59
60
61
# File 'lib/azure_mgmt_cdn/models/endpoint_properties_create_parameters.rb', line 57

def validate
  fail MsRest::ValidationError, 'property origins is nil' if @origins.nil?
  @content_types_to_compress.each{ |e| e.validate if e.respond_to?(:validate) } unless @content_types_to_compress.nil?
  @origins.each{ |e| e.validate if e.respond_to?(:validate) } unless @origins.nil?
end