Class: PhoneComClient::VoicemailApi
- Inherits:
-
Object
- Object
- PhoneComClient::VoicemailApi
- Defined in:
- lib/phone_com_client/api/voicemail_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_account_voicemail(account_id, voicemail_id, opts = {}) ⇒ VoicemailFull
This service shows the details of an individual voicemail.
-
#get_account_voicemail_with_http_info(account_id, voicemail_id, opts = {}) ⇒ Array<(VoicemailFull, Fixnum, Hash)>
This service shows the details of an individual voicemail.
-
#initialize(api_client = ApiClient.default) ⇒ VoicemailApi
constructor
A new instance of VoicemailApi.
-
#list_account_voicemail(account_id, opts = {}) ⇒ ListVoicemail
Get a list of voicemail messages for an account.
-
#list_account_voicemail_with_http_info(account_id, opts = {}) ⇒ Array<(ListVoicemail, Fixnum, Hash)>
Get a list of voicemail messages for an account.
-
#patch_account_voicemail(account_id, voicemail_id, opts = {}) ⇒ VoicemailFull
Update the is_new parameter in a voicemail record.
-
#patch_account_voicemail_with_http_info(account_id, voicemail_id, opts = {}) ⇒ Array<(VoicemailFull, Fixnum, Hash)>
Update the is_new parameter in a voicemail record.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ VoicemailApi
Returns a new instance of VoicemailApi.
19 20 21 |
# File 'lib/phone_com_client/api/voicemail_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/phone_com_client/api/voicemail_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_account_voicemail(account_id, voicemail_id, opts = {}) ⇒ VoicemailFull
This service shows the details of an individual voicemail. This service shows the details of an individual voicemail. See Intro to Voicemail for more info on the properties. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Get Voicemail API with the following definition: GET api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail/:voicemail_id
28 29 30 31 |
# File 'lib/phone_com_client/api/voicemail_api.rb', line 28 def get_account_voicemail(account_id, voicemail_id, opts = {}) data, _status_code, _headers = get_account_voicemail_with_http_info(account_id, voicemail_id, opts) data end |
#get_account_voicemail_with_http_info(account_id, voicemail_id, opts = {}) ⇒ Array<(VoicemailFull, Fixnum, Hash)>
This service shows the details of an individual voicemail. This service shows the details of an individual voicemail. See Intro to Voicemail for more info on the properties. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Get Voicemail API with the following definition: GET api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail/:voicemail_id
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 77 78 79 80 81 |
# File 'lib/phone_com_client/api/voicemail_api.rb', line 39 def get_account_voicemail_with_http_info(account_id, voicemail_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VoicemailApi.get_account_voicemail ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling VoicemailApi.get_account_voicemail" end # verify the required parameter 'voicemail_id' is set if @api_client.config.client_side_validation && voicemail_id.nil? fail ArgumentError, "Missing the required parameter 'voicemail_id' when calling VoicemailApi.get_account_voicemail" end # resource path local_var_path = '/accounts/{account_id}/voicemail/{voicemail_id}'.sub('{' + 'account_id' + '}', account_id.to_s).sub('{' + 'voicemail_id' + '}', voicemail_id.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 = ['apiKey'] 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 => 'VoicemailFull') if @api_client.config.debugging @api_client.config.logger.debug "API called: VoicemailApi#get_account_voicemail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_account_voicemail(account_id, opts = {}) ⇒ ListVoicemail
Get a list of voicemail messages for an account. Get a list of voicemail messages for an account. See Intro to Voicemail for more info on the properties. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the List Voicemail API with the following definition: GET api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail
98 99 100 101 |
# File 'lib/phone_com_client/api/voicemail_api.rb', line 98 def list_account_voicemail(account_id, opts = {}) data, _status_code, _headers = list_account_voicemail_with_http_info(account_id, opts) data end |
#list_account_voicemail_with_http_info(account_id, opts = {}) ⇒ Array<(ListVoicemail, Fixnum, Hash)>
Get a list of voicemail messages for an account. Get a list of voicemail messages for an account. See Intro to Voicemail for more info on the properties. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the List Voicemail API with the following definition: GET api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 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 |
# File 'lib/phone_com_client/api/voicemail_api.rb', line 119 def list_account_voicemail_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VoicemailApi.list_account_voicemail ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling VoicemailApi.list_account_voicemail" end if @api_client.config.client_side_validation && !opts[:'filters_from'].nil? && opts[:'filters_from'] !~ Regexp.new(/^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/) fail ArgumentError, "invalid value for 'opts[:\"filters_from\"]' when calling VoicemailApi.list_account_voicemail, must conform to the pattern /^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/." end if @api_client.config.client_side_validation && !opts[:'filters_to'].nil? && opts[:'filters_to'] !~ Regexp.new(/^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/) fail ArgumentError, "invalid value for 'opts[:\"filters_to\"]' when calling VoicemailApi.list_account_voicemail, must conform to the pattern /^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/." end if @api_client.config.client_side_validation && !opts[:'filters_created_at'].nil? && opts[:'filters_created_at'] !~ Regexp.new(/^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/) fail ArgumentError, "invalid value for 'opts[:\"filters_created_at\"]' when calling VoicemailApi.list_account_voicemail, must conform to the pattern /^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/." end if @api_client.config.client_side_validation && !opts[:'sort_id'].nil? && opts[:'sort_id'] !~ Regexp.new(/asc|desc/) fail ArgumentError, "invalid value for 'opts[:\"sort_id\"]' when calling VoicemailApi.list_account_voicemail, must conform to the pattern /asc|desc/." end if @api_client.config.client_side_validation && !opts[:'sort_created_at'].nil? && opts[:'sort_created_at'] !~ Regexp.new(/asc|desc/) fail ArgumentError, "invalid value for 'opts[:\"sort_created_at\"]' when calling VoicemailApi.list_account_voicemail, must conform to the pattern /asc|desc/." end # resource path local_var_path = '/accounts/{account_id}/voicemail'.sub('{' + 'account_id' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'filters[id]'] = @api_client.build_collection_param(opts[:'filters_id'], :multi) if !opts[:'filters_id'].nil? query_params[:'filters[from]'] = opts[:'filters_from'] if !opts[:'filters_from'].nil? query_params[:'filters[to]'] = opts[:'filters_to'] if !opts[:'filters_to'].nil? query_params[:'filters[is_new]'] = opts[:'filters_is_new'] if !opts[:'filters_is_new'].nil? query_params[:'filters[created_at]'] = opts[:'filters_created_at'] if !opts[:'filters_created_at'].nil? query_params[:'filters[extension]'] = @api_client.build_collection_param(opts[:'filters_extension'], :multi) if !opts[:'filters_extension'].nil? query_params[:'sort[id]'] = opts[:'sort_id'] if !opts[:'sort_id'].nil? query_params[:'sort[created_at]'] = opts[:'sort_created_at'] if !opts[:'sort_created_at'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? # 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 = ['apiKey'] 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 => 'ListVoicemail') if @api_client.config.debugging @api_client.config.logger.debug "API called: VoicemailApi#list_account_voicemail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#patch_account_voicemail(account_id, voicemail_id, opts = {}) ⇒ VoicemailFull
Update the is_new parameter in a voicemail record. Update the is_new parameter in a voicemail record. See Account Voicemail for more info on the properties. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Patch Voicemail API with the following definition: PATCH api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail/:voicemail_id
196 197 198 199 |
# File 'lib/phone_com_client/api/voicemail_api.rb', line 196 def patch_account_voicemail(account_id, voicemail_id, opts = {}) data, _status_code, _headers = patch_account_voicemail_with_http_info(account_id, voicemail_id, opts) data end |
#patch_account_voicemail_with_http_info(account_id, voicemail_id, opts = {}) ⇒ Array<(VoicemailFull, Fixnum, Hash)>
Update the is_new parameter in a voicemail record. Update the is_new parameter in a voicemail record. See Account Voicemail for more info on the properties. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Patch Voicemail API with the following definition: PATCH api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail/:voicemail_id
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/phone_com_client/api/voicemail_api.rb', line 208 def patch_account_voicemail_with_http_info(account_id, voicemail_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VoicemailApi.patch_account_voicemail ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling VoicemailApi.patch_account_voicemail" end # verify the required parameter 'voicemail_id' is set if @api_client.config.client_side_validation && voicemail_id.nil? fail ArgumentError, "Missing the required parameter 'voicemail_id' when calling VoicemailApi.patch_account_voicemail" end # resource path local_var_path = '/accounts/{account_id}/voicemail/{voicemail_id}'.sub('{' + 'account_id' + '}', account_id.to_s).sub('{' + 'voicemail_id' + '}', voicemail_id.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(opts[:'data']) auth_names = ['apiKey'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'VoicemailFull') if @api_client.config.debugging @api_client.config.logger.debug "API called: VoicemailApi#patch_account_voicemail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |