class Teleswagger::StickersApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

add_sticker_to_set(token, user_id, name, png_sticker, emojis, opts = {}) click to toggle source

@param token bot's token to authorize the request @param user_id @param name @param png_sticker @param emojis @param [Hash] opts the optional parameters @option opts [String] :mask_position Serialized to JSON MaskPosition @return [ResponseBool]

# File lib/teleswagger/api/stickers_api.rb, line 44
def add_sticker_to_set(token, user_id, name, png_sticker, emojis, opts = {})
  data, _status_code, _headers = add_sticker_to_set_with_http_info(token, user_id, name, png_sticker, emojis, opts)
  return data
end
add_sticker_to_set_with_http_info(token, user_id, name, png_sticker, emojis, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param user_id @param name @param png_sticker @param emojis @param [Hash] opts the optional parameters @option opts [String] :mask_position Serialized to JSON MaskPosition @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers

# File lib/teleswagger/api/stickers_api.rb, line 59
def add_sticker_to_set_with_http_info(token, user_id, name, png_sticker, emojis, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StickersApi.add_sticker_to_set ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling StickersApi.add_sticker_to_set" if token.nil?
  # verify the required parameter 'user_id' is set
  fail ArgumentError, "Missing the required parameter 'user_id' when calling StickersApi.add_sticker_to_set" if user_id.nil?
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling StickersApi.add_sticker_to_set" if name.nil?
  # verify the required parameter 'png_sticker' is set
  fail ArgumentError, "Missing the required parameter 'png_sticker' when calling StickersApi.add_sticker_to_set" if png_sticker.nil?
  # verify the required parameter 'emojis' is set
  fail ArgumentError, "Missing the required parameter 'emojis' when calling StickersApi.add_sticker_to_set" if emojis.nil?
  # resource path
  local_var_path = "/bot{token}/addStickerToSet".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["user_id"] = user_id
  form_params["name"] = name
  form_params["png_sticker"] = png_sticker
  form_params["emojis"] = emojis
  form_params["mask_position"] = opts[:'mask_position'] if !opts[:'mask_position'].nil?

  # 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: StickersApi#add_sticker_to_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_new_sticker_set(token, user_id, name, title, png_sticker, emojis, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param user_id @param name @param title @param png_sticker @param emojis @param [Hash] opts the optional parameters @option opts [BOOLEAN] :is_masks @option opts [String] :mask_position Serialized to JSON MaskPosition @return [File]

# File lib/teleswagger/api/stickers_api.rb, line 187
def create_new_sticker_set(token, user_id, name, title, png_sticker, emojis, opts = {})
  data, _status_code, _headers = create_new_sticker_set_with_http_info(token, user_id, name, title, png_sticker, emojis, opts)
  return data
end
create_new_sticker_set_with_http_info(token, user_id, name, title, png_sticker, emojis, opts = {}) click to toggle source

@param token bot&#39;s token to authorize the request @param user_id @param name @param title @param png_sticker @param emojis @param [Hash] opts the optional parameters @option opts [BOOLEAN] :is_masks @option opts [String] :mask_position Serialized to JSON MaskPosition @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers

# File lib/teleswagger/api/stickers_api.rb, line 204
def create_new_sticker_set_with_http_info(token, user_id, name, title, png_sticker, emojis, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StickersApi.create_new_sticker_set ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling StickersApi.create_new_sticker_set" if token.nil?
  # verify the required parameter 'user_id' is set
  fail ArgumentError, "Missing the required parameter 'user_id' when calling StickersApi.create_new_sticker_set" if user_id.nil?
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling StickersApi.create_new_sticker_set" if name.nil?
  # verify the required parameter 'title' is set
  fail ArgumentError, "Missing the required parameter 'title' when calling StickersApi.create_new_sticker_set" if title.nil?
  # verify the required parameter 'png_sticker' is set
  fail ArgumentError, "Missing the required parameter 'png_sticker' when calling StickersApi.create_new_sticker_set" if png_sticker.nil?
  # verify the required parameter 'emojis' is set
  fail ArgumentError, "Missing the required parameter 'emojis' when calling StickersApi.create_new_sticker_set" if emojis.nil?
  # resource path
  local_var_path = "/bot{token}/createNewStickerSet".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["user_id"] = user_id
  form_params["name"] = name
  form_params["title"] = title
  form_params["png_sticker"] = png_sticker
  form_params["emojis"] = emojis
  form_params["is_masks"] = opts[:'is_masks'] if !opts[:'is_masks'].nil?
  form_params["mask_position"] = opts[:'mask_position'] if !opts[:'mask_position'].nil?

  # 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 => 'File')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StickersApi#create_new_sticker_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_sticker_from_set(token, sticker, opts = {}) click to toggle source

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

# File lib/teleswagger/api/stickers_api.rb, line 330
def delete_sticker_from_set(token, sticker, opts = {})
  data, _status_code, _headers = delete_sticker_from_set_with_http_info(token, sticker, opts)
  return data
end
delete_sticker_from_set_with_http_info(token, sticker, opts = {}) click to toggle source

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

# File lib/teleswagger/api/stickers_api.rb, line 341
def delete_sticker_from_set_with_http_info(token, sticker, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StickersApi.delete_sticker_from_set ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling StickersApi.delete_sticker_from_set" if token.nil?
  # verify the required parameter 'sticker' is set
  fail ArgumentError, "Missing the required parameter 'sticker' when calling StickersApi.delete_sticker_from_set" if sticker.nil?
  # resource path
  local_var_path = "/bot{token}/deleteStickerFromSet".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 = {}
  form_params["sticker"] = sticker

  # 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: StickersApi#delete_sticker_from_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_sticker_set(token, name, opts = {}) click to toggle source

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

# File lib/teleswagger/api/stickers_api.rb, line 392
def get_sticker_set(token, name, opts = {})
  data, _status_code, _headers = get_sticker_set_with_http_info(token, name, opts)
  return data
end
get_sticker_set_with_http_info(token, name, opts = {}) click to toggle source

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

# File lib/teleswagger/api/stickers_api.rb, line 403
def get_sticker_set_with_http_info(token, name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StickersApi.get_sticker_set ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling StickersApi.get_sticker_set" if token.nil?
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling StickersApi.get_sticker_set" if name.nil?
  # resource path
  local_var_path = "/bot{token}/getStickerSet".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'name'] = 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 => 'InlineResponse2008')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StickersApi#get_sticker_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
set_sticker_position_in_set(token, sticker, position, opts = {}) click to toggle source

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

# File lib/teleswagger/api/stickers_api.rb, line 455
def set_sticker_position_in_set(token, sticker, position, opts = {})
  data, _status_code, _headers = set_sticker_position_in_set_with_http_info(token, sticker, position, opts)
  return data
end
set_sticker_position_in_set_with_http_info(token, sticker, position, opts = {}) click to toggle source

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

# File lib/teleswagger/api/stickers_api.rb, line 467
def set_sticker_position_in_set_with_http_info(token, sticker, position, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StickersApi.set_sticker_position_in_set ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling StickersApi.set_sticker_position_in_set" if token.nil?
  # verify the required parameter 'sticker' is set
  fail ArgumentError, "Missing the required parameter 'sticker' when calling StickersApi.set_sticker_position_in_set" if sticker.nil?
  # verify the required parameter 'position' is set
  fail ArgumentError, "Missing the required parameter 'position' when calling StickersApi.set_sticker_position_in_set" if position.nil?
  # resource path
  local_var_path = "/bot{token}/setStickerPositionInSet".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 = {}
  form_params["sticker"] = sticker
  form_params["position"] = position

  # 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: StickersApi#set_sticker_position_in_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
upload_sticker_file(token, user_id, png_sticker, opts = {}) click to toggle source

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

# File lib/teleswagger/api/stickers_api.rb, line 522
def upload_sticker_file(token, user_id, png_sticker, opts = {})
  data, _status_code, _headers = upload_sticker_file_with_http_info(token, user_id, png_sticker, opts)
  return data
end
upload_sticker_file_with_http_info(token, user_id, png_sticker, opts = {}) click to toggle source

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

# File lib/teleswagger/api/stickers_api.rb, line 534
def upload_sticker_file_with_http_info(token, user_id, png_sticker, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StickersApi.upload_sticker_file ..."
  end
  # verify the required parameter 'token' is set
  fail ArgumentError, "Missing the required parameter 'token' when calling StickersApi.upload_sticker_file" if token.nil?
  # verify the required parameter 'user_id' is set
  fail ArgumentError, "Missing the required parameter 'user_id' when calling StickersApi.upload_sticker_file" if user_id.nil?
  # verify the required parameter 'png_sticker' is set
  fail ArgumentError, "Missing the required parameter 'png_sticker' when calling StickersApi.upload_sticker_file" if png_sticker.nil?
  # resource path
  local_var_path = "/bot{token}/uploadStickerFile".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["user_id"] = user_id
  form_params["png_sticker"] = png_sticker

  # 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 => 'File')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StickersApi#upload_sticker_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end