Module: JPSClient::API::SketchCategory

Defined in:
lib/jpsclient/api/archived_outdated/sketch_category.rb

Overview

SketchCategory 相关 API 自动生成的模块,处理 sketch_category 相关接口

Instance Method Summary collapse

Instance Method Details

#create_sketch_categories(params: {}) ⇒ Hash

Create Sketch Categories

Parameters:

  • params (Hash) (defaults to: {})

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/jpsclient/api/archived_outdated/sketch_category.rb', line 78

def create_sketch_categories(params: {})
  config = @request_config && @request_config["sketch_category_sketch_categories"]
  raise JPSClient::ExceptionError, "Missing config for sketch_category_sketch_categories" unless config && config["url"]

  path = config["url"]

  response = @http_client.post(path, body: params)
  result = JPSClient::Response.new(response)

  if result.need_login?
    (force_login: true)
    response = @http_client.post(path, body: params)
    result = JPSClient::Response.new(response)
  end

  return result.to_h
end

#create_sketch_category(params: {}) ⇒ Hash

Create Sketch Category

Parameters:

  • params (Hash) (defaults to: {})

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/jpsclient/api/archived_outdated/sketch_category.rb', line 34

def create_sketch_category(params: {})
  config = @request_config && @request_config["sketch_category_sketch_category"]
  raise JPSClient::ExceptionError, "Missing config for sketch_category_sketch_category" unless config && config["url"]

  path = config["url"]

  response = @http_client.post(path, body: params)
  result = JPSClient::Response.new(response)

  if result.need_login?
    (force_login: true)
    response = @http_client.post(path, body: params)
    result = JPSClient::Response.new(response)
  end

  return result.to_h
end

#create_weights(params: {}) ⇒ Hash

Create Weights

Parameters:

  • params (Hash) (defaults to: {})

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/jpsclient/api/archived_outdated/sketch_category.rb', line 56

def create_weights(params: {})
  config = @request_config && @request_config["sketch_category_weights"]
  raise JPSClient::ExceptionError, "Missing config for sketch_category_weights" unless config && config["url"]

  path = config["url"]

  response = @http_client.post(path, body: params)
  result = JPSClient::Response.new(response)

  if result.need_login?
    (force_login: true)
    response = @http_client.post(path, body: params)
    result = JPSClient::Response.new(response)
  end

  return result.to_h
end

#update_sketch_category(categoryId:, params: {}) ⇒ Hash

Update Sketch Category

Parameters:

  • params (Hash) (defaults to: {})

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/jpsclient/api/archived_outdated/sketch_category.rb', line 11

def update_sketch_category(categoryId:, params: {})
  config = @request_config && @request_config["sketch_category_sketch_category"]
  raise JPSClient::ExceptionError, "Missing config for sketch_category_sketch_category" unless config && config["url"]

  path = config["url"]
  path = path.gsub("{categoryId}", categoryId.to_s)

  response = @http_client.put(path, body: params)
  result = JPSClient::Response.new(response)

  if result.need_login?
    (force_login: true)
    response = @http_client.put(path, body: params)
    result = JPSClient::Response.new(response)
  end

  return result.to_h
end