Sha256: 7e0ced7670ccd1b8fa31c35bbdaddfcb343f9a1bf8a1c63391f97109a72d7c85
Contents?: true
Size: 942 Bytes
Versions: 13
Compression:
Stored size: 942 Bytes
Contents
require "fog/core/collection" require "fog/google/models/pubsub/subscription" module Fog module Google class Pubsub class Subscriptions < Fog::Collection model Fog::Google::Pubsub::Subscription # Lists all subscriptions that exist on the project. # # @return [Array<Fog::Google::Pubsub::Subscription>] list of # subscriptions def all data = service.list_subscriptions.body["subscriptions"] || [] load(data) end # Retrieves a subscription by name # # @param subscription_name [String] name of subscription to retrieve # @return [Fog::Google::Pubsub::Topic] topic found, or nil if not found def get(subscription_name) subscription = service.get_subscription(subscription_name).body new(subscription) rescue Fog::Errors::NotFound nil end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems