Class: Google::Apis::RequestOptions

Inherits:
Struct
  • Object
show all
Defined in:
lib/google/apis/options.rb,
lib/google/apis/options.rb

Overview

Request options

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#add_invocation_id_headerBoolean

Returns True if the header gccl-invocation-id need to be set.

Returns:

  • (Boolean)

    True if the header gccl-invocation-id need to be set



71
72
73
# File 'lib/google/apis/options.rb', line 71

def add_invocation_id_header
  @add_invocation_id_header
end

#api_format_versionFixnum

Returns Version of the error format to request/expect.

Returns:

  • (Fixnum)

    Version of the error format to request/expect.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def api_format_version
  @api_format_version
end

#authorizationSignet::OAuth2::Client, #apply(Hash)

Returns OAuth2 credentials.

Returns:

  • (Signet::OAuth2::Client, #apply(Hash))

    OAuth2 credentials.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def authorization
  @authorization
end

#base_intervalFloat

Returns The initial interval in seconds between tries.

Returns:

  • (Float)

    The initial interval in seconds between tries.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def base_interval
  @base_interval
end

#headerHash<String,String>

Returns Additional HTTP headers to include in requests.

Returns:

  • (Hash<String,String>)

    Additional HTTP headers to include in requests.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def header
  @header
end

#max_elapsed_timeFixnum

Returns Total time in seconds that requests are allowed to keep being retried.

Returns:

  • (Fixnum)

    Total time in seconds that requests are allowed to keep being retried.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def max_elapsed_time
  @max_elapsed_time
end

#max_intervalFixnum

Returns The maximum interval in seconds that any individual retry can reach.

Returns:

  • (Fixnum)

    The maximum interval in seconds that any individual retry can reach.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def max_interval
  @max_interval
end

#multiplierrw

Returns Each successive interval grows by this factor. A multipler of 1.5 means the next interval will be 1.5x the current interval.

Returns:

  • (rw)

    Each successive interval grows by this factor. A multipler of 1.5 means the next interval will be 1.5x the current interval.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def multiplier
  @multiplier
end

#normalize_unicodeBoolean

Returns True if unicode strings should be normalized in path parameters.

Returns:

  • (Boolean)

    True if unicode strings should be normalized in path parameters.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def normalize_unicode
  @normalize_unicode
end

#queryHash<String,String>

Returns Additional HTTP URL query parameters to include in requests.

Returns:

  • (Hash<String,String>)

    Additional HTTP URL query parameters to include in requests.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def query
  @query
end

#quota_projectString

Returns Project ID to charge quota, or nil to default to the credentials-specified project.

Returns:

  • (String)

    Project ID to charge quota, or nil to default to the credentials-specified project.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def quota_project
  @quota_project
end

#retriesFixnum

Returns Number of times to retry requests on server error.

Returns:

  • (Fixnum)

    Number of times to retry requests on server error.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def retries
  @retries
end

#skip_deserializationBoolean

Returns True if response should be returned in raw form instead of deserialized.

Returns:

  • (Boolean)

    True if response should be returned in raw form instead of deserialized.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def skip_deserialization
  @skip_deserialization
end

#skip_serializationBoolean

Returns True if body object should be treated as raw text instead of an object.

Returns:

  • (Boolean)

    True if body object should be treated as raw text instead of an object.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def skip_serialization
  @skip_serialization
end

#upload_chunk_sizeInteger

Returns The chunk size of storage upload. The default value is 100 MB.

Returns:

  • (Integer)

    The chunk size of storage upload. The default value is 100 MB.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def upload_chunk_size
  @upload_chunk_size
end

#use_opencensusBoolean

Returns Whether OpenCensus spans should be generated for requests. Default is true.

Returns:

  • (Boolean)

    Whether OpenCensus spans should be generated for requests. Default is true.



71
72
73
# File 'lib/google/apis/options.rb', line 71

def use_opencensus
  @use_opencensus
end

Class Method Details

.defaultGoogle::Apis::RequestOptions

Get the default options



107
108
109
# File 'lib/google/apis/options.rb', line 107

def self.default
  @options ||= RequestOptions.new
end

Instance Method Details

#merge(options) ⇒ Object



111
112
113
114
115
116
117
118
119
120
# File 'lib/google/apis/options.rb', line 111

def merge(options)
  return self if options.nil?

  new_options = dup
  members.each do |opt|
    opt = opt.to_sym
    new_options[opt] = options[opt] unless options[opt].nil?
  end
  new_options
end