lib/purecloud/api/greetings_api.rb in purecloud-0.35.1 vs lib/purecloud/api/greetings_api.rb in purecloud-0.36.1

- old
+ new

@@ -1,44 +1,59 @@ +=begin +PureCloud API + +PureCloud API + +OpenAPI spec version: v1 +Contact: chuck.pulfer@inin.com +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: ININ +http://www.inin.com + +Terms of Service: http://www.inin.com + +=end + require "uri" module PureCloud class GreetingsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end - # Gets an Organization&#39;s Greetings + # Deletes a Greeting with the given GreetingId # + # @param greeting_id Greeting ID # @param [Hash] opts the optional parameters - # @option opts [Integer] :page_size Page size - # @option opts [Integer] :page_number Page number - # @return [DomainEntityListing] - def get_greetings(opts = {}) - data, status_code, headers = get_greetings_with_http_info(opts) + # @return [Greeting] + def delete_greeting_id(greeting_id, opts = {}) + data, status_code, headers = delete_greeting_id_with_http_info(greeting_id, opts) return data end - # Gets an Organization&#39;s Greetings + # Deletes a Greeting with the given GreetingId # + # @param greeting_id Greeting ID # @param [Hash] opts the optional parameters - # @option opts [Integer] :page_size Page size - # @option opts [Integer] :page_number Page number - # @return [Array<(DomainEntityListing, Fixnum, Hash)>] DomainEntityListing data, response status code and response headers - def get_greetings_with_http_info(opts = {}) + # @return [Array<(Greeting, Fixnum, Hash)>] Greeting data, response status code and response headers + def delete_greeting_id_with_http_info(greeting_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: GreetingsApi#get_greetings ..." + @api_client.config.logger.debug "Calling API: GreetingsApi#delete_greeting_id ..." end + # verify the required parameter 'greeting_id' is set + fail "Missing the required parameter 'greeting_id' when calling delete_greeting_id" if greeting_id.nil? + # resource path - path = "/api/v2/greetings".sub('{format}','json') + local_var_path = "/api/v2/greetings/{greetingId}".sub('{format}','json').sub('{' + 'greetingId' + '}', greeting_id.to_s) # query parameters query_params = {} - query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] - query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) @@ -53,50 +68,44 @@ form_params = {} # http body (model) post_body = nil - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:GET, path, + 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 => 'DomainEntityListing') + :return_type => 'Greeting') if @api_client.config.debugging - @api_client.config.logger.debug "API called: GreetingsApi#get_greetings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: GreetingsApi#delete_greeting_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create a Greeting for an Organization + # Get an Organization's DefaultGreetingList # - # @param body The Greeting to create # @param [Hash] opts the optional parameters # @return [DefaultGreetingList] - def post_greetings(body, opts = {}) - data, status_code, headers = post_greetings_with_http_info(body, opts) + def get_defaults(opts = {}) + data, status_code, headers = get_defaults_with_http_info(opts) return data end - # Create a Greeting for an Organization + # Get an Organization&#39;s DefaultGreetingList # - # @param body The Greeting to create # @param [Hash] opts the optional parameters # @return [Array<(DefaultGreetingList, Fixnum, Hash)>] DefaultGreetingList data, response status code and response headers - def post_greetings_with_http_info(body, opts = {}) + def get_defaults_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: GreetingsApi#post_greetings ..." + @api_client.config.logger.debug "Calling API: GreetingsApi#get_defaults ..." end - # verify the required parameter 'body' is set - fail "Missing the required parameter 'body' when calling post_greetings" if body.nil? - # resource path - path = "/api/v2/greetings".sub('{format}','json') + local_var_path = "/api/v2/greetings/defaults".sub('{format}','json') # query parameters query_params = {} # header parameters @@ -112,47 +121,51 @@ # form parameters form_params = {} # http body (model) - post_body = @api_client.object_to_http_body(body) + post_body = nil - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:POST, path, + 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 => 'DefaultGreetingList') if @api_client.config.debugging - @api_client.config.logger.debug "API called: GreetingsApi#post_greetings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: GreetingsApi#get_defaults\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get an Organization&#39;s DefaultGreetingList + # Get a Greeting with the given GreetingId # + # @param greeting_id Greeting ID # @param [Hash] opts the optional parameters - # @return [DefaultGreetingList] - def get_defaults(opts = {}) - data, status_code, headers = get_defaults_with_http_info(opts) + # @return [Greeting] + def get_greeting_id(greeting_id, opts = {}) + data, status_code, headers = get_greeting_id_with_http_info(greeting_id, opts) return data end - # Get an Organization&#39;s DefaultGreetingList + # Get a Greeting with the given GreetingId # + # @param greeting_id Greeting ID # @param [Hash] opts the optional parameters - # @return [Array<(DefaultGreetingList, Fixnum, Hash)>] DefaultGreetingList data, response status code and response headers - def get_defaults_with_http_info(opts = {}) + # @return [Array<(Greeting, Fixnum, Hash)>] Greeting data, response status code and response headers + def get_greeting_id_with_http_info(greeting_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: GreetingsApi#get_defaults ..." + @api_client.config.logger.debug "Calling API: GreetingsApi#get_greeting_id ..." end + # verify the required parameter 'greeting_id' is set + fail "Missing the required parameter 'greeting_id' when calling get_greeting_id" if greeting_id.nil? + # resource path - path = "/api/v2/greetings/defaults".sub('{format}','json') + local_var_path = "/api/v2/greetings/{greetingId}".sub('{format}','json').sub('{' + 'greetingId' + '}', greeting_id.to_s) # query parameters query_params = {} # header parameters @@ -170,53 +183,59 @@ form_params = {} # http body (model) post_body = nil - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:GET, path, + 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 => 'DefaultGreetingList') + :return_type => 'Greeting') if @api_client.config.debugging - @api_client.config.logger.debug "API called: GreetingsApi#get_defaults\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: GreetingsApi#get_greeting_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Update an Organization&#39;s DefaultGreetingList + # Get media playback URI for this greeting # - # @param body The updated defaultGreetingList + # @param greeting_id Greeting ID # @param [Hash] opts the optional parameters - # @return [DefaultGreetingList] - def put_defaults(body, opts = {}) - data, status_code, headers = put_defaults_with_http_info(body, opts) + # @option opts [String] :format_id The desired format (WAV, etc.) (default to WAV) + # @return [GreetingMediaInfo] + def get_greeting_id_media(greeting_id, opts = {}) + data, status_code, headers = get_greeting_id_media_with_http_info(greeting_id, opts) return data end - # Update an Organization&#39;s DefaultGreetingList + # Get media playback URI for this greeting # - # @param body The updated defaultGreetingList + # @param greeting_id Greeting ID # @param [Hash] opts the optional parameters - # @return [Array<(DefaultGreetingList, Fixnum, Hash)>] DefaultGreetingList data, response status code and response headers - def put_defaults_with_http_info(body, opts = {}) + # @option opts [String] :format_id The desired format (WAV, etc.) + # @return [Array<(GreetingMediaInfo, Fixnum, Hash)>] GreetingMediaInfo data, response status code and response headers + def get_greeting_id_media_with_http_info(greeting_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: GreetingsApi#put_defaults ..." + @api_client.config.logger.debug "Calling API: GreetingsApi#get_greeting_id_media ..." end - # verify the required parameter 'body' is set - fail "Missing the required parameter 'body' when calling put_defaults" if body.nil? + # verify the required parameter 'greeting_id' is set + fail "Missing the required parameter 'greeting_id' when calling get_greeting_id_media" if greeting_id.nil? + if opts[:'format_id'] && !['WAV'].include?(opts[:'format_id']) + fail 'invalid value for "format_id", must be one of WAV' + end + # resource path - path = "/api/v2/greetings/defaults".sub('{format}','json') + local_var_path = "/api/v2/greetings/{greetingId}/media".sub('{format}','json').sub('{' + 'greetingId' + '}', greeting_id.to_s) # query parameters query_params = {} + query_params[:'formatId'] = opts[:'format_id'] if opts[:'format_id'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) @@ -229,55 +248,55 @@ # form parameters form_params = {} # http body (model) - post_body = @api_client.object_to_http_body(body) + post_body = nil - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:PUT, path, + 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 => 'DefaultGreetingList') + :return_type => 'GreetingMediaInfo') if @api_client.config.debugging - @api_client.config.logger.debug "API called: GreetingsApi#put_defaults\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: GreetingsApi#get_greeting_id_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get a Greeting with the given GreetingId + # Gets an Organization's Greetings # - # @param greeting_id Greeting ID # @param [Hash] opts the optional parameters - # @return [Greeting] - def get_greeting_id(greeting_id, opts = {}) - data, status_code, headers = get_greeting_id_with_http_info(greeting_id, opts) + # @option opts [Integer] :page_size Page size (default to 25) + # @option opts [Integer] :page_number Page number (default to 1) + # @return [DomainEntityListing] + def get_greetings(opts = {}) + data, status_code, headers = get_greetings_with_http_info(opts) return data end - # Get a Greeting with the given GreetingId + # Gets an Organization&#39;s Greetings # - # @param greeting_id Greeting ID # @param [Hash] opts the optional parameters - # @return [Array<(Greeting, Fixnum, Hash)>] Greeting data, response status code and response headers - def get_greeting_id_with_http_info(greeting_id, opts = {}) + # @option opts [Integer] :page_size Page size + # @option opts [Integer] :page_number Page number + # @return [Array<(DomainEntityListing, Fixnum, Hash)>] DomainEntityListing data, response status code and response headers + def get_greetings_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: GreetingsApi#get_greeting_id ..." + @api_client.config.logger.debug "Calling API: GreetingsApi#get_greetings ..." end - # verify the required parameter 'greeting_id' is set - fail "Missing the required parameter 'greeting_id' when calling get_greeting_id" if greeting_id.nil? - # resource path - path = "/api/v2/greetings/{greetingId}".sub('{format}','json').sub('{' + 'greetingId' + '}', greeting_id.to_s) + local_var_path = "/api/v2/greetings".sub('{format}','json') # query parameters query_params = {} + query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] + query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) @@ -292,58 +311,58 @@ form_params = {} # http body (model) post_body = nil - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:GET, path, + 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 => 'Greeting') + :return_type => 'DomainEntityListing') if @api_client.config.debugging - @api_client.config.logger.debug "API called: GreetingsApi#get_greeting_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: GreetingsApi#get_greetings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Updates the Greeting with the given GreetingId + # Get a list of the User's Greetings # - # @param greeting_id Greeting ID - # @param body The updated Greeting + # @param user_id User ID # @param [Hash] opts the optional parameters - # @return [Greeting] - def put_greeting_id(greeting_id, body, opts = {}) - data, status_code, headers = put_greeting_id_with_http_info(greeting_id, body, opts) + # @option opts [Integer] :page_size Page size (default to 25) + # @option opts [Integer] :page_number Page number (default to 1) + # @return [DomainEntityListing] + def get_user_id_greetings(user_id, opts = {}) + data, status_code, headers = get_user_id_greetings_with_http_info(user_id, opts) return data end - # Updates the Greeting with the given GreetingId + # Get a list of the User&#39;s Greetings # - # @param greeting_id Greeting ID - # @param body The updated Greeting + # @param user_id User ID # @param [Hash] opts the optional parameters - # @return [Array<(Greeting, Fixnum, Hash)>] Greeting data, response status code and response headers - def put_greeting_id_with_http_info(greeting_id, body, opts = {}) + # @option opts [Integer] :page_size Page size + # @option opts [Integer] :page_number Page number + # @return [Array<(DomainEntityListing, Fixnum, Hash)>] DomainEntityListing data, response status code and response headers + def get_user_id_greetings_with_http_info(user_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: GreetingsApi#put_greeting_id ..." + @api_client.config.logger.debug "Calling API: GreetingsApi#get_user_id_greetings ..." end - # verify the required parameter 'greeting_id' is set - fail "Missing the required parameter 'greeting_id' when calling put_greeting_id" if greeting_id.nil? + # verify the required parameter 'user_id' is set + fail "Missing the required parameter 'user_id' when calling get_user_id_greetings" if user_id.nil? - # verify the required parameter 'body' is set - fail "Missing the required parameter 'body' when calling put_greeting_id" if body.nil? - # resource path - path = "/api/v2/greetings/{greetingId}".sub('{format}','json').sub('{' + 'greetingId' + '}', greeting_id.to_s) + local_var_path = "/api/v2/users/{userId}/greetings".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} + query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] + query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) @@ -356,52 +375,51 @@ # form parameters form_params = {} # http body (model) - post_body = @api_client.object_to_http_body(body) + post_body = nil - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:PUT, path, + 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 => 'Greeting') + :return_type => 'DomainEntityListing') if @api_client.config.debugging - @api_client.config.logger.debug "API called: GreetingsApi#put_greeting_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: GreetingsApi#get_user_id_greetings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Deletes a Greeting with the given GreetingId + # Grabs the list of Default Greetings given a User's ID # - # @param greeting_id Greeting ID + # @param user_id User ID # @param [Hash] opts the optional parameters - # @return [Greeting] - def delete_greeting_id(greeting_id, opts = {}) - data, status_code, headers = delete_greeting_id_with_http_info(greeting_id, opts) + # @return [DefaultGreetingList] + def get_user_id_greetings_defaults(user_id, opts = {}) + data, status_code, headers = get_user_id_greetings_defaults_with_http_info(user_id, opts) return data end - # Deletes a Greeting with the given GreetingId + # Grabs the list of Default Greetings given a User&#39;s ID # - # @param greeting_id Greeting ID + # @param user_id User ID # @param [Hash] opts the optional parameters - # @return [Array<(Greeting, Fixnum, Hash)>] Greeting data, response status code and response headers - def delete_greeting_id_with_http_info(greeting_id, opts = {}) + # @return [Array<(DefaultGreetingList, Fixnum, Hash)>] DefaultGreetingList data, response status code and response headers + def get_user_id_greetings_defaults_with_http_info(user_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: GreetingsApi#delete_greeting_id ..." + @api_client.config.logger.debug "Calling API: GreetingsApi#get_user_id_greetings_defaults ..." end - # verify the required parameter 'greeting_id' is set - fail "Missing the required parameter 'greeting_id' when calling delete_greeting_id" if greeting_id.nil? + # verify the required parameter 'user_id' is set + fail "Missing the required parameter 'user_id' when calling get_user_id_greetings_defaults" if user_id.nil? # resource path - path = "/api/v2/greetings/{greetingId}".sub('{format}','json').sub('{' + 'greetingId' + '}', greeting_id.to_s) + local_var_path = "/api/v2/users/{userId}/greetings/defaults".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters @@ -419,60 +437,52 @@ form_params = {} # http body (model) post_body = nil - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:DELETE, path, + 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 => 'Greeting') + :return_type => 'DefaultGreetingList') if @api_client.config.debugging - @api_client.config.logger.debug "API called: GreetingsApi#delete_greeting_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: GreetingsApi#get_user_id_greetings_defaults\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get media playback URI for this greeting + # Create a Greeting for an Organization # - # @param greeting_id Greeting ID + # @param body The Greeting to create # @param [Hash] opts the optional parameters - # @option opts [String] :format_id The desired format (WAV, etc.) - # @return [GreetingMediaInfo] - def get_greeting_id_media(greeting_id, opts = {}) - data, status_code, headers = get_greeting_id_media_with_http_info(greeting_id, opts) + # @return [DefaultGreetingList] + def post_greetings(body, opts = {}) + data, status_code, headers = post_greetings_with_http_info(body, opts) return data end - # Get media playback URI for this greeting + # Create a Greeting for an Organization # - # @param greeting_id Greeting ID + # @param body The Greeting to create # @param [Hash] opts the optional parameters - # @option opts [String] :format_id The desired format (WAV, etc.) - # @return [Array<(GreetingMediaInfo, Fixnum, Hash)>] GreetingMediaInfo data, response status code and response headers - def get_greeting_id_media_with_http_info(greeting_id, opts = {}) + # @return [Array<(DefaultGreetingList, Fixnum, Hash)>] DefaultGreetingList data, response status code and response headers + def post_greetings_with_http_info(body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: GreetingsApi#get_greeting_id_media ..." + @api_client.config.logger.debug "Calling API: GreetingsApi#post_greetings ..." end - # verify the required parameter 'greeting_id' is set - fail "Missing the required parameter 'greeting_id' when calling get_greeting_id_media" if greeting_id.nil? + # verify the required parameter 'body' is set + fail "Missing the required parameter 'body' when calling post_greetings" if body.nil? - if opts[:'format_id'] && !['WAV'].include?(opts[:'format_id']) - fail 'invalid value for "format_id", must be one of WAV' - end - # resource path - path = "/api/v2/greetings/{greetingId}/media".sub('{format}','json').sub('{' + 'greetingId' + '}', greeting_id.to_s) + local_var_path = "/api/v2/greetings".sub('{format}','json') # query parameters query_params = {} - query_params[:'formatId'] = opts[:'format_id'] if opts[:'format_id'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) @@ -485,61 +495,59 @@ # form parameters form_params = {} # http body (model) - post_body = nil + post_body = @api_client.object_to_http_body(body) - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:GET, path, + data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GreetingMediaInfo') + :return_type => 'DefaultGreetingList') if @api_client.config.debugging - @api_client.config.logger.debug "API called: GreetingsApi#get_greeting_id_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: GreetingsApi#post_greetings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get a list of the User&#39;s Greetings + # Creates a Greeting for a User # # @param user_id User ID + # @param body The Greeting to create # @param [Hash] opts the optional parameters - # @option opts [Integer] :page_size Page size - # @option opts [Integer] :page_number Page number - # @return [DomainEntityListing] - def get_user_id_greetings(user_id, opts = {}) - data, status_code, headers = get_user_id_greetings_with_http_info(user_id, opts) + # @return [Greeting] + def post_user_id_greetings(user_id, body, opts = {}) + data, status_code, headers = post_user_id_greetings_with_http_info(user_id, body, opts) return data end - # Get a list of the User&#39;s Greetings + # Creates a Greeting for a User # # @param user_id User ID + # @param body The Greeting to create # @param [Hash] opts the optional parameters - # @option opts [Integer] :page_size Page size - # @option opts [Integer] :page_number Page number - # @return [Array<(DomainEntityListing, Fixnum, Hash)>] DomainEntityListing data, response status code and response headers - def get_user_id_greetings_with_http_info(user_id, opts = {}) + # @return [Array<(Greeting, Fixnum, Hash)>] Greeting data, response status code and response headers + def post_user_id_greetings_with_http_info(user_id, body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: GreetingsApi#get_user_id_greetings ..." + @api_client.config.logger.debug "Calling API: GreetingsApi#post_user_id_greetings ..." end # verify the required parameter 'user_id' is set - fail "Missing the required parameter 'user_id' when calling get_user_id_greetings" if user_id.nil? + fail "Missing the required parameter 'user_id' when calling post_user_id_greetings" if user_id.nil? + # verify the required parameter 'body' is set + fail "Missing the required parameter 'body' when calling post_user_id_greetings" if body.nil? + # resource path - path = "/api/v2/users/{userId}/greetings".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) + local_var_path = "/api/v2/users/{userId}/greetings".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} - query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] - query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) @@ -552,57 +560,51 @@ # form parameters form_params = {} # http body (model) - post_body = nil + post_body = @api_client.object_to_http_body(body) - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:GET, path, + data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'DomainEntityListing') + :return_type => 'Greeting') if @api_client.config.debugging - @api_client.config.logger.debug "API called: GreetingsApi#get_user_id_greetings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: GreetingsApi#post_user_id_greetings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Creates a Greeting for a User + # Update an Organization's DefaultGreetingList # - # @param user_id User ID - # @param body The Greeting to create + # @param body The updated defaultGreetingList # @param [Hash] opts the optional parameters - # @return [Greeting] - def post_user_id_greetings(user_id, body, opts = {}) - data, status_code, headers = post_user_id_greetings_with_http_info(user_id, body, opts) + # @return [DefaultGreetingList] + def put_defaults(body, opts = {}) + data, status_code, headers = put_defaults_with_http_info(body, opts) return data end - # Creates a Greeting for a User + # Update an Organization&#39;s DefaultGreetingList # - # @param user_id User ID - # @param body The Greeting to create + # @param body The updated defaultGreetingList # @param [Hash] opts the optional parameters - # @return [Array<(Greeting, Fixnum, Hash)>] Greeting data, response status code and response headers - def post_user_id_greetings_with_http_info(user_id, body, opts = {}) + # @return [Array<(DefaultGreetingList, Fixnum, Hash)>] DefaultGreetingList data, response status code and response headers + def put_defaults_with_http_info(body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: GreetingsApi#post_user_id_greetings ..." + @api_client.config.logger.debug "Calling API: GreetingsApi#put_defaults ..." end - # verify the required parameter 'user_id' is set - fail "Missing the required parameter 'user_id' when calling post_user_id_greetings" if user_id.nil? - # verify the required parameter 'body' is set - fail "Missing the required parameter 'body' when calling post_user_id_greetings" if body.nil? + fail "Missing the required parameter 'body' when calling put_defaults" if body.nil? # resource path - path = "/api/v2/users/{userId}/greetings".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) + local_var_path = "/api/v2/greetings/defaults".sub('{format}','json') # query parameters query_params = {} # header parameters @@ -620,50 +622,54 @@ form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:POST, path, + 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 => 'Greeting') + :return_type => 'DefaultGreetingList') if @api_client.config.debugging - @api_client.config.logger.debug "API called: GreetingsApi#post_user_id_greetings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: GreetingsApi#put_defaults\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Grabs the list of Default Greetings given a User&#39;s ID + # Updates the Greeting with the given GreetingId # - # @param user_id User ID + # @param greeting_id Greeting ID + # @param body The updated Greeting # @param [Hash] opts the optional parameters - # @return [DefaultGreetingList] - def get_user_id_greetings_defaults(user_id, opts = {}) - data, status_code, headers = get_user_id_greetings_defaults_with_http_info(user_id, opts) + # @return [Greeting] + def put_greeting_id(greeting_id, body, opts = {}) + data, status_code, headers = put_greeting_id_with_http_info(greeting_id, body, opts) return data end - # Grabs the list of Default Greetings given a User&#39;s ID + # Updates the Greeting with the given GreetingId # - # @param user_id User ID + # @param greeting_id Greeting ID + # @param body The updated Greeting # @param [Hash] opts the optional parameters - # @return [Array<(DefaultGreetingList, Fixnum, Hash)>] DefaultGreetingList data, response status code and response headers - def get_user_id_greetings_defaults_with_http_info(user_id, opts = {}) + # @return [Array<(Greeting, Fixnum, Hash)>] Greeting data, response status code and response headers + def put_greeting_id_with_http_info(greeting_id, body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: GreetingsApi#get_user_id_greetings_defaults ..." + @api_client.config.logger.debug "Calling API: GreetingsApi#put_greeting_id ..." end - # verify the required parameter 'user_id' is set - fail "Missing the required parameter 'user_id' when calling get_user_id_greetings_defaults" if user_id.nil? + # verify the required parameter 'greeting_id' is set + fail "Missing the required parameter 'greeting_id' when calling put_greeting_id" if greeting_id.nil? + # verify the required parameter 'body' is set + fail "Missing the required parameter 'body' when calling put_greeting_id" if body.nil? + # resource path - path = "/api/v2/users/{userId}/greetings/defaults".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) + local_var_path = "/api/v2/greetings/{greetingId}".sub('{format}','json').sub('{' + 'greetingId' + '}', greeting_id.to_s) # query parameters query_params = {} # header parameters @@ -679,23 +685,22 @@ # form parameters form_params = {} # http body (model) - post_body = nil + post_body = @api_client.object_to_http_body(body) - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:GET, path, + 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 => 'DefaultGreetingList') + :return_type => 'Greeting') if @api_client.config.debugging - @api_client.config.logger.debug "API called: GreetingsApi#get_user_id_greetings_defaults\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: GreetingsApi#put_greeting_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates the DefaultGreetingList of the specified User @@ -725,11 +730,11 @@ # verify the required parameter 'body' is set fail "Missing the required parameter 'body' when calling put_user_id_greetings_defaults" if body.nil? # resource path - path = "/api/v2/users/{userId}/greetings/defaults".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) + local_var_path = "/api/v2/users/{userId}/greetings/defaults".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters @@ -747,13 +752,12 @@ form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:PUT, path, + 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, @@ -763,9 +767,5 @@ end return data, status_code, headers end end end - - - -