feat: Add query to RequestOptions

refs: googleapis/google-cloud-ruby#7806
pr: #1224
This commit is contained in:
Chris Smith authored and GitHub committed 2020-10-20 17:01:42 -06:00
1 parent 530c2d91be
commit cb0c5bf94e
3 files changed
+21 -6

No files matched your search

+2 -1
View File
@@ -145,7 +145,7 @@ module Google
options.authorization.respond_to?(:apply!)
end
# Prepare the request (e.g. calculate headers, serialize data, etc) before sending
# Prepare the request (e.g. calculate headers, add query params, serialize data, etc) before sending
#
# @private
# @return [void]
@@ -153,6 +153,7 @@ module Google
normalize_unicode = true
if options
header.update(options.header) if options.header
query.update(options.query) if options.query
normalize_unicode = options.normalize_unicode
end
self.url = url.expand(params, nil, normalize_unicode) if url.is_a?(Addressable::Template)
+8 -5
View File
@@ -34,7 +34,8 @@ module Google
:skip_deserialization,
:api_format_version,
:use_opencensus,
:quota_project)
:quota_project,
:query)
# General client options
class ClientOptions
@@ -62,13 +63,13 @@ module Google
# Request options
class RequestOptions
# @!attribute [rw] authorization
# @return [Signet::OAuth2::Client, #apply(Hash)] OAuth2 credentials
# @return [Signet::OAuth2::Client, #apply(Hash)] OAuth2 credentials.
# @!attribute [rw] retries
# @return [Fixnum] Number of times to retry requests on server error
# @return [Fixnum] Number of times to retry requests on server error.
# @!attribute [rw] header
# @return [Hash<String,String] Additional HTTP headers to include in requests
# @return [Hash<String,String>] Additional HTTP headers to include in requests.
# @!attribute [rw] normalize_unicode
# @return [Boolean] True if unicode strings should be normalized in path parameters
# @return [Boolean] True if unicode strings should be normalized in path parameters.
# @!attribute [rw] skip_serialization
# @return [Boolean] True if body object should be treated as raw text instead of an object.
# @!attribute [rw] skip_deserialization
@@ -79,6 +80,8 @@ module Google
# @return [Boolean] Whether OpenCensus spans should be generated for requests. Default is true.
# @!attribute [rw] quota_project
# @return [String] Project ID to charge quota, or `nil` to default to the credentials-specified project.
# @!attribute [rw] query
# @return [Hash<String,String>] Additional HTTP URL query parameters to include in requests.
# Get the default options
# @return [Google::Apis::RequestOptions]