Sha256: ca9fe250b9b9707c717f90326db2e5261410dc743f0aa456c579a67bc12bb21c
Contents?: true
Size: 1.4 KB
Versions: 2
Compression:
Stored size: 1.4 KB
Contents
<%- assert_locals method -%> # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.<%= method.name %>.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::<%= method.service.gem.version_name_full %> metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id <%- if method.routing_params? && !method.client_streaming? -%> header_params = { <%- method.routing_params.each_with_index do |routing_param, index| -%> <%- comma = index == method.routing_params.count - 1 ? "" : "," -%> "<%= routing_param %>" => request.<%= routing_param %><%= comma %> <%- end -%> } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header <%- end -%> options.apply_defaults timeout: @config.rpcs.<%= method.name %>.timeout, metadata: metadata, retry_policy: @config.rpcs.<%= method.name %>.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
gapic-generator-0.10.1 | templates/default/service/client/method/def/_options_defaults.erb |
gapic-generator-0.10.0 | templates/default/service/client/method/def/_options_defaults.erb |