azure_mgmt_cdn 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/LICENSE.txt +21 -0
- data/Rakefile +5 -0
- data/azure_mgmt_cdn.gemspec +34 -0
- data/lib/azure_mgmt_cdn.rb +77 -0
- data/lib/azure_mgmt_cdn/cdn_management_client.rb +87 -0
- data/lib/azure_mgmt_cdn/custom_domains.rb +482 -0
- data/lib/azure_mgmt_cdn/endpoints.rb +940 -0
- data/lib/azure_mgmt_cdn/models/check_name_availability_input.rb +66 -0
- data/lib/azure_mgmt_cdn/models/check_name_availability_output.rb +75 -0
- data/lib/azure_mgmt_cdn/models/custom_domain.rb +82 -0
- data/lib/azure_mgmt_cdn/models/custom_domain_list_result.rb +77 -0
- data/lib/azure_mgmt_cdn/models/custom_domain_parameters.rb +62 -0
- data/lib/azure_mgmt_cdn/models/custom_domain_properties.rb +84 -0
- data/lib/azure_mgmt_cdn/models/custom_domain_properties_parameters.rb +56 -0
- data/lib/azure_mgmt_cdn/models/custom_domain_resource_state.rb +17 -0
- data/lib/azure_mgmt_cdn/models/deep_created_origin.rb +72 -0
- data/lib/azure_mgmt_cdn/models/deep_created_origin_properties.rb +78 -0
- data/lib/azure_mgmt_cdn/models/endpoint.rb +95 -0
- data/lib/azure_mgmt_cdn/models/endpoint_create_parameters.rb +82 -0
- data/lib/azure_mgmt_cdn/models/endpoint_list_result.rb +76 -0
- data/lib/azure_mgmt_cdn/models/endpoint_properties.rb +197 -0
- data/lib/azure_mgmt_cdn/models/endpoint_properties_create_parameters.rb +160 -0
- data/lib/azure_mgmt_cdn/models/endpoint_properties_update_parameters.rb +127 -0
- data/lib/azure_mgmt_cdn/models/endpoint_resource_state.rb +20 -0
- data/lib/azure_mgmt_cdn/models/endpoint_update_parameters.rb +72 -0
- data/lib/azure_mgmt_cdn/models/error_response.rb +65 -0
- data/lib/azure_mgmt_cdn/models/load_parameters.rb +58 -0
- data/lib/azure_mgmt_cdn/models/operation.rb +71 -0
- data/lib/azure_mgmt_cdn/models/operation_display.rb +75 -0
- data/lib/azure_mgmt_cdn/models/operation_list_result.rb +77 -0
- data/lib/azure_mgmt_cdn/models/origin.rb +83 -0
- data/lib/azure_mgmt_cdn/models/origin_list_result.rb +76 -0
- data/lib/azure_mgmt_cdn/models/origin_parameters.rb +62 -0
- data/lib/azure_mgmt_cdn/models/origin_properties.rb +106 -0
- data/lib/azure_mgmt_cdn/models/origin_properties_parameters.rb +78 -0
- data/lib/azure_mgmt_cdn/models/origin_resource_state.rb +17 -0
- data/lib/azure_mgmt_cdn/models/profile.rb +95 -0
- data/lib/azure_mgmt_cdn/models/profile_create_parameters.rb +82 -0
- data/lib/azure_mgmt_cdn/models/profile_list_result.rb +76 -0
- data/lib/azure_mgmt_cdn/models/profile_properties.rb +90 -0
- data/lib/azure_mgmt_cdn/models/profile_properties_create_parameters.rb +63 -0
- data/lib/azure_mgmt_cdn/models/profile_resource_state.rb +18 -0
- data/lib/azure_mgmt_cdn/models/profile_update_parameters.rb +57 -0
- data/lib/azure_mgmt_cdn/models/provisioning_state.rb +17 -0
- data/lib/azure_mgmt_cdn/models/purge_parameters.rb +58 -0
- data/lib/azure_mgmt_cdn/models/query_string_caching_behavior.rb +18 -0
- data/lib/azure_mgmt_cdn/models/sku.rb +60 -0
- data/lib/azure_mgmt_cdn/models/sku_name.rb +16 -0
- data/lib/azure_mgmt_cdn/models/sso_uri.rb +56 -0
- data/lib/azure_mgmt_cdn/models/tracked_resource.rb +85 -0
- data/lib/azure_mgmt_cdn/models/validate_custom_domain_input.rb +56 -0
- data/lib/azure_mgmt_cdn/models/validate_custom_domain_output.rb +75 -0
- data/lib/azure_mgmt_cdn/module_definition.rb +8 -0
- data/lib/azure_mgmt_cdn/name_availability.rb +101 -0
- data/lib/azure_mgmt_cdn/operations.rb +87 -0
- data/lib/azure_mgmt_cdn/origins.rb +533 -0
- data/lib/azure_mgmt_cdn/profiles.rb +607 -0
- data/lib/azure_mgmt_cdn/version.rb +8 -0
- metadata +172 -0
@@ -0,0 +1,197 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ARM::CDN
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Model object.
|
10
|
+
#
|
11
|
+
class EndpointProperties
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] The host name of the endpoint {endpointName}.{DNSZone}
|
16
|
+
attr_accessor :host_name
|
17
|
+
|
18
|
+
# @return [String] The host header CDN provider will send along with
|
19
|
+
# content requests to origins. The default value would be the host name
|
20
|
+
# of the origin.
|
21
|
+
attr_accessor :origin_host_header
|
22
|
+
|
23
|
+
# @return [String] The path used for origin requests
|
24
|
+
attr_accessor :origin_path
|
25
|
+
|
26
|
+
# @return [Array<String>] List of content types on which compression
|
27
|
+
# will be applied. The value for the elements should be Internet media
|
28
|
+
# type.
|
29
|
+
attr_accessor :content_types_to_compress
|
30
|
+
|
31
|
+
# @return [Boolean] Indicates whether the compression is enabled.
|
32
|
+
# Default value is false. If compression is enabled, the content
|
33
|
+
# transferred from cdn endpoint to end user will be compressed. The
|
34
|
+
# requested content must be larger than 1 byte and smaller than 1 MB.
|
35
|
+
attr_accessor :is_compression_enabled
|
36
|
+
|
37
|
+
# @return [Boolean] Indicates whether http traffic is allowed on the
|
38
|
+
# endpoint. Default value is true. At least one protocol (http or
|
39
|
+
# https) must be allowed.
|
40
|
+
attr_accessor :is_http_allowed
|
41
|
+
|
42
|
+
# @return [Boolean] Indicates whether https traffic is allowed on the
|
43
|
+
# endpoint. Default value is true. At least one protocol (http or
|
44
|
+
# https) must be allowed.
|
45
|
+
attr_accessor :is_https_allowed
|
46
|
+
|
47
|
+
# @return [QueryStringCachingBehavior] Defines the query string caching
|
48
|
+
# behavior. Possible values include: 'IgnoreQueryString',
|
49
|
+
# 'BypassCaching', 'UseQueryString', 'NotSet'
|
50
|
+
attr_accessor :query_string_caching_behavior
|
51
|
+
|
52
|
+
# @return [Array<DeepCreatedOrigin>] The set of origins of the CDN
|
53
|
+
# endpoint. When multiple origins exist, the first origin will be used
|
54
|
+
# as primary and rest will be used as failover options.
|
55
|
+
attr_accessor :origins
|
56
|
+
|
57
|
+
# @return [EndpointResourceState] Resource status of the endpoint.
|
58
|
+
# Possible values include: 'Creating', 'Deleting', 'Running',
|
59
|
+
# 'Starting', 'Stopped', 'Stopping'
|
60
|
+
attr_accessor :resource_state
|
61
|
+
|
62
|
+
# @return [ProvisioningState] Provisioning status of the endpoint.
|
63
|
+
# Possible values include: 'Creating', 'Succeeded', 'Failed'
|
64
|
+
attr_accessor :provisioning_state
|
65
|
+
|
66
|
+
#
|
67
|
+
# Validate the object. Throws ValidationError if validation fails.
|
68
|
+
#
|
69
|
+
def validate
|
70
|
+
@content_types_to_compress.each{ |e| e.validate if e.respond_to?(:validate) } unless @content_types_to_compress.nil?
|
71
|
+
@origins.each{ |e| e.validate if e.respond_to?(:validate) } unless @origins.nil?
|
72
|
+
end
|
73
|
+
|
74
|
+
#
|
75
|
+
# Serializes given Model object into Ruby Hash.
|
76
|
+
# @param object Model object to serialize.
|
77
|
+
# @return [Hash] Serialized object in form of Ruby Hash.
|
78
|
+
#
|
79
|
+
def self.serialize_object(object)
|
80
|
+
object.validate
|
81
|
+
output_object = {}
|
82
|
+
|
83
|
+
serialized_property = object.host_name
|
84
|
+
output_object['hostName'] = serialized_property unless serialized_property.nil?
|
85
|
+
|
86
|
+
serialized_property = object.origin_host_header
|
87
|
+
output_object['originHostHeader'] = serialized_property unless serialized_property.nil?
|
88
|
+
|
89
|
+
serialized_property = object.origin_path
|
90
|
+
output_object['originPath'] = serialized_property unless serialized_property.nil?
|
91
|
+
|
92
|
+
serialized_property = object.content_types_to_compress
|
93
|
+
output_object['contentTypesToCompress'] = serialized_property unless serialized_property.nil?
|
94
|
+
|
95
|
+
serialized_property = object.is_compression_enabled
|
96
|
+
output_object['isCompressionEnabled'] = serialized_property unless serialized_property.nil?
|
97
|
+
|
98
|
+
serialized_property = object.is_http_allowed
|
99
|
+
output_object['isHttpAllowed'] = serialized_property unless serialized_property.nil?
|
100
|
+
|
101
|
+
serialized_property = object.is_https_allowed
|
102
|
+
output_object['isHttpsAllowed'] = serialized_property unless serialized_property.nil?
|
103
|
+
|
104
|
+
serialized_property = object.query_string_caching_behavior
|
105
|
+
output_object['queryStringCachingBehavior'] = serialized_property unless serialized_property.nil?
|
106
|
+
|
107
|
+
serialized_property = object.origins
|
108
|
+
unless serialized_property.nil?
|
109
|
+
serializedArray = []
|
110
|
+
serialized_property.each do |element1|
|
111
|
+
unless element1.nil?
|
112
|
+
element1 = DeepCreatedOrigin.serialize_object(element1)
|
113
|
+
end
|
114
|
+
serializedArray.push(element1)
|
115
|
+
end
|
116
|
+
serialized_property = serializedArray
|
117
|
+
end
|
118
|
+
output_object['origins'] = serialized_property unless serialized_property.nil?
|
119
|
+
|
120
|
+
serialized_property = object.resource_state
|
121
|
+
output_object['resourceState'] = serialized_property unless serialized_property.nil?
|
122
|
+
|
123
|
+
serialized_property = object.provisioning_state
|
124
|
+
output_object['provisioningState'] = serialized_property unless serialized_property.nil?
|
125
|
+
|
126
|
+
output_object
|
127
|
+
end
|
128
|
+
|
129
|
+
#
|
130
|
+
# Deserializes given Ruby Hash into Model object.
|
131
|
+
# @param object [Hash] Ruby Hash object to deserialize.
|
132
|
+
# @return [EndpointProperties] Deserialized object.
|
133
|
+
#
|
134
|
+
def self.deserialize_object(object)
|
135
|
+
return if object.nil?
|
136
|
+
output_object = EndpointProperties.new
|
137
|
+
|
138
|
+
deserialized_property = object['hostName']
|
139
|
+
output_object.host_name = deserialized_property
|
140
|
+
|
141
|
+
deserialized_property = object['originHostHeader']
|
142
|
+
output_object.origin_host_header = deserialized_property
|
143
|
+
|
144
|
+
deserialized_property = object['originPath']
|
145
|
+
output_object.origin_path = deserialized_property
|
146
|
+
|
147
|
+
deserialized_property = object['contentTypesToCompress']
|
148
|
+
output_object.content_types_to_compress = deserialized_property
|
149
|
+
|
150
|
+
deserialized_property = object['isCompressionEnabled']
|
151
|
+
output_object.is_compression_enabled = deserialized_property
|
152
|
+
|
153
|
+
deserialized_property = object['isHttpAllowed']
|
154
|
+
output_object.is_http_allowed = deserialized_property
|
155
|
+
|
156
|
+
deserialized_property = object['isHttpsAllowed']
|
157
|
+
output_object.is_https_allowed = deserialized_property
|
158
|
+
|
159
|
+
deserialized_property = object['queryStringCachingBehavior']
|
160
|
+
if (!deserialized_property.nil? && !deserialized_property.empty?)
|
161
|
+
enum_is_valid = QueryStringCachingBehavior.constants.any? { |e| QueryStringCachingBehavior.const_get(e).to_s.downcase == deserialized_property.downcase }
|
162
|
+
warn 'Enum QueryStringCachingBehavior does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
|
163
|
+
end
|
164
|
+
output_object.query_string_caching_behavior = deserialized_property
|
165
|
+
|
166
|
+
deserialized_property = object['origins']
|
167
|
+
unless deserialized_property.nil?
|
168
|
+
deserialized_array = []
|
169
|
+
deserialized_property.each do |element3|
|
170
|
+
unless element3.nil?
|
171
|
+
element3 = DeepCreatedOrigin.deserialize_object(element3)
|
172
|
+
end
|
173
|
+
deserialized_array.push(element3)
|
174
|
+
end
|
175
|
+
deserialized_property = deserialized_array
|
176
|
+
end
|
177
|
+
output_object.origins = deserialized_property
|
178
|
+
|
179
|
+
deserialized_property = object['resourceState']
|
180
|
+
if (!deserialized_property.nil? && !deserialized_property.empty?)
|
181
|
+
enum_is_valid = EndpointResourceState.constants.any? { |e| EndpointResourceState.const_get(e).to_s.downcase == deserialized_property.downcase }
|
182
|
+
warn 'Enum EndpointResourceState does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
|
183
|
+
end
|
184
|
+
output_object.resource_state = deserialized_property
|
185
|
+
|
186
|
+
deserialized_property = object['provisioningState']
|
187
|
+
if (!deserialized_property.nil? && !deserialized_property.empty?)
|
188
|
+
enum_is_valid = ProvisioningState.constants.any? { |e| ProvisioningState.const_get(e).to_s.downcase == deserialized_property.downcase }
|
189
|
+
warn 'Enum ProvisioningState does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
|
190
|
+
end
|
191
|
+
output_object.provisioning_state = deserialized_property
|
192
|
+
|
193
|
+
output_object
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
@@ -0,0 +1,160 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ARM::CDN
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Model object.
|
10
|
+
#
|
11
|
+
class EndpointPropertiesCreateParameters
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] The host header CDN provider will send along with
|
16
|
+
# content requests to origins. The default value would be the host name
|
17
|
+
# of the origin.
|
18
|
+
attr_accessor :origin_host_header
|
19
|
+
|
20
|
+
# @return [String] The path used for origin requests
|
21
|
+
attr_accessor :origin_path
|
22
|
+
|
23
|
+
# @return [Array<String>] List of content types on which compression
|
24
|
+
# will be applied. The value for the elements should be Internet media
|
25
|
+
# type.
|
26
|
+
attr_accessor :content_types_to_compress
|
27
|
+
|
28
|
+
# @return [Boolean] Indicates whether the compression is enabled.
|
29
|
+
# Default value is false. If compression is enabled, the content
|
30
|
+
# transferred from cdn endpoint to end user will be compressed. The
|
31
|
+
# requested content must be larger than 1 byte and smaller than 1 MB.
|
32
|
+
attr_accessor :is_compression_enabled
|
33
|
+
|
34
|
+
# @return [Boolean] Indicates whether http traffic is allowed on the
|
35
|
+
# endpoint. Default value is true. At least one protocol (http or
|
36
|
+
# https) must be allowed.
|
37
|
+
attr_accessor :is_http_allowed
|
38
|
+
|
39
|
+
# @return [Boolean] Indicates whether https traffic is allowed on the
|
40
|
+
# endpoint. Default value is true. At least one protocol (http or
|
41
|
+
# https) must be allowed.
|
42
|
+
attr_accessor :is_https_allowed
|
43
|
+
|
44
|
+
# @return [QueryStringCachingBehavior] Defines the query string caching
|
45
|
+
# behavior. Possible values include: 'IgnoreQueryString',
|
46
|
+
# 'BypassCaching', 'UseQueryString', 'NotSet'
|
47
|
+
attr_accessor :query_string_caching_behavior
|
48
|
+
|
49
|
+
# @return [Array<DeepCreatedOrigin>] The set of origins of the CDN
|
50
|
+
# endpoint. When multiple origins exist, the first origin will be used
|
51
|
+
# as primary and rest will be used as failover options.
|
52
|
+
attr_accessor :origins
|
53
|
+
|
54
|
+
#
|
55
|
+
# Validate the object. Throws ValidationError if validation fails.
|
56
|
+
#
|
57
|
+
def validate
|
58
|
+
fail MsRest::ValidationError, 'property origins is nil' if @origins.nil?
|
59
|
+
@content_types_to_compress.each{ |e| e.validate if e.respond_to?(:validate) } unless @content_types_to_compress.nil?
|
60
|
+
@origins.each{ |e| e.validate if e.respond_to?(:validate) } unless @origins.nil?
|
61
|
+
end
|
62
|
+
|
63
|
+
#
|
64
|
+
# Serializes given Model object into Ruby Hash.
|
65
|
+
# @param object Model object to serialize.
|
66
|
+
# @return [Hash] Serialized object in form of Ruby Hash.
|
67
|
+
#
|
68
|
+
def self.serialize_object(object)
|
69
|
+
object.validate
|
70
|
+
output_object = {}
|
71
|
+
|
72
|
+
serialized_property = object.origins
|
73
|
+
unless serialized_property.nil?
|
74
|
+
serializedArray = []
|
75
|
+
serialized_property.each do |element|
|
76
|
+
unless element.nil?
|
77
|
+
element = DeepCreatedOrigin.serialize_object(element)
|
78
|
+
end
|
79
|
+
serializedArray.push(element)
|
80
|
+
end
|
81
|
+
serialized_property = serializedArray
|
82
|
+
end
|
83
|
+
output_object['origins'] = serialized_property unless serialized_property.nil?
|
84
|
+
|
85
|
+
serialized_property = object.origin_host_header
|
86
|
+
output_object['originHostHeader'] = serialized_property unless serialized_property.nil?
|
87
|
+
|
88
|
+
serialized_property = object.origin_path
|
89
|
+
output_object['originPath'] = serialized_property unless serialized_property.nil?
|
90
|
+
|
91
|
+
serialized_property = object.content_types_to_compress
|
92
|
+
output_object['contentTypesToCompress'] = serialized_property unless serialized_property.nil?
|
93
|
+
|
94
|
+
serialized_property = object.is_compression_enabled
|
95
|
+
output_object['isCompressionEnabled'] = serialized_property unless serialized_property.nil?
|
96
|
+
|
97
|
+
serialized_property = object.is_http_allowed
|
98
|
+
output_object['isHttpAllowed'] = serialized_property unless serialized_property.nil?
|
99
|
+
|
100
|
+
serialized_property = object.is_https_allowed
|
101
|
+
output_object['isHttpsAllowed'] = serialized_property unless serialized_property.nil?
|
102
|
+
|
103
|
+
serialized_property = object.query_string_caching_behavior
|
104
|
+
output_object['queryStringCachingBehavior'] = serialized_property unless serialized_property.nil?
|
105
|
+
|
106
|
+
output_object
|
107
|
+
end
|
108
|
+
|
109
|
+
#
|
110
|
+
# Deserializes given Ruby Hash into Model object.
|
111
|
+
# @param object [Hash] Ruby Hash object to deserialize.
|
112
|
+
# @return [EndpointPropertiesCreateParameters] Deserialized object.
|
113
|
+
#
|
114
|
+
def self.deserialize_object(object)
|
115
|
+
return if object.nil?
|
116
|
+
output_object = EndpointPropertiesCreateParameters.new
|
117
|
+
|
118
|
+
deserialized_property = object['origins']
|
119
|
+
unless deserialized_property.nil?
|
120
|
+
deserialized_array = []
|
121
|
+
deserialized_property.each do |element2|
|
122
|
+
unless element2.nil?
|
123
|
+
element2 = DeepCreatedOrigin.deserialize_object(element2)
|
124
|
+
end
|
125
|
+
deserialized_array.push(element2)
|
126
|
+
end
|
127
|
+
deserialized_property = deserialized_array
|
128
|
+
end
|
129
|
+
output_object.origins = deserialized_property
|
130
|
+
|
131
|
+
deserialized_property = object['originHostHeader']
|
132
|
+
output_object.origin_host_header = deserialized_property
|
133
|
+
|
134
|
+
deserialized_property = object['originPath']
|
135
|
+
output_object.origin_path = deserialized_property
|
136
|
+
|
137
|
+
deserialized_property = object['contentTypesToCompress']
|
138
|
+
output_object.content_types_to_compress = deserialized_property
|
139
|
+
|
140
|
+
deserialized_property = object['isCompressionEnabled']
|
141
|
+
output_object.is_compression_enabled = deserialized_property
|
142
|
+
|
143
|
+
deserialized_property = object['isHttpAllowed']
|
144
|
+
output_object.is_http_allowed = deserialized_property
|
145
|
+
|
146
|
+
deserialized_property = object['isHttpsAllowed']
|
147
|
+
output_object.is_https_allowed = deserialized_property
|
148
|
+
|
149
|
+
deserialized_property = object['queryStringCachingBehavior']
|
150
|
+
if (!deserialized_property.nil? && !deserialized_property.empty?)
|
151
|
+
enum_is_valid = QueryStringCachingBehavior.constants.any? { |e| QueryStringCachingBehavior.const_get(e).to_s.downcase == deserialized_property.downcase }
|
152
|
+
warn 'Enum QueryStringCachingBehavior does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
|
153
|
+
end
|
154
|
+
output_object.query_string_caching_behavior = deserialized_property
|
155
|
+
|
156
|
+
output_object
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ARM::CDN
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Model object.
|
10
|
+
#
|
11
|
+
class EndpointPropertiesUpdateParameters
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] The host header CDN provider will send along with
|
16
|
+
# content requests to origins. The default value would be the host name
|
17
|
+
# of the origin.
|
18
|
+
attr_accessor :origin_host_header
|
19
|
+
|
20
|
+
# @return [String] The path used for origin requests
|
21
|
+
attr_accessor :origin_path
|
22
|
+
|
23
|
+
# @return [Array<String>] List of content types on which compression
|
24
|
+
# will be applied. The value for the elements should be Internet media
|
25
|
+
# type.
|
26
|
+
attr_accessor :content_types_to_compress
|
27
|
+
|
28
|
+
# @return [Boolean] Indicates whether the compression is enabled.
|
29
|
+
# Default value is false. If compression is enabled, the content
|
30
|
+
# transferred from cdn endpoint to end user will be compressed. The
|
31
|
+
# requested content must be larger than 1 byte and smaller than 1 MB.
|
32
|
+
attr_accessor :is_compression_enabled
|
33
|
+
|
34
|
+
# @return [Boolean] Indicates whether http traffic is allowed on the
|
35
|
+
# endpoint. Default value is true. At least one protocol (http or
|
36
|
+
# https) must be allowed.
|
37
|
+
attr_accessor :is_http_allowed
|
38
|
+
|
39
|
+
# @return [Boolean] Indicates whether https traffic is allowed on the
|
40
|
+
# endpoint. Default value is true. At least one protocol (http or
|
41
|
+
# https) must be allowed.
|
42
|
+
attr_accessor :is_https_allowed
|
43
|
+
|
44
|
+
# @return [QueryStringCachingBehavior] Defines the query string caching
|
45
|
+
# behavior. Possible values include: 'IgnoreQueryString',
|
46
|
+
# 'BypassCaching', 'UseQueryString', 'NotSet'
|
47
|
+
attr_accessor :query_string_caching_behavior
|
48
|
+
|
49
|
+
#
|
50
|
+
# Validate the object. Throws ValidationError if validation fails.
|
51
|
+
#
|
52
|
+
def validate
|
53
|
+
@content_types_to_compress.each{ |e| e.validate if e.respond_to?(:validate) } unless @content_types_to_compress.nil?
|
54
|
+
end
|
55
|
+
|
56
|
+
#
|
57
|
+
# Serializes given Model object into Ruby Hash.
|
58
|
+
# @param object Model object to serialize.
|
59
|
+
# @return [Hash] Serialized object in form of Ruby Hash.
|
60
|
+
#
|
61
|
+
def self.serialize_object(object)
|
62
|
+
object.validate
|
63
|
+
output_object = {}
|
64
|
+
|
65
|
+
serialized_property = object.origin_host_header
|
66
|
+
output_object['originHostHeader'] = serialized_property unless serialized_property.nil?
|
67
|
+
|
68
|
+
serialized_property = object.origin_path
|
69
|
+
output_object['originPath'] = serialized_property unless serialized_property.nil?
|
70
|
+
|
71
|
+
serialized_property = object.content_types_to_compress
|
72
|
+
output_object['contentTypesToCompress'] = serialized_property unless serialized_property.nil?
|
73
|
+
|
74
|
+
serialized_property = object.is_compression_enabled
|
75
|
+
output_object['isCompressionEnabled'] = serialized_property unless serialized_property.nil?
|
76
|
+
|
77
|
+
serialized_property = object.is_http_allowed
|
78
|
+
output_object['isHttpAllowed'] = serialized_property unless serialized_property.nil?
|
79
|
+
|
80
|
+
serialized_property = object.is_https_allowed
|
81
|
+
output_object['isHttpsAllowed'] = serialized_property unless serialized_property.nil?
|
82
|
+
|
83
|
+
serialized_property = object.query_string_caching_behavior
|
84
|
+
output_object['queryStringCachingBehavior'] = serialized_property unless serialized_property.nil?
|
85
|
+
|
86
|
+
output_object
|
87
|
+
end
|
88
|
+
|
89
|
+
#
|
90
|
+
# Deserializes given Ruby Hash into Model object.
|
91
|
+
# @param object [Hash] Ruby Hash object to deserialize.
|
92
|
+
# @return [EndpointPropertiesUpdateParameters] Deserialized object.
|
93
|
+
#
|
94
|
+
def self.deserialize_object(object)
|
95
|
+
return if object.nil?
|
96
|
+
output_object = EndpointPropertiesUpdateParameters.new
|
97
|
+
|
98
|
+
deserialized_property = object['originHostHeader']
|
99
|
+
output_object.origin_host_header = deserialized_property
|
100
|
+
|
101
|
+
deserialized_property = object['originPath']
|
102
|
+
output_object.origin_path = deserialized_property
|
103
|
+
|
104
|
+
deserialized_property = object['contentTypesToCompress']
|
105
|
+
output_object.content_types_to_compress = deserialized_property
|
106
|
+
|
107
|
+
deserialized_property = object['isCompressionEnabled']
|
108
|
+
output_object.is_compression_enabled = deserialized_property
|
109
|
+
|
110
|
+
deserialized_property = object['isHttpAllowed']
|
111
|
+
output_object.is_http_allowed = deserialized_property
|
112
|
+
|
113
|
+
deserialized_property = object['isHttpsAllowed']
|
114
|
+
output_object.is_https_allowed = deserialized_property
|
115
|
+
|
116
|
+
deserialized_property = object['queryStringCachingBehavior']
|
117
|
+
if (!deserialized_property.nil? && !deserialized_property.empty?)
|
118
|
+
enum_is_valid = QueryStringCachingBehavior.constants.any? { |e| QueryStringCachingBehavior.const_get(e).to_s.downcase == deserialized_property.downcase }
|
119
|
+
warn 'Enum QueryStringCachingBehavior does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
|
120
|
+
end
|
121
|
+
output_object.query_string_caching_behavior = deserialized_property
|
122
|
+
|
123
|
+
output_object
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|