Class: Google::Apis::RequestOptions
- Inherits:
-
Struct
- Object
- Struct
- Google::Apis::RequestOptions
- Defined in:
- lib/google/apis/options.rb,
lib/google/apis/options.rb
Overview
Request options
Instance Attribute Summary collapse
-
#api_format_version ⇒ Fixnum
Version of the error format to request/expect.
-
#authorization ⇒ Signet::OAuth2::Client, #apply(Hash)
OAuth2 credentials.
-
#header ⇒ Hash<String,String>
Additional HTTP headers to include in requests.
-
#normalize_unicode ⇒ Boolean
True if unicode strings should be normalized in path parameters.
-
#query ⇒ Hash<String,String>
Additional HTTP URL query parameters to include in requests.
-
#quota_project ⇒ String
Project ID to charge quota, or
nil
to default to the credentials-specified project. -
#retries ⇒ Fixnum
Number of times to retry requests on server error.
-
#skip_deserialization ⇒ Boolean
True if response should be returned in raw form instead of deserialized.
-
#skip_serialization ⇒ Boolean
True if body object should be treated as raw text instead of an object.
-
#use_opencensus ⇒ Boolean
Whether OpenCensus spans should be generated for requests.
Class Method Summary collapse
-
.default ⇒ Google::Apis::RequestOptions
Get the default options.
Instance Method Summary collapse
Instance Attribute Details
#api_format_version ⇒ Fixnum
Returns Version of the error format to request/expect.
65 66 67 |
# File 'lib/google/apis/options.rb', line 65 def api_format_version @api_format_version end |
#authorization ⇒ Signet::OAuth2::Client, #apply(Hash)
Returns OAuth2 credentials.
65 66 67 |
# File 'lib/google/apis/options.rb', line 65 def @authorization end |
#header ⇒ Hash<String,String>
Returns Additional HTTP headers to include in requests.
65 66 67 |
# File 'lib/google/apis/options.rb', line 65 def header @header end |
#normalize_unicode ⇒ Boolean
Returns True if unicode strings should be normalized in path parameters.
65 66 67 |
# File 'lib/google/apis/options.rb', line 65 def normalize_unicode @normalize_unicode end |
#query ⇒ Hash<String,String>
Returns Additional HTTP URL query parameters to include in requests.
65 66 67 |
# File 'lib/google/apis/options.rb', line 65 def query @query end |
#quota_project ⇒ String
Returns Project ID to charge quota, or nil
to default to the credentials-specified project.
65 66 67 |
# File 'lib/google/apis/options.rb', line 65 def quota_project @quota_project end |
#retries ⇒ Fixnum
Returns Number of times to retry requests on server error.
65 66 67 |
# File 'lib/google/apis/options.rb', line 65 def retries @retries end |
#skip_deserialization ⇒ Boolean
Returns True if response should be returned in raw form instead of deserialized.
65 66 67 |
# File 'lib/google/apis/options.rb', line 65 def skip_deserialization @skip_deserialization end |
#skip_serialization ⇒ Boolean
Returns True if body object should be treated as raw text instead of an object.
65 66 67 |
# File 'lib/google/apis/options.rb', line 65 def skip_serialization @skip_serialization end |
#use_opencensus ⇒ Boolean
Returns Whether OpenCensus spans should be generated for requests. Default is true.
65 66 67 |
# File 'lib/google/apis/options.rb', line 65 def use_opencensus @use_opencensus end |
Class Method Details
.default ⇒ Google::Apis::RequestOptions
Get the default options
88 89 90 |
# File 'lib/google/apis/options.rb', line 88 def self.default @options ||= RequestOptions.new end |
Instance Method Details
#merge(options) ⇒ Object
92 93 94 95 96 97 98 99 100 101 |
# File 'lib/google/apis/options.rb', line 92 def merge() return self if .nil? = dup members.each do |opt| opt = opt.to_sym [opt] = [opt] unless [opt].nil? end end |