Module: Google::Apps::Chat::V1::ChatService::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/apps/chat/v1/chat_service/paths.rb

Overview

Path helper methods for the ChatService API.

Instance Method Summary collapse

Instance Method Details

#attachment_path(space:, message:, attachment:) ⇒ ::String

Create a fully-qualified Attachment resource string.

The resource will be in the following format:

spaces/{space}/messages/{message}/attachments/{attachment}

Parameters:

  • space (String)
  • message (String)
  • attachment (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
44
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 39

def attachment_path space:, message:, attachment:
  raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/"
  raise ::ArgumentError, "message cannot contain /" if message.to_s.include? "/"

  "spaces/#{space}/messages/#{message}/attachments/#{attachment}"
end

#custom_emoji_path(custom_emoji:) ⇒ ::String

Create a fully-qualified CustomEmoji resource string.

The resource will be in the following format:

customEmojis/{custom_emoji}

Parameters:

  • custom_emoji (String)

Returns:

  • (::String)


56
57
58
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 56

def custom_emoji_path custom_emoji:
  "customEmojis/#{custom_emoji}"
end

#membership_path(space:, member:) ⇒ ::String

Create a fully-qualified Membership resource string.

The resource will be in the following format:

spaces/{space}/members/{member}

Parameters:

  • space (String)
  • member (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


71
72
73
74
75
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 71

def membership_path space:, member:
  raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/"

  "spaces/#{space}/members/#{member}"
end

#message_path(space:, message:) ⇒ ::String

Create a fully-qualified Message resource string.

The resource will be in the following format:

spaces/{space}/messages/{message}

Parameters:

  • space (String)
  • message (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


88
89
90
91
92
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 88

def message_path space:, message:
  raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/"

  "spaces/#{space}/messages/#{message}"
end

#quoted_message_metadata_path(space:, message:, quoted_message_metadata:) ⇒ ::String

Create a fully-qualified QuotedMessageMetadata resource string.

The resource will be in the following format:

spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}

Parameters:

  • space (String)
  • message (String)
  • quoted_message_metadata (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


106
107
108
109
110
111
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 106

def  space:, message:, quoted_message_metadata:
  raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/"
  raise ::ArgumentError, "message cannot contain /" if message.to_s.include? "/"

  "spaces/#{space}/messages/#{message}/quotedMessageMetadata/#{quoted_message_metadata}"
end

#reaction_path(space:, message:, reaction:) ⇒ ::String

Create a fully-qualified Reaction resource string.

The resource will be in the following format:

spaces/{space}/messages/{message}/reactions/{reaction}

Parameters:

  • space (String)
  • message (String)
  • reaction (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


125
126
127
128
129
130
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 125

def reaction_path space:, message:, reaction:
  raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/"
  raise ::ArgumentError, "message cannot contain /" if message.to_s.include? "/"

  "spaces/#{space}/messages/#{message}/reactions/#{reaction}"
end

#space_event_path(space:, space_event:) ⇒ ::String

Create a fully-qualified SpaceEvent resource string.

The resource will be in the following format:

spaces/{space}/spaceEvents/{space_event}

Parameters:

  • space (String)
  • space_event (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


157
158
159
160
161
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 157

def space_event_path space:, space_event:
  raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/"

  "spaces/#{space}/spaceEvents/#{space_event}"
end

#space_notification_setting_path(user:, space:) ⇒ ::String

Create a fully-qualified SpaceNotificationSetting resource string.

The resource will be in the following format:

users/{user}/spaces/{space}/spaceNotificationSetting

Parameters:

  • user (String)
  • space (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


174
175
176
177
178
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 174

def space_notification_setting_path user:, space:
  raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"

  "users/#{user}/spaces/#{space}/spaceNotificationSetting"
end

#space_path(space:) ⇒ ::String

Create a fully-qualified Space resource string.

The resource will be in the following format:

spaces/{space}

Parameters:

  • space (String)

Returns:

  • (::String)


142
143
144
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 142

def space_path space:
  "spaces/#{space}"
end

#space_read_state_path(user:, space:) ⇒ ::String

Create a fully-qualified SpaceReadState resource string.

The resource will be in the following format:

users/{user}/spaces/{space}/spaceReadState

Parameters:

  • user (String)
  • space (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


191
192
193
194
195
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 191

def space_read_state_path user:, space:
  raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"

  "users/#{user}/spaces/#{space}/spaceReadState"
end

#thread_path(space:, thread:) ⇒ ::String

Create a fully-qualified Thread resource string.

The resource will be in the following format:

spaces/{space}/threads/{thread}

Parameters:

  • space (String)
  • thread (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


208
209
210
211
212
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 208

def thread_path space:, thread:
  raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/"

  "spaces/#{space}/threads/#{thread}"
end

#thread_read_state_path(user:, space:, thread:) ⇒ ::String

Create a fully-qualified ThreadReadState resource string.

The resource will be in the following format:

users/{user}/spaces/{space}/threads/{thread}/threadReadState

Parameters:

  • user (String)
  • space (String)
  • thread (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


226
227
228
229
230
231
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 226

def thread_read_state_path user:, space:, thread:
  raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
  raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/"

  "users/#{user}/spaces/#{space}/threads/#{thread}/threadReadState"
end