lib/google/cloud/app_engine/v1/firewall/client.rb in google-cloud-app_engine-v1-0.3.3 vs lib/google/cloud/app_engine/v1/firewall/client.rb in google-cloud-app_engine-v1-0.3.4

- old
+ new

@@ -187,10 +187,31 @@ # # @return [::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::FirewallRule>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # + # @example Basic example + # require "google/cloud/app_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AppEngine::V1::Firewall::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AppEngine::V1::ListIngressRulesRequest.new + # + # # Call the list_ingress_rules method. + # result = client.list_ingress_rules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can + # # iterate over all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Cloud::AppEngine::V1::FirewallRule. + # p response + # end + # def list_ingress_rules request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::ListIngressRulesRequest @@ -204,13 +225,15 @@ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::AppEngine::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - header_params = { - "parent" => request.parent - } + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_ingress_rules.timeout, metadata: metadata, @@ -263,10 +286,25 @@ # # @return [::Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # + # @example Basic example + # require "google/cloud/app_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AppEngine::V1::Firewall::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesRequest.new + # + # # Call the batch_update_ingress_rules method. + # result = client.batch_update_ingress_rules request + # + # # The returned object is of type Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesResponse. + # p result + # def batch_update_ingress_rules request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesRequest @@ -280,13 +318,15 @@ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::AppEngine::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - header_params = { - "name" => request.name - } + header_params = {} + if request.name + header_params["name"] = request.name + end + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.batch_update_ingress_rules.timeout, metadata: metadata, @@ -343,10 +383,25 @@ # # @return [::Google::Cloud::AppEngine::V1::FirewallRule] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # + # @example Basic example + # require "google/cloud/app_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AppEngine::V1::Firewall::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AppEngine::V1::CreateIngressRuleRequest.new + # + # # Call the create_ingress_rule method. + # result = client.create_ingress_rule request + # + # # The returned object is of type Google::Cloud::AppEngine::V1::FirewallRule. + # p result + # def create_ingress_rule request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::CreateIngressRuleRequest @@ -360,13 +415,15 @@ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::AppEngine::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - header_params = { - "parent" => request.parent - } + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_ingress_rule.timeout, metadata: metadata, @@ -412,10 +469,25 @@ # # @return [::Google::Cloud::AppEngine::V1::FirewallRule] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # + # @example Basic example + # require "google/cloud/app_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AppEngine::V1::Firewall::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AppEngine::V1::GetIngressRuleRequest.new + # + # # Call the get_ingress_rule method. + # result = client.get_ingress_rule request + # + # # The returned object is of type Google::Cloud::AppEngine::V1::FirewallRule. + # p result + # def get_ingress_rule request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::GetIngressRuleRequest @@ -429,13 +501,15 @@ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::AppEngine::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - header_params = { - "name" => request.name - } + header_params = {} + if request.name + header_params["name"] = request.name + end + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_ingress_rule.timeout, metadata: metadata, @@ -485,10 +559,25 @@ # # @return [::Google::Cloud::AppEngine::V1::FirewallRule] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # + # @example Basic example + # require "google/cloud/app_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AppEngine::V1::Firewall::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AppEngine::V1::UpdateIngressRuleRequest.new + # + # # Call the update_ingress_rule method. + # result = client.update_ingress_rule request + # + # # The returned object is of type Google::Cloud::AppEngine::V1::FirewallRule. + # p result + # def update_ingress_rule request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::UpdateIngressRuleRequest @@ -502,13 +591,15 @@ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::AppEngine::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - header_params = { - "name" => request.name - } + header_params = {} + if request.name + header_params["name"] = request.name + end + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_ingress_rule.timeout, metadata: metadata, @@ -554,10 +645,25 @@ # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # + # @example Basic example + # require "google/cloud/app_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AppEngine::V1::Firewall::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AppEngine::V1::DeleteIngressRuleRequest.new + # + # # Call the delete_ingress_rule method. + # result = client.delete_ingress_rule request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_ingress_rule request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::DeleteIngressRuleRequest @@ -571,12 +677,14 @@ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::AppEngine::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - header_params = { - "name" => request.name - } + header_params = {} + if request.name + header_params["name"] = request.name + end + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_ingress_rule.timeout, metadata: metadata,