phone_com_client 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +69 -0
- data/LICENSE +21 -0
- data/README.md +344 -0
- data/Rakefile +8 -0
- data/docs/AccountFull.md +14 -0
- data/docs/AccountSummary.md +9 -0
- data/docs/AccountsApi.md +127 -0
- data/docs/Address.md +13 -0
- data/docs/AddressListContacts.md +13 -0
- data/docs/ApplicationFull.md +9 -0
- data/docs/ApplicationSummary.md +9 -0
- data/docs/ApplicationsApi.md +137 -0
- data/docs/AvailableNumbersApi.md +94 -0
- data/docs/AvailableNumbersFull.md +18 -0
- data/docs/CallDetails.md +12 -0
- data/docs/CallFull.md +8 -0
- data/docs/CallLogFull.md +27 -0
- data/docs/CallLogsApi.md +149 -0
- data/docs/CallNotifications.md +9 -0
- data/docs/CallbackObject.md +13 -0
- data/docs/CallerIdFull.md +10 -0
- data/docs/CallerIdPhoneNumber.md +9 -0
- data/docs/CallerIdsApi.md +82 -0
- data/docs/CallsApi.md +67 -0
- data/docs/ContactAccount.md +14 -0
- data/docs/ContactFull.md +26 -0
- data/docs/ContactResponse.md +14 -0
- data/docs/ContactSummary.md +15 -0
- data/docs/ContactsApi.md +333 -0
- data/docs/CreateCallParams.md +15 -0
- data/docs/CreateContactParams.md +23 -0
- data/docs/CreateDeviceParams.md +9 -0
- data/docs/CreateExtensionParams.md +20 -0
- data/docs/CreateGroupParams.md +8 -0
- data/docs/CreateListenerParams.md +10 -0
- data/docs/CreateMediaParams.md +17 -0
- data/docs/CreateMenuParams.md +14 -0
- data/docs/CreateOauthParams.md +16 -0
- data/docs/CreatePaymentParams.md +11 -0
- data/docs/CreatePhoneNumberParams.md +15 -0
- data/docs/CreatePricingParams.md +10 -0
- data/docs/CreateQueueParams.md +14 -0
- data/docs/CreateRedirectUriParams.md +8 -0
- data/docs/CreateRouteParams.md +10 -0
- data/docs/CreateSmsParams.md +11 -0
- data/docs/CreateSubaccountParams.md +11 -0
- data/docs/CreateTrunkParams.md +14 -0
- data/docs/DefaultApi.md +57 -0
- data/docs/DeleteEntry.md +8 -0
- data/docs/DeviceFull.md +11 -0
- data/docs/DeviceMembership.md +9 -0
- data/docs/DeviceSummary.md +9 -0
- data/docs/DevicesApi.md +316 -0
- data/docs/Email.md +9 -0
- data/docs/ExpressServiceCodeFull.md +10 -0
- data/docs/ExpressServiceCodesApi.md +125 -0
- data/docs/ExtensionFull.md +24 -0
- data/docs/ExtensionSummary.md +10 -0
- data/docs/ExtensionsApi.md +262 -0
- data/docs/FilterCallLogs.md +13 -0
- data/docs/FilterIdArray.md +8 -0
- data/docs/FilterIdDirectionFrom.md +10 -0
- data/docs/FilterIdExtensionNameArray.md +10 -0
- data/docs/FilterIdGroupIdUpdatedAtArray.md +10 -0
- data/docs/FilterIdNameArray.md +9 -0
- data/docs/FilterIdNamePhoneNumberArray.md +10 -0
- data/docs/FilterListAvailableNumbers.md +17 -0
- data/docs/FilterListPhoneNumbersRegions.md +14 -0
- data/docs/FilterNameNumberArray.md +9 -0
- data/docs/FilterVoicemailArray.md +13 -0
- data/docs/FromObject.md +11 -0
- data/docs/GetOauthAccessToken.md +10 -0
- data/docs/Greeting.md +11 -0
- data/docs/GreetingInput.md +11 -0
- data/docs/GroupFull.md +9 -0
- data/docs/GroupListContacts.md +9 -0
- data/docs/GroupSummary.md +9 -0
- data/docs/GroupsApi.md +329 -0
- data/docs/HoldMusic.md +9 -0
- data/docs/Line.md +9 -0
- data/docs/ListAccounts.md +13 -0
- data/docs/ListApplications.md +13 -0
- data/docs/ListAvailableNumbers.md +13 -0
- data/docs/ListCallLogs.md +13 -0
- data/docs/ListCallerIds.md +13 -0
- data/docs/ListContacts.md +13 -0
- data/docs/ListDevices.md +13 -0
- data/docs/ListExpressServiceCodes.md +13 -0
- data/docs/ListExtensions.md +13 -0
- data/docs/ListGroups.md +13 -0
- data/docs/ListListeners.md +13 -0
- data/docs/ListMedia.md +13 -0
- data/docs/ListMenus.md +13 -0
- data/docs/ListOauthClients.md +13 -0
- data/docs/ListOauthClientsRedirectUris.md +12 -0
- data/docs/ListPaymentMethods.md +13 -0
- data/docs/ListPhoneNumbers.md +13 -0
- data/docs/ListPhoneNumbersRegions.md +14 -0
- data/docs/ListPricings.md +13 -0
- data/docs/ListQueues.md +13 -0
- data/docs/ListRoutes.md +13 -0
- data/docs/ListSchedules.md +13 -0
- data/docs/ListSms.md +13 -0
- data/docs/ListTrunks.md +13 -0
- data/docs/ListVoicemail.md +13 -0
- data/docs/ListenerFull.md +14 -0
- data/docs/ListenersApi.md +312 -0
- data/docs/MediaApi.md +441 -0
- data/docs/MediaFull.md +10 -0
- data/docs/MediaSummary.md +9 -0
- data/docs/Member.md +9 -0
- data/docs/MenuFull.md +15 -0
- data/docs/MenuSummary.md +9 -0
- data/docs/MenusApi.md +316 -0
- data/docs/Notification.md +9 -0
- data/docs/NumberRegionsApi.md +98 -0
- data/docs/OauthAccessToken.md +12 -0
- data/docs/OauthApi.md +176 -0
- data/docs/OauthClientFull.md +9 -0
- data/docs/OauthClientRedirectUriFull.md +10 -0
- data/docs/OauthClientsApi.md +191 -0
- data/docs/OauthClientsRedirectUrisApi.md +262 -0
- data/docs/Option.md +9 -0
- data/docs/PatchPaymentParams.md +8 -0
- data/docs/PatchSmsParams.md +8 -0
- data/docs/PatchVoicemailParams.md +8 -0
- data/docs/PaymentFull.md +20 -0
- data/docs/PaymentMethodsApi.md +311 -0
- data/docs/PaymentSummary.md +13 -0
- data/docs/PhoneNumberContact.md +10 -0
- data/docs/PhoneNumberFull.md +16 -0
- data/docs/PhoneNumbersApi.md +262 -0
- data/docs/PhoneNumbersRegionFull.md +15 -0
- data/docs/PingResponse.md +11 -0
- data/docs/PricingFull.md +13 -0
- data/docs/PricingObject.md +9 -0
- data/docs/QueueFull.md +15 -0
- data/docs/QueueSummary.md +9 -0
- data/docs/QueuesApi.md +316 -0
- data/docs/Recipient.md +9 -0
- data/docs/RedirectUriFull.md +10 -0
- data/docs/ReplaceExtensionParams.md +21 -0
- data/docs/ReplaceMenuParams.md +14 -0
- data/docs/ReplacePhoneNumberParams.md +13 -0
- data/docs/RouteFull.md +11 -0
- data/docs/RouteSummary.md +9 -0
- data/docs/RoutesApi.md +316 -0
- data/docs/RuleSet.md +9 -0
- data/docs/RuleSetAction.md +17 -0
- data/docs/RuleSetFilter.md +11 -0
- data/docs/RuleSetForwardItem.md +14 -0
- data/docs/ScheduleFull.md +9 -0
- data/docs/ScheduleSummary.md +9 -0
- data/docs/SchedulesApi.md +137 -0
- data/docs/ScopeDetails.md +8 -0
- data/docs/SipAuthentication.md +11 -0
- data/docs/SmsApi.md +265 -0
- data/docs/SmsForwarding.md +10 -0
- data/docs/SmsForwardingParams.md +10 -0
- data/docs/SmsFull.md +15 -0
- data/docs/SortCallLogs.md +10 -0
- data/docs/SortId.md +8 -0
- data/docs/SortIdCreatedAt.md +9 -0
- data/docs/SortIdExtensionName.md +10 -0
- data/docs/SortIdName.md +9 -0
- data/docs/SortIdNamePhoneNumber.md +10 -0
- data/docs/SortIdUpdatedAt.md +9 -0
- data/docs/SortListAvailableNumbers.md +10 -0
- data/docs/SortListPhoneNumbersRegions.md +14 -0
- data/docs/SortNameNumber.md +9 -0
- data/docs/SubaccountPricingApi.md +261 -0
- data/docs/SubaccountsApi.md +133 -0
- data/docs/TrunkFull.md +15 -0
- data/docs/TrunkSummary.md +9 -0
- data/docs/TrunksApi.md +314 -0
- data/docs/Voicemail.md +13 -0
- data/docs/VoicemailApi.md +207 -0
- data/docs/VoicemailFull.md +16 -0
- data/docs/VoicemailInput.md +13 -0
- data/git_push.sh +55 -0
- data/lib/phone_com_client/api/accounts_api.rb +144 -0
- data/lib/phone_com_client/api/applications_api.rb +166 -0
- data/lib/phone_com_client/api/available_numbers_api.rb +131 -0
- data/lib/phone_com_client/api/call_logs_api.rb +204 -0
- data/lib/phone_com_client/api/caller_ids_api.rb +112 -0
- data/lib/phone_com_client/api/calls_api.rb +79 -0
- data/lib/phone_com_client/api/contacts_api.rb +377 -0
- data/lib/phone_com_client/api/default_api.rb +71 -0
- data/lib/phone_com_client/api/devices_api.rb +344 -0
- data/lib/phone_com_client/api/express_service_codes_api.rb +140 -0
- data/lib/phone_com_client/api/extensions_api.rb +294 -0
- data/lib/phone_com_client/api/groups_api.rb +382 -0
- data/lib/phone_com_client/api/listeners_api.rb +334 -0
- data/lib/phone_com_client/api/media_api.rb +470 -0
- data/lib/phone_com_client/api/menus_api.rb +344 -0
- data/lib/phone_com_client/api/number_regions_api.rb +149 -0
- data/lib/phone_com_client/api/oauth_api.rb +196 -0
- data/lib/phone_com_client/api/oauth_clients_api.rb +216 -0
- data/lib/phone_com_client/api/oauth_clients_redirect_uris_api.rb +296 -0
- data/lib/phone_com_client/api/payment_methods_api.rb +338 -0
- data/lib/phone_com_client/api/phone_numbers_api.rb +294 -0
- data/lib/phone_com_client/api/queues_api.rb +344 -0
- data/lib/phone_com_client/api/routes_api.rb +344 -0
- data/lib/phone_com_client/api/schedules_api.rb +166 -0
- data/lib/phone_com_client/api/sms_api.rb +316 -0
- data/lib/phone_com_client/api/subaccount_pricing_api.rb +300 -0
- data/lib/phone_com_client/api/subaccounts_api.rb +156 -0
- data/lib/phone_com_client/api/trunks_api.rb +352 -0
- data/lib/phone_com_client/api/voicemail_api.rb +252 -0
- data/lib/phone_com_client/api_client.rb +389 -0
- data/lib/phone_com_client/api_error.rb +38 -0
- data/lib/phone_com_client/configuration.rb +209 -0
- data/lib/phone_com_client/models/account_full.rb +245 -0
- data/lib/phone_com_client/models/account_summary.rb +195 -0
- data/lib/phone_com_client/models/address.rb +250 -0
- data/lib/phone_com_client/models/address_list_contacts.rb +234 -0
- data/lib/phone_com_client/models/application_full.rb +195 -0
- data/lib/phone_com_client/models/application_summary.rb +195 -0
- data/lib/phone_com_client/models/available_numbers_full.rb +285 -0
- data/lib/phone_com_client/models/call_details.rb +225 -0
- data/lib/phone_com_client/models/call_full.rb +185 -0
- data/lib/phone_com_client/models/call_log_full.rb +377 -0
- data/lib/phone_com_client/models/call_notifications.rb +197 -0
- data/lib/phone_com_client/models/callback_object.rb +234 -0
- data/lib/phone_com_client/models/caller_id_full.rb +205 -0
- data/lib/phone_com_client/models/caller_id_phone_number.rb +210 -0
- data/lib/phone_com_client/models/contact_account.rb +243 -0
- data/lib/phone_com_client/models/contact_full.rb +370 -0
- data/lib/phone_com_client/models/contact_response.rb +243 -0
- data/lib/phone_com_client/models/contact_summary.rb +255 -0
- data/lib/phone_com_client/models/create_call_params.rb +254 -0
- data/lib/phone_com_client/models/create_contact_params.rb +340 -0
- data/lib/phone_com_client/models/create_device_params.rb +196 -0
- data/lib/phone_com_client/models/create_extension_params.rb +302 -0
- data/lib/phone_com_client/models/create_group_params.rb +184 -0
- data/lib/phone_com_client/models/create_listener_params.rb +206 -0
- data/lib/phone_com_client/models/create_media_params.rb +274 -0
- data/lib/phone_com_client/models/create_menu_params.rb +239 -0
- data/lib/phone_com_client/models/create_oauth_params.rb +264 -0
- data/lib/phone_com_client/models/create_payment_params.rb +214 -0
- data/lib/phone_com_client/models/create_phone_number_params.rb +251 -0
- data/lib/phone_com_client/models/create_pricing_params.rb +204 -0
- data/lib/phone_com_client/models/create_queue_params.rb +246 -0
- data/lib/phone_com_client/models/create_redirect_uri_params.rb +184 -0
- data/lib/phone_com_client/models/create_route_params.rb +206 -0
- data/lib/phone_com_client/models/create_sms_params.rb +229 -0
- data/lib/phone_com_client/models/create_subaccount_params.rb +224 -0
- data/lib/phone_com_client/models/create_trunk_params.rb +246 -0
- data/lib/phone_com_client/models/delete_entry.rb +183 -0
- data/lib/phone_com_client/models/device_full.rb +216 -0
- data/lib/phone_com_client/models/device_membership.rb +195 -0
- data/lib/phone_com_client/models/device_summary.rb +195 -0
- data/lib/phone_com_client/models/email.rb +194 -0
- data/lib/phone_com_client/models/express_service_code_full.rb +207 -0
- data/lib/phone_com_client/models/extension_full.rb +342 -0
- data/lib/phone_com_client/models/extension_summary.rb +205 -0
- data/lib/phone_com_client/models/filter_call_logs.rb +228 -0
- data/lib/phone_com_client/models/filter_id_array.rb +183 -0
- data/lib/phone_com_client/models/filter_id_direction_from.rb +201 -0
- data/lib/phone_com_client/models/filter_id_extension_name_array.rb +201 -0
- data/lib/phone_com_client/models/filter_id_group_id_updated_at_array.rb +201 -0
- data/lib/phone_com_client/models/filter_id_name_array.rb +192 -0
- data/lib/phone_com_client/models/filter_id_name_phone_number_array.rb +201 -0
- data/lib/phone_com_client/models/filter_list_available_numbers.rb +264 -0
- data/lib/phone_com_client/models/filter_list_phone_numbers_regions.rb +237 -0
- data/lib/phone_com_client/models/filter_name_number_array.rb +192 -0
- data/lib/phone_com_client/models/filter_voicemail_array.rb +228 -0
- data/lib/phone_com_client/models/from_object.rb +215 -0
- data/lib/phone_com_client/models/get_oauth_access_token.rb +203 -0
- data/lib/phone_com_client/models/greeting.rb +215 -0
- data/lib/phone_com_client/models/greeting_input.rb +215 -0
- data/lib/phone_com_client/models/group_full.rb +195 -0
- data/lib/phone_com_client/models/group_list_contacts.rb +195 -0
- data/lib/phone_com_client/models/group_summary.rb +195 -0
- data/lib/phone_com_client/models/hold_music.rb +195 -0
- data/lib/phone_com_client/models/line.rb +194 -0
- data/lib/phone_com_client/models/list_accounts.rb +230 -0
- data/lib/phone_com_client/models/list_applications.rb +230 -0
- data/lib/phone_com_client/models/list_available_numbers.rb +230 -0
- data/lib/phone_com_client/models/list_call_logs.rb +230 -0
- data/lib/phone_com_client/models/list_caller_ids.rb +230 -0
- data/lib/phone_com_client/models/list_contacts.rb +230 -0
- data/lib/phone_com_client/models/list_devices.rb +230 -0
- data/lib/phone_com_client/models/list_express_service_codes.rb +232 -0
- data/lib/phone_com_client/models/list_extensions.rb +230 -0
- data/lib/phone_com_client/models/list_groups.rb +230 -0
- data/lib/phone_com_client/models/list_listeners.rb +230 -0
- data/lib/phone_com_client/models/list_media.rb +230 -0
- data/lib/phone_com_client/models/list_menus.rb +230 -0
- data/lib/phone_com_client/models/list_oauth_clients.rb +230 -0
- data/lib/phone_com_client/models/list_oauth_clients_redirect_uris.rb +221 -0
- data/lib/phone_com_client/models/list_payment_methods.rb +230 -0
- data/lib/phone_com_client/models/list_phone_numbers.rb +231 -0
- data/lib/phone_com_client/models/list_phone_numbers_regions.rb +241 -0
- data/lib/phone_com_client/models/list_pricings.rb +230 -0
- data/lib/phone_com_client/models/list_queues.rb +230 -0
- data/lib/phone_com_client/models/list_routes.rb +230 -0
- data/lib/phone_com_client/models/list_schedules.rb +230 -0
- data/lib/phone_com_client/models/list_sms.rb +230 -0
- data/lib/phone_com_client/models/list_trunks.rb +230 -0
- data/lib/phone_com_client/models/list_voicemail.rb +230 -0
- data/lib/phone_com_client/models/listener_full.rb +244 -0
- data/lib/phone_com_client/models/media_full.rb +220 -0
- data/lib/phone_com_client/models/media_summary.rb +195 -0
- data/lib/phone_com_client/models/member.rb +194 -0
- data/lib/phone_com_client/models/menu_full.rb +257 -0
- data/lib/phone_com_client/models/menu_summary.rb +195 -0
- data/lib/phone_com_client/models/notification.rb +197 -0
- data/lib/phone_com_client/models/oauth_access_token.rb +219 -0
- data/lib/phone_com_client/models/oauth_client_full.rb +195 -0
- data/lib/phone_com_client/models/oauth_client_redirect_uri_full.rb +205 -0
- data/lib/phone_com_client/models/option.rb +194 -0
- data/lib/phone_com_client/models/patch_payment_params.rb +184 -0
- data/lib/phone_com_client/models/patch_sms_params.rb +184 -0
- data/lib/phone_com_client/models/patch_voicemail_params.rb +184 -0
- data/lib/phone_com_client/models/payment_full.rb +305 -0
- data/lib/phone_com_client/models/payment_summary.rb +235 -0
- data/lib/phone_com_client/models/phone_number_contact.rb +204 -0
- data/lib/phone_com_client/models/phone_number_full.rb +262 -0
- data/lib/phone_com_client/models/phone_numbers_region_full.rb +255 -0
- data/lib/phone_com_client/models/ping_response.rb +211 -0
- data/lib/phone_com_client/models/pricing_full.rb +235 -0
- data/lib/phone_com_client/models/pricing_object.rb +194 -0
- data/lib/phone_com_client/models/queue_full.rb +266 -0
- data/lib/phone_com_client/models/queue_summary.rb +205 -0
- data/lib/phone_com_client/models/recipient.rb +194 -0
- data/lib/phone_com_client/models/redirect_uri_full.rb +204 -0
- data/lib/phone_com_client/models/replace_extension_params.rb +312 -0
- data/lib/phone_com_client/models/replace_menu_params.rb +239 -0
- data/lib/phone_com_client/models/replace_phone_number_params.rb +251 -0
- data/lib/phone_com_client/models/route_full.rb +217 -0
- data/lib/phone_com_client/models/route_summary.rb +195 -0
- data/lib/phone_com_client/models/rule_set.rb +195 -0
- data/lib/phone_com_client/models/rule_set_action.rb +292 -0
- data/lib/phone_com_client/models/rule_set_filter.rb +230 -0
- data/lib/phone_com_client/models/rule_set_forward_item.rb +294 -0
- data/lib/phone_com_client/models/schedule_full.rb +195 -0
- data/lib/phone_com_client/models/schedule_summary.rb +195 -0
- data/lib/phone_com_client/models/scope_details.rb +183 -0
- data/lib/phone_com_client/models/sip_authentication.rb +215 -0
- data/lib/phone_com_client/models/sms_forwarding.rb +220 -0
- data/lib/phone_com_client/models/sms_forwarding_params.rb +220 -0
- data/lib/phone_com_client/models/sms_full.rb +257 -0
- data/lib/phone_com_client/models/sort_call_logs.rb +201 -0
- data/lib/phone_com_client/models/sort_id.rb +183 -0
- data/lib/phone_com_client/models/sort_id_created_at.rb +192 -0
- data/lib/phone_com_client/models/sort_id_extension_name.rb +201 -0
- data/lib/phone_com_client/models/sort_id_name.rb +192 -0
- data/lib/phone_com_client/models/sort_id_name_phone_number.rb +201 -0
- data/lib/phone_com_client/models/sort_id_updated_at.rb +192 -0
- data/lib/phone_com_client/models/sort_list_available_numbers.rb +201 -0
- data/lib/phone_com_client/models/sort_list_phone_numbers_regions.rb +237 -0
- data/lib/phone_com_client/models/sort_name_number.rb +192 -0
- data/lib/phone_com_client/models/trunk_full.rb +297 -0
- data/lib/phone_com_client/models/trunk_summary.rb +205 -0
- data/lib/phone_com_client/models/voicemail.rb +234 -0
- data/lib/phone_com_client/models/voicemail_full.rb +265 -0
- data/lib/phone_com_client/models/voicemail_input.rb +234 -0
- data/lib/phone_com_client/version.rb +15 -0
- data/lib/phone_com_client.rb +214 -0
- data/phone_com_client.gemspec +45 -0
- data/spec/api/accounts_api_spec.rb +63 -0
- data/spec/api/applications_api_spec.rb +67 -0
- data/spec/api/available_numbers_api_spec.rb +62 -0
- data/spec/api/call_logs_api_spec.rb +73 -0
- data/spec/api/caller_ids_api_spec.rb +55 -0
- data/spec/api/calls_api_spec.rb +48 -0
- data/spec/api/contacts_api_spec.rb +113 -0
- data/spec/api/default_api_spec.rb +46 -0
- data/spec/api/devices_api_spec.rb +107 -0
- data/spec/api/express_service_codes_api_spec.rb +61 -0
- data/spec/api/extensions_api_spec.rb +96 -0
- data/spec/api/groups_api_spec.rb +112 -0
- data/spec/api/listeners_api_spec.rb +105 -0
- data/spec/api/media_api_spec.rb +136 -0
- data/spec/api/menus_api_spec.rb +107 -0
- data/spec/api/number_regions_api_spec.rb +64 -0
- data/spec/api/oauth_api_spec.rb +73 -0
- data/spec/api/oauth_clients_api_spec.rb +78 -0
- data/spec/api/oauth_clients_redirect_uris_api_spec.rb +95 -0
- data/spec/api/payment_methods_api_spec.rb +105 -0
- data/spec/api/phone_numbers_api_spec.rb +96 -0
- data/spec/api/queues_api_spec.rb +107 -0
- data/spec/api/routes_api_spec.rb +107 -0
- data/spec/api/schedules_api_spec.rb +67 -0
- data/spec/api/sms_api_spec.rb +98 -0
- data/spec/api/subaccount_pricing_api_spec.rb +95 -0
- data/spec/api/subaccounts_api_spec.rb +65 -0
- data/spec/api/trunks_api_spec.rb +107 -0
- data/spec/api/voicemail_api_spec.rb +85 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/account_full_spec.rb +77 -0
- data/spec/models/account_summary_spec.rb +47 -0
- data/spec/models/address_list_contacts_spec.rb +71 -0
- data/spec/models/address_spec.rb +71 -0
- data/spec/models/application_full_spec.rb +47 -0
- data/spec/models/application_summary_spec.rb +47 -0
- data/spec/models/available_numbers_full_spec.rb +101 -0
- data/spec/models/call_details_spec.rb +65 -0
- data/spec/models/call_full_spec.rb +41 -0
- data/spec/models/call_log_full_spec.rb +155 -0
- data/spec/models/call_notifications_spec.rb +47 -0
- data/spec/models/callback_object_spec.rb +71 -0
- data/spec/models/caller_id_full_spec.rb +53 -0
- data/spec/models/caller_id_phone_number_spec.rb +47 -0
- data/spec/models/contact_account_spec.rb +77 -0
- data/spec/models/contact_full_spec.rb +149 -0
- data/spec/models/contact_response_spec.rb +77 -0
- data/spec/models/contact_summary_spec.rb +83 -0
- data/spec/models/create_call_params_spec.rb +83 -0
- data/spec/models/create_contact_params_spec.rb +131 -0
- data/spec/models/create_device_params_spec.rb +47 -0
- data/spec/models/create_extension_params_spec.rb +113 -0
- data/spec/models/create_group_params_spec.rb +41 -0
- data/spec/models/create_listener_params_spec.rb +53 -0
- data/spec/models/create_media_params_spec.rb +95 -0
- data/spec/models/create_menu_params_spec.rb +77 -0
- data/spec/models/create_oauth_params_spec.rb +89 -0
- data/spec/models/create_payment_params_spec.rb +59 -0
- data/spec/models/create_phone_number_params_spec.rb +83 -0
- data/spec/models/create_pricing_params_spec.rb +53 -0
- data/spec/models/create_queue_params_spec.rb +77 -0
- data/spec/models/create_redirect_uri_params_spec.rb +41 -0
- data/spec/models/create_route_params_spec.rb +53 -0
- data/spec/models/create_sms_params_spec.rb +59 -0
- data/spec/models/create_subaccount_params_spec.rb +59 -0
- data/spec/models/create_trunk_params_spec.rb +77 -0
- data/spec/models/delete_entry_spec.rb +41 -0
- data/spec/models/device_full_spec.rb +59 -0
- data/spec/models/device_membership_spec.rb +47 -0
- data/spec/models/device_summary_spec.rb +47 -0
- data/spec/models/email_spec.rb +47 -0
- data/spec/models/express_service_code_full_spec.rb +53 -0
- data/spec/models/extension_full_spec.rb +137 -0
- data/spec/models/extension_summary_spec.rb +53 -0
- data/spec/models/filter_call_logs_spec.rb +71 -0
- data/spec/models/filter_id_array_spec.rb +41 -0
- data/spec/models/filter_id_direction_from_spec.rb +53 -0
- data/spec/models/filter_id_extension_name_array_spec.rb +53 -0
- data/spec/models/filter_id_group_id_updated_at_array_spec.rb +53 -0
- data/spec/models/filter_id_name_array_spec.rb +47 -0
- data/spec/models/filter_id_name_phone_number_array_spec.rb +53 -0
- data/spec/models/filter_list_available_numbers_spec.rb +95 -0
- data/spec/models/filter_list_phone_numbers_regions_spec.rb +77 -0
- data/spec/models/filter_name_number_array_spec.rb +47 -0
- data/spec/models/filter_voicemail_array_spec.rb +71 -0
- data/spec/models/from_object_spec.rb +59 -0
- data/spec/models/get_oauth_access_token_spec.rb +53 -0
- data/spec/models/greeting_input_spec.rb +59 -0
- data/spec/models/greeting_spec.rb +59 -0
- data/spec/models/group_full_spec.rb +47 -0
- data/spec/models/group_list_contacts_spec.rb +47 -0
- data/spec/models/group_summary_spec.rb +47 -0
- data/spec/models/hold_music_spec.rb +47 -0
- data/spec/models/line_spec.rb +47 -0
- data/spec/models/list_accounts_spec.rb +71 -0
- data/spec/models/list_applications_spec.rb +71 -0
- data/spec/models/list_available_numbers_spec.rb +71 -0
- data/spec/models/list_call_logs_spec.rb +71 -0
- data/spec/models/list_caller_ids_spec.rb +71 -0
- data/spec/models/list_contacts_spec.rb +71 -0
- data/spec/models/list_devices_spec.rb +71 -0
- data/spec/models/list_express_service_codes_spec.rb +71 -0
- data/spec/models/list_extensions_spec.rb +71 -0
- data/spec/models/list_groups_spec.rb +71 -0
- data/spec/models/list_listeners_spec.rb +71 -0
- data/spec/models/list_media_spec.rb +71 -0
- data/spec/models/list_menus_spec.rb +71 -0
- data/spec/models/list_oauth_clients_redirect_uris_spec.rb +65 -0
- data/spec/models/list_oauth_clients_spec.rb +71 -0
- data/spec/models/list_payment_methods_spec.rb +71 -0
- data/spec/models/list_phone_numbers_regions_spec.rb +77 -0
- data/spec/models/list_phone_numbers_spec.rb +71 -0
- data/spec/models/list_pricings_spec.rb +71 -0
- data/spec/models/list_queues_spec.rb +71 -0
- data/spec/models/list_routes_spec.rb +71 -0
- data/spec/models/list_schedules_spec.rb +71 -0
- data/spec/models/list_sms_spec.rb +71 -0
- data/spec/models/list_trunks_spec.rb +71 -0
- data/spec/models/list_voicemail_spec.rb +71 -0
- data/spec/models/listener_full_spec.rb +77 -0
- data/spec/models/media_full_spec.rb +53 -0
- data/spec/models/media_summary_spec.rb +47 -0
- data/spec/models/member_spec.rb +47 -0
- data/spec/models/menu_full_spec.rb +83 -0
- data/spec/models/menu_summary_spec.rb +47 -0
- data/spec/models/notification_spec.rb +47 -0
- data/spec/models/oauth_access_token_spec.rb +65 -0
- data/spec/models/oauth_client_full_spec.rb +47 -0
- data/spec/models/oauth_client_redirect_uri_full_spec.rb +53 -0
- data/spec/models/option_spec.rb +47 -0
- data/spec/models/patch_payment_params_spec.rb +41 -0
- data/spec/models/patch_sms_params_spec.rb +41 -0
- data/spec/models/patch_voicemail_params_spec.rb +41 -0
- data/spec/models/payment_full_spec.rb +113 -0
- data/spec/models/payment_summary_spec.rb +71 -0
- data/spec/models/phone_number_contact_spec.rb +53 -0
- data/spec/models/phone_number_full_spec.rb +89 -0
- data/spec/models/phone_numbers_region_full_spec.rb +83 -0
- data/spec/models/ping_response_spec.rb +59 -0
- data/spec/models/pricing_full_spec.rb +71 -0
- data/spec/models/pricing_object_spec.rb +47 -0
- data/spec/models/queue_full_spec.rb +83 -0
- data/spec/models/queue_summary_spec.rb +47 -0
- data/spec/models/recipient_spec.rb +47 -0
- data/spec/models/redirect_uri_full_spec.rb +53 -0
- data/spec/models/replace_extension_params_spec.rb +119 -0
- data/spec/models/replace_menu_params_spec.rb +77 -0
- data/spec/models/replace_phone_number_params_spec.rb +83 -0
- data/spec/models/route_full_spec.rb +59 -0
- data/spec/models/route_summary_spec.rb +47 -0
- data/spec/models/rule_set_action_spec.rb +95 -0
- data/spec/models/rule_set_filter_spec.rb +59 -0
- data/spec/models/rule_set_forward_item_spec.rb +77 -0
- data/spec/models/rule_set_spec.rb +47 -0
- data/spec/models/schedule_full_spec.rb +47 -0
- data/spec/models/schedule_summary_spec.rb +47 -0
- data/spec/models/scope_details_spec.rb +41 -0
- data/spec/models/sip_authentication_spec.rb +59 -0
- data/spec/models/sms_forwarding_params_spec.rb +53 -0
- data/spec/models/sms_forwarding_spec.rb +53 -0
- data/spec/models/sms_full_spec.rb +83 -0
- data/spec/models/sort_call_logs_spec.rb +53 -0
- data/spec/models/sort_id_created_at_spec.rb +47 -0
- data/spec/models/sort_id_extension_name_spec.rb +53 -0
- data/spec/models/sort_id_name_phone_number_spec.rb +53 -0
- data/spec/models/sort_id_name_spec.rb +47 -0
- data/spec/models/sort_id_spec.rb +41 -0
- data/spec/models/sort_id_updated_at_spec.rb +47 -0
- data/spec/models/sort_list_available_numbers_spec.rb +53 -0
- data/spec/models/sort_list_phone_numbers_regions_spec.rb +77 -0
- data/spec/models/sort_name_number_spec.rb +47 -0
- data/spec/models/trunk_full_spec.rb +83 -0
- data/spec/models/trunk_summary_spec.rb +47 -0
- data/spec/models/voicemail_full_spec.rb +89 -0
- data/spec/models/voicemail_input_spec.rb +71 -0
- data/spec/models/voicemail_spec.rb +71 -0
- data/spec/spec_helper.rb +111 -0
- metadata +942 -0
@@ -0,0 +1,252 @@
|
|
1
|
+
=begin
|
2
|
+
#Phone.com API
|
3
|
+
|
4
|
+
#This is a Phone.com api PhoneCom definition
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
Contact: apisupport@phone.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
PhoneCom Codegen version: 2.4.4
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module PhoneComClient
|
16
|
+
class VoicemailApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# This service shows the details of an individual voicemail.
|
23
|
+
# 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 https://api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail/:voicemail_id
|
24
|
+
# @param account_id Account ID
|
25
|
+
# @param voicemail_id Voicemail ID
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [VoicemailFull]
|
28
|
+
def get_account_voicemail(account_id, voicemail_id, opts = {})
|
29
|
+
data, _status_code, _headers = get_account_voicemail_with_http_info(account_id, voicemail_id, opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# This service shows the details of an individual voicemail.
|
34
|
+
# 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 https://api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail/:voicemail_id
|
35
|
+
# @param account_id Account ID
|
36
|
+
# @param voicemail_id Voicemail ID
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(VoicemailFull, Fixnum, Hash)>] VoicemailFull data, response status code and response headers
|
39
|
+
def get_account_voicemail_with_http_info(account_id, voicemail_id, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: VoicemailApi.get_account_voicemail ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'account_id' is set
|
44
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling VoicemailApi.get_account_voicemail"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'voicemail_id' is set
|
48
|
+
if @api_client.config.client_side_validation && voicemail_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'voicemail_id' when calling VoicemailApi.get_account_voicemail"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/accounts/{account_id}/voicemail/{voicemail_id}'.sub('{' + 'account_id' + '}', account_id.to_s).sub('{' + 'voicemail_id' + '}', voicemail_id.to_s)
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = {}
|
59
|
+
# HTTP header 'Accept' (if needed)
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
61
|
+
# HTTP header 'Content-Type'
|
62
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
63
|
+
|
64
|
+
# form parameters
|
65
|
+
form_params = {}
|
66
|
+
|
67
|
+
# http body (model)
|
68
|
+
post_body = nil
|
69
|
+
auth_names = ['apiKey']
|
70
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
71
|
+
:header_params => header_params,
|
72
|
+
:query_params => query_params,
|
73
|
+
:form_params => form_params,
|
74
|
+
:body => post_body,
|
75
|
+
:auth_names => auth_names,
|
76
|
+
:return_type => 'VoicemailFull')
|
77
|
+
if @api_client.config.debugging
|
78
|
+
@api_client.config.logger.debug "API called: VoicemailApi#get_account_voicemail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
79
|
+
end
|
80
|
+
return data, status_code, headers
|
81
|
+
end
|
82
|
+
# Get a list of voicemail messages for an account.
|
83
|
+
# 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 https://api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail
|
84
|
+
# @param account_id Account ID
|
85
|
+
# @param [Hash] opts the optional parameters
|
86
|
+
# @option opts [Array<String>] :filters_id ID filter
|
87
|
+
# @option opts [String] :filters_from Caller ID filter
|
88
|
+
# @option opts [String] :filters_to Callee ID filter, the E.164 phone number to send the SMS TO. Note you must encode the + as %2B
|
89
|
+
# @option opts [BOOLEAN] :filters_is_new
|
90
|
+
# @option opts [String] :filters_created_at Date string representing the UTC time that sms was created
|
91
|
+
# @option opts [Array<String>] :filters_extension Extension filter
|
92
|
+
# @option opts [String] :sort_id ID sorting
|
93
|
+
# @option opts [String] :sort_created_at Sort by the UTC time that voicemail was created
|
94
|
+
# @option opts [Integer] :limit Max results
|
95
|
+
# @option opts [Integer] :offset Results to skip
|
96
|
+
# @option opts [String] :fields Field set
|
97
|
+
# @return [ListVoicemail]
|
98
|
+
def list_account_voicemail(account_id, opts = {})
|
99
|
+
data, _status_code, _headers = list_account_voicemail_with_http_info(account_id, opts)
|
100
|
+
data
|
101
|
+
end
|
102
|
+
|
103
|
+
# Get a list of voicemail messages for an account.
|
104
|
+
# 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 https://api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail
|
105
|
+
# @param account_id Account ID
|
106
|
+
# @param [Hash] opts the optional parameters
|
107
|
+
# @option opts [Array<String>] :filters_id ID filter
|
108
|
+
# @option opts [String] :filters_from Caller ID filter
|
109
|
+
# @option opts [String] :filters_to Callee ID filter, the E.164 phone number to send the SMS TO. Note you must encode the + as %2B
|
110
|
+
# @option opts [BOOLEAN] :filters_is_new
|
111
|
+
# @option opts [String] :filters_created_at Date string representing the UTC time that sms was created
|
112
|
+
# @option opts [Array<String>] :filters_extension Extension filter
|
113
|
+
# @option opts [String] :sort_id ID sorting
|
114
|
+
# @option opts [String] :sort_created_at Sort by the UTC time that voicemail was created
|
115
|
+
# @option opts [Integer] :limit Max results
|
116
|
+
# @option opts [Integer] :offset Results to skip
|
117
|
+
# @option opts [String] :fields Field set
|
118
|
+
# @return [Array<(ListVoicemail, Fixnum, Hash)>] ListVoicemail data, response status code and response headers
|
119
|
+
def list_account_voicemail_with_http_info(account_id, opts = {})
|
120
|
+
if @api_client.config.debugging
|
121
|
+
@api_client.config.logger.debug 'Calling API: VoicemailApi.list_account_voicemail ...'
|
122
|
+
end
|
123
|
+
# verify the required parameter 'account_id' is set
|
124
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
125
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling VoicemailApi.list_account_voicemail"
|
126
|
+
end
|
127
|
+
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:.*,.*/)
|
128
|
+
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:.*,.*/."
|
129
|
+
end
|
130
|
+
|
131
|
+
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:.*,.*/)
|
132
|
+
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:.*,.*/."
|
133
|
+
end
|
134
|
+
|
135
|
+
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:.*,.*/)
|
136
|
+
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:.*,.*/."
|
137
|
+
end
|
138
|
+
|
139
|
+
if @api_client.config.client_side_validation && !opts[:'sort_id'].nil? && opts[:'sort_id'] !~ Regexp.new(/asc|desc/)
|
140
|
+
fail ArgumentError, "invalid value for 'opts[:\"sort_id\"]' when calling VoicemailApi.list_account_voicemail, must conform to the pattern /asc|desc/."
|
141
|
+
end
|
142
|
+
|
143
|
+
if @api_client.config.client_side_validation && !opts[:'sort_created_at'].nil? && opts[:'sort_created_at'] !~ Regexp.new(/asc|desc/)
|
144
|
+
fail ArgumentError, "invalid value for 'opts[:\"sort_created_at\"]' when calling VoicemailApi.list_account_voicemail, must conform to the pattern /asc|desc/."
|
145
|
+
end
|
146
|
+
|
147
|
+
# resource path
|
148
|
+
local_var_path = '/accounts/{account_id}/voicemail'.sub('{' + 'account_id' + '}', account_id.to_s)
|
149
|
+
|
150
|
+
# query parameters
|
151
|
+
query_params = {}
|
152
|
+
query_params[:'filters[id]'] = @api_client.build_collection_param(opts[:'filters_id'], :multi) if !opts[:'filters_id'].nil?
|
153
|
+
query_params[:'filters[from]'] = opts[:'filters_from'] if !opts[:'filters_from'].nil?
|
154
|
+
query_params[:'filters[to]'] = opts[:'filters_to'] if !opts[:'filters_to'].nil?
|
155
|
+
query_params[:'filters[is_new]'] = opts[:'filters_is_new'] if !opts[:'filters_is_new'].nil?
|
156
|
+
query_params[:'filters[created_at]'] = opts[:'filters_created_at'] if !opts[:'filters_created_at'].nil?
|
157
|
+
query_params[:'filters[extension]'] = @api_client.build_collection_param(opts[:'filters_extension'], :multi) if !opts[:'filters_extension'].nil?
|
158
|
+
query_params[:'sort[id]'] = opts[:'sort_id'] if !opts[:'sort_id'].nil?
|
159
|
+
query_params[:'sort[created_at]'] = opts[:'sort_created_at'] if !opts[:'sort_created_at'].nil?
|
160
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
161
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
162
|
+
query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
|
163
|
+
|
164
|
+
# header parameters
|
165
|
+
header_params = {}
|
166
|
+
# HTTP header 'Accept' (if needed)
|
167
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
168
|
+
# HTTP header 'Content-Type'
|
169
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
170
|
+
|
171
|
+
# form parameters
|
172
|
+
form_params = {}
|
173
|
+
|
174
|
+
# http body (model)
|
175
|
+
post_body = nil
|
176
|
+
auth_names = ['apiKey']
|
177
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
178
|
+
:header_params => header_params,
|
179
|
+
:query_params => query_params,
|
180
|
+
:form_params => form_params,
|
181
|
+
:body => post_body,
|
182
|
+
:auth_names => auth_names,
|
183
|
+
:return_type => 'ListVoicemail')
|
184
|
+
if @api_client.config.debugging
|
185
|
+
@api_client.config.logger.debug "API called: VoicemailApi#list_account_voicemail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
186
|
+
end
|
187
|
+
return data, status_code, headers
|
188
|
+
end
|
189
|
+
# Update the is_new parameter in a voicemail record.
|
190
|
+
# 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 https://api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail/:voicemail_id
|
191
|
+
# @param account_id Account ID
|
192
|
+
# @param voicemail_id Voicemail ID
|
193
|
+
# @param [Hash] opts the optional parameters
|
194
|
+
# @option opts [PatchVoicemailParams] :data Payment data
|
195
|
+
# @return [VoicemailFull]
|
196
|
+
def patch_account_voicemail(account_id, voicemail_id, opts = {})
|
197
|
+
data, _status_code, _headers = patch_account_voicemail_with_http_info(account_id, voicemail_id, opts)
|
198
|
+
data
|
199
|
+
end
|
200
|
+
|
201
|
+
# Update the is_new parameter in a voicemail record.
|
202
|
+
# 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 https://api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail/:voicemail_id
|
203
|
+
# @param account_id Account ID
|
204
|
+
# @param voicemail_id Voicemail ID
|
205
|
+
# @param [Hash] opts the optional parameters
|
206
|
+
# @option opts [PatchVoicemailParams] :data Payment data
|
207
|
+
# @return [Array<(VoicemailFull, Fixnum, Hash)>] VoicemailFull data, response status code and response headers
|
208
|
+
def patch_account_voicemail_with_http_info(account_id, voicemail_id, opts = {})
|
209
|
+
if @api_client.config.debugging
|
210
|
+
@api_client.config.logger.debug 'Calling API: VoicemailApi.patch_account_voicemail ...'
|
211
|
+
end
|
212
|
+
# verify the required parameter 'account_id' is set
|
213
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
214
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling VoicemailApi.patch_account_voicemail"
|
215
|
+
end
|
216
|
+
# verify the required parameter 'voicemail_id' is set
|
217
|
+
if @api_client.config.client_side_validation && voicemail_id.nil?
|
218
|
+
fail ArgumentError, "Missing the required parameter 'voicemail_id' when calling VoicemailApi.patch_account_voicemail"
|
219
|
+
end
|
220
|
+
# resource path
|
221
|
+
local_var_path = '/accounts/{account_id}/voicemail/{voicemail_id}'.sub('{' + 'account_id' + '}', account_id.to_s).sub('{' + 'voicemail_id' + '}', voicemail_id.to_s)
|
222
|
+
|
223
|
+
# query parameters
|
224
|
+
query_params = {}
|
225
|
+
|
226
|
+
# header parameters
|
227
|
+
header_params = {}
|
228
|
+
# HTTP header 'Accept' (if needed)
|
229
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
230
|
+
# HTTP header 'Content-Type'
|
231
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
232
|
+
|
233
|
+
# form parameters
|
234
|
+
form_params = {}
|
235
|
+
|
236
|
+
# http body (model)
|
237
|
+
post_body = @api_client.object_to_http_body(opts[:'data'])
|
238
|
+
auth_names = ['apiKey']
|
239
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
|
240
|
+
:header_params => header_params,
|
241
|
+
:query_params => query_params,
|
242
|
+
:form_params => form_params,
|
243
|
+
:body => post_body,
|
244
|
+
:auth_names => auth_names,
|
245
|
+
:return_type => 'VoicemailFull')
|
246
|
+
if @api_client.config.debugging
|
247
|
+
@api_client.config.logger.debug "API called: VoicemailApi#patch_account_voicemail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
248
|
+
end
|
249
|
+
return data, status_code, headers
|
250
|
+
end
|
251
|
+
end
|
252
|
+
end
|
@@ -0,0 +1,389 @@
|
|
1
|
+
=begin
|
2
|
+
#Phone.com API
|
3
|
+
|
4
|
+
#This is a Phone.com api PhoneCom definition
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
Contact: apisupport@phone.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
PhoneCom Codegen version: 2.4.4
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'json'
|
15
|
+
require 'logger'
|
16
|
+
require 'tempfile'
|
17
|
+
require 'typhoeus'
|
18
|
+
require 'uri'
|
19
|
+
|
20
|
+
module PhoneComClient
|
21
|
+
class ApiClient
|
22
|
+
# The Configuration object holding settings to be used in the API client.
|
23
|
+
attr_accessor :config
|
24
|
+
|
25
|
+
# Defines the headers to be used in HTTP requests of all API calls by default.
|
26
|
+
#
|
27
|
+
# @return [Hash]
|
28
|
+
attr_accessor :default_headers
|
29
|
+
|
30
|
+
# Initializes the ApiClient
|
31
|
+
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
32
|
+
def initialize(config = Configuration.default)
|
33
|
+
@config = config
|
34
|
+
@user_agent = "PhoneCom-Codegen/#{VERSION}/ruby"
|
35
|
+
@default_headers = {
|
36
|
+
'Content-Type' => 'application/json',
|
37
|
+
'User-Agent' => @user_agent
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.default
|
42
|
+
@@default ||= ApiClient.new
|
43
|
+
end
|
44
|
+
|
45
|
+
# Call an API with given options.
|
46
|
+
#
|
47
|
+
# @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
|
48
|
+
# the data deserialized from response body (could be nil), response status code and response headers.
|
49
|
+
def call_api(http_method, path, opts = {})
|
50
|
+
request = build_request(http_method, path, opts)
|
51
|
+
response = request.run
|
52
|
+
|
53
|
+
if @config.debugging
|
54
|
+
@config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
|
55
|
+
end
|
56
|
+
|
57
|
+
unless response.success?
|
58
|
+
if response.timed_out?
|
59
|
+
fail ApiError.new('Connection timed out')
|
60
|
+
elsif response.code == 0
|
61
|
+
# Errors from libcurl will be made visible here
|
62
|
+
fail ApiError.new(:code => 0,
|
63
|
+
:message => response.return_message)
|
64
|
+
else
|
65
|
+
fail ApiError.new(:code => response.code,
|
66
|
+
:response_headers => response.headers,
|
67
|
+
:response_body => response.body),
|
68
|
+
response.status_message
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
if opts[:return_type]
|
73
|
+
data = deserialize(response, opts[:return_type])
|
74
|
+
else
|
75
|
+
data = nil
|
76
|
+
end
|
77
|
+
return data, response.code, response.headers
|
78
|
+
end
|
79
|
+
|
80
|
+
# Builds the HTTP request
|
81
|
+
#
|
82
|
+
# @param [String] http_method HTTP method/verb (e.g. POST)
|
83
|
+
# @param [String] path URL path (e.g. /account/new)
|
84
|
+
# @option opts [Hash] :header_params Header parameters
|
85
|
+
# @option opts [Hash] :query_params Query parameters
|
86
|
+
# @option opts [Hash] :form_params Query parameters
|
87
|
+
# @option opts [Object] :body HTTP body (JSON/XML)
|
88
|
+
# @return [Typhoeus::Request] A Typhoeus Request
|
89
|
+
def build_request(http_method, path, opts = {})
|
90
|
+
url = build_request_url(path)
|
91
|
+
http_method = http_method.to_sym.downcase
|
92
|
+
|
93
|
+
header_params = @default_headers.merge(opts[:header_params] || {})
|
94
|
+
query_params = opts[:query_params] || {}
|
95
|
+
form_params = opts[:form_params] || {}
|
96
|
+
|
97
|
+
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
98
|
+
|
99
|
+
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
|
100
|
+
_verify_ssl_host = @config.verify_ssl_host ? 2 : 0
|
101
|
+
|
102
|
+
req_opts = {
|
103
|
+
:method => http_method,
|
104
|
+
:headers => header_params,
|
105
|
+
:params => query_params,
|
106
|
+
:params_encoding => @config.params_encoding,
|
107
|
+
:timeout => @config.timeout,
|
108
|
+
:ssl_verifypeer => @config.verify_ssl,
|
109
|
+
:ssl_verifyhost => _verify_ssl_host,
|
110
|
+
:sslcert => @config.cert_file,
|
111
|
+
:sslkey => @config.key_file,
|
112
|
+
:verbose => @config.debugging
|
113
|
+
}
|
114
|
+
|
115
|
+
# set custom cert, if provided
|
116
|
+
req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
|
117
|
+
|
118
|
+
if [:post, :patch, :put, :delete].include?(http_method)
|
119
|
+
req_body = build_request_body(header_params, form_params, opts[:body])
|
120
|
+
req_opts.update :body => req_body
|
121
|
+
if @config.debugging
|
122
|
+
@config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
request = Typhoeus::Request.new(url, req_opts)
|
127
|
+
download_file(request) if opts[:return_type] == 'File'
|
128
|
+
request
|
129
|
+
end
|
130
|
+
|
131
|
+
# Check if the given MIME is a JSON MIME.
|
132
|
+
# JSON MIME examples:
|
133
|
+
# application/json
|
134
|
+
# application/json; charset=UTF8
|
135
|
+
# APPLICATION/JSON
|
136
|
+
# */*
|
137
|
+
# @param [String] mime MIME
|
138
|
+
# @return [Boolean] True if the MIME is application/json
|
139
|
+
def json_mime?(mime)
|
140
|
+
(mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
|
141
|
+
end
|
142
|
+
|
143
|
+
# Deserialize the response to the given return type.
|
144
|
+
#
|
145
|
+
# @param [Response] response HTTP response
|
146
|
+
# @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
|
147
|
+
def deserialize(response, return_type)
|
148
|
+
body = response.body
|
149
|
+
|
150
|
+
# handle file downloading - return the File instance processed in request callbacks
|
151
|
+
# note that response body is empty when the file is written in chunks in request on_body callback
|
152
|
+
return @tempfile if return_type == 'File'
|
153
|
+
|
154
|
+
return nil if body.nil? || body.empty?
|
155
|
+
|
156
|
+
# return response body directly for String return type
|
157
|
+
return body if return_type == 'String'
|
158
|
+
|
159
|
+
# ensuring a default content type
|
160
|
+
content_type = response.headers['Content-Type'] || 'application/json'
|
161
|
+
|
162
|
+
fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
|
163
|
+
|
164
|
+
begin
|
165
|
+
data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
|
166
|
+
rescue JSON::ParserError => e
|
167
|
+
if %w(String Date DateTime).include?(return_type)
|
168
|
+
data = body
|
169
|
+
else
|
170
|
+
raise e
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
convert_to_type data, return_type
|
175
|
+
end
|
176
|
+
|
177
|
+
# Convert data to the given return type.
|
178
|
+
# @param [Object] data Data to be converted
|
179
|
+
# @param [String] return_type Return type
|
180
|
+
# @return [Mixed] Data in a particular type
|
181
|
+
def convert_to_type(data, return_type)
|
182
|
+
return nil if data.nil?
|
183
|
+
case return_type
|
184
|
+
when 'String'
|
185
|
+
data.to_s
|
186
|
+
when 'Integer'
|
187
|
+
data.to_i
|
188
|
+
when 'Float'
|
189
|
+
data.to_f
|
190
|
+
when 'BOOLEAN'
|
191
|
+
data == true
|
192
|
+
when 'DateTime'
|
193
|
+
# parse date time (expecting ISO 8601 format)
|
194
|
+
DateTime.parse data
|
195
|
+
when 'Date'
|
196
|
+
# parse date time (expecting ISO 8601 format)
|
197
|
+
Date.parse data
|
198
|
+
when 'Object'
|
199
|
+
# generic object (usually a Hash), return directly
|
200
|
+
data
|
201
|
+
when /\AArray<(.+)>\z/
|
202
|
+
# e.g. Array<Pet>
|
203
|
+
sub_type = $1
|
204
|
+
data.map { |item| convert_to_type(item, sub_type) }
|
205
|
+
when /\AHash\<String, (.+)\>\z/
|
206
|
+
# e.g. Hash<String, Integer>
|
207
|
+
sub_type = $1
|
208
|
+
{}.tap do |hash|
|
209
|
+
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
210
|
+
end
|
211
|
+
else
|
212
|
+
# models, e.g. Pet
|
213
|
+
PhoneComClient.const_get(return_type).new.tap do |model|
|
214
|
+
model.build_from_hash data
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
# Save response body into a file in (the defined) temporary folder, using the filename
|
220
|
+
# from the "Content-Disposition" header if provided, otherwise a random filename.
|
221
|
+
# The response body is written to the file in chunks in order to handle files which
|
222
|
+
# size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
|
223
|
+
# process can use.
|
224
|
+
#
|
225
|
+
# @see Configuration#temp_folder_path
|
226
|
+
def download_file(request)
|
227
|
+
tempfile = nil
|
228
|
+
encoding = nil
|
229
|
+
request.on_headers do |response|
|
230
|
+
content_disposition = response.headers['Content-Disposition']
|
231
|
+
if content_disposition && content_disposition =~ /filename=/i
|
232
|
+
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
233
|
+
prefix = sanitize_filename(filename)
|
234
|
+
else
|
235
|
+
prefix = 'download-'
|
236
|
+
end
|
237
|
+
prefix = prefix + '-' unless prefix.end_with?('-')
|
238
|
+
encoding = response.body.encoding
|
239
|
+
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
240
|
+
@tempfile = tempfile
|
241
|
+
end
|
242
|
+
request.on_body do |chunk|
|
243
|
+
chunk.force_encoding(encoding)
|
244
|
+
tempfile.write(chunk)
|
245
|
+
end
|
246
|
+
request.on_complete do |response|
|
247
|
+
tempfile.close
|
248
|
+
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
249
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
250
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
251
|
+
"explicitly with `tempfile.delete`"
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
# Sanitize filename by removing path.
|
256
|
+
# e.g. ../../sun.gif becomes sun.gif
|
257
|
+
#
|
258
|
+
# @param [String] filename the filename to be sanitized
|
259
|
+
# @return [String] the sanitized filename
|
260
|
+
def sanitize_filename(filename)
|
261
|
+
filename.gsub(/.*[\/\\]/, '')
|
262
|
+
end
|
263
|
+
|
264
|
+
def build_request_url(path)
|
265
|
+
# Add leading and trailing slashes to path
|
266
|
+
path = "/#{path}".gsub(/\/+/, '/')
|
267
|
+
URI.encode(@config.base_url + path)
|
268
|
+
end
|
269
|
+
|
270
|
+
# Builds the HTTP request body
|
271
|
+
#
|
272
|
+
# @param [Hash] header_params Header parameters
|
273
|
+
# @param [Hash] form_params Query parameters
|
274
|
+
# @param [Object] body HTTP body (JSON/XML)
|
275
|
+
# @return [String] HTTP body data in the form of string
|
276
|
+
def build_request_body(header_params, form_params, body)
|
277
|
+
# http form
|
278
|
+
if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
|
279
|
+
header_params['Content-Type'] == 'multipart/form-data'
|
280
|
+
data = {}
|
281
|
+
form_params.each do |key, value|
|
282
|
+
case value
|
283
|
+
when ::File, ::Array, nil
|
284
|
+
# let typhoeus handle File, Array and nil parameters
|
285
|
+
data[key] = value
|
286
|
+
else
|
287
|
+
data[key] = value.to_s
|
288
|
+
end
|
289
|
+
end
|
290
|
+
elsif body
|
291
|
+
data = body.is_a?(String) ? body : body.to_json
|
292
|
+
else
|
293
|
+
data = nil
|
294
|
+
end
|
295
|
+
data
|
296
|
+
end
|
297
|
+
|
298
|
+
# Update hearder and query params based on authentication settings.
|
299
|
+
#
|
300
|
+
# @param [Hash] header_params Header parameters
|
301
|
+
# @param [Hash] query_params Query parameters
|
302
|
+
# @param [String] auth_names Authentication scheme name
|
303
|
+
def update_params_for_auth!(header_params, query_params, auth_names)
|
304
|
+
Array(auth_names).each do |auth_name|
|
305
|
+
auth_setting = @config.auth_settings[auth_name]
|
306
|
+
next unless auth_setting
|
307
|
+
case auth_setting[:in]
|
308
|
+
when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
|
309
|
+
when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
|
310
|
+
else fail ArgumentError, 'Authentication token must be in `query` of `header`'
|
311
|
+
end
|
312
|
+
end
|
313
|
+
end
|
314
|
+
|
315
|
+
# Sets user agent in HTTP header
|
316
|
+
#
|
317
|
+
# @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
|
318
|
+
def user_agent=(user_agent)
|
319
|
+
@user_agent = user_agent
|
320
|
+
@default_headers['User-Agent'] = @user_agent
|
321
|
+
end
|
322
|
+
|
323
|
+
# Return Accept header based on an array of accepts provided.
|
324
|
+
# @param [Array] accepts array for Accept
|
325
|
+
# @return [String] the Accept header (e.g. application/json)
|
326
|
+
def select_header_accept(accepts)
|
327
|
+
return nil if accepts.nil? || accepts.empty?
|
328
|
+
# use JSON when present, otherwise use all of the provided
|
329
|
+
json_accept = accepts.find { |s| json_mime?(s) }
|
330
|
+
json_accept || accepts.join(',')
|
331
|
+
end
|
332
|
+
|
333
|
+
# Return Content-Type header based on an array of content types provided.
|
334
|
+
# @param [Array] content_types array for Content-Type
|
335
|
+
# @return [String] the Content-Type header (e.g. application/json)
|
336
|
+
def select_header_content_type(content_types)
|
337
|
+
# use application/json by default
|
338
|
+
return 'application/json' if content_types.nil? || content_types.empty?
|
339
|
+
# use JSON when present, otherwise use the first one
|
340
|
+
json_content_type = content_types.find { |s| json_mime?(s) }
|
341
|
+
json_content_type || content_types.first
|
342
|
+
end
|
343
|
+
|
344
|
+
# Convert object (array, hash, object, etc) to JSON string.
|
345
|
+
# @param [Object] model object to be converted into JSON string
|
346
|
+
# @return [String] JSON string representation of the object
|
347
|
+
def object_to_http_body(model)
|
348
|
+
return model if model.nil? || model.is_a?(String)
|
349
|
+
local_body = nil
|
350
|
+
if model.is_a?(Array)
|
351
|
+
local_body = model.map { |m| object_to_hash(m) }
|
352
|
+
else
|
353
|
+
local_body = object_to_hash(model)
|
354
|
+
end
|
355
|
+
local_body.to_json
|
356
|
+
end
|
357
|
+
|
358
|
+
# Convert object(non-array) to hash.
|
359
|
+
# @param [Object] obj object to be converted into JSON string
|
360
|
+
# @return [String] JSON string representation of the object
|
361
|
+
def object_to_hash(obj)
|
362
|
+
if obj.respond_to?(:to_hash)
|
363
|
+
obj.to_hash
|
364
|
+
else
|
365
|
+
obj
|
366
|
+
end
|
367
|
+
end
|
368
|
+
|
369
|
+
# Build parameter value according to the given collection format.
|
370
|
+
# @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
|
371
|
+
def build_collection_param(param, collection_format)
|
372
|
+
case collection_format
|
373
|
+
when :csv
|
374
|
+
param.join(',')
|
375
|
+
when :ssv
|
376
|
+
param.join(' ')
|
377
|
+
when :tsv
|
378
|
+
param.join("\t")
|
379
|
+
when :pipes
|
380
|
+
param.join('|')
|
381
|
+
when :multi
|
382
|
+
# return the array directly as typhoeus will handle it as expected
|
383
|
+
param
|
384
|
+
else
|
385
|
+
fail "unknown collection format: #{collection_format.inspect}"
|
386
|
+
end
|
387
|
+
end
|
388
|
+
end
|
389
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
=begin
|
2
|
+
#Phone.com API
|
3
|
+
|
4
|
+
#This is a Phone.com api PhoneCom definition
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
Contact: apisupport@phone.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
PhoneCom Codegen version: 2.4.4
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
module PhoneComClient
|
14
|
+
class ApiError < StandardError
|
15
|
+
attr_reader :code, :response_headers, :response_body
|
16
|
+
|
17
|
+
# Usage examples:
|
18
|
+
# ApiError.new
|
19
|
+
# ApiError.new("message")
|
20
|
+
# ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
|
21
|
+
# ApiError.new(:code => 404, :message => "Not Found")
|
22
|
+
def initialize(arg = nil)
|
23
|
+
if arg.is_a? Hash
|
24
|
+
if arg.key?(:message) || arg.key?('message')
|
25
|
+
super(arg[:message] || arg['message'])
|
26
|
+
else
|
27
|
+
super arg
|
28
|
+
end
|
29
|
+
|
30
|
+
arg.each do |k, v|
|
31
|
+
instance_variable_set "@#{k}", v
|
32
|
+
end
|
33
|
+
else
|
34
|
+
super arg
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|