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

#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)


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

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)


74
75
76
77
78
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 74

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)


92
93
94
95
96
97
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 92

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/#{}"
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)


111
112
113
114
115
116
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 111

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)


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

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

  "spaces/#{space}/spaceEvents/#{space_event}"
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)


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

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)


160
161
162
163
164
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 160

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)


177
178
179
180
181
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 177

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)


195
196
197
198
199
200
# File 'lib/google/apps/chat/v1/chat_service/paths.rb', line 195

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