Stay organized with collectionsSave and categorize content based on your preferences.
Reference documentation and code samples for the google-cloud-webrisk module Google::Cloud::Webrisk.
Ruby Client for Web Risk API
This library is deprecated, and will no longer receive updates. Please use thegoogle-cloud-web_risklibrary instead. For detailed information on the differences, see themigration guide.
Web Risk v1beta1 API defines an interface to detect malicious URLs on your
website and in client applications.
Parameters
credentials(Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc) — Provides the means for authenticating requests made by the client. This parameter can
be many types.
AGoogle::Auth::Credentialsuses a the properties of its represented keyfile for
authenticating requests made by this client.
AStringwill be treated as the path to the keyfile to be used for the construction of
credentials for this client.
AHashwill be treated as the contents of a keyfile to be used for the construction of
credentials for this client.
AGRPC::Core::Channelwill be used to make calls through.
AGRPC::Core::ChannelCredentialsfor the setting up the RPC client. The channel credentials
should already be composed with aGRPC::Core::CallCredentialsobject.
AProcwill be used as an updater_proc for the Grpc channel. The proc transforms the
metadata for requests, generally, to give OAuth credentials.
scopes(Array<String>) — The OAuth scopes for this service. This parameter is ignored if
an updater_proc is supplied.
client_config(Hash) — A Hash for call options for each method. See
Google::Gax#construct_settings for the structure of
this data. Falls back to the default config if not specified
or the specified config is missing data points.
timeout(Numeric) — The default timeout, in seconds, for calls made through this client.
metadata(Hash) — Default metadata to be sent with each request. This can be overridden on a per call basis.
service_address(String) — Override for the service hostname, ornilto leave as the default.
service_port(Integer) — Override for the service port, ornilto leave as the default.
exception_transformer(Proc) — An optional proc that intercepts any exceptions raised during an API call to inject
custom error handling.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# google-cloud-webrisk - Module Google::Cloud::Webrisk (v0.6.1)\n\nReference documentation and code samples for the google-cloud-webrisk module Google::Cloud::Webrisk.\n\nRuby Client for Web Risk API\n----------------------------\n\n**This library is deprecated, and will no longer receive updates. Please use the\n[`google-cloud-web_risk`](https://rubygems.org/gems/google-cloud-web_risk)\nlibrary instead. For detailed information on the differences, see the\n[migration guide](https://googleapis.dev/ruby/google-cloud-web_risk/latest/file.MIGRATING.html).**\n\n[Web Risk API](https://cloud.google.com/web-risk):\n\n\u003cbr /\u003e\n\n- [Product Documentation](https://cloud.google.com/web-risk)\n\n### Quick Start\n\n\u003cbr /\u003e\n\nIn order to use this library, you first need to go through the following\nsteps:\n\n\u003cbr /\u003e\n\n1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)\n2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)\n3. [Enable the Web Risk API.](https://console.cloud.google.com/apis/library/webrisk.googleapis.com)\n4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-webrisk/latest/file.AUTHENTICATION.html)\n\n#### Installation\n\n\u003cbr /\u003e\n\n`\n$ gem install google-cloud-webrisk\n`\n\n#### Next Steps\n\n- Read the [Web Risk API Product documentation](https://cloud.google.com/web-risk) to learn more about the product and see How-to Guides.\n- View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md) to see the full list of Cloud APIs that we cover.\n\n### Enabling Logging\n\nTo enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.\nThe logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,\nor a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)\nthat will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)\nand the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.\n\nConfiguring a Ruby stdlib logger:\n\n\\`\\`\\`ruby\nrequire \"logger\"\n\nmodule MyLogger\nLOGGER = Logger.new $stderr, level: Logger::WARN\ndef logger\nLOGGER\nend\nend\n\nDefine a gRPC module-level logger method before grpc/logconfig.rb loads.\n------------------------------------------------------------------------\n\nmodule GRPC\nextend MyLogger\nend\n\\`\\`\\`\n\nMethods\n-------\n\n### .new\n\n def self.new(version:, credentials:, scopes:, client_config:, timeout:)\n\nWeb Risk v1beta1 API defines an interface to detect malicious URLs on your\nwebsite and in client applications. \n**Overloads** \n\n def self.new(version:, credentials:, scopes:, client_config:, timeout:)\n\nWeb Risk v1beta1 API defines an interface to detect malicious URLs on your website and in client applications. \n**Parameters**\n\n- **credentials** (Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc) --- Provides the means for authenticating requests made by the client. This parameter can be many types. A `Google::Auth::Credentials` uses a the properties of its represented keyfile for authenticating requests made by this client. A `String` will be treated as the path to the keyfile to be used for the construction of credentials for this client. A `Hash` will be treated as the contents of a keyfile to be used for the construction of credentials for this client. A `GRPC::Core::Channel` will be used to make calls through. A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials should already be composed with a `GRPC::Core::CallCredentials` object. A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the metadata for requests, generally, to give OAuth credentials.\n- **scopes** (Array\\\u003cString\\\u003e) --- The OAuth scopes for this service. This parameter is ignored if an updater_proc is supplied.\n- **client_config** (Hash) --- A Hash for call options for each method. See Google::Gax#construct_settings for the structure of this data. Falls back to the default config if not specified or the specified config is missing data points.\n- **timeout** (Numeric) --- The default timeout, in seconds, for calls made through this client.\n- **metadata** (Hash) --- Default metadata to be sent with each request. This can be overridden on a per call basis.\n- **service_address** (String) --- Override for the service hostname, or `nil` to leave as the default.\n- **service_port** (Integer) --- Override for the service port, or `nil` to leave as the default.\n- **exception_transformer** (Proc) --- An optional proc that intercepts any exceptions raised during an API call to inject custom error handling.\n\nConstants\n---------\n\n### FILE_DIR\n\n**value:** File.realdirpath(Pathname.new(**FILE** ).join(\"..\").join(\"webrisk\")) \nrubocop:enable LineLength\n\n### AVAILABLE_VERSIONS\n\n**value:** Dir\\[\"#[FILE_DIR](/ruby/docs/reference/google-cloud-webrisk/latest/Google-Cloud-Webrisk#Google__Cloud__Webrisk__FILE_DIR \"Google::Cloud::Webrisk::FILE_DIR (constant)\")/\\*\"\\]\n.select { \\|file\\| File.directory?(file) }\n.select { \\|dir\\| Google::Gax::VERSION_MATCHER.match(File.basename(dir)) }\n.select { \\|dir\\| File.exist?(dir + \".rb\") }\n.map { \\|dir\\| File.basename(dir) }\n\n### VERSION\n\n**value:**\"0.6.1\".freeze"]]