Class: SmoochApi::MenuApi

Inherits:
Object
  • Object
show all
Defined in:
lib/smooch-api/api/menu_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MenuApi

Returns a new instance of MenuApi.



19
20
21
# File 'lib/smooch-api/api/menu_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/smooch-api/api/menu_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_menu(appId, opts = {}) ⇒ MenuResponse

Remove the specified app’s menu.

Parameters:

  • appId

    Identifies the app.

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/smooch-api/api/menu_api.rb', line 28

def delete_menu(appId, opts = {})
  data, _status_code, _headers = delete_menu_with_http_info(appId, opts)
  return data
end

#delete_menu_with_http_info(appId, opts = {}) ⇒ Array<(MenuResponse, Fixnum, Hash)>

Remove the specified app’s menu.

Parameters:

  • appId

    Identifies the app.

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

    the optional parameters

Returns:

  • (Array<(MenuResponse, Fixnum, Hash)>)

    MenuResponse data, response status code and response headers



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
75
76
# File 'lib/smooch-api/api/menu_api.rb', line 38

def delete_menu_with_http_info(appId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MenuApi.delete_menu ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling MenuApi.delete_menu"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/menu".sub('{' + 'appId' + '}', appId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'MenuResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MenuApi#delete_menu\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_menu(appId, opts = {}) ⇒ MenuResponse

Get the specified app’s menu.

Parameters:

  • appId

    Identifies the app.

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

    the optional parameters

Returns:



83
84
85
86
# File 'lib/smooch-api/api/menu_api.rb', line 83

def get_menu(appId, opts = {})
  data, _status_code, _headers = get_menu_with_http_info(appId, opts)
  return data
end

#get_menu_with_http_info(appId, opts = {}) ⇒ Array<(MenuResponse, Fixnum, Hash)>

Get the specified app’s menu.

Parameters:

  • appId

    Identifies the app.

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

    the optional parameters

Returns:

  • (Array<(MenuResponse, Fixnum, Hash)>)

    MenuResponse data, response status code and response headers



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
130
131
# File 'lib/smooch-api/api/menu_api.rb', line 93

def get_menu_with_http_info(appId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MenuApi.get_menu ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling MenuApi.get_menu"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/menu".sub('{' + 'appId' + '}', appId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  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 => 'MenuResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MenuApi#get_menu\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_menu(appId, menuUpdateBody, opts = {}) ⇒ MenuResponse

Configure the specified app’s menu.

Parameters:

  • appId

    Identifies the app.

  • menuUpdateBody

    Body for a updateMenu request.

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

    the optional parameters

Returns:



139
140
141
142
# File 'lib/smooch-api/api/menu_api.rb', line 139

def update_menu(appId, menuUpdateBody, opts = {})
  data, _status_code, _headers = update_menu_with_http_info(appId, menuUpdateBody, opts)
  return data
end

#update_menu_with_http_info(appId, menuUpdateBody, opts = {}) ⇒ Array<(MenuResponse, Fixnum, Hash)>

Configure the specified app’s menu.

Parameters:

  • appId

    Identifies the app.

  • menuUpdateBody

    Body for a updateMenu request.

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

    the optional parameters

Returns:

  • (Array<(MenuResponse, Fixnum, Hash)>)

    MenuResponse data, response status code and response headers



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
# File 'lib/smooch-api/api/menu_api.rb', line 150

def update_menu_with_http_info(appId, menuUpdateBody, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MenuApi.update_menu ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling MenuApi.update_menu"
  end
  # verify the required parameter 'menuUpdateBody' is set
  if @api_client.config.client_side_validation && menuUpdateBody.nil?
    fail ArgumentError, "Missing the required parameter 'menuUpdateBody' when calling MenuApi.update_menu"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/menu".sub('{' + 'appId' + '}', appId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(menuUpdateBody)
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'MenuResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MenuApi#update_menu\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end