/
YuriyMaksimov
/
Lab3
Обзор
Документация
Войти
/
YuriyMaksimov
/
Lab3
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
lib/openapi_client/api/auth_api.rb
145 строк
5 KB
Yuriy
init
12 дек 2025, 23:07
12 дек 2025, 23:07
7df06fa
Код
Авторство
О чём код?
=begin #Task API v1 #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: v1 Generated by: https://openapi-generator.tech Generator version: 7.17.0 =end require 'cgi' require 'debug' module OpenapiClient class AuthApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key Unique key for idempotent POST requests # @option opts [LoginDto] :login_dto # @return [nil] def api_v1_auth_login_post(opts = {}) api_v1_auth_login_post_with_http_info(opts) nil end # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key Unique key for idempotent POST requests # @option opts [LoginDto] :login_dto # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def api_v1_auth_login_post_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthApi.api_v1_auth_login_post ...' end # resource path local_var_path = '/api/v1/auth/login' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'login_dto']) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Bearer'] new_options = opts.merge( :operation => :"AuthApi.api_v1_auth_login_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthApi#api_v1_auth_login_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key Unique key for idempotent POST requests # @option opts [RegisterDto] :register_dto # @return [nil] def api_v1_auth_register_post(opts = {}) api_v1_auth_register_post_with_http_info(opts) nil end # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key Unique key for idempotent POST requests # @option opts [RegisterDto] :register_dto # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def api_v1_auth_register_post_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthApi.api_v1_auth_register_post ...' end # resource path local_var_path = '/api/v1/auth/register' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'register_dto']) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Bearer'] new_options = opts.merge( :operation => :"AuthApi.api_v1_auth_register_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthApi#api_v1_auth_register_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end