Skip to content

Commit

Permalink
Add route_rules to UrlMap for Traffic Director (#256)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored and Ty Larrabee committed Dec 6, 2019
1 parent e3e78b9 commit 8e8b7c0
Show file tree
Hide file tree
Showing 37 changed files with 1,764 additions and 19 deletions.
254 changes: 242 additions & 12 deletions docs/resources/google_compute_url_map.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/resources/google_compute_url_maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ See [google_compute_url_map.md](google_compute_url_map.md) for more detailed inf
* `creation_timestamps`: an array of `google_compute_url_map` creation_timestamp
* `default_services`: an array of `google_compute_url_map` default_service
* `descriptions`: an array of `google_compute_url_map` description
* `host_rules`: an array of `google_compute_url_map` host_rules
* `ids`: an array of `google_compute_url_map` id
* `fingerprints`: an array of `google_compute_url_map` fingerprint
* `header_actions`: an array of `google_compute_url_map` header_action
* `host_rules`: an array of `google_compute_url_map` host_rules
* `names`: an array of `google_compute_url_map` name
* `path_matchers`: an array of `google_compute_url_map` path_matchers
* `tests`: an array of `google_compute_url_map` tests
Expand Down
45 changes: 45 additions & 0 deletions libraries/google/compute/property/urlmap_header_action.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/compute/property/urlmap_header_action_request_headers_to_add'
require 'google/compute/property/urlmap_header_action_response_headers_to_add'
module GoogleInSpec
module Compute
module Property
class UrlMapHeaderAction
attr_reader :request_headers_to_add

attr_reader :request_headers_to_remove

attr_reader :response_headers_to_add

attr_reader :response_headers_to_remove

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@request_headers_to_add = GoogleInSpec::Compute::Property::UrlMapHeaderActionRequestHeadersToAddArray.parse(args['requestHeadersToAdd'], to_s)
@request_headers_to_remove = args['requestHeadersToRemove']
@response_headers_to_add = GoogleInSpec::Compute::Property::UrlMapHeaderActionResponseHeadersToAddArray.parse(args['responseHeadersToAdd'], to_s)
@response_headers_to_remove = args['responseHeadersToRemove']
end

def to_s
"#{@parent_identifier} UrlMapHeaderAction"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Compute
module Property
class UrlMapHeaderActionRequestHeadersToAdd
attr_reader :header_name

attr_reader :header_value

attr_reader :replace

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@header_name = args['headerName']
@header_value = args['headerValue']
@replace = args['replace']
end

def to_s
"#{@parent_identifier} UrlMapHeaderActionRequestHeadersToAdd"
end
end

class UrlMapHeaderActionRequestHeadersToAddArray
def self.parse(value, parent_identifier)
return if value.nil?
return UrlMapHeaderActionRequestHeadersToAdd.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| UrlMapHeaderActionRequestHeadersToAdd.new(v, parent_identifier) }
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Compute
module Property
class UrlMapHeaderActionResponseHeadersToAdd
attr_reader :header_name

attr_reader :header_value

attr_reader :replace

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@header_name = args['headerName']
@header_value = args['headerValue']
@replace = args['replace']
end

def to_s
"#{@parent_identifier} UrlMapHeaderActionResponseHeadersToAdd"
end
end

class UrlMapHeaderActionResponseHeadersToAddArray
def self.parse(value, parent_identifier)
return if value.nil?
return UrlMapHeaderActionResponseHeadersToAdd.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| UrlMapHeaderActionResponseHeadersToAdd.new(v, parent_identifier) }
end
end
end
end
end
14 changes: 12 additions & 2 deletions libraries/google/compute/property/urlmap_path_matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/compute/property/urlmap_path_matchers_header_action'
require 'google/compute/property/urlmap_path_matchers_header_action_request_headers_to_add'
require 'google/compute/property/urlmap_path_matchers_header_action_response_headers_to_add'
require 'google/compute/property/urlmap_path_matchers_path_rules'
require 'google/compute/property/urlmap_path_matchers_route_rules'
module GoogleInSpec
module Compute
module Property
Expand All @@ -22,17 +26,23 @@ class UrlMapPathMatchers

attr_reader :description

attr_reader :path_rules

attr_reader :header_action

attr_reader :name

attr_reader :path_rules
attr_reader :route_rules

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@default_service = args['defaultService']
@description = args['description']
@name = args['name']
@path_rules = GoogleInSpec::Compute::Property::UrlMapPathMatchersPathRulesArray.parse(args['pathRules'], to_s)
@header_action = GoogleInSpec::Compute::Property::UrlMapPathMatchersHeaderAction.new(args['headerAction'], to_s)
@name = args['name']
@route_rules = GoogleInSpec::Compute::Property::UrlMapPathMatchersRouteRulesArray.parse(args['routeRules'], to_s)
end

def to_s
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/compute/property/urlmap_path_matchers_header_action_request_headers_to_add'
require 'google/compute/property/urlmap_path_matchers_header_action_response_headers_to_add'
module GoogleInSpec
module Compute
module Property
class UrlMapPathMatchersHeaderAction
attr_reader :request_headers_to_add

attr_reader :request_headers_to_remove

attr_reader :response_headers_to_add

attr_reader :response_headers_to_remove

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@request_headers_to_add = GoogleInSpec::Compute::Property::UrlMapPathMatchersHeaderActionRequestHeadersToAddArray.parse(args['requestHeadersToAdd'], to_s)
@request_headers_to_remove = args['requestHeadersToRemove']
@response_headers_to_add = GoogleInSpec::Compute::Property::UrlMapPathMatchersHeaderActionResponseHeadersToAddArray.parse(args['responseHeadersToAdd'], to_s)
@response_headers_to_remove = args['responseHeadersToRemove']
end

def to_s
"#{@parent_identifier} UrlMapPathMatchersHeaderAction"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Compute
module Property
class UrlMapPathMatchersHeaderActionRequestHeadersToAdd
attr_reader :header_name

attr_reader :header_value

attr_reader :replace

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@header_name = args['headerName']
@header_value = args['headerValue']
@replace = args['replace']
end

def to_s
"#{@parent_identifier} UrlMapPathMatchersHeaderActionRequestHeadersToAdd"
end
end

class UrlMapPathMatchersHeaderActionRequestHeadersToAddArray
def self.parse(value, parent_identifier)
return if value.nil?
return UrlMapPathMatchersHeaderActionRequestHeadersToAdd.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| UrlMapPathMatchersHeaderActionRequestHeadersToAdd.new(v, parent_identifier) }
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Compute
module Property
class UrlMapPathMatchersHeaderActionResponseHeadersToAdd
attr_reader :header_name

attr_reader :header_value

attr_reader :replace

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@header_name = args['headerName']
@header_value = args['headerValue']
@replace = args['replace']
end

def to_s
"#{@parent_identifier} UrlMapPathMatchersHeaderActionResponseHeadersToAdd"
end
end

class UrlMapPathMatchersHeaderActionResponseHeadersToAddArray
def self.parse(value, parent_identifier)
return if value.nil?
return UrlMapPathMatchersHeaderActionResponseHeadersToAdd.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| UrlMapPathMatchersHeaderActionResponseHeadersToAdd.new(v, parent_identifier) }
end
end
end
end
end
Loading

0 comments on commit 8e8b7c0

Please sign in to comment.