Module: Google::Cloud::Compute::V1::SecurityPolicies::Rest::GrpcTranscoding

Extended by:
GrpcTranscoding
Included in:
GrpcTranscoding
Defined in:
lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb

Overview

GRPC transcoding helper methods for the SecurityPolicies REST API.

Instance Method Summary collapse

Instance Method Details

#transcode_add_rule(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

Returns Uri, Body, Query string parameters.

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



32
33
34
35
36
37
38
# File 'lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb', line 32

def transcode_add_rule request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/global/securityPolicies/#{request_pb.security_policy}/addRule"
  body = request_pb.security_policy_rule_resource.to_json
  query_string_params = {}

  [uri, body, query_string_params]
end

#transcode_delete(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

Returns Uri, Body, Query string parameters.

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



44
45
46
47
48
49
50
51
# File 'lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb', line 44

def transcode_delete request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/global/securityPolicies/#{request_pb.security_policy}"
  body = nil
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#transcode_get(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

Returns Uri, Body, Query string parameters.

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



57
58
59
60
61
62
63
# File 'lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb', line 57

def transcode_get request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/global/securityPolicies/#{request_pb.security_policy}"
  body = nil
  query_string_params = {}

  [uri, body, query_string_params]
end

#transcode_get_rule(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

Returns Uri, Body, Query string parameters.

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



69
70
71
72
73
74
75
76
# File 'lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb', line 69

def transcode_get_rule request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/global/securityPolicies/#{request_pb.security_policy}/getRule"
  body = nil
  query_string_params = {}
  query_string_params["priority"] = request_pb.priority.to_s if request_pb.has_priority?

  [uri, body, query_string_params]
end

#transcode_insert(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

Returns Uri, Body, Query string parameters.

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



82
83
84
85
86
87
88
89
# File 'lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb', line 82

def transcode_insert request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/global/securityPolicies"
  body = request_pb.security_policy_resource.to_json
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#transcode_list(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

Returns Uri, Body, Query string parameters.

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb', line 95

def transcode_list request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/global/securityPolicies"
  body = nil
  query_string_params = {}
  query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
  query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
  query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
  query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
  query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?

  [uri, body, query_string_params]
end

#transcode_list_preconfigured_expression_sets(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

Returns Uri, Body, Query string parameters.

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb', line 112

def transcode_list_preconfigured_expression_sets request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/global/securityPolicies/listPreconfiguredExpressionSets"
  body = nil
  query_string_params = {}
  query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
  query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
  query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
  query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
  query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?

  [uri, body, query_string_params]
end

#transcode_patch(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

Returns Uri, Body, Query string parameters.

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



129
130
131
132
133
134
135
136
# File 'lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb', line 129

def transcode_patch request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/global/securityPolicies/#{request_pb.security_policy}"
  body = request_pb.security_policy_resource.to_json
  query_string_params = {}
  query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?

  [uri, body, query_string_params]
end

#transcode_patch_rule(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

Returns Uri, Body, Query string parameters.

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



142
143
144
145
146
147
148
149
# File 'lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb', line 142

def transcode_patch_rule request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/global/securityPolicies/#{request_pb.security_policy}/patchRule"
  body = request_pb.security_policy_rule_resource.to_json
  query_string_params = {}
  query_string_params["priority"] = request_pb.priority.to_s if request_pb.has_priority?

  [uri, body, query_string_params]
end

#transcode_remove_rule(request_pb) ⇒ Array(String, [String, nil], Hash{String => String})

Returns Uri, Body, Query string parameters.

Parameters:

Returns:

  • (Array(String, [String, nil], Hash{String => String}))

    Uri, Body, Query string parameters



155
156
157
158
159
160
161
162
# File 'lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb', line 155

def transcode_remove_rule request_pb
  uri = "/compute/v1/projects/#{request_pb.project}/global/securityPolicies/#{request_pb.security_policy}/removeRule"
  body = nil
  query_string_params = {}
  query_string_params["priority"] = request_pb.priority.to_s if request_pb.has_priority?

  [uri, body, query_string_params]
end