Module: Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/apps/events/subscriptions/v1/subscriptions_service/paths.rb

Overview

Path helper methods for the SubscriptionsService API.

Instance Method Summary collapse

Instance Method Details

#subscription_path(subscription:) ⇒ ::String

Create a fully-qualified Subscription resource string.

The resource will be in the following format:

subscriptions/{subscription}

Parameters:

  • subscription (String)

Returns:

  • (::String)


38
39
40
# File 'lib/google/apps/events/subscriptions/v1/subscriptions_service/paths.rb', line 38

def subscription_path subscription:
  "subscriptions/#{subscription}"
end

#topic_path(project:, topic:) ⇒ ::String

Create a fully-qualified Topic resource string.

The resource will be in the following format:

projects/{project}/topics/{topic}

Parameters:

  • project (String)
  • topic (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


53
54
55
56
57
# File 'lib/google/apps/events/subscriptions/v1/subscriptions_service/paths.rb', line 53

def topic_path project:, topic:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/topics/#{topic}"
end

#user_path(user:) ⇒ ::String

Create a fully-qualified User resource string.

The resource will be in the following format:

users/{user}

Parameters:

  • user (String)

Returns:

  • (::String)


69
70
71
# File 'lib/google/apps/events/subscriptions/v1/subscriptions_service/paths.rb', line 69

def user_path user:
  "users/#{user}"
end