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

#api_format_version ⇒ Fixnum

Returns Version of the error format to request/expect.

Returns:

  • (Fixnum) —

    Version of the error format to request/expect.



62
63
64
# File 'lib/google/apis/options.rb', line 62

def api_format_version
  @api_format_version
end

#authorization ⇒ Signet::OAuth2::Client, #apply(Hash)

Returns OAuth2 credentials

Returns:

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

    OAuth2 credentials



62
63
64
# File 'lib/google/apis/options.rb', line 62

def authorization
  @authorization
end

#header ⇒ Hash<String,String] Additional HTTP headers to include in requests

Returns Hash<String,String] Additional HTTP headers to include in requests

Returns:

  • (Hash<String,String] Additional HTTP headers to include in requests) —

    Hash<String,String] Additional HTTP headers to include in requests



62
63
64
# File 'lib/google/apis/options.rb', line 62

def header
  @header
end

#normalize_unicode ⇒ Boolean

Returns True if unicode strings should be normalized in path parameters

Returns:

  • (Boolean) —

    True if unicode strings should be normalized in path parameters



62
63
64
# File 'lib/google/apis/options.rb', line 62

def normalize_unicode
  @normalize_unicode
end

#retries ⇒ Fixnum

Returns Number of times to retry requests on server error

Returns:

  • (Fixnum) —

    Number of times to retry requests on server error



62
63
64
# File 'lib/google/apis/options.rb', line 62

def retries
  @retries
end

#skip_deserialization ⇒ Boolean

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.



62
63
64
# File 'lib/google/apis/options.rb', line 62

def skip_deserialization
  @skip_deserialization
end

#skip_serialization ⇒ Boolean

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.



62
63
64
# File 'lib/google/apis/options.rb', line 62

def skip_serialization
  @skip_serialization
end

Class Method Details

.default ⇒ Google::Apis::RequestOptions

Get the default options



79
80
81
# File 'lib/google/apis/options.rb', line 79

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

Instance Method Details

#merge(options) ⇒ Object



83
84
85
86
87
88
89
90
91
92
# File 'lib/google/apis/options.rb', line 83

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