Module: JPSClient::API::Publisher

Included in:
Client
Defined in:
lib/jpsclient/api/publisher.rb

Overview

Publisher 相关 API 自动生成的模块,处理 publisher 相关接口

Instance Method Summary collapse

Instance Method Details

#create_detail(params: {}) ⇒ Hash

Create Detail

Parameters:

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

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/jpsclient/api/publisher.rb', line 123

def create_detail(params: {})
  config = @request_config && @request_config["publisher_detail"]
  raise JPSClient::ExceptionError, "Missing config for publisher_detail" 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_publishers(params: {}) ⇒ Hash

Create Publishers

Parameters:

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

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



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

def create_publishers(params: {})
  config = @request_config && @request_config["publisher_publishers"]
  raise JPSClient::ExceptionError, "Missing config for publisher_publishers" 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_stream(params: {}) ⇒ Hash

Create Stream

Parameters:

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

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



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

def create_stream(params: {})
  config = @request_config && @request_config["publisher_stream"]
  raise JPSClient::ExceptionError, "Missing config for publisher_stream" 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:



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/jpsclient/api/publisher.rb', line 101

def create_weights(params: {})
  config = @request_config && @request_config["publisher_weights"]
  raise JPSClient::ExceptionError, "Missing config for publisher_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

#delete_publisher(publisherId:, params: {}) ⇒ Hash

Delete Publisher

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
51
# File 'lib/jpsclient/api/publisher.rb', line 34

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

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

  response = @http_client.delete(path)
  result = JPSClient::Response.new(response)

  if result.need_login?
    (force_login: true)
    response = @http_client.delete(path)
    result = JPSClient::Response.new(response)
  end

  return result.to_h
end

#get_store_applications_detail(publisherId:, params: {}) ⇒ Hash

Get Store Applications Detail

Parameters:

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

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/jpsclient/api/publisher.rb', line 145

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

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

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

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

  return result.to_h
end

#update_publisher(publisherId:, params: {}) ⇒ Hash

Update Publisher

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/publisher.rb', line 11

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

  path = config["url"]
  path = path.gsub("{publisherId}", publisherId.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