Skip to content

Commit

Permalink
feat: Automated regeneration of chat v1 client
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation committed Dec 3, 2020
1 parent 0f920ae commit 5043725
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 2 deletions.
12 changes: 12 additions & 0 deletions api_names_out.yaml
Expand Up @@ -19918,20 +19918,32 @@
"/chat:v1/WidgetMarkup/image": image
"/chat:v1/WidgetMarkup/keyValue": key_value
"/chat:v1/WidgetMarkup/textParagraph": text_paragraph
"/chat:v1/chat.dms.conversations.messages": messages_dm_conversation
"/chat:v1/chat.dms.conversations.messages.create": create_dm_conversation_message
"/chat:v1/chat.dms.conversations.messages.create/parent": parent
"/chat:v1/chat.dms.conversations.messages.create/threadKey": thread_key
"/chat:v1/chat.dms.conversations.messages/parent": parent
"/chat:v1/chat.dms.conversations.messages/threadKey": thread_key
"/chat:v1/chat.dms.messages": messages_dm
"/chat:v1/chat.dms.messages.create": create_dm_message
"/chat:v1/chat.dms.messages.create/parent": parent
"/chat:v1/chat.dms.messages.create/threadKey": thread_key
"/chat:v1/chat.dms.messages/parent": parent
"/chat:v1/chat.dms.messages/threadKey": thread_key
"/chat:v1/chat.media.download": download_medium
"/chat:v1/chat.media.download/resourceName": resource_name
"/chat:v1/chat.rooms.conversations.messages": messages_room_conversation
"/chat:v1/chat.rooms.conversations.messages.create": create_room_conversation_message
"/chat:v1/chat.rooms.conversations.messages.create/parent": parent
"/chat:v1/chat.rooms.conversations.messages.create/threadKey": thread_key
"/chat:v1/chat.rooms.conversations.messages/parent": parent
"/chat:v1/chat.rooms.conversations.messages/threadKey": thread_key
"/chat:v1/chat.rooms.messages": messages_room
"/chat:v1/chat.rooms.messages.create": create_room_message
"/chat:v1/chat.rooms.messages.create/parent": parent
"/chat:v1/chat.rooms.messages.create/threadKey": thread_key
"/chat:v1/chat.rooms.messages/parent": parent
"/chat:v1/chat.rooms.messages/threadKey": thread_key
"/chat:v1/chat.spaces.get": get_space
"/chat:v1/chat.spaces.get/name": name
"/chat:v1/chat.spaces.list": list_spaces
Expand Down
2 changes: 1 addition & 1 deletion generated/google/apis/chat_v1.rb
Expand Up @@ -25,7 +25,7 @@ module Apis
# @see https://developers.google.com/hangouts/chat
module ChatV1
VERSION = 'V1'
REVISION = '20201028'
REVISION = '20201127'
end
end
end
176 changes: 176 additions & 0 deletions generated/google/apis/chat_v1/service.rb
Expand Up @@ -47,6 +47,94 @@ def initialize
@batch_path = 'batch'
end

# Legacy path for creating message. Calling these will result in a BadRequest
# response.
# @param [String] parent
# Required. Space resource name, in the form "spaces/*". Example: spaces/
# AAAAMpdlehY
# @param [Google::Apis::ChatV1::Message] message_object
# @param [String] thread_key
# Opaque thread identifier string that can be specified to group messages into a
# single thread. If this is the first message with a given thread identifier, a
# new thread is created. Subsequent messages with the same thread identifier
# will be posted into the same thread. This relieves bots and webhooks from
# having to store the Hangouts Chat thread ID of a thread (created earlier by
# them) to post further updates to it. Has no effect if thread field,
# corresponding to an existing thread, is set in message.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ChatV1::Message] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ChatV1::Message]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def messages_dm(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+parent}/messages', options)
command.request_representation = Google::Apis::ChatV1::Message::Representation
command.request_object = message_object
command.response_representation = Google::Apis::ChatV1::Message::Representation
command.response_class = Google::Apis::ChatV1::Message
command.params['parent'] = parent unless parent.nil?
command.query['threadKey'] = thread_key unless thread_key.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end

# Legacy path for creating message. Calling these will result in a BadRequest
# response.
# @param [String] parent
# Required. Space resource name, in the form "spaces/*". Example: spaces/
# AAAAMpdlehY
# @param [Google::Apis::ChatV1::Message] message_object
# @param [String] thread_key
# Opaque thread identifier string that can be specified to group messages into a
# single thread. If this is the first message with a given thread identifier, a
# new thread is created. Subsequent messages with the same thread identifier
# will be posted into the same thread. This relieves bots and webhooks from
# having to store the Hangouts Chat thread ID of a thread (created earlier by
# them) to post further updates to it. Has no effect if thread field,
# corresponding to an existing thread, is set in message.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ChatV1::Message] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ChatV1::Message]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def messages_dm_conversation(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+parent}/messages', options)
command.request_representation = Google::Apis::ChatV1::Message::Representation
command.request_object = message_object
command.response_representation = Google::Apis::ChatV1::Message::Representation
command.response_class = Google::Apis::ChatV1::Message
command.params['parent'] = parent unless parent.nil?
command.query['threadKey'] = thread_key unless thread_key.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end

# Downloads media. Download is supported on the URI `/v1/media/`+name`?alt=media`
# .
# @param [String] resource_name
Expand Down Expand Up @@ -85,6 +173,94 @@ def download_medium(resource_name, fields: nil, quota_user: nil, download_dest:
execute_or_queue_command(command, &block)
end

# Legacy path for creating message. Calling these will result in a BadRequest
# response.
# @param [String] parent
# Required. Space resource name, in the form "spaces/*". Example: spaces/
# AAAAMpdlehY
# @param [Google::Apis::ChatV1::Message] message_object
# @param [String] thread_key
# Opaque thread identifier string that can be specified to group messages into a
# single thread. If this is the first message with a given thread identifier, a
# new thread is created. Subsequent messages with the same thread identifier
# will be posted into the same thread. This relieves bots and webhooks from
# having to store the Hangouts Chat thread ID of a thread (created earlier by
# them) to post further updates to it. Has no effect if thread field,
# corresponding to an existing thread, is set in message.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ChatV1::Message] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ChatV1::Message]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def messages_room(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+parent}/messages', options)
command.request_representation = Google::Apis::ChatV1::Message::Representation
command.request_object = message_object
command.response_representation = Google::Apis::ChatV1::Message::Representation
command.response_class = Google::Apis::ChatV1::Message
command.params['parent'] = parent unless parent.nil?
command.query['threadKey'] = thread_key unless thread_key.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end

# Legacy path for creating message. Calling these will result in a BadRequest
# response.
# @param [String] parent
# Required. Space resource name, in the form "spaces/*". Example: spaces/
# AAAAMpdlehY
# @param [Google::Apis::ChatV1::Message] message_object
# @param [String] thread_key
# Opaque thread identifier string that can be specified to group messages into a
# single thread. If this is the first message with a given thread identifier, a
# new thread is created. Subsequent messages with the same thread identifier
# will be posted into the same thread. This relieves bots and webhooks from
# having to store the Hangouts Chat thread ID of a thread (created earlier by
# them) to post further updates to it. Has no effect if thread field,
# corresponding to an existing thread, is set in message.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ChatV1::Message] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ChatV1::Message]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def messages_room_conversation(parent, message_object = nil, thread_key: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+parent}/messages', options)
command.request_representation = Google::Apis::ChatV1::Message::Representation
command.request_object = message_object
command.response_representation = Google::Apis::ChatV1::Message::Representation
command.response_class = Google::Apis::ChatV1::Message
command.params['parent'] = parent unless parent.nil?
command.query['threadKey'] = thread_key unless thread_key.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end

# Returns a space.
# @param [String] name
# Required. Resource name of the space, in the form "spaces/*". Example: spaces/
Expand Down
2 changes: 1 addition & 1 deletion generated/google/apis/chat_v1/synth.metadata
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/google-api-ruby-client.git",
"sha": "21445baae8adc1d75f0cde5c3cd6cebcc971f757"
"sha": "0f920ae5ebe394e34a9ce17dd866bea7a4621f7d"
}
}
]
Expand Down

0 comments on commit 5043725

Please sign in to comment.