class Teleswagger::ChatsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/teleswagger/api/chats_api.rb, line 30
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

delete_chat_photo(token, chat_id, opts = {}) click to toggle source

@param token bot's token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 40
def delete_chat_photo(token, chat_id, opts = {})
  data, _status_code, _headers = delete_chat_photo_with_http_info(token, chat_id, opts)
  return data
end
delete_chat_photo_with_http_info(token, chat_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 51
def delete_chat_photo_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.delete_chat_photo ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.delete_chat_photo" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.delete_chat_photo" if chat_id.nil?
  # resource path
  local_var_path = "/bot{token}/deleteChatPhoto".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#delete_chat_photo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_chat_sticker_set(token, chat_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 102
def delete_chat_sticker_set(token, chat_id, opts = {})
  data, _status_code, _headers = delete_chat_sticker_set_with_http_info(token, chat_id, opts)
  return data
end
delete_chat_sticker_set_with_http_info(token, chat_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 113
def delete_chat_sticker_set_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.delete_chat_sticker_set ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.delete_chat_sticker_set" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.delete_chat_sticker_set" if chat_id.nil?
  # resource path
  local_var_path = "/bot{token}/deleteChatStickerSet".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#delete_chat_sticker_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_chat(token, chat_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [InlineResponse2001]

# File lib/teleswagger/api/chats_api.rb, line 226
def get_chat(token, chat_id, opts = {})
  data, _status_code, _headers = get_chat_with_http_info(token, chat_id, opts)
  return data
end
get_chat_administrators(token, chat_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [InlineResponse2002]

# File lib/teleswagger/api/chats_api.rb, line 288
def get_chat_administrators(token, chat_id, opts = {})
  data, _status_code, _headers = get_chat_administrators_with_http_info(token, chat_id, opts)
  return data
end
get_chat_administrators_with_http_info(token, chat_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [Array<(InlineResponse2002, Fixnum, Hash)>] InlineResponse2002 data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 299
def get_chat_administrators_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.get_chat_administrators ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.get_chat_administrators" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.get_chat_administrators" if chat_id.nil?
  # resource path
  local_var_path = "/bot{token}/getChatAdministrators".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2002')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#get_chat_administrators\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_chat_member(token, chat_id, user_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param user_id @param [Hash] opts the optional parameters @return [InlineResponse2003]

# File lib/teleswagger/api/chats_api.rb, line 351
def get_chat_member(token, chat_id, user_id, opts = {})
  data, _status_code, _headers = get_chat_member_with_http_info(token, chat_id, user_id, opts)
  return data
end
get_chat_member_with_http_info(token, chat_id, user_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param user_id @param [Hash] opts the optional parameters @return [Array<(InlineResponse2003, Fixnum, Hash)>] InlineResponse2003 data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 363
def get_chat_member_with_http_info(token, chat_id, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.get_chat_member ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.get_chat_member" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.get_chat_member" if chat_id.nil?
  # verify the required parameter 'user_id' is set
  fail ArgumentError, "Missing the required parameter 'user_id' when calling ChatsApi.get_chat_member" if user_id.nil?
  # resource path
  local_var_path = "/bot{token}/getChatMember".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'user_id'] = user_id

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2003')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#get_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_chat_members_count(token, chat_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [InlineResponse2004]

# File lib/teleswagger/api/chats_api.rb, line 417
def get_chat_members_count(token, chat_id, opts = {})
  data, _status_code, _headers = get_chat_members_count_with_http_info(token, chat_id, opts)
  return data
end
get_chat_members_count_with_http_info(token, chat_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [Array<(InlineResponse2004, Fixnum, Hash)>] InlineResponse2004 data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 428
def get_chat_members_count_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.get_chat_members_count ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.get_chat_members_count" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.get_chat_members_count" if chat_id.nil?
  # resource path
  local_var_path = "/bot{token}/getChatMembersCount".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2004')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#get_chat_members_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_chat_with_http_info(token, chat_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [Array<(InlineResponse2001, Fixnum, Hash)>] InlineResponse2001 data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 237
def get_chat_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.get_chat ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.get_chat" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.get_chat" if chat_id.nil?
  # resource path
  local_var_path = "/bot{token}/getChat".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2001')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#get_chat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
kick_chat_member(token, chat_id, user_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param user_id @param [Hash] opts the optional parameters @option opts [Integer] :until_date @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 481
def kick_chat_member(token, chat_id, user_id, opts = {})
  data, _status_code, _headers = kick_chat_member_with_http_info(token, chat_id, user_id, opts)
  return data
end
kick_chat_member_with_http_info(token, chat_id, user_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param user_id @param [Hash] opts the optional parameters @option opts [Integer] :until_date @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 494
def kick_chat_member_with_http_info(token, chat_id, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.kick_chat_member ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.kick_chat_member" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.kick_chat_member" if chat_id.nil?
  # verify the required parameter 'user_id' is set
  fail ArgumentError, "Missing the required parameter 'user_id' when calling ChatsApi.kick_chat_member" if user_id.nil?
  # resource path
  local_var_path = "/bot{token}/kickChatMember".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'user_id'] = user_id
  query_params[:'until_date'] = opts[:'until_date'] if !opts[:'until_date'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#kick_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
leave_chat(token, chat_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 549
def leave_chat(token, chat_id, opts = {})
  data, _status_code, _headers = leave_chat_with_http_info(token, chat_id, opts)
  return data
end
leave_chat_with_http_info(token, chat_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 560
def leave_chat_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.leave_chat ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.leave_chat" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.leave_chat" if chat_id.nil?
  # resource path
  local_var_path = "/bot{token}/leaveChat".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#leave_chat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
pin_chat_message(token, chat_id, message_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param message_id @param [Hash] opts the optional parameters @option opts [BOOLEAN] :disable_notification @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 613
def pin_chat_message(token, chat_id, message_id, opts = {})
  data, _status_code, _headers = pin_chat_message_with_http_info(token, chat_id, message_id, opts)
  return data
end
pin_chat_message_with_http_info(token, chat_id, message_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param message_id @param [Hash] opts the optional parameters @option opts [BOOLEAN] :disable_notification @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 626
def pin_chat_message_with_http_info(token, chat_id, message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.pin_chat_message ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.pin_chat_message" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.pin_chat_message" if chat_id.nil?
  # verify the required parameter 'message_id' is set
  fail ArgumentError, "Missing the required parameter 'message_id' when calling ChatsApi.pin_chat_message" if message_id.nil?
  # resource path
  local_var_path = "/bot{token}/pinChatMessage".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'message_id'] = message_id
  query_params[:'disable_notification'] = opts[:'disable_notification'] if !opts[:'disable_notification'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#pin_chat_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
promote_chat_member(token, body, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param body @param [Hash] opts the optional parameters @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 681
def promote_chat_member(token, body, opts = {})
  data, _status_code, _headers = promote_chat_member_with_http_info(token, body, opts)
  return data
end
promote_chat_member_with_http_info(token, body, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param body @param [Hash] opts the optional parameters @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 692
def promote_chat_member_with_http_info(token, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.promote_chat_member ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.promote_chat_member" if token.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling ChatsApi.promote_chat_member" if body.nil?
  # resource path
  local_var_path = "/bot{token}/promoteChatMember".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#promote_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
restrict_chat_member(token, body, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param body @param [Hash] opts the optional parameters @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 742
def restrict_chat_member(token, body, opts = {})
  data, _status_code, _headers = restrict_chat_member_with_http_info(token, body, opts)
  return data
end
restrict_chat_member_with_http_info(token, body, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param body @param [Hash] opts the optional parameters @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 753
def restrict_chat_member_with_http_info(token, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.restrict_chat_member ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.restrict_chat_member" if token.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling ChatsApi.restrict_chat_member" if body.nil?
  # resource path
  local_var_path = "/bot{token}/restrictChatMember".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#restrict_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
send_chat_action(token, chat_id, action, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param action @param [Hash] opts the optional parameters @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 804
def send_chat_action(token, chat_id, action, opts = {})
  data, _status_code, _headers = send_chat_action_with_http_info(token, chat_id, action, opts)
  return data
end
send_chat_action_with_http_info(token, chat_id, action, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param action @param [Hash] opts the optional parameters @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 816
def send_chat_action_with_http_info(token, chat_id, action, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.send_chat_action ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.send_chat_action" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.send_chat_action" if chat_id.nil?
  # verify the required parameter 'action' is set
  fail ArgumentError, "Missing the required parameter 'action' when calling ChatsApi.send_chat_action" if action.nil?
  # verify enum value
  unless ['typing', 'upload_photo', 'record_video', 'upload_video', 'record_audio', 'upload_audio', 'upload_document', 'find_location', 'record_video_note', 'upload_video_note'].include?(action)
    fail ArgumentError, "invalid value for 'action', must be one of typing, upload_photo, record_video, upload_video, record_audio, upload_audio, upload_document, find_location, record_video_note, upload_video_note"
  end
  # resource path
  local_var_path = "/bot{token}/sendChatAction".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'action'] = action

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#send_chat_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
set_chat_description(token, chat_id, description, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param description @param [Hash] opts the optional parameters @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 875
def set_chat_description(token, chat_id, description, opts = {})
  data, _status_code, _headers = set_chat_description_with_http_info(token, chat_id, description, opts)
  return data
end
set_chat_description_with_http_info(token, chat_id, description, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param description @param [Hash] opts the optional parameters @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 887
def set_chat_description_with_http_info(token, chat_id, description, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.set_chat_description ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.set_chat_description" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.set_chat_description" if chat_id.nil?
  # verify the required parameter 'description' is set
  fail ArgumentError, "Missing the required parameter 'description' when calling ChatsApi.set_chat_description" if description.nil?
  # resource path
  local_var_path = "/bot{token}/setChatDescription".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'description'] = description

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#set_chat_description\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
set_chat_photo(token, chat_id, photo, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param photo @param [Hash] opts the optional parameters @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 942
def set_chat_photo(token, chat_id, photo, opts = {})
  data, _status_code, _headers = set_chat_photo_with_http_info(token, chat_id, photo, opts)
  return data
end
set_chat_photo_with_http_info(token, chat_id, photo, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param photo @param [Hash] opts the optional parameters @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 954
def set_chat_photo_with_http_info(token, chat_id, photo, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.set_chat_photo ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.set_chat_photo" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.set_chat_photo" if chat_id.nil?
  # verify the required parameter 'photo' is set
  fail ArgumentError, "Missing the required parameter 'photo' when calling ChatsApi.set_chat_photo" if photo.nil?
  # resource path
  local_var_path = "/bot{token}/setChatPhoto".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['multipart/form-data']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}
  form_params["chat_id"] = chat_id
  form_params["photo"] = photo

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#set_chat_photo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
set_chat_sticker_set(token, chat_id, sticker_set_name, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param sticker_set_name @param [Hash] opts the optional parameters @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 1009
def set_chat_sticker_set(token, chat_id, sticker_set_name, opts = {})
  data, _status_code, _headers = set_chat_sticker_set_with_http_info(token, chat_id, sticker_set_name, opts)
  return data
end
set_chat_sticker_set_with_http_info(token, chat_id, sticker_set_name, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param sticker_set_name @param [Hash] opts the optional parameters @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 1021
def set_chat_sticker_set_with_http_info(token, chat_id, sticker_set_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.set_chat_sticker_set ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.set_chat_sticker_set" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.set_chat_sticker_set" if chat_id.nil?
  # verify the required parameter 'sticker_set_name' is set
  fail ArgumentError, "Missing the required parameter 'sticker_set_name' when calling ChatsApi.set_chat_sticker_set" if sticker_set_name.nil?
  # resource path
  local_var_path = "/bot{token}/setChatStickerSet".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'sticker_set_name'] = sticker_set_name

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#set_chat_sticker_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
set_chat_title(token, chat_id, title, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param title @param [Hash] opts the optional parameters @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 1076
def set_chat_title(token, chat_id, title, opts = {})
  data, _status_code, _headers = set_chat_title_with_http_info(token, chat_id, title, opts)
  return data
end
set_chat_title_with_http_info(token, chat_id, title, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param title @param [Hash] opts the optional parameters @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 1088
def set_chat_title_with_http_info(token, chat_id, title, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.set_chat_title ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.set_chat_title" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.set_chat_title" if chat_id.nil?
  # verify the required parameter 'title' is set
  fail ArgumentError, "Missing the required parameter 'title' when calling ChatsApi.set_chat_title" if title.nil?
  # resource path
  local_var_path = "/bot{token}/setChatTitle".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'title'] = title

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#set_chat_title\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
unban_chat_member(token, chat_id, user_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param user_id @param [Hash] opts the optional parameters @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 1143
def unban_chat_member(token, chat_id, user_id, opts = {})
  data, _status_code, _headers = unban_chat_member_with_http_info(token, chat_id, user_id, opts)
  return data
end
unban_chat_member_with_http_info(token, chat_id, user_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param user_id @param [Hash] opts the optional parameters @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 1155
def unban_chat_member_with_http_info(token, chat_id, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.unban_chat_member ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.unban_chat_member" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.unban_chat_member" if chat_id.nil?
  # verify the required parameter 'user_id' is set
  fail ArgumentError, "Missing the required parameter 'user_id' when calling ChatsApi.unban_chat_member" if user_id.nil?
  # resource path
  local_var_path = "/bot{token}/unbanChatMember".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'user_id'] = user_id

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#unban_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
unpin_chat_message(token, chat_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [ResponseBool]

# File lib/teleswagger/api/chats_api.rb, line 1209
def unpin_chat_message(token, chat_id, opts = {})
  data, _status_code, _headers = unpin_chat_message_with_http_info(token, chat_id, opts)
  return data
end
unpin_chat_message_with_http_info(token, chat_id, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param chat_id @param [Hash] opts the optional parameters @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/chats_api.rb, line 1220
def unpin_chat_message_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.unpin_chat_message ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.unpin_chat_message" if token.nil?
  # verify the required parameter 'chat_id' is set
  fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.unpin_chat_message" if chat_id.nil?
  # resource path
  local_var_path = "/bot{token}/unpinChatMessage".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#unpin_chat_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end