Class: Kleister::ProfileApi

Inherits:
Object
  • Object
show all
Defined in:
lib/kleister/api/profile_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ProfileApi

Returns a new instance of ProfileApi.



17
18
19
# File 'lib/kleister/api/profile_api.rb', line 17

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



15
16
17
# File 'lib/kleister/api/profile_api.rb', line 15

def api_client
  @api_client
end

Instance Method Details

#show_profile(opts = {}) ⇒ Profile

Fetch profile details of the personal account

Parameters:

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

    the optional parameters

Returns:



24
25
26
27
# File 'lib/kleister/api/profile_api.rb', line 24

def show_profile(opts = {})
  data, _status_code, _headers = show_profile_with_http_info(opts)
  data
end

#show_profile_with_http_info(opts = {}) ⇒ Array<(Profile, Integer, Hash)>

Fetch profile details of the personal account

Parameters:

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

    the optional parameters

Returns:

  • (Array<(Profile, Integer, Hash)>)

    Profile data, response status code and response headers



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/kleister/api/profile_api.rb', line 32

def show_profile_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.show_profile ...'
  end
  # resource path
  local_var_path = '/profile/self'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Profile'

  # auth_names
  auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]

  new_options = opts.merge(
    operation: :'ProfileApi.show_profile',
    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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfileApi#show_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#token_profile(opts = {}) ⇒ AuthToken

Retrieve an unlimited auth token

Parameters:

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

    the optional parameters

Returns:



79
80
81
82
# File 'lib/kleister/api/profile_api.rb', line 79

def token_profile(opts = {})
  data, _status_code, _headers = token_profile_with_http_info(opts)
  data
end

#token_profile_with_http_info(opts = {}) ⇒ Array<(AuthToken, Integer, Hash)>

Retrieve an unlimited auth token

Parameters:

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

    the optional parameters

Returns:

  • (Array<(AuthToken, Integer, Hash)>)

    AuthToken data, response status code and response headers



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/kleister/api/profile_api.rb', line 87

def token_profile_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.token_profile ...'
  end
  # resource path
  local_var_path = '/profile/token'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AuthToken'

  # auth_names
  auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]

  new_options = opts.merge(
    operation: :'ProfileApi.token_profile',
    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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfileApi#token_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#update_profile(profile, opts = {}) ⇒ Profile

Update your own profile information

Parameters:

  • profile (Profile)

    The profile data to update

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

    the optional parameters

Returns:



135
136
137
138
# File 'lib/kleister/api/profile_api.rb', line 135

def update_profile(profile, opts = {})
  data, _status_code, _headers = update_profile_with_http_info(profile, opts)
  data
end

#update_profile_with_http_info(profile, opts = {}) ⇒ Array<(Profile, Integer, Hash)>

Update your own profile information

Parameters:

  • profile (Profile)

    The profile data to update

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

    the optional parameters

Returns:

  • (Array<(Profile, Integer, Hash)>)

    Profile data, response status code and response headers



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/kleister/api/profile_api.rb', line 144

def update_profile_with_http_info(profile, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.update_profile ...'
  end
  # verify the required parameter 'profile' is set
  if @api_client.config.client_side_validation && profile.nil?
    raise ArgumentError, "Missing the required parameter 'profile' when calling ProfileApi.update_profile"
  end

  # resource path
  local_var_path = '/profile/self'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  unless content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(profile)

  # return_type
  return_type = opts[:debug_return_type] || 'Profile'

  # auth_names
  auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]

  new_options = opts.merge(
    operation: :'ProfileApi.update_profile',
    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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfileApi#update_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end