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
-
#add_invocation_id_header ⇒ Boolean
True if the header gccl-invocation-id need to be set.
-
#api_format_version ⇒ Integer
Version of the error format to request/expect.
-
#authorization ⇒ Signet::OAuth2::Client, #apply(Hash)
OAuth2 credentials.
-
#base_interval ⇒ Float
The initial interval in seconds between tries.
-
#header ⇒ Hash<String,String>
Additional HTTP headers to include in requests.
-
#max_elapsed_time ⇒ Integer
Total time in seconds that requests are allowed to keep being retried.
-
#max_interval ⇒ Integer
The maximum interval in seconds that any individual retry can reach.
-
#multiplier ⇒ Numeric
Each successive interval grows by this factor.
-
#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 ⇒ Integer
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.
-
#upload_chunk_size ⇒ Integer
The chunk size of storage upload.
-
#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
#add_invocation_id_header ⇒ Boolean
Returns True if the header gccl-invocation-id need to be set.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def add_invocation_id_header @add_invocation_id_header end |
#api_format_version ⇒ Integer
Returns Version of the error format to request/expect.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def api_format_version @api_format_version end |
#authorization ⇒ Signet::OAuth2::Client, #apply(Hash)
Returns OAuth2 credentials.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def @authorization end |
#base_interval ⇒ Float
Returns The initial interval in seconds between tries.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def base_interval @base_interval end |
#header ⇒ Hash<String,String>
Returns Additional HTTP headers to include in requests.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def header @header end |
#max_elapsed_time ⇒ Integer
Returns Total time in seconds that requests are allowed to keep being retried.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def max_elapsed_time @max_elapsed_time end |
#max_interval ⇒ Integer
Returns The maximum interval in seconds that any individual retry can reach.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def max_interval @max_interval end |
#multiplier ⇒ Numeric
Returns Each successive interval grows by this factor. A multipler of 1.5 means the next interval will be 1.5x the current interval.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def multiplier @multiplier end |
#normalize_unicode ⇒ Boolean
Returns True if unicode strings should be normalized in path parameters.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def normalize_unicode @normalize_unicode end |
#query ⇒ Hash<String,String>
Returns Additional HTTP URL query parameters to include in requests.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def query @query end |
#quota_project ⇒ String
Returns Project ID to charge quota, or nil
to default to the credentials-specified project.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def quota_project @quota_project end |
#retries ⇒ Integer
Returns Number of times to retry requests on server error.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def retries @retries end |
#skip_deserialization ⇒ Boolean
Returns True if response should be returned in raw form instead of deserialized.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def skip_deserialization @skip_deserialization end |
#skip_serialization ⇒ Boolean
Returns True if body object should be treated as raw text instead of an object.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def skip_serialization @skip_serialization end |
#upload_chunk_size ⇒ Integer
Returns The chunk size of storage upload. The default value is 100 MB.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def upload_chunk_size @upload_chunk_size end |
#use_opencensus ⇒ Boolean
Returns Whether OpenCensus spans should be generated for requests. Default is true.
73 74 75 |
# File 'lib/google/apis/options.rb', line 73 def use_opencensus @use_opencensus end |
Class Method Details
.default ⇒ Google::Apis::RequestOptions
Get the default options
109 110 111 |
# File 'lib/google/apis/options.rb', line 109 def self.default @options ||= RequestOptions.new end |
Instance Method Details
#merge(options) ⇒ Object
113 114 115 116 117 118 119 120 121 122 |
# File 'lib/google/apis/options.rb', line 113 def merge() return self if .nil? = dup members.each do |opt| opt = opt.to_sym [opt] = [opt] unless [opt].nil? end end |