Class: Google::Gax::CallSettings
- Inherits:
-
Object
- Object
- Google::Gax::CallSettings
- Defined in:
- lib/google/gax.rb
Overview
Encapsulates the call settings for an ApiCallable
Instance Attribute Summary collapse
- #bundle_descriptor ⇒ BundleDescriptor readonly
-
#bundler ⇒ Object
readonly
Returns the value of attribute bundler.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
- #kwargs ⇒ Hash readonly
- #page_descriptor ⇒ PageDescriptor readonly
- #page_token ⇒ Object readonly
- #retry_options ⇒ RetryOptions readonly
- #timeout ⇒ Numeric readonly
Instance Method Summary collapse
-
#bundler? ⇒ Boolean
True when it has valid bundler configuration.
-
#initialize(timeout: 30, retry_options: nil, page_descriptor: nil, page_token: nil, bundler: nil, bundle_descriptor: nil, kwargs: {}, errors: []) ⇒ CallSettings
constructor
A new instance of CallSettings.
-
#merge(options) ⇒ Object
Creates a new CallSetting instance which is based on this but merged settings from options.
-
#retry_codes? ⇒ Boolean
True when it has retry codes.
Constructor Details
#initialize(timeout: 30, retry_options: nil, page_descriptor: nil, page_token: nil, bundler: nil, bundle_descriptor: nil, kwargs: {}, errors: []) ⇒ CallSettings
Returns a new instance of CallSettings.
76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/google/gax.rb', line 76 def initialize(timeout: 30, retry_options: nil, page_descriptor: nil, page_token: nil, bundler: nil, bundle_descriptor: nil, kwargs: {}, errors: []) @timeout = timeout @retry_options = @page_descriptor = page_descriptor @page_token = page_token @bundler = bundler @bundle_descriptor = bundle_descriptor @kwargs = kwargs @errors = errors end |
Instance Attribute Details
#bundle_descriptor ⇒ BundleDescriptor (readonly)
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/google/gax.rb', line 54 class CallSettings attr_reader :timeout, :retry_options, :page_descriptor, :page_token, :bundler, :bundle_descriptor, :kwargs, :errors # @param timeout [Numeric] The client-side timeout for API calls. This # parameter is ignored for retrying calls. # @param retry_options [RetryOptions] The configuration for retrying upon # transient error. If set to nil, this call will not retry. # @param page_descriptor [PageDescriptor] indicates the structure of page # streaming to be performed. If set to nil, page streaming is not # performed. # @param page_token [Object] determines the page token used in the # page streaming request. If there is no page_descriptor, this has no # meaning. # @param bundler orchestrates bundling. If nil, bundling is not # performed. # @param bundle_descriptor [BundleDescriptor] indicates the structure of # the bundle. If nil, bundling is not performed. # @param kwargs [Hash] # Additional keyword argments to be passed to the API call. # @param errors [Array<Exception>] # Configures the exceptions to wrap with GaxError. def initialize(timeout: 30, retry_options: nil, page_descriptor: nil, page_token: nil, bundler: nil, bundle_descriptor: nil, kwargs: {}, errors: []) @timeout = timeout @retry_options = @page_descriptor = page_descriptor @page_token = page_token @bundler = bundler @bundle_descriptor = bundle_descriptor @kwargs = kwargs @errors = errors end # @return true when it has retry codes. def retry_codes? @retry_options && @retry_options.retry_codes end # @return true when it has valid bundler configuration. def bundler? @bundler && @bundle_descriptor end # Creates a new CallSetting instance which is based on this but merged # settings from options. # @param options [CallOptions, nil] The overriding call settings. # @return a new merged call settings. def merge() unless return CallSettings.new(timeout: @timeout, retry_options: @retry_options, page_descriptor: @page_descriptor, page_token: @page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: @kwargs, errors: @errors) end timeout = if .timeout == :OPTION_INHERIT @timeout else .timeout end = if . == :OPTION_INHERIT @retry_options else . end page_token = if .page_token == :OPTION_INHERIT @page_token else .page_token end kwargs = @kwargs.dup kwargs.update(.kwargs) if .kwargs != :OPTION_INHERIT CallSettings.new(timeout: timeout, retry_options: , page_descriptor: @page_descriptor, page_token: page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: kwargs, errors: @errors) end end |
#bundler ⇒ Object (readonly)
Returns the value of attribute bundler.
55 56 57 |
# File 'lib/google/gax.rb', line 55 def bundler @bundler end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
55 56 57 |
# File 'lib/google/gax.rb', line 55 def errors @errors end |
#kwargs ⇒ Hash (readonly)
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/google/gax.rb', line 54 class CallSettings attr_reader :timeout, :retry_options, :page_descriptor, :page_token, :bundler, :bundle_descriptor, :kwargs, :errors # @param timeout [Numeric] The client-side timeout for API calls. This # parameter is ignored for retrying calls. # @param retry_options [RetryOptions] The configuration for retrying upon # transient error. If set to nil, this call will not retry. # @param page_descriptor [PageDescriptor] indicates the structure of page # streaming to be performed. If set to nil, page streaming is not # performed. # @param page_token [Object] determines the page token used in the # page streaming request. If there is no page_descriptor, this has no # meaning. # @param bundler orchestrates bundling. If nil, bundling is not # performed. # @param bundle_descriptor [BundleDescriptor] indicates the structure of # the bundle. If nil, bundling is not performed. # @param kwargs [Hash] # Additional keyword argments to be passed to the API call. # @param errors [Array<Exception>] # Configures the exceptions to wrap with GaxError. def initialize(timeout: 30, retry_options: nil, page_descriptor: nil, page_token: nil, bundler: nil, bundle_descriptor: nil, kwargs: {}, errors: []) @timeout = timeout @retry_options = @page_descriptor = page_descriptor @page_token = page_token @bundler = bundler @bundle_descriptor = bundle_descriptor @kwargs = kwargs @errors = errors end # @return true when it has retry codes. def retry_codes? @retry_options && @retry_options.retry_codes end # @return true when it has valid bundler configuration. def bundler? @bundler && @bundle_descriptor end # Creates a new CallSetting instance which is based on this but merged # settings from options. # @param options [CallOptions, nil] The overriding call settings. # @return a new merged call settings. def merge() unless return CallSettings.new(timeout: @timeout, retry_options: @retry_options, page_descriptor: @page_descriptor, page_token: @page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: @kwargs, errors: @errors) end timeout = if .timeout == :OPTION_INHERIT @timeout else .timeout end = if . == :OPTION_INHERIT @retry_options else . end page_token = if .page_token == :OPTION_INHERIT @page_token else .page_token end kwargs = @kwargs.dup kwargs.update(.kwargs) if .kwargs != :OPTION_INHERIT CallSettings.new(timeout: timeout, retry_options: , page_descriptor: @page_descriptor, page_token: page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: kwargs, errors: @errors) end end |
#page_descriptor ⇒ PageDescriptor (readonly)
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/google/gax.rb', line 54 class CallSettings attr_reader :timeout, :retry_options, :page_descriptor, :page_token, :bundler, :bundle_descriptor, :kwargs, :errors # @param timeout [Numeric] The client-side timeout for API calls. This # parameter is ignored for retrying calls. # @param retry_options [RetryOptions] The configuration for retrying upon # transient error. If set to nil, this call will not retry. # @param page_descriptor [PageDescriptor] indicates the structure of page # streaming to be performed. If set to nil, page streaming is not # performed. # @param page_token [Object] determines the page token used in the # page streaming request. If there is no page_descriptor, this has no # meaning. # @param bundler orchestrates bundling. If nil, bundling is not # performed. # @param bundle_descriptor [BundleDescriptor] indicates the structure of # the bundle. If nil, bundling is not performed. # @param kwargs [Hash] # Additional keyword argments to be passed to the API call. # @param errors [Array<Exception>] # Configures the exceptions to wrap with GaxError. def initialize(timeout: 30, retry_options: nil, page_descriptor: nil, page_token: nil, bundler: nil, bundle_descriptor: nil, kwargs: {}, errors: []) @timeout = timeout @retry_options = @page_descriptor = page_descriptor @page_token = page_token @bundler = bundler @bundle_descriptor = bundle_descriptor @kwargs = kwargs @errors = errors end # @return true when it has retry codes. def retry_codes? @retry_options && @retry_options.retry_codes end # @return true when it has valid bundler configuration. def bundler? @bundler && @bundle_descriptor end # Creates a new CallSetting instance which is based on this but merged # settings from options. # @param options [CallOptions, nil] The overriding call settings. # @return a new merged call settings. def merge() unless return CallSettings.new(timeout: @timeout, retry_options: @retry_options, page_descriptor: @page_descriptor, page_token: @page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: @kwargs, errors: @errors) end timeout = if .timeout == :OPTION_INHERIT @timeout else .timeout end = if . == :OPTION_INHERIT @retry_options else . end page_token = if .page_token == :OPTION_INHERIT @page_token else .page_token end kwargs = @kwargs.dup kwargs.update(.kwargs) if .kwargs != :OPTION_INHERIT CallSettings.new(timeout: timeout, retry_options: , page_descriptor: @page_descriptor, page_token: page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: kwargs, errors: @errors) end end |
#page_token ⇒ Object (readonly)
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/google/gax.rb', line 54 class CallSettings attr_reader :timeout, :retry_options, :page_descriptor, :page_token, :bundler, :bundle_descriptor, :kwargs, :errors # @param timeout [Numeric] The client-side timeout for API calls. This # parameter is ignored for retrying calls. # @param retry_options [RetryOptions] The configuration for retrying upon # transient error. If set to nil, this call will not retry. # @param page_descriptor [PageDescriptor] indicates the structure of page # streaming to be performed. If set to nil, page streaming is not # performed. # @param page_token [Object] determines the page token used in the # page streaming request. If there is no page_descriptor, this has no # meaning. # @param bundler orchestrates bundling. If nil, bundling is not # performed. # @param bundle_descriptor [BundleDescriptor] indicates the structure of # the bundle. If nil, bundling is not performed. # @param kwargs [Hash] # Additional keyword argments to be passed to the API call. # @param errors [Array<Exception>] # Configures the exceptions to wrap with GaxError. def initialize(timeout: 30, retry_options: nil, page_descriptor: nil, page_token: nil, bundler: nil, bundle_descriptor: nil, kwargs: {}, errors: []) @timeout = timeout @retry_options = @page_descriptor = page_descriptor @page_token = page_token @bundler = bundler @bundle_descriptor = bundle_descriptor @kwargs = kwargs @errors = errors end # @return true when it has retry codes. def retry_codes? @retry_options && @retry_options.retry_codes end # @return true when it has valid bundler configuration. def bundler? @bundler && @bundle_descriptor end # Creates a new CallSetting instance which is based on this but merged # settings from options. # @param options [CallOptions, nil] The overriding call settings. # @return a new merged call settings. def merge() unless return CallSettings.new(timeout: @timeout, retry_options: @retry_options, page_descriptor: @page_descriptor, page_token: @page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: @kwargs, errors: @errors) end timeout = if .timeout == :OPTION_INHERIT @timeout else .timeout end = if . == :OPTION_INHERIT @retry_options else . end page_token = if .page_token == :OPTION_INHERIT @page_token else .page_token end kwargs = @kwargs.dup kwargs.update(.kwargs) if .kwargs != :OPTION_INHERIT CallSettings.new(timeout: timeout, retry_options: , page_descriptor: @page_descriptor, page_token: page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: kwargs, errors: @errors) end end |
#retry_options ⇒ RetryOptions (readonly)
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/google/gax.rb', line 54 class CallSettings attr_reader :timeout, :retry_options, :page_descriptor, :page_token, :bundler, :bundle_descriptor, :kwargs, :errors # @param timeout [Numeric] The client-side timeout for API calls. This # parameter is ignored for retrying calls. # @param retry_options [RetryOptions] The configuration for retrying upon # transient error. If set to nil, this call will not retry. # @param page_descriptor [PageDescriptor] indicates the structure of page # streaming to be performed. If set to nil, page streaming is not # performed. # @param page_token [Object] determines the page token used in the # page streaming request. If there is no page_descriptor, this has no # meaning. # @param bundler orchestrates bundling. If nil, bundling is not # performed. # @param bundle_descriptor [BundleDescriptor] indicates the structure of # the bundle. If nil, bundling is not performed. # @param kwargs [Hash] # Additional keyword argments to be passed to the API call. # @param errors [Array<Exception>] # Configures the exceptions to wrap with GaxError. def initialize(timeout: 30, retry_options: nil, page_descriptor: nil, page_token: nil, bundler: nil, bundle_descriptor: nil, kwargs: {}, errors: []) @timeout = timeout @retry_options = @page_descriptor = page_descriptor @page_token = page_token @bundler = bundler @bundle_descriptor = bundle_descriptor @kwargs = kwargs @errors = errors end # @return true when it has retry codes. def retry_codes? @retry_options && @retry_options.retry_codes end # @return true when it has valid bundler configuration. def bundler? @bundler && @bundle_descriptor end # Creates a new CallSetting instance which is based on this but merged # settings from options. # @param options [CallOptions, nil] The overriding call settings. # @return a new merged call settings. def merge() unless return CallSettings.new(timeout: @timeout, retry_options: @retry_options, page_descriptor: @page_descriptor, page_token: @page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: @kwargs, errors: @errors) end timeout = if .timeout == :OPTION_INHERIT @timeout else .timeout end = if . == :OPTION_INHERIT @retry_options else . end page_token = if .page_token == :OPTION_INHERIT @page_token else .page_token end kwargs = @kwargs.dup kwargs.update(.kwargs) if .kwargs != :OPTION_INHERIT CallSettings.new(timeout: timeout, retry_options: , page_descriptor: @page_descriptor, page_token: page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: kwargs, errors: @errors) end end |
#timeout ⇒ Numeric (readonly)
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/google/gax.rb', line 54 class CallSettings attr_reader :timeout, :retry_options, :page_descriptor, :page_token, :bundler, :bundle_descriptor, :kwargs, :errors # @param timeout [Numeric] The client-side timeout for API calls. This # parameter is ignored for retrying calls. # @param retry_options [RetryOptions] The configuration for retrying upon # transient error. If set to nil, this call will not retry. # @param page_descriptor [PageDescriptor] indicates the structure of page # streaming to be performed. If set to nil, page streaming is not # performed. # @param page_token [Object] determines the page token used in the # page streaming request. If there is no page_descriptor, this has no # meaning. # @param bundler orchestrates bundling. If nil, bundling is not # performed. # @param bundle_descriptor [BundleDescriptor] indicates the structure of # the bundle. If nil, bundling is not performed. # @param kwargs [Hash] # Additional keyword argments to be passed to the API call. # @param errors [Array<Exception>] # Configures the exceptions to wrap with GaxError. def initialize(timeout: 30, retry_options: nil, page_descriptor: nil, page_token: nil, bundler: nil, bundle_descriptor: nil, kwargs: {}, errors: []) @timeout = timeout @retry_options = @page_descriptor = page_descriptor @page_token = page_token @bundler = bundler @bundle_descriptor = bundle_descriptor @kwargs = kwargs @errors = errors end # @return true when it has retry codes. def retry_codes? @retry_options && @retry_options.retry_codes end # @return true when it has valid bundler configuration. def bundler? @bundler && @bundle_descriptor end # Creates a new CallSetting instance which is based on this but merged # settings from options. # @param options [CallOptions, nil] The overriding call settings. # @return a new merged call settings. def merge() unless return CallSettings.new(timeout: @timeout, retry_options: @retry_options, page_descriptor: @page_descriptor, page_token: @page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: @kwargs, errors: @errors) end timeout = if .timeout == :OPTION_INHERIT @timeout else .timeout end = if . == :OPTION_INHERIT @retry_options else . end page_token = if .page_token == :OPTION_INHERIT @page_token else .page_token end kwargs = @kwargs.dup kwargs.update(.kwargs) if .kwargs != :OPTION_INHERIT CallSettings.new(timeout: timeout, retry_options: , page_descriptor: @page_descriptor, page_token: page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: kwargs, errors: @errors) end end |
Instance Method Details
#bundler? ⇒ Boolean
Returns true when it has valid bundler configuration.
95 96 97 |
# File 'lib/google/gax.rb', line 95 def bundler? @bundler && @bundle_descriptor end |
#merge(options) ⇒ Object
Creates a new CallSetting instance which is based on this but merged settings from options.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/google/gax.rb', line 103 def merge() unless return CallSettings.new(timeout: @timeout, retry_options: @retry_options, page_descriptor: @page_descriptor, page_token: @page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: @kwargs, errors: @errors) end timeout = if .timeout == :OPTION_INHERIT @timeout else .timeout end = if . == :OPTION_INHERIT @retry_options else . end page_token = if .page_token == :OPTION_INHERIT @page_token else .page_token end kwargs = @kwargs.dup kwargs.update(.kwargs) if .kwargs != :OPTION_INHERIT CallSettings.new(timeout: timeout, retry_options: , page_descriptor: @page_descriptor, page_token: page_token, bundler: @bundler, bundle_descriptor: @bundle_descriptor, kwargs: kwargs, errors: @errors) end |
#retry_codes? ⇒ Boolean
Returns true when it has retry codes.
90 91 92 |
# File 'lib/google/gax.rb', line 90 def retry_codes? @retry_options && @retry_options.retry_codes end |